  @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

  :root {
    --bg: #edf3f7;
    --surface: #ffffff;
    --surface-alt: #e4edf3;
    --border: #d2dfe8;
    --text: #1a1a1a;
    --text-muted: #566169;
    --accent: #3ec0f0;
    --accent-ink: #175f8f;
    --accent-soft: #ddf1fb;
    --gold: #2e6ba0;
    --gold-soft: #e2ecf4;
    --danger: #e52822;
    --shadow: rgba(18, 42, 64, 0.10);
    --radius-card: 14px;
    --radius-chip: 999px;
    color-scheme: light;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #101a22;
      --surface: #17232d;
      --surface-alt: #1e2c37;
      --border: #2c3d49;
      --text: #e8eef2;
      --text-muted: #9fb0bb;
      --accent: #4ecbfa;
      --accent-ink: #a9e0f6;
      --accent-soft: #16344a;
      --gold: #6ea8de;
      --gold-soft: #21344a;
      --danger: #f2705f;
      --shadow: rgba(0, 0, 0, 0.5);
      color-scheme: dark;
    }
  }

  :root[data-theme="dark"] {
    --bg: #101a22;
    --surface: #17232d;
    --surface-alt: #1e2c37;
    --border: #2c3d49;
    --text: #e8eef2;
    --text-muted: #9fb0bb;
    --accent: #4ecbfa;
    --accent-ink: #a9e0f6;
    --accent-soft: #16344a;
    --gold: #6ea8de;
    --gold-soft: #21344a;
    --danger: #f2705f;
    --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.6;
  }

  .wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px 96px;
  }

  header.masthead {
    padding: 40px 0 22px;
    border-bottom: 1px solid var(--border);
  }

  /* Title + logo: stacked (logo above title) on narrow screens; side by side
     (title left, logo right) once there is room. row-reverse keeps the logo on
     the right while the logo comes first in the DOM so it stacks ABOVE the
     title when the row collapses to a column. */
  .masthead-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 8px;
  }
  @media (min-width: 560px) {
    .masthead-head {
      flex-direction: row-reverse;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
    }
  }
  .masthead-head .title { margin: 0; }
  .brand-logo {
    display: block;
    height: 48px;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
  }

  .eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: var(--accent-soft);
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-chip);
    margin-bottom: 14px;
  }

  h1.title {
    font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.6rem);
    margin: 0 0 8px;
    text-wrap: balance;
    letter-spacing: -0.01em;
  }

  .masthead p.sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 60ch;
  }

  .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 18px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text-muted);
  }
  .meta-row strong { color: var(--text); font-weight: 600; }

  nav.toc {
    position: sticky;
    top: var(--appbar-h, 46px);
    z-index: 20;
    background: var(--bg);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }
  nav.toc::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 100%;
    background: var(--bg);
    z-index: -1;
  }
  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 9px 14px;
    border-radius: var(--radius-chip);
    cursor: pointer;
    text-align: left;
  }
  .toc-toggle:hover,
  .toc-toggle:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
  .toc-toggle-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .toc-toggle-chevron {
    flex: 0 0 auto;
    display: flex;
    transition: transform 0.2s ease;
  }
  .toc-toggle-chevron svg { width: 15px; height: 15px; }
  nav.toc.open .toc-toggle-chevron { transform: rotate(180deg); }
  .toc-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  nav.toc.open .toc-panel {
    max-height: 65vh;
    overflow-y: auto;
  }
  .toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding-top: 10px;
  }
  .toc-grid a {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    line-height: 1.3;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .toc-grid a:hover,
  .toc-grid a:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
  .toc-grid span.num { color: var(--text-muted); margin-right: 6px; }

  section.game {
    padding: 48px 0 8px;
    border-bottom: 1px solid var(--border);
    /* clear the sticky app bar + TOC when jumping to a game */
    scroll-margin-top: calc(var(--appbar-h, 46px) + 60px);
  }
  section.game:last-of-type { border-bottom: none; }

  .chapter-num {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 6px;
  }

  h2.game-title {
    font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    margin: 0 0 6px;
    text-wrap: balance;
  }

  p.credits {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    letter-spacing: 0.01em;
  }
  p.credits b { color: var(--text); font-weight: 500; }

  .preview-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-chip);
    margin: 0 0 22px;
  }

  .game-grid {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  /* Grid items default to min-width:auto, so a wide image (any size) forces the
     track wider than the viewport and the page scrolls horizontally on mobile.
     Letting the items shrink to 0 keeps the layout within the screen. */
  .game-grid > *,
  .expansion-grid > * { min-width: 0; }
  @media (max-width: 620px) {
    .game-grid { grid-template-columns: minmax(0, 1fr); }
  }

  .cover-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    background: linear-gradient(155deg, var(--accent-soft), var(--surface) 70%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    box-shadow: 0 6px 18px var(--shadow);
    overflow: hidden;
  }
  .cover-tile-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }
  .cover-tile.has-image {
    aspect-ratio: auto;
    display: block;
  }
  .cover-tile.has-image .cover-tile-inner {
    display: block;
    flex: none;
  }
  .cover-tile .box-mark {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.15;
    color: var(--accent-ink);
    text-wrap: balance;
  }
  .cover-tile .ph-note { font-weight: 400; opacity: 0.7; }
  .cover-tile svg { width: 30px; height: 30px; opacity: 0.55; }
  .cover-photo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  .stat-block {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    overflow: hidden;
  }
  .stat-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    border-bottom: 1px solid var(--border);
  }
  .stat-row:last-child { border-bottom: none; }
  .stat-row .k { color: var(--text-muted); flex: 0 0 auto; }
  .stat-row .v { color: var(--text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

  /* Links / Downloads — sit below the stat block in the left column. */
  .extras { margin-top: 16px; }
  .extras-head {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 7px;
  }
  .extras-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
  .extras-list li { line-height: 1.35; }
  .extras-list a {
    color: var(--accent-ink);
    text-decoration: none;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
    display: inline-flex;
    gap: 6px;
    align-items: baseline;
  }
  .extras-list a:hover { text-decoration: underline; }
  /* small leading marker: ↗ for links, ↓ for downloads */
  .extras-list a::before { content: "\2197"; color: var(--accent); font-size: 0.85em; flex: 0 0 auto; }
  .extras-downloads a::before { content: "\2193"; }

  .weight-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: 0 0 auto; }
  .dot.full { background: var(--gold); }
  .dot.half { background: linear-gradient(90deg, var(--gold) 50%, var(--border) 50%); }

  .pitch {
    font-size: 1.05rem;
    max-width: 62ch;
  }
  .pitch::first-letter {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 2.6em;
    float: left;
    line-height: 0.85;
    padding: 4px 6px 0 0;
    color: var(--accent-ink);
  }

  .mechanics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 24px;
  }
  .mech-chip {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11.5px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 10px;
    border-radius: var(--radius-chip);
  }
  .mech-chip.genre { color: var(--accent-ink); border-color: var(--accent); }

  h3.rules-head {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 30px 0 12px;
  }

  .rules-rows {
    display: grid;
    gap: 10px;
    max-width: 62ch;
  }
  .rule-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 0.98rem;
  }
  /* Let the text column shrink and break long unbreakable tokens (e.g.
     slash-joined lists like "Farmen/Energie/Siedlungen/…") instead of
     forcing the row wider than the screen. */
  .rule-row > * { min-width: 0; }
  .rule-row > *:last-child { overflow-wrap: anywhere; }
  .rule-row:first-child { border-top: none; padding-top: 0; }
  .rule-row .label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-ink);
    padding-top: 2px;
  }
  .rule-row.lose .label { color: var(--danger); }

  .game-footnote {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    margin-top: 14px;
  }

  /* Safety net: never let a long unbreakable token (URL, slash-list, long word)
     in any text block push the layout wider than the screen. */
  .pitch, .credits, .expansion-pitch, .box-mark, .mech-chip { overflow-wrap: break-word; }

  footer {
    max-width: 780px;
    margin: 40px auto 0;
    padding: 0 20px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11.5px;
  }


  .expansion {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px dashed var(--border);
  }
  .expansion-eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 6px;
  }
  h3.expansion-title {
    font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 0 14px;
    text-wrap: balance;
  }
  .expansion .preview-note { margin: 0 0 18px; }
  .expansion-grid {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  @media (max-width: 620px) {
    .expansion-grid { grid-template-columns: minmax(0, 1fr); }
  }
  p.expansion-pitch {
    font-size: 0.98rem;
    max-width: 62ch;
    margin: 0;
  }
  .expansion h4.rules-head { margin: 22px 0 12px; }

  @media (prefers-reduced-motion: no-preference) {
    section.game { animation: rise 0.4s ease both; }
    @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  }

  /* ---------- Search + filter toolbar ---------- */
  /* The TOC (game selector) is the sticky element (see nav.toc). The filter
     chips and the search row below it scroll normally. */
  .searchbar {
    margin: 12px 0 8px;
  }
  .toolbar {
    margin: 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .toolbar-search { position: relative; display: flex; align-items: center; }
  .toolbar-search-icon {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
  }
  .filter-search {
    width: 100%;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-chip);
    padding: 11px 40px;
  }
  .filter-search::placeholder { color: var(--text-muted); }
  .filter-search:focus-visible { outline: none; border-color: var(--accent); }
  /* hide the native search clear (we render our own) */
  .filter-search::-webkit-search-cancel-button { display: none; }
  .filter-clear {
    position: absolute;
    right: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 50%;
  }
  .filter-clear:hover,
  .filter-clear:focus-visible { color: var(--text); }

  .filter-groups { display: flex; flex-direction: column; gap: 8px; }
  .filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .filter-group-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    flex: 0 0 auto;
    min-width: 96px;
  }
  .filter-chip {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11.5px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-chip);
    padding: 4px 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .filter-chip:hover { border-color: var(--accent); }
  .filter-chip:focus-visible { outline: none; border-color: var(--accent); }
  .filter-chip[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent-ink);
    border-color: var(--accent);
    font-weight: 600;
  }

  .toolbar-status {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-muted);
  }
  .result-count strong { color: var(--text); font-weight: 600; }
  .filter-reset {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--accent-ink);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
  }
  .filter-reset:hover { color: var(--accent); }

  @media (min-width: 560px) {
    .filter-search { max-width: 420px; }
  }

  /* filtered-out games/TOC entries */
  .filter-hidden { display: none !important; }

  .no-results {
    padding: 44px 4px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 14px;
  }

  /* ---------- Loading / error states ---------- */
  .state-loading,
  .state-error {
    padding: 52px 4px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 14px;
  }
  .state-loading { display: flex; align-items: center; gap: 12px; }
  .spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 0.7s linear infinite;
    flex: 0 0 auto;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.2s; } }
  .state-error p { margin: 0 0 10px; color: var(--text); }
  .state-error .state-error-detail { color: var(--text-muted); font-size: 12px; }
  .retry-btn {
    margin-top: 6px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--accent-ink);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-chip);
    padding: 8px 18px;
    cursor: pointer;
  }
  .retry-btn:hover { background: var(--accent); color: #fff; }

  /* ---------- Back to top ---------- */
  .to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent-ink);
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .to-top svg { width: 20px; height: 20px; }
  .to-top.show { opacity: 1; transform: none; pointer-events: auto; }
  .to-top:hover,
  .to-top:focus-visible { border-color: var(--accent); color: var(--accent); }
  @supports (padding: max(0px)) {
    .to-top {
      right: max(16px, env(safe-area-inset-right));
      bottom: max(16px, env(safe-area-inset-bottom));
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .to-top { transition: opacity 0.2s ease; transform: none; }
  }

  /* ============================================================ app shell ===
     Top bar + section nav shared by "Spiele" and "Einsatzplan". */
  .appbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .appbar-brand { display: inline-flex; flex-shrink: 0; }
  .appbar-brand img { display: block; height: 26px; width: auto; }
  .appnav {
    display: flex;
    gap: 6px;
    margin-right: auto;
  }
  .appnav a {
    font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-chip);
    transition: color 0.15s ease, background 0.15s ease;
  }
  .appnav a:hover { color: var(--text); background: var(--surface-alt); }
  .appnav a[aria-current="page"] {
    color: var(--accent-ink);
    background: var(--accent-soft);
  }
  .appbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8rem;
  }
  .appbar-name {
    color: var(--text-muted);
    max-width: 22ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .appbar-admin, .appbar-logout {
    color: var(--accent-ink);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-chip);
    padding: 4px 10px;
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .appbar-admin:hover, .appbar-logout:hover { border-color: var(--accent); color: var(--accent); }
  @media (max-width: 560px) {
    .appbar { gap: 12px; padding: 8px 14px; flex-wrap: wrap; }
    .appbar-name { display: none; }
  }

  /* ========================================================== Einsatzplan ===
     Personal shift view, in the same visual language as the briefing. */
  .plan { padding-top: 26px; }
  .plan-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  .plan-picker { display: grid; gap: 6px; }
  .plan-picker-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .plan-picker select {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 240px;
    cursor: pointer;
  }
  .plan-picker select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .plan-count {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--accent-ink);
    background: var(--accent-soft);
    padding: 5px 11px;
    border-radius: var(--radius-chip);
  }
  .plan-remember { margin-bottom: 16px; }
  .plan-remember button {
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--accent-ink);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-chip);
    padding: 7px 14px;
  }
  .plan-remember button:disabled { opacity: 0.5; cursor: default; }
  .plan-list { display: grid; gap: 12px; }
  .plan-shift {
    display: grid;
    /* fixed first column so it always fits the longest weekday ("Donnerstag")
       and the time column doesn't shift as the day filter changes */
    grid-template-columns: 5.5rem auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: 0 4px 14px var(--shadow);
  }
  .plan-day {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .plan-hours { font-weight: 600; font-size: 1.05rem; }
  .plan-position {
    justify-self: end;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.85rem;
    color: var(--accent-ink);
    background: var(--gold-soft);
    border-radius: 10px;
    padding: 8px 12px;
  }
  .plan-empty { text-align: center; color: var(--text-muted); padding: 48px 20px; }
  .plan-empty-icon { font-size: 40px; margin-bottom: 12px; }
  .plan-empty h3 { font-family: 'Bricolage Grotesque', sans-serif; color: var(--text); margin: 0 0 6px; }
  .plan-empty p { margin: 0; max-width: 46ch; margin-inline: auto; }
  @media (max-width: 560px) {
    .plan-shift { grid-template-columns: 1fr; gap: 8px; }
    .plan-position { justify-self: start; }
  }

  .plan-admin-link { margin: 10px 0 0; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.85rem; }
  .plan-admin-link a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
  .plan-admin-link a:hover { color: var(--accent); }

  .plan-imported { margin: 22px 0 0; text-align: right; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.78rem; color: var(--text-muted); }
  .plan-imported strong { color: var(--text); font-weight: 600; }

  .plan-pickers { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }

  .plan-meta { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  .plan-game { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.8rem; color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
  .plan-game:hover { color: var(--accent); }
  @media (max-width: 560px) {
    .plan-meta { justify-self: start; align-items: flex-start; }
    .plan-game { text-align: left; max-width: 100%; }
  }

  .spiele-admin { margin: 0 0 16px; text-align: right; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.85rem; }
  .spiele-admin a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent); }
  .spiele-admin a:hover { color: var(--accent); }

  .plan-shift.now { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 4px 14px var(--shadow); }
  .plan-shift.next { border-color: var(--gold); }
  .plan-tag { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-chip); }
  .plan-tag.now { background: var(--accent-soft); color: var(--accent-ink); }
  .plan-tag.next { background: var(--gold-soft); color: var(--gold); }

  .demo-where {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin: 0 0 22px;
    padding: 10px 14px;
    background: var(--accent-soft);
    border-radius: var(--radius-card);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--accent-ink);
  }
  .demo-where-label { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; opacity: 0.75; }
  .demo-where ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
  .demo-where strong { font-weight: 600; }

  .install-hint {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 40px 10px 14px;
    background: var(--accent-ink);
    color: #fff;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.76rem;
    line-height: 1.3;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  .install-hint.show { transform: translateY(0); }
  .install-hint-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
  }

  .plan-testtime { margin: 10px 0 0; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.8rem; color: var(--danger); }
  .plan-testtime code { background: var(--surface-alt); padding: 1px 5px; border-radius: 5px; }
