:root {
      --page-bg: #fff8fc;
      --surface: rgba(255, 255, 255, 0.92);
      --surface-strong: #ffffff;
      --ink: #2b2331;
      --muted: #64576d;
      --soft-border: rgba(87, 66, 102, 0.13);
      --primary: #6f3fd4;
      --primary-dark: #5630ad;
      --pink: #ff7bc0;
      --orange: #f59e0b;
      --orange-dark: #b45309;
      --blue: #2563eb;
      --green: #16a34a;
      --red: #dc2626;
      --shadow: 0 18px 48px rgba(46, 30, 66, 0.10);
      --shadow-strong: 0 24px 70px rgba(46, 30, 66, 0.16);
      --radius-xl: 28px;
      --radius-lg: 22px;
      --radius-md: 16px;
    }

    * { box-sizing: border-box; }

    html {
      scroll-behavior: smooth;
      -webkit-text-size-adjust: 100%;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Arial, Helvetica, sans-serif;
      color: var(--ink);
      background:
        radial-gradient(circle at top left, rgba(255, 226, 240, 0.95), transparent 32%),
        radial-gradient(circle at bottom right, rgba(221, 237, 255, 0.95), transparent 34%),
        var(--page-bg);
    }

    a { color: inherit; }

    .site-header {
      position: sticky;
      top: 0;
      z-index: 20;
      background: rgba(255, 248, 252, 0.84);
      border-bottom: 1px solid var(--soft-border);
      backdrop-filter: blur(18px);
    }

    .topbar,
    .page-shell {
      width: min(1120px, calc(100% - 36px));
      margin: 0 auto;
    }

    .topbar {
      min-height: 72px;
      padding: 12px 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
    }

    .brand,
    .nav-link,
    .back-link {
      text-decoration: none;
      font-weight: 900;
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      white-space: nowrap;
    }

    .logo {
      width: 42px;
      height: 42px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, var(--primary), var(--pink));
      color: #ffffff;
      box-shadow: 0 12px 26px rgba(123, 69, 223, 0.22);
    }

    .topbar-links {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .nav-link {
      font-size: 0.9rem;
      padding: 9px 11px;
      border-radius: 999px;
      color: #44354d;
    }

    .nav-link:hover,
    .nav-link:focus-visible,
    .nav-link.active-link {
      background: rgba(255, 255, 255, 0.88);
      outline: none;
    }

    .page-shell {
      padding: clamp(26px, 5vw, 52px) 0 42px;
    }

    .hero {
      margin-bottom: 16px;
    }

    .hero-copy {
      background: var(--surface);
      border: 1px solid var(--soft-border);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow);
      padding: clamp(18px, 3vw, 26px);
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
    }

    .hero-text {
      min-width: 0;
    }

    .hero-copy::before {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: 8px;
      background: linear-gradient(90deg, var(--primary), var(--pink), var(--orange));
    }

    .eyebrow {
      margin: 0 0 12px;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 0.11em;
      font-size: 0.78rem;
      font-weight: 900;
    }

    h1 {
      max-width: 760px;
      margin: 0;
      font-size: clamp(2rem, 4.5vw, 3.55rem);
      line-height: 1;
      letter-spacing: -0.06em;
    }

    .lead {
      max-width: 680px;
      margin: 10px 0 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: clamp(0.98rem, 1.8vw, 1.08rem);
    }

    .hero-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 0;
    }

    .back-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 42px;
      padding: 10px 14px;
      border-radius: 999px;
      background: #ffffff;
      border: 1px solid var(--soft-border);
      color: #44354d;
    }

    .teacher-note {
      padding: 20px;
      display: grid;
      align-content: center;
      gap: 12px;
    }

    .mini-stat {
      padding: 16px;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.74);
      border: 1px solid rgba(87, 66, 102, 0.10);
    }

    .mini-stat strong {
      display: block;
      font-size: 1.42rem;
      letter-spacing: -0.04em;
    }

    .mini-stat span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-weight: 800;
      line-height: 1.35;
    }

    .game-card {
      background: var(--surface);
      border: 1px solid var(--soft-border);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-strong);
      padding: clamp(18px, 4vw, 34px);
      overflow: hidden;
      position: relative;
    }

    .game-card::before {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: 8px;
      background: linear-gradient(90deg, var(--orange), #fb7185, #38bdf8, #22c55e);
    }

    .top-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin: 2px 0 22px;
      flex-wrap: wrap;
    }

    .pill {
      border-radius: 999px;
      padding: 10px 15px;
      background: #fff7ed;
      color: var(--orange-dark);
      border: 1px solid rgba(245, 158, 11, 0.22);
      font-weight: 900;
    }

    .score {
      background: #eef2ff;
      color: var(--primary-dark);
      border-color: rgba(111, 63, 212, 0.18);
    }

    .main-grid {
      display: grid;
      grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
      gap: clamp(18px, 4vw, 36px);
      align-items: stretch;
    }

    .clock-wrap {
      display: grid;
      place-items: center;
      align-content: center;
      background: linear-gradient(180deg, #fff7ed, #ffffff);
      border-radius: var(--radius-lg);
      padding: clamp(18px, 4vw, 26px);
      border: 2px dashed rgba(245, 158, 11, 0.35);
      min-height: 100%;
    }

    .clock {
      --clock-size: clamp(190px, 26vw, 238px);
      --number-radius: calc(var(--clock-size) * 0.40);
      width: var(--clock-size);
      height: var(--clock-size);
      border-radius: 50%;
      background: #ffffff;
      border: clamp(7px, 1.2vw, 10px) solid var(--orange);
      position: relative;
      box-shadow: inset 0 0 0 6px #fffbeb, 0 14px 30px rgba(146, 64, 14, 0.14);
    }

    .center-dot {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #111827;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 5;
    }

    .hand {
      position: absolute;
      left: 50%;
      bottom: 50%;
      transform-origin: bottom center;
      border-radius: 999px;
    }

    .hour-hand {
      width: 10px;
      height: calc(var(--clock-size) * 0.28);
      background: #111827;
      margin-left: -5px;
      z-index: 3;
    }

    .minute-hand {
      width: 6px;
      height: calc(var(--clock-size) * 0.38);
      background: var(--blue);
      margin-left: -3px;
      z-index: 4;
    }

    .number {
      position: absolute;
      left: 50%;
      top: 50%;
      font-weight: 900;
      color: #374151;
      font-size: clamp(0.88rem, 2vw, 1rem);
      transform: translate(-50%, -50%);
    }

    .digital-time {
      margin-top: 18px;
      padding: 8px 14px;
      border-radius: 999px;
      background: #ffffff;
      border: 1px solid rgba(245, 158, 11, 0.22);
      font-weight: 900;
      font-size: clamp(1.35rem, 4vw, 2rem);
      color: var(--orange-dark);
      letter-spacing: 0.04em;
    }

    .question-area {
      background: #ffffff;
      border: 1px solid rgba(87, 66, 102, 0.10);
      border-radius: var(--radius-lg);
      padding: clamp(18px, 3.4vw, 28px);
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .question-area h2 {
      margin: 0 0 8px;
      font-size: clamp(1.75rem, 4vw, 2.7rem);
      letter-spacing: -0.05em;
    }

    .instruction {
      margin: 0 0 16px;
      color: var(--muted);
      font-size: 1.02rem;
      line-height: 1.5;
    }

    .answers {
      display: grid;
      gap: 11px;
    }

    .answer-btn {
      border: 1px solid rgba(87, 66, 102, 0.12);
      background: #fff8fc;
      color: #2b2331;
      border-radius: 18px;
      padding: 15px 16px;
      font-size: 1.04rem;
      line-height: 1.35;
      font-weight: 900;
      text-align: left;
      cursor: pointer;
      transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

    .answer-btn:hover:not(:disabled),
    .answer-btn:focus-visible:not(:disabled) {
      transform: translateY(-2px);
      border-color: rgba(111, 63, 212, 0.35);
      box-shadow: 0 12px 24px rgba(111, 63, 212, 0.12);
      background: #ffffff;
      outline: none;
    }

    .answer-btn:disabled {
      cursor: not-allowed;
      opacity: 0.9;
    }

    .answer-btn.correct {
      border-color: var(--green);
      background: #dcfce7;
      color: #14532d;
    }

    .answer-btn.wrong {
      border-color: var(--red);
      background: #fee2e2;
      color: #7f1d1d;
    }

    .feedback {
      min-height: 38px;
      margin: 16px 0 0;
      font-size: 1.08rem;
      line-height: 1.45;
      font-weight: 900;
    }

    .feedback.good { color: var(--green); }
    .feedback.bad { color: var(--red); }

    .actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 18px;
    }

    .primary-btn,
    .secondary-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 46px;
      border: 0;
      border-radius: 16px;
      padding: 12px 17px;
      font-weight: 900;
      font-size: 1rem;
      cursor: pointer;
      transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

    .primary-btn {
      background: var(--primary);
      color: #ffffff;
      box-shadow: 0 14px 28px rgba(111, 63, 212, 0.20);
    }

    .secondary-btn {
      background: rgba(255, 255, 255, 0.9);
      border: 1px solid var(--soft-border);
      color: #44354d;
    }

    .primary-btn:hover,
    .secondary-btn:hover,
    .primary-btn:focus-visible,
    .secondary-btn:focus-visible {
      transform: translateY(-2px);
      outline: none;
    }

    .primary-btn[hidden] { display: none; }

    .result-screen {
      text-align: center;
      display: none;
      padding: clamp(28px, 6vw, 52px) 12px 18px;
    }

    .result-screen.show { display: block; }
    .quiz-screen.hide { display: none; }

    .result-emoji {
      width: 90px;
      height: 90px;
      margin: 0 auto 14px;
      display: grid;
      place-items: center;
      border-radius: 28px;
      background: linear-gradient(135deg, #fff7ed, #eef2ff);
      font-size: 3.4rem;
      box-shadow: 0 18px 38px rgba(46, 30, 66, 0.10);
    }

    .result-title {
      font-size: clamp(2rem, 5vw, 3.6rem);
      margin: 0 0 10px;
      letter-spacing: -0.05em;
    }

    .result-text {
      color: var(--muted);
      font-size: 1.16rem;
      line-height: 1.55;
      margin: 0 auto 22px;
      max-width: 560px;
    }

    footer {
      padding: 24px 18px 34px;
      text-align: center;
      color: var(--muted);
      font-weight: 800;
    }

    @media (max-width: 820px) {
      .topbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .hero-copy,
      .main-grid {
        grid-template-columns: 1fr;
      }

      .hero-copy {
        align-items: flex-start;
        flex-direction: column;
      }
    }

    @media (max-width: 560px) {
      .topbar,
      .page-shell {
        width: min(100% - 24px, 1120px);
      }

      .brand-text {
        white-space: normal;
      }

      .topbar-links {
        width: 100%;
        justify-content: flex-start;
      }

      .nav-link {
        font-size: 0.84rem;
        padding: 8px 10px;
      }

      .game-card {
        padding: 16px;
        border-radius: 24px;
      }

      .clock-wrap,
      .question-area {
        border-radius: 20px;
      }

      .answer-btn {
        padding: 14px;
        font-size: 0.98rem;
      }

      .actions,
      .primary-btn,
      .secondary-btn {
        width: 100%;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        transition: none !important;
      }
    }

    /* Mobile: do not keep the exercise header sticky. */
    @media (max-width: 760px) {
      .site-header {
        position: static;
      }
    }


.footer-link {
  font-weight: 900;
  color: #4c279a;
  text-decoration: none;
  border-bottom: 1px solid rgba(76, 39, 154, 0.35);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #7b45df;
  outline: none;
}
