:root {
    --bg:          #f5f4f0;
    --bg2:         #edecea;
    --bg3:         #e6e4de;
    --surface:     #ffffff;
    --border:      rgba(0,0,0,0.08);
    --border-hi:   rgba(0,0,0,0.15);
    --text:        #1a1a1a;
    --muted:       #636363;
    --accent:      #c8192a;
    --accent2:     #1a4f8c;
    --accent-dim:  rgba(200,25,42,0.07);
    --green:       #1a6642;
    --tag-bg:      rgba(26,79,140,0.09);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);

    --serif: 'DM Serif Display', Georgia, serif;
    --mono:  'DM Mono', monospace;
    --sans:  'DM Sans', system-ui, sans-serif;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
  }

  /* Grain texture — actually visible this time */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
    mix-blend-mode: multiply;
  }

  /* ── HEADER ── */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 clamp(1.25rem, 4vw, 3.5rem);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-hi);
    background: rgba(245,244,240,0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    flex-shrink: 0;
  }

  .logo-mark img {
    height: 40px;
    width: auto;
    display: block;
  }

  .logo-text {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.3;
  }

  .logo-text span {
    display: block;
    color: var(--muted);
    font-size: 9.5px;
    letter-spacing: 0.07em;
  }

  nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
  }

  nav a {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    border-radius: 2px;
    transition: color 0.15s, background 0.15s;
  }

  nav a:hover {
    color: var(--text);
    background: var(--surface);
  }

  /* ── HERO ── */
  .hero {
    position: relative;
    z-index: 1;
    padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4.5rem);
    max-width: 1240px;
    margin: 0 auto;
  }

  .hero-eyebrow {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .hero-eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
  }

  h1 {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5.5vw, 4.2rem);
    font-weight: 400;
    line-height: 1.06;
    color: var(--text);
    max-width: 18ch;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
  }

  h1 em {
    font-style: italic;
    color: var(--accent);
  }

  .hero-desc {
    font-size: 15.5px;
    color: var(--muted);
    max-width: 50ch;
    line-height: 1.7;
    margin-bottom: 2rem;
    font-weight: 300;
  }

  .hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .tag {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--accent2);
    background: var(--tag-bg);
    border: 1px solid rgba(26,79,140,0.22);
    padding: 0.25rem 0.65rem;
    border-radius: 2px;
  }

  /* ── SECTION LABELS ── */
  .section-label {
    position: relative;
    z-index: 1;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--muted);
    padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 4vw, 3.5rem) 0.9rem;
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    scroll-margin-top: 68px;
  }

  .section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  /* ── KEY BAR ── */
  .key-bar {
    position: relative;
    z-index: 1;
    background: var(--surface);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.85rem clamp(1.25rem, 4vw, 3.5rem) 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.1rem;
    align-items: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
  }

  .key-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-transform: uppercase;
    margin-right: 0.1rem;
  }

  .key-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted);
    letter-spacing: 0.03em;
  }

  /* ── YEAR GRID ── */
  .year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1px;
    background: var(--border);
    max-width: 1240px;
    margin: 0 auto clamp(0.5rem, 2vw, 1rem);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
  }

  .year-card {
    background: var(--surface);
    padding: 1.6rem 1.85rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    transition: background 0.18s;
    position: relative;
    overflow: hidden;
  }

  /* Left accent line */
  .year-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    transition: background 0.18s;
  }

  .year-card:hover { background: var(--bg2); }
  .year-card:hover::before { background: var(--accent); }

  .year-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }

  .year-number {
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.02em;
  }

  .year-title {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .year-badge {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 2px;
    border: 1px solid;
    flex-shrink: 0;
  }

  .badge-active {
    color: var(--green);
    border-color: rgba(26,102,66,0.35);
    background: rgba(26,102,66,0.06);
  }

  .badge-soon {
    color: var(--muted);
    border-color: var(--border);
    background: transparent;
  }

  /* ── GAME LIST ── */
  .game-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .game-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    position: relative;
  }

  .game-item:hover {
    border-color: var(--border-hi);
    background: var(--surface);
    transform: translateX(2px);
  }

  .game-item.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
  }

  .game-icon {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
  }

  .icon-classroom { background: rgba(200,169,110,0.13); }
  .icon-self      { background: rgba(26,79,140,0.10);  }
  .icon-culture   { background: rgba(155,126,203,0.12);}
  .icon-reading   { background: rgba(180,80,80,0.11);  }
  .icon-guide     { background: rgba(100,155,110,0.12);}
  .icon-mun       { background: rgba(26,79,140,0.13);  }

  .game-info { flex: 1; min-width: 0; }

  .game-name {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


.game-desc{
  font-size:11px;
  line-height:1.35;
  color:var(--muted);
  margin-top:3px;
  margin-bottom:2px;
  opacity:.8;
}

  .game-meta {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.03em;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── TYPE BADGES ── */
  .game-type {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0.18rem 0.42rem;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid transparent;
  }

  .type-classroom { color: var(--accent);  background: var(--accent-dim); border-color: rgba(200,25,42,0.15); }
  .type-self      { color: var(--accent2); background: var(--tag-bg);     border-color: rgba(26,79,140,0.2); }
  .type-lesson    { color: #6a9060;  background: rgba(106,144,96,0.09);  border-color: rgba(106,144,96,0.22); }
  .type-reading   { color: #b04a4a;  background: rgba(176,74,74,0.09);   border-color: rgba(176,74,74,0.2); }
  .type-literary  { color: #b86a3a;  background: rgba(184,106,58,0.09);  border-color: rgba(184,106,58,0.2); }
  .type-guide     { color: #5a8e6a;  background: rgba(90,142,106,0.09);  border-color: rgba(90,142,106,0.22); }
  .type-culture   { color: #8a66bb;  background: rgba(138,102,187,0.09); border-color: rgba(138,102,187,0.22); }
  .type-mun       { color: #2a5fa0;  background: rgba(42,95,160,0.09);   border-color: rgba(42,95,160,0.22); }
  .type-soon      { color: var(--muted); background: transparent; border-color: var(--border); }

  /* ── COMING SOON STATE ── */
  .year-card.coming-soon .year-title { opacity: 0.38; }

  .coming-soon-msg {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px dashed var(--border-hi);
    padding: 0.85rem 1rem;
    text-align: center;
    border-radius: 2px;
  }

  /* ── BOOK GRID ── */
  .book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1px;
    background: var(--border);
    max-width: 1240px;
    margin: 0 auto clamp(1rem, 3vw, 2rem);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
  }

  .book-card {
    background: var(--surface);
    padding: 1.6rem 1.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    overflow: hidden;
    transition: background 0.18s;
  }

  /* Top accent line — all cards, on hover */
  .book-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: transparent;
    transition: background 0.18s;
  }

  .book-card:hover { background: var(--bg2); }
  .book-card:not(.coming-soon):hover::before { background: var(--accent); }

  .book-cover-placeholder {
    width: 46px;
    height: 62px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
  }

  .book-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
  }

  .book-author {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.07em;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: -0.3rem;
  }

  .book-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.58;
    font-weight: 300;
  }

  .book-link {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    transition: gap 0.15s;
  }

  .book-link:hover { gap: 0.65rem; }
  .book-link.disabled { color: var(--muted); pointer-events: none; }

  /* ── FOOTER ── */
  footer {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: clamp(2rem, 5vw, 4rem) auto 0;
    padding: 1.35rem clamp(1.25rem, 4vw, 3.5rem);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .footer-left {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: 0.06em;
  }

  .footer-left strong { color: var(--text); font-weight: 400; }

  .footer-right {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-align: right;
  }

  /* ── THEMENFELD DIVIDER ── */
  .themenfeld-divider {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.35rem 0 0.1rem;
  }

  .themenfeld-divider::before,
  .themenfeld-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  .type-themenfeld {
    color: #7a5ea0;
    background: rgba(122,94,160,0.08);
    border-color: rgba(122,94,160,0.22);
  }

  .themenfeld-item {
    opacity: 0.72;
    pointer-events: none;
    cursor: default;
  }

  /* ── SCROLLBAR ── */
  ::-webkit-scrollbar { width: 5px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  /* ── MOBILE NAV ── */
  .nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-hi);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s, color 0.15s;
  }

  .nav-toggle:hover { background: var(--surface); color: var(--text); }

  @media (max-width: 620px) {
    nav {
      display: none;
      flex-direction: column;
      position: absolute;
      top: 60px;
      left: 0; right: 0;
      background: var(--bg);
      border-bottom: 1px solid var(--border-hi);
      padding: 0.5rem;
      z-index: 200;
    }
    nav.open { display: flex; }
    nav a { padding: 0.6rem 0.75rem; }
    .nav-toggle { display: block; }
    .year-grid, .book-grid { grid-template-columns: 1fr; }
    .key-bar { gap: 0.6rem; }
    h1 { max-width: 100%; }
  }

  /* ── SEARCH ── */
  .search-bar-wrap {
    max-width: 680px;
    margin: 0 auto 2rem;
    padding: 0 clamp(1.25rem, 4vw, 3.5rem);
  }

  .search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: 8px;
    padding: 0 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .search-bar:focus-within {
    border-color: var(--accent2);
    box-shadow: 0 0 0 3px rgba(26,79,140,0.1);
  }

  .search-icon {
    font-size: 1.15rem;
    color: var(--muted);
    pointer-events: none;
    flex-shrink: 0;
  }

  #hubSearch {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--text);
    padding: 0.7rem 0;
    outline: none;
  }

  #hubSearch::placeholder { color: var(--muted); }

  .search-clear {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.1rem;
    flex-shrink: 0;
    line-height: 1;
  }

  .search-clear:hover { color: var(--text); }

  .search-empty {
    text-align: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.875rem;
    padding: 2.5rem 1rem;
  }

  /* Hide section labels and year-grids when all their cards are hidden */
  .section-label.search-hidden,
  .year-grid.search-hidden,
  .book-grid.search-hidden {
    display: none;
  }

  .game-item.search-hidden {
    display: none;
  }

  .year-card.search-hidden,
  .book-card.search-hidden {
    display: none;
  }

  /* ── REDUCED MOTION ── */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition: none !important;
      animation: none !important;
    }
  }
