    :root {
      --sky-50: #f8fdff;
      --sky-100: #eaf8ff;
      --sky-200: #cdefff;
      --sky-300: #a9e2fa;
      --sky-500: #55b9df;
      --sky-700: #237b9f;
      --pink-50: #fff8fb;
      --pink-100: #ffebf3;
      --pink-200: #ffd2e2;
      --pink-300: #ffb5cf;
      --pink-500: #ea709d;
      --pink-700: #ad3d68;
      --ink: #183344;
      --muted: #65808d;
      --line: #dcecf3;
      --white: #ffffff;
      --shadow: 0 14px 38px rgba(38, 99, 129, 0.13);
      --sidebar-width: 335px;
      --topbar-height: 80px;
      --curio-viewport-height: 100vh;
      --radius-xl: 24px;
      --radius-lg: 17px;
      --radius-md: 13px;
    }

    /* Mobile sidebar: closed before first paint via inline script on <html> */
    html.mobile-init .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
    html.mobile-init .sidebar {
      transform: translate3d(calc(-100% - 16px), 0, 0);
      transition: none;
      pointer-events: none;
    }
    html.mobile-init .sidebar-overlay { display: none !important; }

    * { box-sizing: border-box; }
    html { background: var(--sky-50); scroll-behavior: auto; }

    body {
      min-width: 320px;
      margin: 0;
      color: var(--ink);
      background:
        radial-gradient(circle at top left, rgba(255, 211, 228, 0.58), transparent 31rem),
        radial-gradient(circle at top right, rgba(174, 229, 255, 0.62), transparent 37rem),
        var(--sky-50);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    button, a, input { font: inherit; }
    button { cursor: pointer; }
    a { text-decoration: none; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

    /* Header */
    .topbar {
      position: sticky;
      top: 0;
      z-index: 50;
      height: var(--topbar-height);
      min-height: var(--topbar-height);
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 11px 24px;
      border-bottom: 1px solid rgba(220, 236, 243, 0.92);
      background: rgba(255, 255, 255, 0.84);
      backdrop-filter: blur(16px);
    }

    .nav-toggle {
      width: 46px;
      height: 46px;
      position: relative;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: var(--sky-700);
      border: 1px solid var(--sky-200);
      border-radius: 13px;
      background: var(--sky-100);
      transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
    }
    .nav-toggle:hover { transform: translateY(-1px); border-color: var(--pink-200); background: var(--pink-50); }
    .nav-toggle-lines { width: 22px; height: 18px; position: relative; display: block; }
    .nav-toggle-line {
      width: 22px;
      height: 2.5px;
      position: absolute;
      left: 0;
      border-radius: 999px;
      background: currentColor;
      transform-origin: center;
      transition: transform 340ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease;
    }
    .nav-toggle-line:nth-child(1) { top: 1px; }
    .nav-toggle-line:nth-child(2) { top: 8px; }
    .nav-toggle-line:nth-child(3) { top: 15px; }
    .nav-toggle.is-active .nav-toggle-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.is-active .nav-toggle-line:nth-child(2) { opacity: 0; }
    .nav-toggle.is-active .nav-toggle-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); text-decoration: none; }
    .brand-mark {
      width: 58px;
      height: 58px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: var(--pink-700);
      border-radius: 18px;
      background: linear-gradient(135deg, var(--pink-200), var(--sky-200));
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 8px 18px rgba(233, 111, 155, 0.14);
      font-size: 2.55rem;
      line-height: 1;
    }
    .brand-mark svg {
      display: block;
      width: 54%;
      height: auto;
      transform: translateY(1px);
    }
    .brand-copy { display: grid; gap: 2px; }
    .brand-copy strong { letter-spacing: -0.035em; font-size: 1.04rem; }
    .brand-copy span { color: var(--muted); font-size: 0.76rem; }
    .topbar-links { display: flex; align-items: center; gap: 8px; margin-left: auto; }
    .topbar-links a { padding: 9px 12px; color: var(--muted); border-radius: 10px; font-size: 0.9rem; font-weight: 800; text-decoration: none; transition: color 180ms ease, background 180ms ease; }
    .topbar-links a:hover, .topbar-links a.is-current { color: var(--pink-700); background: var(--pink-100); }

    .app-shell {
      min-height: calc(100vh - var(--topbar-height));
      display: grid;
      grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
      align-items: start;
    }
    .app-shell.sidebar-closed { grid-template-columns: 0 minmax(0, 1fr); }

    .sidebar {
      width: var(--sidebar-width);
      height: calc(100vh - var(--topbar-height));
      height: calc(100svh - var(--topbar-height));
      position: sticky;
      top: var(--topbar-height);
      z-index: 30;
      align-self: start;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-right: 1px solid var(--line);
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(12px);
      box-shadow: 14px 0 32px rgba(33, 91, 117, 0.08);
      transform: translate3d(0, 0, 0);
      transition: transform 520ms cubic-bezier(.22, 1, .36, 1);
      will-change: transform;
      contain: layout paint style;
      backface-visibility: hidden;
    }
    .app-shell.sidebar-closed .sidebar {
      transform: translate3d(calc(-100% - 16px), 0, 0);
      pointer-events: none;
    }

    .sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 14px; }
    .sidebar-heading h2 { margin: 0; color: var(--sky-700); letter-spacing: 0.1em; font-size: 0.72rem; text-transform: uppercase; }
    .game-count { padding: 5px 9px; color: var(--pink-700); border-radius: 999px; background: var(--pink-100); font-size: 0.72rem; font-weight: 800; }
    .library-search { padding: 0 20px 15px; }
    .library-search input { width: 100%; padding: 11px 12px; color: var(--ink); outline: none; border: 1px solid var(--line); border-radius: 11px; background: var(--white); transition: border-color 180ms ease, box-shadow 180ms ease; }
    .library-search input:focus { border-color: var(--sky-500); box-shadow: 0 0 0 4px rgba(85, 185, 223, 0.14); }

    /* Browse-button flash — smooth pink border glow, transition-based */
    .library-search input {
      transition: border-color 400ms ease, box-shadow 400ms ease;
    }
    .library-search input.search-flash {
      border-color: var(--pink-300);
      box-shadow: 0 0 0 4px rgba(255, 181, 207, 0.35);
      transition: border-color 200ms ease, box-shadow 200ms ease;
    }
    .game-library {
      flex: 1 1 auto;
      min-height: 0;
      padding: 0 12px 22px;
      overflow-y: auto;
      overscroll-behavior: contain;
      overscroll-behavior-y: contain;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
    }

    /* Animated collapsible subjects */
    .subject { border-bottom: 1px solid rgba(220, 236, 243, 0.9); }
    .subject-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 8px; color: var(--ink); border: 0; background: transparent; text-align: left; }
    .subject-toggle:hover .subject-name { color: var(--pink-700); }
    .subject-name { display: flex; align-items: center; gap: 9px; font-size: 0.94rem; font-weight: 850; transition: color 180ms ease; }
    .subject-total { color: var(--muted); font-size: 0.72rem; font-weight: 750; }
    .subject-chevron { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--sky-700); border: 1px solid var(--sky-200); border-radius: 50%; background: var(--sky-100); transition: transform 260ms cubic-bezier(.2, .8, .2, 1), color 180ms ease, background 180ms ease; }
    .subject-chevron svg { width: 16px; height: 16px; }
    .subject.is-open .subject-chevron { color: var(--pink-700); background: var(--pink-100); transform: rotate(90deg); }
    .subject-panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 290ms cubic-bezier(.2, .8, .2, 1), opacity 190ms ease; }
    .subject-panel-inner { min-height: 0; overflow: hidden; padding: 0 4px; transition: padding 290ms cubic-bezier(.2, .8, .2, 1); }
    .subject.is-open .subject-panel { grid-template-rows: 1fr; opacity: 1; }
    .subject.is-open .subject-panel-inner { padding: 0 4px 14px; }
    .subject-games { display: grid; gap: 7px; }

    /* Game cards — <a> tags */
    .game-card {
      width: 100%;
      display: grid;
      grid-template-columns: 59px minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      padding: 8px;
      color: var(--ink);
      border: 1px solid transparent;
      border-radius: 13px;
      background: transparent;
      text-align: left;
      transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
    }
    .game-card:hover { transform: translateX(3px); border-color: var(--sky-200); background: var(--sky-100); }
    .game-card.is-active { border-color: var(--pink-200); background: linear-gradient(135deg, var(--pink-100), var(--sky-100)); }

    /* Thumbnails */
    .game-thumb {
      position: relative;
      width: 59px;
      height: 44px;
      overflow: hidden;
      border-radius: 10px;
      background: linear-gradient(135deg, #a6e5fc, #ffc6dc);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.76);
      flex-shrink: 0;
    }
    .game-thumb img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .game-thumb:not(:has(img))::before,
    .game-thumb:not(:has(img))::after { position: absolute; content: ""; }
    .game-thumb:not(:has(img))::before { width: 23px; height: 23px; top: 10px; left: 17px; border: 3px solid rgba(255, 255, 255, 0.88); border-radius: 50%; }
    .game-thumb:not(:has(img))::after { width: 11px; height: 11px; right: 7px; bottom: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.9); }

    .thumb-physics { background: linear-gradient(135deg, #b6f1e1, #c5eaff); }
    .thumb-chemistry { background: linear-gradient(135deg, #ffe0a7, #ffc6da); }
    .thumb-biology { background: linear-gradient(135deg, #b8eec9, #c7ecff); }
    .thumb-computer-science { background: linear-gradient(135deg, #d4c4ff, #beeaff); }
    .thumb-other { background: linear-gradient(135deg, #ffc9de, #cbeaff); }
    .game-card-copy { min-width: 0; display: grid; gap: 3px; }
    .game-card-title { overflow: hidden; color: var(--ink); font-size: 0.86rem; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
    .game-card-meta { overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
    .empty-search { padding: 22px 10px; color: var(--muted); font-size: 0.86rem; line-height: 1.5; text-align: center; }

    /* Content */
    .content {
      min-height: calc(100vh - var(--topbar-height));
      min-height: calc(100svh - var(--topbar-height));
      grid-column: 2;
      min-width: 0;
      display: flex;
      flex-direction: column;
      padding: clamp(20px, 3vw, 44px);
    }
    .content-inner { width: min(1140px, 100%); flex: 0 0 auto; margin: 0 auto; }

    /* Footer */
    .site-footer {
      width: min(1140px, 100%);
      flex: 0 0 auto;
      margin: clamp(24px, 4vw, 42px) auto 0;
      padding: 14px 0 calc(20px + env(safe-area-inset-bottom, 0px));
    }
    .footer-links {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 8px;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 800;
    }
    .footer-links a {
      padding: 8px 9px;
      color: var(--muted);
      border-radius: 10px;
      transition: color 180ms ease, background 180ms ease;
    }
    .footer-links a:hover,
    .footer-links a.is-current {
      color: var(--pink-700);
      background: rgba(255, 235, 243, 0.78);
    }
    .footer-separator { color: rgba(101, 128, 141, 0.55); }

    /* Home */
    .home-hero { position: relative; overflow: hidden; padding: clamp(28px, 5vw, 60px); border: 1px solid rgba(220, 236, 243, 0.95); border-radius: var(--radius-xl); background: radial-gradient(circle at 85% 18%, rgba(255, 185, 210, 0.72), transparent 15rem), radial-gradient(circle at 70% 90%, rgba(175, 229, 255, 0.82), transparent 17rem), rgba(255, 255, 255, 0.86); box-shadow: var(--shadow); }
    .home-hero::after { width: 210px; height: 210px; position: absolute; right: -58px; bottom: -70px; z-index: 0; border: 22px solid rgba(255, 255, 255, 0.38); border-radius: 50%; content: ""; pointer-events: none; }
    .home-hero > * { position: relative; z-index: 1; }
    .eyebrow { margin: 0 0 12px; color: var(--pink-700); letter-spacing: 0.12em; font-size: 0.73rem; font-weight: 900; text-transform: uppercase; }
    .home-hero h1 { max-width: 710px; margin: 0; letter-spacing: -0.055em; font-size: clamp(2.45rem, 6vw, 4.65rem); line-height: 0.98; }
    .home-hero p { max-width: 630px; margin: 19px 0 0; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.13rem); line-height: 1.65; }
    .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
    .button-primary, .button-secondary {
      display: inline-block;
      padding: 12px 16px;
      border-radius: 12px;
      font-size: 0.9rem;
      font-weight: 850;
      text-decoration: none;
      transition: transform 180ms ease, box-shadow 180ms ease;
      border: none;
    }
    .button-primary { color: white; border: 1px solid var(--pink-500); background: linear-gradient(135deg, var(--pink-500), #ef8bb0); box-shadow: 0 9px 18px rgba(234, 112, 157, 0.24); }
    .button-secondary { color: var(--sky-700); border: 1px solid var(--sky-200); background: var(--sky-100); }
    .button-primary:hover, .button-secondary:hover { transform: translateY(-2px); }
    .home-section { margin-top: 30px; }
    .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
    .section-heading h2 { margin: 0; letter-spacing: -0.03em; font-size: 1.35rem; }
    .section-heading p { margin: 0; color: var(--muted); font-size: 0.9rem; }
    .subject-grid, .featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }

    .home-subject-card { min-height: 123px; padding: 17px; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.82); text-align: left; box-shadow: 0 8px 20px rgba(37, 103, 135, 0.05); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; display: block; }
    .home-subject-card:hover { transform: translateY(-3px); border-color: var(--pink-200); box-shadow: 0 12px 25px rgba(37, 103, 135, 0.1); }
    .home-subject-card span { display: block; color: var(--pink-700); font-size: 0.78rem; font-weight: 850; }
    .home-subject-card strong { display: block; margin-top: 8px; font-size: 1rem; }
    .home-subject-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 0.78rem; }

    .featured-card { padding: 12px; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.84); text-align: left; box-shadow: 0 8px 20px rgba(37, 103, 135, 0.05); transition: transform 180ms ease, border-color 180ms ease; display: block; }
    .featured-card:hover { transform: translateY(-3px); border-color: var(--sky-300); }
    .featured-thumb {
      position: relative;
      width: 100%;
      height: 128px;
      margin-bottom: 12px;
      overflow: hidden;
      border-radius: 12px;
    }
    .featured-thumb img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    /* Decorative shapes when no thumbnail present */
    .featured-thumb:not(:has(img))::before,
    .featured-thumb:not(:has(img))::after { position: absolute; content: ""; }
    .featured-thumb:not(:has(img))::before { width: 52px; height: 52px; top: 28px; left: 50%; transform: translateX(-50%); border: 5px solid rgba(255,255,255,0.7); border-radius: 50%; }
    .featured-thumb:not(:has(img))::after { width: 22px; height: 22px; right: 18px; bottom: 16px; border-radius: 7px; background: rgba(255,255,255,0.8); }
    .featured-card strong { display: block; font-size: 0.95rem; }
    .featured-card .featured-label { display: block; margin-top: 4px; color: var(--muted); font-size: 0.78rem; }

    /* About */
    .about-hero {
      position: relative; overflow: hidden; padding: clamp(28px, 5vw, 58px);
      border: 1px solid rgba(220, 236, 243, 0.95); border-radius: var(--radius-xl);
      background: radial-gradient(circle at 88% 17%, rgba(175, 229, 255, 0.8), transparent 15rem),
        radial-gradient(circle at 12% 100%, rgba(255, 187, 211, 0.68), transparent 18rem),
        rgba(255, 255, 255, 0.87);
      box-shadow: var(--shadow);
    }
    .about-hero::after { width: 145px; height: 145px; position: absolute; right: 8%; bottom: -84px; z-index: 0; border: 18px solid rgba(255, 255, 255, 0.48); border-radius: 50%; content: ""; pointer-events: none; }
    .about-hero > * { position: relative; z-index: 1; }
    .about-hero h1 { max-width: 720px; margin: 0; letter-spacing: -0.055em; font-size: clamp(2.35rem, 5.8vw, 4.35rem); line-height: 0.98; }
    .about-hero > p:not(.eyebrow) { max-width: 650px; margin: 19px 0 0; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.12rem); line-height: 1.68; }
    .about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
    .about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
    .about-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.84); box-shadow: 0 8px 20px rgba(37, 103, 135, 0.05); }
    .about-card h2 { margin: 0 0 10px; letter-spacing: -0.02em; font-size: 1.1rem; }
    .about-card p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.68; }
    .about-principles { display: grid; gap: 12px; margin: 17px 0 0; padding: 0; list-style: none; }
    .about-principles li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 10px; color: var(--muted); font-size: 0.91rem; line-height: 1.55; }
    .about-principles b { width: 26px; height: 26px; display: grid; place-items: center; color: var(--pink-700); border-radius: 9px; background: var(--pink-100); font-size: 0.83rem; }
    .about-note { margin-top: 14px; background: linear-gradient(135deg, rgba(234, 248, 255, 0.86), rgba(255, 248, 251, 0.94)); }

    /* Text pages */
    .text-page { width: min(850px, 100%); margin: 0 auto; }
    .text-page-hero {
      position: relative;
      overflow: hidden;
      padding: clamp(27px, 4vw, 48px);
      border: 1px solid rgba(220, 236, 243, 0.95);
      border-radius: var(--radius-xl);
      background: radial-gradient(circle at 86% 12%, rgba(175, 229, 255, 0.74), transparent 14rem),
        radial-gradient(circle at 10% 100%, rgba(255, 187, 211, 0.58), transparent 17rem),
        rgba(255, 255, 255, 0.88);
      box-shadow: var(--shadow);
    }
    .text-page-hero h1 {
      max-width: 680px;
      margin: 0;
      letter-spacing: -0.05em;
      font-size: clamp(2.25rem, 5.4vw, 4rem);
      line-height: 1;
    }
    .text-page-hero p:not(.eyebrow) {
      max-width: 690px;
      margin: 16px 0 0;
      color: var(--muted);
      font-size: clamp(1rem, 1.6vw, 1.08rem);
      line-height: 1.66;
    }
    .text-page-hero .page-updated {
      margin-top: 15px;
      color: var(--pink-700);
      font-size: 0.86rem;
      font-weight: 850;
    }
    .text-page-body { display: grid; gap: 13px; margin-top: 20px; }
    .text-section,
    .contact-card {
      padding: clamp(20px, 3vw, 26px);
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      background: rgba(255, 255, 255, 0.84);
      box-shadow: 0 8px 20px rgba(37, 103, 135, 0.05);
    }
    .text-section h2 {
      margin: 0 0 10px;
      letter-spacing: -0.02em;
      font-size: 1.07rem;
    }
    .text-section p,
    .text-section li,
    .contact-card p {
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1.68;
    }
    .text-section p,
    .contact-card p { margin: 0; }
    .text-section p + p,
    .contact-card p + p { margin-top: 12px; }
    .text-section ul {
      display: grid;
      gap: 8px;
      margin: 12px 0 0;
      padding-left: 20px;
    }
    .contact-page { min-height: min(720px, 68vh); }
    .contact-card { margin-top: 20px; }
    .contact-form {
      display: grid;
      gap: 14px;
      margin: 20px 0 18px;
    }
    .contact-form label {
      display: grid;
      gap: 7px;
    }
    .contact-form label span {
      color: var(--pink-700);
      letter-spacing: 0.08em;
      font-size: 0.73rem;
      font-weight: 900;
      text-transform: uppercase;
    }
    .contact-form input,
    .contact-form textarea {
      width: 100%;
      padding: 12px 13px;
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 12px;
      outline: none;
      background: rgba(255, 255, 255, 0.92);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
      transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    }
    .contact-form textarea {
      min-height: 150px;
      resize: vertical;
    }
    .contact-form input:focus,
    .contact-form textarea:focus {
      border-color: var(--sky-500);
      background: var(--white);
      box-shadow: 0 0 0 4px rgba(85, 185, 223, 0.14);
    }
    .contact-submit {
      width: fit-content;
      margin-top: 2px;
    }

    /* Game view */
    .breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 0.82rem; font-weight: 750; }
    .breadcrumb a { color: var(--muted); text-decoration: none; transition: color 180ms ease; }
    .breadcrumb a:hover { color: var(--pink-700); }
    .breadcrumb span:last-child { color: var(--pink-700); }
    .game-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
    .game-header h1 { margin: 0; letter-spacing: -0.05em; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1; }
    .game-header p { max-width: 700px; margin: 11px 0 0; color: var(--muted); line-height: 1.62; }
    .game-tag { flex: 0 0 auto; padding: 8px 11px; color: var(--sky-700); border: 1px solid var(--sky-200); border-radius: 999px; background: var(--sky-100); font-size: 0.77rem; font-weight: 850; }
    .game-embed { width: 100%; overflow: hidden; border-radius: var(--radius-xl); background: transparent; container-type: inline-size; }
    .game-frame { width: 100%; height: 657px; display: block; overflow: hidden; border: 0; background: transparent; }
    body.game-fullscreen-active {
      overflow: hidden;
      overscroll-behavior: none;
      background: #000;
    }
    body.game-fullscreen-active .game-embed {
      position: fixed;
      inset: 0;
      z-index: 1000;
      width: 100vw;
      height: auto;
      min-height: var(--curio-viewport-height);
      min-height: 100vh;
      min-height: 100dvh;
      overflow: hidden;
      border-radius: 0;
      background: #000;
      container-type: normal;
      touch-action: none;
    }
    body.game-fullscreen-active .game-frame {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100% !important;
      background: #000;
    }
    .game-fullscreen-exit {
      display: none;
      width: 42px;
      height: 42px;
      position: fixed;
      top: calc(10px + env(safe-area-inset-top, 0px));
      right: calc(10px + env(safe-area-inset-right, 0px));
      z-index: 1001;
      place-items: center;
      color: #eaf8ff;
      border: 1px solid rgba(234, 248, 255, 0.36);
      border-radius: 10px;
      background: rgba(0, 0, 0, 0.72);
      font-size: 1rem;
      font-weight: 900;
      line-height: 1;
    }
    body.game-fullscreen-active .game-fullscreen-exit {
      display: grid;
    }
    .game-fullscreen-exit[hidden] {
      display: none !important;
    }
    .game-details { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: 22px; margin-top: 24px; }
    .detail-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.83); box-shadow: 0 8px 20px rgba(37, 103, 135, 0.05); }
    .detail-card h2 { margin: 0 0 10px; font-size: 1.03rem; }
    .detail-card p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.65; }
    .related-grid { display: grid; gap: 10px; }
    .related-card { width: 100%; min-height: 65px; display: grid; grid-template-columns: 65px minmax(0, 1fr) 22px; align-items: center; gap: 10px; padding: 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--white); text-align: left; transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
    .related-card:hover { transform: translateX(3px); border-color: var(--pink-200); background: var(--pink-50); }
    .related-thumb { width: 65px !important; height: 47px !important; border-radius: 8px; }
    .related-copy { min-width: 0; }
    .related-copy strong, .related-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .related-copy strong { font-size: 0.83rem; }
    .related-copy span { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
    .related-arrow { height: 100%; display: grid; place-items: center; align-self: stretch; color: var(--pink-700); font-size: 1.35rem; font-weight: 700; line-height: 1; }
    .related-empty { padding: 18px 4px 8px; }
    .related-empty p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.65; }

    .sidebar-overlay { display: none; }

    @media (max-width: 1100px), (hover: none) and (pointer: coarse) {
      .app-shell, .app-shell.sidebar-closed { display: block; }
      .sidebar {
        width: min(345px, 88vw);
        position: fixed;
        top: var(--topbar-height);
        bottom: 0;
        left: 0;
        height: auto;
        box-shadow: 20px 0 42px rgba(24, 51, 69, 0.17);
      }
      .sidebar-overlay {
        position: fixed;
        top: var(--topbar-height);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        background: rgba(24, 51, 69, 0.3);
      }
      .app-shell:not(.sidebar-closed) + .sidebar-overlay { display: block; }
      .subject-grid, .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .game-details { grid-template-columns: 1fr; }
    }

    @media (max-width: 600px) {
      :root { --topbar-height: 68px; }
      .topbar { height: var(--topbar-height); min-height: var(--topbar-height); gap: 8px; padding: 8px 10px; }
      .nav-toggle { width: 42px; height: 42px; border-radius: 12px; }
      .nav-toggle-lines { width: 20px; }
      .nav-toggle-line { width: 20px; }
      .brand { min-width: 0; flex: 1 1 0; gap: 8px; overflow: hidden; }
      .brand-mark { width: 44px; height: 44px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78); font-size: 2.1rem; }
      .brand-copy { min-width: 0; overflow: hidden; }
      .brand-copy strong { display: block; overflow: hidden; font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }
      .brand-copy span { display: none; }
      .topbar-links { flex: 0 0 auto; gap: 2px; margin-left: 0; }
      .topbar-links a, .topbar-links a:not(.is-current) { display: inline-block; padding: 8px 7px; font-size: 0.76rem; line-height: 1.1; white-space: nowrap; }
      .content { padding: 20px 15px 34px; }
      .site-footer {
        margin-top: 28px;
        padding: 12px 0 calc(22px + env(safe-area-inset-bottom, 0px));
      }
      .footer-links { gap: 4px; font-size: 0.8rem; }
      .footer-links a { padding: 7px 6px; }
      .home-hero { padding: 29px 24px; }
      .subject-grid, .featured-grid { grid-template-columns: 1fr; }
      .game-header { display: block; }
      .game-tag { display: inline-block; margin-top: 14px; }
      .text-page-hero { padding: 29px 24px; }
      .text-section, .contact-card { padding: 20px; }
    }

    @media (max-width: 360px) {
      .topbar { gap: 6px; padding: 7px 8px; }
      .nav-toggle { width: 40px; height: 40px; }
      .brand { gap: 6px; }
      .brand-mark { width: 40px; height: 40px; font-size: 1.9rem; }
      .brand-copy strong { font-size: 0.74rem; }
      .topbar-links a, .topbar-links a:not(.is-current) { padding: 7px 5px; font-size: 0.72rem; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
    }

    @media (max-width: 1100px), (hover: none) and (pointer: coarse) {
      html, body {
        overscroll-behavior-y: auto;
      }
      .topbar {
        position: fixed;
        top: -1px;
        right: 0;
        left: 0;
        width: 100%;
        height: calc(var(--topbar-height) + 1px);
        min-height: calc(var(--topbar-height) + 1px);
        z-index: 60;
        background: #fff;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
      }
      .topbar::before {
        width: 100%;
        height: calc(140px + env(safe-area-inset-top, 0px));
        position: absolute;
        right: 0;
        bottom: calc(100% - 1px);
        left: 0;
        background: #fff;
        content: "";
        pointer-events: none;
      }
      body {
        padding-top: var(--topbar-height);
      }
      body.game-fullscreen-active {
        padding-top: 0;
      }
      .app-shell, .app-shell.sidebar-closed { min-height: calc(100vh - var(--topbar-height)); min-height: calc(100dvh - var(--topbar-height)); }
      .sidebar {
        position: fixed;
        top: var(--topbar-height);
        bottom: 0;
        height: calc(100vh - var(--topbar-height));
        height: calc(100dvh - var(--topbar-height));
        z-index: 55;
        overscroll-behavior: auto;
        overscroll-behavior-y: auto;
        -webkit-overflow-scrolling: touch;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
      }
      .sidebar-overlay { top: var(--topbar-height); z-index: 50; }
    }
