:root {
      --bg: #050816;
      --panel: rgba(255,255,255,.08);
      --panel-border: rgba(255,255,255,.14);
      --text: #ffffff;
      --muted: rgba(255,255,255,.72);
      --yellow: #ffd166;
      --blue: #38bdf8;
      --pink: #fb7185;
      --green: #22c55e;
      --purple: #a78bfa;
      --wall: #2563eb;
      --wall-glow: rgba(37, 99, 235, .55);
      --dark: #0f172a;
      --shadow: 0 18px 45px rgba(0,0,0,.32);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background:
        radial-gradient(circle at top, rgba(37,99,235,.22), transparent 35%),
        radial-gradient(circle at bottom right, rgba(251,113,133,.15), transparent 28%),
        var(--bg);
      color: var(--text);
    }

    a { color: inherit; text-decoration: none; }

    .eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: rgba(255, 255, 255, .13);
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 999px;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 850;
        color: rgba(255, 255, 255, .9);
        margin-bottom: 16px;
    }

    .site-header {
      position: sticky;
      top: 0;
      z-index: 50;
      background: rgba(6, 53, 31, .94);
      backdrop-filter: blur(14px);
      border-bottom: 1px solid rgba(255,255,255,.12);
    }

    .nav {
      width: min(1180px, calc(100% - 32px));
      min-height: 70px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #fff;
      font-weight: 700;
      letter-spacing: -0.035em;
      font-size: 21px;
    }

    .logo-icon {
      width: 42px;
      height: 42px;
      border-radius: 14px;
      background: linear-gradient(135deg, #ffffff, #dbeafe);
      display: grid;
      place-items: center;
      color: #0f172a;
      font-size: 24px;
      box-shadow: 0 10px 20px rgba(0,0,0,.18);
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .nav-links a {
      color: rgba(255,255,255,.86);
      font-size: 14px;
      font-weight: 800;
      padding: 10px 12px;
      border-radius: 999px;
    }

    .nav-links a:hover,
    .nav-links a.active {
      background: rgba(255,255,255,.13);
      color: #fff;
    }

    .hero {
      background:
        radial-gradient(circle at 18% 18%, rgba(255,209,102,.22), transparent 32%),
        radial-gradient(circle at 82% 12%, rgba(45,212,191,.18), transparent 28%),
        linear-gradient(145deg, var(--bg-dark), var(--bg));
      color: #fff;
      padding: 48px 0 28px;
    }

    .hero h1 {
      margin: 0;
      max-width: 900px;
      font-size: clamp(2em, 5.5vw, 3em);
      line-height: .96;
      letter-spacing: 0;
      font-weight: 700;
    }

    .hero p {
      margin: 18px 0 0;
      max-width: 90%;
      color: rgba(255,255,255,.82);
      font-size: clamp(17px, 2vw, 21px);
      line-height: 1.55;
    }

    .hero-wrap {
      width: min(1180px, calc(100% - 32px));
      margin: 0 auto;
    }

    .app {
      width: min(1218px, 100%);
      margin: 0 auto;
      padding: 18px;
    }

    .brand h1 {
      margin: 0 0 5px;
      font-size: clamp(28px, 4vw, 48px);
      letter-spacing: -0.055em;
    }

    .brand p {
      margin: 0;
      color: var(--muted);
      font-size: 15px;
    }

    .controls {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 15px;
    }

    button,
    select {
      border: 0;
      border-radius: 999px;
      padding: 11px 15px;
      font-size: 14px;
      font-weight: 850;
      cursor: pointer;
    }

    button {
      background: var(--yellow);
      color: #111827;
      box-shadow: 0 10px 22px rgba(0,0,0,.22);
    }

    button.secondary {
      background: rgba(255,255,255,.12);
      color: #fff;
      border: 1px solid rgba(255,255,255,.18);
    }

    select {
      background: rgba(255,255,255,.95);
      color: #111827;
      min-width: 170px;
    }

    .game-shell {
      display: grid;
      grid-template-columns: 260px 1fr;
      gap: 18px;
      align-items: start;
    }

    .side-panel,
    .board-panel {
      background: var(--panel);
      border: 1px solid var(--panel-border);
      border-radius: 24px;
      box-shadow: var(--shadow);
    }

    .side-panel { padding: 16px; }
    .board-panel { padding: 16px; overflow: auto; }

    .stats {
      display: grid;
      gap: 10px;
      margin-bottom: 16px;
    }

    .stat {
      background: rgba(0,0,0,.22);
      border: 1px solid rgba(255,255,255,.12);
      border-radius: 18px;
      padding: 13px 14px;
    }

    .stat small {
      display: block;
      color: var(--muted);
      margin-bottom: 3px;
      font-size: 12px;
    }

    .stat strong {
      display: block;
      font-size: 25px;
      line-height: 1.1;
    }

    .instructions {
      color: var(--muted);
      line-height: 1.55;
      font-size: 14px;
      margin: 0 0 14px;
    }

    .keys {
      display: grid;
      grid-template-columns: repeat(3, 38px);
      justify-content: center;
      gap: 6px;
      margin-top: 14px;
    }

    .key {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.14);
      color: #fff;
      font-weight: 900;
    }

    .key.empty { opacity: 0; }

    .status {
      margin: 0 0 14px;
      padding: 13px 15px;
      background: rgba(0,0,0,.22);
      border: 1px solid rgba(255,255,255,.13);
      border-radius: 18px;
      color: var(--muted);
      font-weight: 750;
    }

    canvas {
      display: block;
      width: min(100%, 760px);
      max-width: 100%;
      height: auto;
      margin: 0 auto;
      background: #050816;
      border-radius: 20px;
      border: 1px solid rgba(255,255,255,.15);
      box-shadow: inset 0 0 0 2px rgba(37,99,235,.18), 0 18px 40px rgba(0,0,0,.28);
    }

    .mobile-controls {
      display: none;
      grid-template-columns: repeat(3, 58px);
      justify-content: center;
      gap: 8px;
      margin-top: 14px;
    }

    .mobile-controls button {
      width: 58px;
      height: 58px;
      border-radius: 17px;
      padding: 0;
      font-size: 22px;
      background: rgba(255,255,255,.13);
      color: #fff;
      border: 1px solid rgba(255,255,255,.16);
    }

    .mobile-controls .empty { visibility: hidden; }

    .seo-content {
      margin-top: 30px;
      background: #f8fafc;
      color: #111827;
      border-radius: 28px;
      padding: clamp(22px, 4vw, 44px);
      box-shadow: 0 18px 45px rgba(0,0,0,.18);
    }

    .content-wrap { max-width: 980px; margin: 0 auto; }
    .seo-content article { line-height: 1.75; font-size: 17px; }

    .seo-content h2 {
      margin: 34px 0 12px;
      font-size: clamp(24px, 3vw, 34px);
      letter-spacing: -0.035em;
      color: #0f172a;
    }

    .seo-content h2:first-child { margin-top: 0; }
    .seo-content h3 { margin: 24px 0 8px; font-size: 21px; color: #123c69; }
    .seo-content p { margin: 0 0 14px; color: #334155; }
    .seo-content ul, .seo-content ol { color: #334155; padding-left: 23px; }
    .seo-content li { margin-bottom: 8px; }
    .seo-content strong { color: #0f172a; }

    .content-section,
    .other-games-section {
      background: #f8fafc;
      border-radius: 28px;
      margin-top:30px;
      color:#111827;
      padding:clamp(22px, 4vw, 44px);
      box-shadow: 0 18px 45px rgba(0,0,0,.18);
    }

    .content-wrap,
    .other-games-wrap {
      width: min(980px, calc(100% - 32px));
      margin: 0 auto;
      padding: 58px 0;
    }

    .content-wrap article {
      font-size: 17px;
      line-height: 1.75;
      color: #334155;
    }

    .content-wrap h2,
    .other-games-wrap h2 {
      margin: 36px 0 12px;
      font-size: clamp(26px, 3vw, 38px);
      color: #0f172a;
      letter-spacing: -0.045em;
      line-height: 1.1;
    }

    .content-wrap h2:first-child,
    .other-games-wrap h2:first-child { margin-top: 0; }

    .content-wrap h3 {
      margin: 24px 0 8px;
      font-size: 22px;
      color: #123c69;
      letter-spacing: -0.02em;
    }

    .content-wrap p { margin: 0 0 14px; }
    .content-wrap ul { padding-left: 22px; }
    .content-wrap li { margin-bottom: 8px; }
    .content-wrap strong { color: #0f172a; }

    .other-games-section {
      border-top: 1px solid var(--line);
      padding-bottom: 16px;
    }

    .other-games-intro {
      margin: 0 0 22px;
      color: var(--muted);
      line-height: 1.6;
      font-size: 17px;
      max-width: 780px;
    }

    .games-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
    }

    .game-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 24px;
      box-shadow: 0 12px 28px rgba(15,23,42,.08);
      padding: 20px;
      min-height: 170px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }

    .game-card:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow);
      border-color: #bbf7d0;
    }

    .game-icon {
      width: 58px;
      height: 58px;
      border-radius: 20px;
      background: #e8f7ef;
      display: grid;
      place-items: center;
      font-size: 30px;
      margin-bottom: 14px;
    }

    .game-card h3 {
      margin: 0 0 8px;
      font-size: 22px;
      letter-spacing: -0.035em;
    }

    .game-card p {
      margin: 0;
      color: #475569;
      line-height: 1.55;
      font-size: 15px;
    }

    .game-link {
      margin-top: 18px;
      display: inline-flex;
      color: #0f5132;
      font-weight: 950;
    }

    .site-footer {
      background: #062617;
      color: rgba(255,255,255,.74);
      padding: 28px 0;
    }

    .footer-wrap {
      width: min(1180px, calc(100% - 32px));
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      font-size: 14px;
    }

    .footer-wrap a { color: #fff; font-weight: 850; }

    @media (max-width: 900px) {
      .game-shell { grid-template-columns: 1fr; }
      .stats { grid-template-columns: repeat(4, 1fr); }
    }

    @media (max-width: 680px) {

      .nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
      }

      .nav-links {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
      }

      .app { padding: 12px; }
      .brand h1 { font-size: 32px; }
      .stats { grid-template-columns: repeat(2, 1fr); }
      .mobile-controls { display: grid; }
      .keys { display: none; }

      .games-grid { grid-template-columns: 1fr; }

    }