    :root{
      --bg: #0f1724;
      --card: rgba(200, 233, 255, 0.1);
      --muted: #252525;
      --accent: #0d529f;
      --accent-2: #0d529f;
      --std: #0e3c6e;
      --glass: rgba(255, 255, 255, 0.034);
      --radius: 12px;
      color-scheme: normal;
    }

    main {
      margin-top: 5px; /* Höhe deines Headers anpassen */
    }

    *{box-sizing:border-box}
    html,body{height:100%}

    body{
      margin:0;
      font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;

      background: url('../images/hintergrund.jpg'),
        linear-gradient(180deg, #577496 0%, #ffffff 80%),
        linear-gradient(rgba(255,255,255,0.6), rgba(255,255,255,0.6));
      background-repeat: no-repeat, no-repeat, no-repeat;
      background-size: cover, cover, cover;
      background-attachment: fixed, fixed, fixed;
      background-position: center, center, center;
      /* Transparenz nur fürs Bild, nicht den Verlauf */
      background-blend-mode: soft-light, normal, normal;
      /* overlay / multiply / soft-light  */

      /* Schriftfarbe */
      color:#0e3c6e;
      -webkit-font-smoothing:antialiased;
      -moz-osx-font-smoothing:grayscale;
      line-height:1.4;
    }

    #home{
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      text-align: left;
    }

    .container  {
      max-width:1100px;
      margin:0 auto;
      padding:28px
    }
    .maincontainer  {
      background: rgba(255, 255, 255, 0.651);
      padding:10px;
      border-radius:15px;
      max-width:1100px;
      margin:0 auto;
      padding:28px
    }

    .container + .maincontainer {
        margin-top: 90px;
    }

    header {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 120px;

      background: rgba(255,255,255,0.18);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border-bottom: 1px solid rgba(255,255,255,0.06);

      display: flex;
      justify-content: center; /* Zentriert den inneren Container */
      z-index: 1000;
    }

    .header-content {
      width: 100%;
      max-width: 950px;        /* gleiche Breite wie dein Content */
      display: flex;
      justify-content: flex-end; /* Navigation nach rechts */
      align-items: center;
      padding: 0 24px;

      gap: 16px;
    }

    nav a.active {
        font-weight: bold;
        border-bottom: 2px solid #fff;
    }

    .brand{display:flex;align-items:center;gap:12px}
    .logo{width:100px;height:100px;border-radius:10px;display:flex;align-items:right;justify-content:right;font-weight:800;color:rgba(255, 255, 255, 0);}
    .image {
      display: block;
      margin: 0 auto;
      height: 300px;
      border-radius: 10px;
    }
    #ueberuns .image {
      width: min(100%, 700px);
      max-width: 100%;
      height: auto;
      border-radius: 10px;
      object-fit: contain;
    }
    nav{display:flex;gap:18px;align-items:center}
    nav a{color:var(--muted);text-decoration:none;font-weight:600}
    .btn{padding:10px 14px;border-radius:10px;background:linear-gradient(90deg,var(--accent),var(--accent-2));border:none;color:rgb(255, 255, 255);font-weight:700;cursor:pointer}

    /* mobile */
    .menu-toggle{display:none;background:none;border:1px solid rgba(255,255,255,0.06);padding:8px;border-radius:8px;color:var(--muted)}
    .mobile-menu{
      position: fixed;
      top: 120px;
      left: 0;
      right: 0;
      z-index: 999;
      padding: 8px 16px 0;
    }
    .mobile-menu-card{
      padding:12px;
      display:flex;
      flex-direction:column;
      gap:8px;
    }
    .mobile-menu-card a{
      padding: 6px 2px;
    }
    .mobile-menu:not(.is-open){
      display:none;
    }
    .mobile-menu.is-open{
      display:block;
    }
    @media (max-width:800px){
      .main-nav{display:none}
      .menu-toggle{display:inline-flex}
      header{
        height:88px;
        justify-content:space-between;
        padding:0 10px;
      }
      .header-content{
        width:auto;
        max-width:none;
        min-width:0;
        flex:1 1 auto;
        justify-content:flex-end;
        padding:0;
      }
      .brand{
        flex:0 0 auto;
      }
      .logo{width:72px;height:72px}
      .mobile-menu{top:88px}
      .container + .maincontainer {margin-top: 60px;}
      .footerNav{grid-template-columns:1fr}
      .footerNav .muted{text-align:center}
      .footerNav .footer-social{text-align:center}
      .footerNav .footer-social a{
        text-align:center;
      }

      .footerNav .main-nav{display:none}

      .footerNav .main-nav a{
        text-align:right;
        min-width:0;
        font-size:0.95rem;
      }
    }

    /* Hero */
    .hero{
      display:grid;
      grid-template-columns:1fr 420px;
      gap:28px;align-items:center;
      padding:5px 0
    }
    
    .footerNav{
      display:grid;
      grid-template-columns:1fr 210px;
      gap:28px;align-items:center;
      padding:5px 0
    }
    .footerNav .muted{white-space:nowrap}
    .footer-social a{
      display:block;
      text-align:right;
    }
    .hero-card{background:linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(255,255,255,0.01));border-radius:var(--radius);padding:28px}
    .kicker{display:inline-block;padding:6px 0px;border-radius:999px;color:var(--std);font-weight:600;font-size:large; margin-bottom:12px}
    h1{font-size:34px;margin:6px 0}
    p.lead{color:var(--muted);margin:12px 0 20px}
    .cta-row{display:flex;gap:12px;flex-wrap:wrap}

    .hero-visual{height:280px;border-radius:14px;background:linear-gradient(135deg,#052a3d,#02314a);display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
    .hero-visual .snow{position:absolute;inset:0;opacity:0.12;background-image:radial-gradient(circle at 10% 10%, rgba(255,255,255,0.08) 0 1px, transparent 1px), radial-gradient(circle at 70% 40%, rgba(255,255,255,0.06) 0 1px, transparent 1px);} 
    .hero-visual svg{width:80%;height:auto;filter:drop-shadow(0 8px 18px rgba(0,0,0,0.6))}

    /* Sections */
    section{
      scroll-margin-top: 100px;
      padding:5px 0
    }
    .grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
    .card {
      background:var(--card);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border-radius:12px;
      padding:18px
    }

    .card + .card {
      margin-top: 20px;
  }

    .small{font-size:14px;color:var(--muted)}

    /* Events */
    .events {
      display:flex;
      gap:12px;
      align-items:flex-start
    }

    .event .date{
      min-width:108px;
      background:linear-gradient(180deg,#95c5e7,#c2e0f5);
      padding:10px;
      border-radius:8px;
      text-align:center;
      box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    }

    .event h4{margin:0}
    .date .day {font-weight:800}

    .download-link {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;

      padding: 0.5rem 0.9rem;
      border-radius: 8px;

      background:linear-gradient(180deg,#95c5e7,#c2e0f5);
      box-shadow: 0 3px 6px rgba(0,0,0,0.1);
      text-decoration: none;
      font-weight: 600;
      min-width: 400px;
    }

    .download-DIV + .download-DIV {
        margin-top: 20px;
    }

    .download-link:hover {
      background: #449fe0;
    }

    .more-link {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;

      padding: 0.5rem 0.9rem;
      border-radius: 8px;

      background:#c2e0f5;
      box-shadow: 0 3px 6px rgba(0,0,0,0.1);
      text-decoration: none;
      font-weight: 600;
    }

    .more-link:hover {
      background: #449fe0;
    }

    /* News */
    .news-grid {
      display: grid;
      gap: 20px;
      grid-template-columns: 1fr;
      margin-top: 20px;
      margin-bottom: 20px;
    }

    .news-card {
      border-bottom: 1px solid rgba(0,0,0,0.1);
      padding: 18px;
      background:var(--card);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border-radius: 12px;
      box-shadow: 0 3px 6px rgba(0,0,0,0.1);
      cursor: default;
      transition: 0.2s;
    }

    .event {
      display:flex;
      gap:20px;
      align-items:flex-start
    }

    #formStatus {
      font-size: 0.9rem;
      margin-top: 6px;
    }

    .news-card .news-content {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Galerie standardmäßig versteckt */
    .news-card .artGallery {
        display: none;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
    }

    /* Galerie anzeigen, wenn Card offen ist */
    .news-card.open .artGallery {
        display: flex;
    }

    .news-card .artGallery img {
        width: 120px;   /* gewünschte Thumbnailgröße */
        height: 120px;  /* quadratisch */
        object-fit: cover;
        border-radius: 6px;
        cursor: pointer;
        transition: transform 0.2s ease;
    }

    .news-card .artGallery img:hover {
        transform: scale(1.03);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    #message {
        width: 100%;
        max-width: 100%;
        min-height: 140px;
        resize: vertical;
        padding: 10px 12px;
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid rgba(0,0,0,0.2);
    }

    /* .news-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    } */

    .news-card h3 {
      margin: 0 0 6px;
      font-size: 18px;
      color: #0d529f;
    }

    .news-meta {
      font-size: 13px;
      color: #666;
      margin-bottom: 8px;
    }

    /* Wenn die Card aufgeklappt ist */
    .news-card.open .news-teaser {
      -webkit-line-clamp: unset;     /* Begrenzung aufheben */
      line-clamp: unset;
      max-height: 500px;             /* ausreichend groß zum Aufklappen */
    }

    .news-teaser {
      display: -webkit-box;
      display: box;
      -webkit-line-clamp: 2;         /* 2 Zeilen Standard */
      line-clamp: 2;
      -webkit-box-orient: vertical;
      box-orient: vertical;
      overflow: hidden;
      transition: max-height 0.3s ease;
      max-height: 4em;               /* ca 2 Zeilen, je nach font-size */
    }

    .news-toggle {
      font-size: 14px;
      font-style:var(--accent);
      cursor: pointer;
      color: #b69d0d;
      margin-top: 4px;
      user-select: none;
      width: fit-content;
      transition: transform 0.3s ease;
    }

    .next-event {
      border-left: 4px solid #0d529f;
    }

    /* Gallery */
    .gallery {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap:8px;
    }

    .gallery img {
    width: 100%;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
    }

    .gallery img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    #lightbox {
        display:none;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,0.8);
        justify-content:center;
        align-items:center;
    }

    #lightbox.open {
        display:flex;
    }

    #prevBtn, #nextBtn {
        position:absolute;
        top:50%;
        transform:translateY(-50%);
        font-size:40px;
        background:none;
        border:none;
        cursor:pointer;
        color:white;
        padding:20px;
    }

    #prevBtn { left:20px; }
    #nextBtn { right:20px; }

    /* Lightbox */
    .lightbox {
        position: fixed;
        inset: 0;
        background: rgba(109, 109, 109, 0.8);
        display: none;
        justify-content: center;
        align-items: center;
        padding: 20px;
        z-index: 9999;
    }

    .lightbox.open {
        display: flex;
    }

    .lightbox img {
        max-width: 90%;
        max-height: 90%;
        border-radius: 8px;
        box-shadow: 0 0 20px rgba(0,0,0,0.5);
        z-index: 9998;
    }

    .lightbox-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.5);
        border: none;
        color: white;
        font-size: 30px;
        padding: 10px 15px;
        cursor: pointer;
        border-radius: 6px;
        z-index: 10000;
    }

    .lightbox-btn.prev {
        left: 20px;
    }

    .lightbox-btn.next {
        right: 20px;
    }

    .lightbox-btn:hover {
        background: rgba(0,0,0,0.7);
    }

    /* small helpers */
    .muted{
      color:var(--muted)
    }
    .pill{display:inline-block;padding:6px 10px;background:rgba(255,255,255,0.03);border-radius:999px;font-weight:700}

    /* accessibility focus */
    a:focus, button:focus {outline:3px solid rgba(14,165,163,0.12);outline-offset:3px}

    #resultsContainer table {
        border-collapse: collapse;
        width: 100%;
        margin-bottom: 40px;
    }

    #resultsContainer th, #resultsContainer td {
        border: 1px solid #ccc;
        padding: 8px;
    }

    #resultsContainer thead {
        background: #eee;
    }

    #resultsTable {
      border-collapse: collapse;
      table-layout: fixed;   /* Wichtig! */
      width: 100%;           /* Oder feste px */
    }

    .results-table th,
    .results-table td {
        padding: 4px 6px;
        border-bottom: 1px solid #ccc;
        text-align: left;
        word-wrap: break-word;
    }

    .form {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .form-item {
        display: flex;
        flex-direction: column;
        grid-column: span 2;
        padding: 10px 12px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .filters {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    #message-content {
        margin-top: 10px;
    }

    .filter-item {
        display: flex;
        flex-direction: column;
    }

    .filter-item label {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 4px;
    }

    .filter-item select,
    .filter-item input {
        padding: 10px 12px;
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid rgba(0,0,0,0.2);
    }

    .filter-slot {
        position: relative;
        width: 100%;
        min-height: 44px;
    }

    .filter-slot select {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }

    .filter-slot select.hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* Suche etwas breiter auf Desktop */
    @media (min-width: 900px) {
        .filter-search {
            grid-column: span 2;
        }
    }

    /* feste Breiten für alle Tabellen */

    .results-table th:nth-child(1),
    .results-table td:nth-child(1) { width: 50px; } /* Rang */

    .results-table th:nth-child(2),
    .results-table td:nth-child(2) { width: 140px; } /* Name */

    .results-table th:nth-child(3),
    .results-table td:nth-child(3) { width: 120px; } /* Vorname */

    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { width: 180px; } /* Verein */

    .results-table th:nth-child(5),
    .results-table td:nth-child(5) { width: 60px; } /* StNr */

    .results-table th:nth-child(6),
    .results-table td:nth-child(6) { width: 80px; } /* Laufzeit */
@media (max-width: 800px) {
  #upcoming-events .event {
    flex-direction: column;
    gap: 12px;
  }

  #upcoming-events .event .date {
    min-width: 100px;
    width: fit-content;
  }

  #upcoming-events .event > div:last-child {
    min-width: 0;
    width: 100%;
  }

  #upcoming-events .download-link {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #upcoming-events .image {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 420px) {
  #upcoming-events h2 {
    font-size: 1.45rem;
  }

  #upcoming-events .news-card {
    padding: 14px;
  }

  #upcoming-events .event h4 {
    font-size: 1rem;
    line-height: 1.3;
  }

  #upcoming-events .event .date {
    padding: 8px;
  }

  #upcoming-events .date .day {
    font-size: 1rem;
  }

  #upcoming-events .small {
    font-size: 12px;
  }

  #upcoming-events .download-link {
    padding: 0.45rem 0.65rem;
    gap: 0.3rem;
    font-size: 0.9rem;
  }

  #upcoming-events .download-link small {
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {

  #upcoming-events .news-card {
    padding: 12px;
  }

  #upcoming-events .event {
    gap: 10px;
  }

  #upcoming-events .event h4 {
    font-size: 0.95rem;
  }

  #upcoming-events .download-link {
    font-size: 0.85rem;
  }
}

@media (max-width: 800px) {
  #resultsContainer .results-table {
    border-collapse: separate;
    width: 100%;
    table-layout: auto;
  }

  #resultsContainer .results-table thead {
    display: none;
  }

  #resultsContainer .results-table tbody,
  #resultsContainer .results-table tr,
  #resultsContainer .results-table td {
    display: block;
    width: 100%;
  }

  #resultsContainer .results-table tr {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.22);
  }

  #resultsContainer .results-table td {
    border: none;
    border-bottom: 1px dashed rgba(0,0,0,0.12);
    padding: 6px 0;
    word-break: break-word;
  }

  #resultsContainer .results-table td:last-child {
    border-bottom: none;
  }

  #resultsContainer .results-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: #0d529f;
  }

  #downloadsContainer .download-link {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #downloadsContainer .download-link small {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
