@font-face { font-family: "Baloo2"; src: url("fonts/Baloo2.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }

:root {
  --night: #2A2480; --ink: #1B1464; --cream: #FFF8E7; --mist: #F1F3F7;
  --sun: #FFC93C; --sky: #4CC3FF; --mint: #2ED3A0; --coral: #FF6B5B;
  --slate-2: #4A5068;
  --display: "Baloo2", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); line-height: 1.5; }
h1, h2 { font-family: var(--display); margin: 0; line-height: 1.05; }
p { margin: 0; }
:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; }

/* Gugu family bar v1 — source of truth: gugu-home/family-bar/. Copy verbatim. */
.gugu-bar {
  flex: none; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 24px; padding: 0 20px; background: #2A2480; color: #E9E7FF;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.gugu-bar--deep { background: #1B1464; }
.gugu-bar .gugu-bar__home { display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.gugu-bar .gugu-bar__home:hover { color: #FFC93C; text-decoration: none; }
.gugu-bar .gugu-bar__home:focus-visible { outline: 2px solid #FFC93C; outline-offset: 2px; border-radius: 4px; }
.gugu-bar svg { flex: none; }
.gugu-bar__note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .gugu-bar__note { display: none; } }
@media print { .gugu-bar { display: none; } }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.top { background: var(--night); color: #fff; padding: 16px 0 24px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 36px; }
.lang { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--ink); }
.pill { border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px; font: 700 15px var(--body); cursor: pointer; background: transparent; color: #fff; }
.pill[aria-pressed="true"] { background: var(--sun); color: var(--ink); }

main.wrap { padding-top: 28px; padding-bottom: 56px; }
.tagline { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat { display: flex; align-items: center; gap: 10px; background: #fff; border: 4px solid var(--ink); border-radius: 20px; padding: 8px 18px; font-weight: 700; font-size: 20px; }
.stat strong { font-family: var(--display); font-size: 34px; }
.done-title { font-size: 44px; font-weight: 800; margin-bottom: 8px; }
.summary { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }

.big, .choice {
  display: inline-flex; align-items: center; justify-content: center;
  border: 4px solid var(--ink); border-radius: 28px; background: var(--sun); color: var(--ink);
  font-family: var(--display); font-weight: 800; box-shadow: 0 6px 0 var(--ink); cursor: pointer;
}
.big { min-height: 72px; min-width: 200px; padding: 0 32px; font-size: 30px; }
.big.alt { background: #fff; }
.big:active, .choice:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }

.progress { font-weight: 700; font-size: 18px; color: var(--slate-2); }
.question { font-size: 56px; font-weight: 800; margin: 4px 0 12px; }
.frame { max-width: 340px; margin-bottom: 12px; }
.tenframe { display: block; width: 100%; height: auto; }
.feedback { min-height: 36px; font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.choice { min-height: 84px; font-size: 44px; }
.choice.hit { background: var(--mint); }
.choice.miss, .choice:disabled.miss { background: var(--mist); color: var(--slate-2); border-style: dashed; box-shadow: none; cursor: default; }

/* Small phones, portrait: everything must fit without scrolling, so the four answers go in one row. */
@media (max-width: 560px) {
  .top { padding: 8px 0 10px; }
  .brand { font-size: 28px; }
  main.wrap { padding-top: 12px; padding-bottom: 24px; }
  .progress { font-size: 16px; }
  .question { font-size: 40px; margin: 0 0 6px; }
  .frame { margin-bottom: 6px; }
  .tenframe { width: auto; max-width: 100%; max-height: 28vh; }
  .feedback { min-height: 28px; font-size: 20px; margin: 6px 0; }
  .choices { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .choice { min-height: 68px; padding: 0; font-size: 34px; border-radius: 20px; }
}

/* Short wide screens (phones on their side): picture on the left, answers on the right. */
@media (orientation: landscape) and (max-height: 520px) {
  .top { padding: 6px 0 8px; }
  .brand { font-size: 26px; }
  main.wrap { padding-top: 8px; padding-bottom: 12px; }
  [data-screen="play"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  [data-screen="play"] > * { grid-column: 1; }
  [data-screen="play"] > .choices { grid-column: 2; grid-row: 1 / span 4; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .progress { font-size: 16px; }
  .question { font-size: 36px; margin: 0 0 4px; }
  .frame { margin-bottom: 4px; }
  .tenframe { width: auto; max-width: 100%; max-height: 40vh; }
  .feedback { min-height: 26px; font-size: 18px; margin: 4px 0 0; }
  .choice { min-height: 76px; font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { .big:active, .choice:active { transform: none; } }

/* Tablets and laptops held sideways (wide but not tall): the question, the pictures and
   the buttons on the left, the four answers on the right, so nothing needs scrolling. */
@media (min-width: 900px) and (max-height: 900px) {
  [data-screen="play"] { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 32px; align-items: start; }
  [data-screen="play"] > * { grid-column: 1; }
  [data-screen="play"] > .choices { grid-column: 2; grid-row: 1 / span 6; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
  .question { font-size: 48px; }
}
