/* css/game.css — the playable student side (js/game/app.mjs). Prefix g-. Needs css/tokens.css + css/pals.css.
   Phone frame ≥ 900 px, frameless card below. The X-ray panel (.g-x) is the dark "backstage" beside it. */

/* ───────────────────────────────────────────── root + kind themes */
.g-app {
  --k-tint: #F1ECE2; --k-accent: #B8B5AC; --k-ink: #4A4B52; --k-wall: #F4EFE6; --k-rug: #E5DccC; --k-floor: #EBDDC9;
  --g-right: #E4F7EF; --g-right-line: #56BF98; --g-right-ink: #1F7A5A;
  --g-wrong: #FBEDEA; --g-wrong-line: #E7AFA4; --g-wrong-ink: #A4493A;
  --g-late: #E9A23B;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font: 400 15px/1.45 var(--display);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.g-app *, .g-app *::before, .g-app *::after, .g-x *, .g-x *::before, .g-x *::after { box-sizing: border-box; }
.g-app[data-kind='chiikawa'] { --k-tint: #FCE3EA; --k-accent: #F6A9BE; --k-ink: #B8416A; --k-wall: #FCE8EE; --k-rug: #F6B9CA; --k-floor: #F1DCCB; }
.g-app[data-kind='hachiware'] { --k-tint: #DFE6F4; --k-accent: #5E77B0; --k-ink: #3F5A96; --k-wall: #E4EAF6; --k-rug: #AFC0E6; --k-floor: #E6DCCE; }
.g-app[data-kind='usagi'] { --k-tint: #FFF1C4; --k-accent: #F4CF5D; --k-ink: #8C6A12; --k-wall: #FFF3D2; --k-rug: #F7D878; --k-floor: #EEDCC4; }
.g-app button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-app button:focus-visible, .g-x button:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.g-app [tabindex='-1']:focus { outline: none; }
:is(#game, .g-app) :is(h2, h3, h4, p), :is(#xray, .g-x) :is(h3, h4, p) { margin: 0; }
/* the site styles bare h2 (max-width 13ch, optical size 144) — the game's headings opt out */
:is(#game, .g-app, #xray, .g-x) :is(h2, h3, h4) { max-width: none; font-variation-settings: normal; }
.g-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ───────────────────────────────────────────── device */
.g-device { position: relative; width: 100%; min-width: 0; }
.g-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  height: clamp(620px, calc(100svh - 120px), 740px);
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.g-status { display: none; }
@media (min-width: 900px) {
  .g-device {
    width: 398px;
    padding: 11px;
    border-radius: 60px;
    background: #17181D;
    box-shadow: inset 0 0 0 1.5px #34353C, 0 0 0 2.5px #0C0D10, 0 2px 6px rgba(18, 19, 24, .1), 0 40px 80px -36px rgba(18, 19, 24, .5);
  }
  .g-device::before, .g-device::after { content: ''; position: absolute; width: 4px; border-radius: 3px; background: #0C0D10; }
  .g-device::before { left: -4px; top: 150px; height: 62px; box-shadow: 0 80px 0 #0C0D10; }
  .g-device::after { right: -4px; top: 190px; height: 92px; }
  /* the whole phone fits a laptop window under the sticky site header (65 px) — top bar and bottom nav/CTA in view together */
  .g-screen { height: clamp(600px, calc(100svh - 112px), 800px); border-radius: 49px; border: 0; box-shadow: none; }
  .g-status {
    position: relative;
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 4px 30px 0 38px;
    font: 700 14.5px/1 var(--display);
    letter-spacing: -.01em;
    background: var(--card);
  }
  .g-status::after { content: ''; position: absolute; left: 50%; top: 11px; width: 108px; height: 31px; border-radius: 20px; background: #0B0C0F; transform: translateX(-50%); }
  .g-status__dots { display: flex; gap: 3px; align-items: flex-end; }
  .g-status__dots i { display: block; width: 4px; border-radius: 1.5px; background: var(--ink); }
  .g-status__dots i:nth-child(1) { height: 6px; } .g-status__dots i:nth-child(2) { height: 9px; } .g-status__dots i:nth-child(3) { height: 12px; }
}

/* ───────────────────────────────────────────── top bar */
.g-top {
  position: relative;
  z-index: 4;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.g-top__who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.g-top__name { font: 500 13.5px/1.1 var(--display); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-top__name strong { font-weight: 850; color: var(--ink); }
.g-top__right { display: flex; align-items: center; gap: 7px; flex: none; }
.g-avatar { position: relative; display: inline-block; flex: none; overflow: hidden; border-radius: 50%; background: var(--k-tint); }
.g-avatar__cv { display: block; width: 100%; height: 100%; }
.g-avatar--top { width: 38px; height: 38px; box-shadow: inset 0 0 0 1.5px rgba(59, 46, 46, .1); }
.g-avatar[data-kind='chiikawa'] { background: #FCE3EA; }
.g-avatar[data-kind='hachiware'] { background: #DFE6F4; }
.g-avatar[data-kind='usagi'] { background: #FFF1C4; }
.g-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--k-tint);
  color: var(--k-ink);
  font: 600 9.5px/1 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.g-chip[hidden] { display: none; }
.g-chip[data-stage='ready'] { background: #FFF1C4; color: #7A5A06; box-shadow: 0 0 0 0 rgba(244, 207, 93, .7); animation: g-ring 1.6s ease-out infinite; }
.g-coins {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px 0 4px;
  border-radius: 999px;
  background: #FFF6D8;
  box-shadow: inset 0 0 0 1.5px #F0DB98;
  font: 900 16px/1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  min-width: 64px;
}
.g-coins__ico, .g-coins__ico svg { display: block; width: 24px; height: 24px; }
.g-coins.is-bump { animation: g-bump .38s var(--ease-back); }

/* "Animation is paused" note (the site's pause switch is on, so the live canvases sleep) */
.g-paused { position: relative; z-index: 4; flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; background: #FFF1C4; border-bottom: 1px solid #F2D98A; }
.g-paused[hidden] { display: none; }
.g-paused p { flex: 1; min-width: 0; font: 500 13px/1.3 var(--display); color: var(--ink-2); }
.g-paused strong { color: var(--ink); font-weight: 850; }
.g-paused__btn { flex: none; min-height: 34px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--ink); color: #FFFDF8 !important; font: 800 12.5px/1 var(--display) !important; }

/* ───────────────────────────────────────────── views */
.g-views { position: relative; flex: 1; min-height: 0; }
.g-view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.g-view.is-active { display: flex; }
.g-view.is-enter { animation: g-in .3s var(--ease-swift) both; }
.g-pad { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 18px; }
.g-pad--tight { padding-top: 12px; }
:is(#game, .g-app) .g-note { font: italic 400 14.5px/1.4 var(--human); color: var(--ink-2); }
:is(#game, .g-app) .g-kicker { font: 600 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt); }
:is(#game, .g-app) .g-h1 { font: 950 34px/.96 var(--display); letter-spacing: -.04em; }
:is(#game, .g-app) .g-h2 { font: 900 25px/1.02 var(--display); letter-spacing: -.03em; }
:is(#game, .g-app) .g-lede { color: var(--ink-2); font-size: 15px; line-height: 1.45; }

/* bars */
.g-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  background: rgba(255, 253, 248, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
:is(#game, .g-app) .g-bar__title { flex: 1; min-width: 0; font: 850 16.5px/1.15 var(--display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bar__spacer { width: 8px; }
.g-back {
  display: inline-flex; align-items: center; gap: 2px;
  height: 34px; padding: 0 12px 0 6px; border: 0; border-radius: 999px;
  background: var(--paper); font: 700 13.5px/1 var(--display);
  transition: background .18s;
}
.g-back .g-ico, .g-back svg { width: 20px; height: 20px; display: block; }
.g-iconbtn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--paper); transition: background .18s; }
.g-iconbtn .g-ico, .g-iconbtn svg { width: 18px; height: 18px; display: block; }

/* buttons */
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border: 0; border-radius: 999px;
  font: 800 15.5px/1.1 var(--display) !important; letter-spacing: -.01em;
  background: var(--paper); color: var(--ink);
  transition: transform .2s var(--ease-back), background .18s, box-shadow .18s, opacity .18s;
}
.g-btn--primary { background: var(--cobalt); color: #FFFFFF !important; box-shadow: 0 6px 16px -8px rgba(35, 64, 255, .75); }
.g-btn--ghost { background: #FFFDF8; box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .16); }
.g-btn--wide { width: 100%; }
.g-btn--small { min-height: 38px; padding: 0 14px; font-size: 13.5px !important; }
.g-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.g-btn .g-ico, .g-btn .g-ico svg { width: 16px; height: 16px; display: block; }

/* ───────────────────────────────────────────── welcome */
.g-welcome { display: flex; flex-direction: column; gap: 16px; min-height: 100%; padding: 22px 16px 18px; background: var(--card); }
.g-welcome__head { display: grid; gap: 8px; }
.g-eggs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 4px; }
.g-egg { display: grid; gap: 8px; min-width: 0; }
.g-egg[data-kind='chiikawa'] { --tint: #FCE3EA; --tink: #B8416A; }
.g-egg[data-kind='hachiware'] { --tint: #DFE6F4; --tink: #3F5A96; }
.g-egg[data-kind='usagi'] { --tint: #FFF1C4; --tink: #8C6A12; }
.g-egg__stage {
  position: relative;
  height: 158px;
  border-radius: 22px;
  background: var(--tint);
  transition: transform .26s var(--ease-back), box-shadow .22s;
}
.g-egg__stage::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 9px; height: 10px; border-radius: 50%; background: rgba(59, 46, 46, .07); }
.g-egg__cv { position: relative; z-index: 1; }
.g-egg.is-picked .g-egg__stage { transform: translateY(-4px); box-shadow: inset 0 0 0 3px var(--tink), 0 14px 22px -14px var(--tink); }
.g-egg__pick {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 40px; padding: 0 6px; border: 0; border-radius: 999px;
  background: #FFFDF8; box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .14);
  font: 750 13px/1.1 var(--display) !important; white-space: nowrap;
  transition: background .18s, box-shadow .18s, color .18s;
}
.g-egg__tick { display: none; width: 15px; height: 15px; }
.g-egg__tick svg { display: block; width: 100%; height: 100%; }
.g-egg.is-picked .g-egg__pick { background: var(--tink); color: #FFFFFF; box-shadow: none; }
.g-egg.is-picked .g-egg__tick { display: block; }
.g-loop { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.g-loop li { display: grid; gap: 3px; padding: 10px 10px 11px; border-radius: 16px; background: var(--paper); }
.g-loop b { font: 600 9px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cobalt); }
.g-loop span { font: 700 13px/1.25 var(--display); letter-spacing: -.01em; }
.g-welcome__teaser { min-height: 1.4em; text-align: center; font: italic 400 16px/1.35 var(--human); color: var(--ink-2); }
.g-welcome .g-btn--wide { margin-top: auto; }
/* a short laptop window: the phone got shorter, so the welcome tightens up and keeps its button on screen
   (the lede already says quests → 30 points → hatch → grow, so the three-step strip can go) */
@media (min-width: 900px) and (max-height: 860px) {
  .g-welcome { gap: 12px; padding-top: 16px; }
  .g-egg__stage { height: 132px; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .g-loop { display: none; }
}

/* ───────────────────────────────────────────── home: the nest */
.g-view--home { gap: 10px; padding-bottom: 12px; }
.g-room {
  --pal-shift: 0px;
  position: relative;
  flex: 1 1 300px;
  min-height: 280px;
  overflow: hidden;
  background: var(--k-wall);
}
/* once the pal is out, the care buttons take the right-hand column: the pal (and its rug) glide a little to the left
   so the widest Best friends — a guitar, a snack in hand — never run under the buttons. A rigid translate of the whole
   canvas: the canvas keeps its size (no refit, no redraw), so the character is never scaled. */
.g-room[data-state='pal'] { --pal-shift: -30px; }
/* keyboard focus on the pal: the room clips a canvas outline (and the shifted canvas would show one stray edge), so the
   ring is drawn around the whole room instead */
.g-room__cv:focus-visible { outline: none; }
.g-room::after { content: ''; position: absolute; inset: 0; z-index: 5; box-shadow: inset 0 0 0 3px var(--cobalt); opacity: 0; pointer-events: none; }
.g-room:has(.g-room__cv:focus-visible)::after { opacity: 1; }
.g-room__wall { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255, 255, 255, .7) 1.6px, transparent 2.1px); background-size: 20px 20px; background-position: 6px 4px; }
.g-room__window {
  position: absolute; left: 16px; top: 16px; width: 62px; height: 76px;
  border: 5px solid #FFFDF8; border-radius: 32px 32px 8px 8px;
  background: #CFE8F7; overflow: hidden;
  box-shadow: 0 3px 0 rgba(59, 46, 46, .07);
}
.g-room__window::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #FFFDF8; z-index: 2; }
.g-room__window::after { content: ''; position: absolute; left: 0; right: 0; top: 52%; height: 4px; background: #FFFDF8; z-index: 2; }
.g-room__sun { position: absolute; right: 7px; top: 9px; width: 15px; height: 15px; border-radius: 50%; background: #FFD968; }
.g-room__cloud { position: absolute; left: 6px; top: 34px; width: 22px; height: 9px; border-radius: 9px; background: #FFFFFF; box-shadow: 9px -4px 0 -1px #FFFFFF; animation: g-cloud 14s ease-in-out infinite alternate; }
.g-room__bunting { position: absolute; top: 0; right: 10px; width: 52%; height: 40px; display: flex; justify-content: space-around; align-items: flex-start; padding-top: 6px; }
.g-room__bunting::before { content: ''; position: absolute; left: -2px; right: -2px; top: -12px; height: 26px; border-bottom: 1.5px solid rgba(59, 46, 46, .35); border-radius: 0 0 50% 50%; }
.g-room__bunting i { position: relative; top: var(--dy, 6px); display: block; width: 14px; height: 16px; clip-path: polygon(0 0, 100% 0, 50% 100%); background: #F6A9BE; }
.g-room__bunting i:nth-child(3n+2) { background: #9FB3E0; }
.g-room__bunting i:nth-child(3n) { background: #F4CF5D; }
.g-room__bunting i:nth-child(1), .g-room__bunting i:nth-child(7) { --dy: 1px; }
.g-room__bunting i:nth-child(2), .g-room__bunting i:nth-child(6) { --dy: 5px; }
.g-room__bunting i:nth-child(3), .g-room__bunting i:nth-child(5) { --dy: 8px; }
.g-room__bunting i:nth-child(4) { --dy: 9px; }
.g-room__shelf { position: absolute; left: 14px; top: 132px; width: 74px; height: 6px; border-radius: 3px; background: #FFFDF8; box-shadow: 0 2px 0 rgba(59, 46, 46, .08); }
.g-room__plant { position: absolute; left: 6px; bottom: 6px; width: 16px; height: 13px; border-radius: 2px 2px 5px 5px; background: #E8A87C; }
.g-room__plant::before { content: ''; position: absolute; left: -3px; bottom: 11px; width: 11px; height: 15px; border-radius: 50% 50% 50% 0; background: #86C58A; transform: rotate(-20deg); }
.g-room__plant::after { content: ''; position: absolute; right: -3px; bottom: 11px; width: 11px; height: 14px; border-radius: 50% 50% 0 50%; background: #6FAE62; transform: rotate(18deg); }
.g-room__books { position: absolute; left: 30px; bottom: 6px; width: 9px; height: 20px; border-radius: 2px; background: #9FB3E0; box-shadow: 10px 3px 0 -0px #F6A9BE; }
.g-room__trophy { position: absolute; right: 6px; bottom: 6px; width: 13px; height: 13px; border-radius: 2px 2px 7px 7px; background: #F4CF5D; }
.g-room__trophy::after { content: ''; position: absolute; left: 3px; bottom: -3px; width: 7px; height: 3px; background: #D9A62E; }
.g-room__floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background-color: var(--k-floor);
  background-image: repeating-linear-gradient(90deg, transparent 0 62px, rgba(122, 86, 52, .1) 62px 64px);
  border-top: 7px solid #FFFDF8;
}
.g-room__rug {
  position: absolute; left: 50%; bottom: 5.5%; width: min(66%, 250px); height: 15%;
  border-radius: 50%;
  background: var(--k-rug);
  outline: 2px dashed rgba(255, 255, 255, .85);
  outline-offset: -8px;
  transform: translateX(calc(-50% + var(--pal-shift)));
  transition: transform .5s var(--ease-swift);
}
.g-room__glow {
  position: absolute; left: 50%; bottom: 7%; width: 260px; height: 260px; margin-left: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 234, 150, .95) 0, rgba(255, 234, 150, .5) 32%, rgba(255, 234, 150, 0) 66%);
  opacity: 0; transform: scale(.7);
  transition: opacity .5s, transform .6s var(--ease-back);
  pointer-events: none;
}
.g-room[data-state='ready'] .g-room__glow { opacity: 1; transform: scale(1); animation: g-glow 2.2s ease-in-out infinite; }
.g-room[data-state='hatching'] .g-room__glow { opacity: 1; transform: scale(1.15); }
/* ready: little four-point sparkles twinkle around the egg */
.g-room__sparkles { position: absolute; left: 50%; bottom: 20%; width: 0; height: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .4s; filter: drop-shadow(0 0 3px rgba(255, 196, 60, .85)) drop-shadow(0 1px 0 rgba(59, 46, 46, .18)); }
.g-room[data-state='ready'] .g-room__sparkles { opacity: 1; }
.g-room__sparkles i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s, 16px); height: var(--s, 16px); margin: calc(var(--s, 16px) / -2) 0 0 calc(var(--s, 16px) / -2);
  background: var(--c, #FFD968);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: g-twinkle 1.8s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.g-room__sparkles i:nth-child(1) { --x: -104px; --y: -118px; --s: 22px; --d: 0s; --c: #FFC93D; }
.g-room__sparkles i:nth-child(2) { --x: 96px; --y: -150px; --s: 14px; --d: .5s; --c: #FFFFFF; }
.g-room__sparkles i:nth-child(3) { --x: 112px; --y: -64px; --s: 24px; --d: .9s; --c: #FFC93D; }
.g-room__sparkles i:nth-child(4) { --x: -118px; --y: -40px; --s: 12px; --d: 1.3s; --c: #FFFFFF; }
.g-room__sparkles i:nth-child(5) { --x: -64px; --y: -196px; --s: 12px; --d: .3s; --c: var(--k-accent); }
.g-room__sparkles i:nth-child(6) { --x: 58px; --y: -206px; --s: 18px; --d: 1.1s; --c: #FFC93D; }
.g-room__pet { position: absolute; inset: 0; z-index: 1; }
/* only the canvas moves: the voice bubbles live in .g-room__pet and pet.mjs places them from the canvas offset, so they
   stay inside the room */
.g-room__cv { position: absolute; inset: 0; border-radius: 0; transform: translateX(var(--pal-shift)); transition: transform .5s var(--ease-swift); }
.g-room__plate {
  position: absolute; left: 12px; bottom: 11px; z-index: 2;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255, 253, 248, .92);
  font: 600 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--k-ink);
  pointer-events: none;
}

/* the ready callout (top of the room) */
.g-ready {
  position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3;
  display: grid; gap: 8px;
  padding: 12px 12px 11px 14px;
  border-radius: 18px;
  background: #FFFDF8;
  box-shadow: 0 10px 24px -14px rgba(18, 19, 24, .45), inset 0 0 0 1.5px #F4CF5D;
}
.g-ready[hidden] { display: none; }
.g-ready.is-in { animation: g-drop .5s var(--ease-back) both; }
.g-ready__title { font: 500 14px/1.3 var(--display); color: var(--ink-2); }
.g-ready__title strong { color: var(--ink); font-weight: 850; }
.g-ready__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.g-ready__pips { display: flex; gap: 6px; }
.g-ready__pips i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .12); transition: background .2s, transform .3s var(--ease-back); }
.g-ready__pips i.is-on { background: #F4CF5D; box-shadow: inset 0 0 0 1.5px #C9971F; transform: scale(1.15); }

/* growth banner (drops in at the top of the room, clear of the care buttons, so the meter stays in view) */
.g-banner {
  position: absolute; left: 12px; right: 76px; top: 12px; z-index: 4;
  display: flex; align-items: center; gap: 11px;
  min-height: 62px; padding: 10px 14px 10px 12px;
  border-radius: 18px;
  background: var(--cobalt); color: #FFFFFF;
  box-shadow: 0 14px 28px -14px rgba(35, 64, 255, .8);
  opacity: 0; transform: translateY(-16px) scale(.96);
  transition: opacity .22s, transform .42s var(--ease-back);
  pointer-events: none;
}
.g-banner.is-on { opacity: 1; transform: none; }
.g-banner p { display: grid; gap: 2px; min-width: 0; }
.g-banner__title { font: 850 15.5px/1.2 var(--display); letter-spacing: -.01em; }
.g-banner__note { font: italic 400 13.5px/1.3 var(--human); opacity: .92; }
.g-banner__spark, .g-banner__spark svg { flex: none; width: 24px; height: 24px; display: block; color: #FFE08A; }
.g-banner.is-on .g-banner__spark { animation: g-spin 1.2s var(--ease-swift); }

/* progress */
.g-prog { position: relative; flex: none; padding: 2px 16px 0; }
.g-prog__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.g-prog__label { font: 800 14px/1.2 var(--display); letter-spacing: -.01em; }
.g-prog__val { font: 600 10.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; }
.g-prog__track { position: relative; height: 12px; margin: 0 8px 26px; border-radius: 999px; background: var(--paper-2); }
.g-prog__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: var(--k-accent); transition: width .95s var(--ease-swift); }
.g-prog__fill::after { content: ''; position: absolute; right: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .8); }
.g-prog__mark { position: absolute; left: var(--at); top: 50%; transform: translate(-50%, -50%); }
.g-prog__dot {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #FFFDF8; color: transparent;
  box-shadow: inset 0 0 0 2px rgba(18, 19, 24, .16);
  transition: background .3s, color .3s, box-shadow .3s, transform .35s var(--ease-back);
}
.g-prog__dot svg { width: 12px; height: 12px; display: block; }
.g-prog__mark.is-reached .g-prog__dot { background: var(--k-ink); color: #FFFFFF; box-shadow: none; transform: scale(1.08); }
.g-prog__mlabel { position: absolute; left: 50%; top: 23px; transform: translateX(-50%); font: 500 9.5px/1 var(--mono); letter-spacing: .03em; color: var(--ink-3); white-space: nowrap; }
.g-prog__mlabel b { font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.g-prog__mark:last-child .g-prog__mlabel { left: auto; right: -6px; transform: none; }
.g-prog__mark:first-of-type .g-prog__mlabel { left: -8px; transform: none; }

/* care HUD (inside the room, right side) */
.g-hud { position: absolute; right: 10px; top: 50%; z-index: 3; display: grid; gap: 9px; transform: translateY(-56%); }
.g-hud[hidden] { display: none; }
.g-hud__btn { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; border-radius: 16px; }
.g-hud.is-in .g-hud__btn { animation: g-drop .42s var(--ease-back) both; }
.g-hud.is-in .g-hud__btn:nth-child(2) { animation-delay: .07s; }
.g-hud.is-in .g-hud__btn:nth-child(3) { animation-delay: .14s; }
.g-hud__ico {
  display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: #FFFDF8;
  box-shadow: 0 0 0 1.5px rgba(59, 46, 46, .14), 0 4px 0 rgba(59, 46, 46, .1), 0 12px 20px -12px rgba(18, 19, 24, .4);
  transition: transform .22s var(--ease-back), background .18s;
}
.g-hud__ico svg { width: 25px; height: 25px; display: block; }
.g-hud__label { padding: 3px 7px; border-radius: 999px; background: rgba(255, 253, 248, .92); font: 800 10.5px/1.1 var(--display); letter-spacing: -.005em; white-space: nowrap; }
.g-hud__full { display: none; position: absolute; top: -5px; right: -6px; padding: 3px 6px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font: 600 8.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.g-hud__btn.is-full .g-hud__full { display: block; }
.g-hud__btn.is-full .g-hud__ico { opacity: .7; }

/* nav tiles */
.g-nav { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 14px; }
.g-nav__btn {
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 5px;
  min-height: 70px; padding: 8px 4px; border: 0; border-radius: 20px;
  background: #FFFDF8; box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .12), 0 3px 0 rgba(18, 19, 24, .06);
  font: 800 13.5px/1.1 var(--display) !important; letter-spacing: -.01em; text-align: center;
  transition: transform .22s var(--ease-back), box-shadow .2s, background .2s;
}
.g-nav__btn .g-ico, .g-nav__btn .g-ico svg { width: 26px; height: 26px; display: block; }
.g-nav__btn--quests { background: var(--cobalt); color: #FFFFFF !important; box-shadow: 0 8px 18px -10px rgba(35, 64, 255, .9); }
.g-nav__btn--quests .g-ico { color: #FFFFFF; }
.g-nav__btn--quests .g-ico svg rect[fill='#fff'] { fill: rgba(255, 255, 255, .18); }
.g-nav__btn--quests.is-nudge { animation: g-nudge 2.4s ease-in-out infinite; }
.g-nav__btn[aria-disabled='true'] { opacity: .5; }
.g-nav__badge { position: absolute; top: 7px; right: 9px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #FFE08A; color: var(--ink); font: 900 11px/19px var(--display); }
.g-nav__badge[hidden] { display: none; }
.g-nav__lock { display: none; position: absolute; top: 8px; right: 10px; width: 14px; height: 14px; color: var(--ink-3); }
.g-nav__lock svg { display: block; width: 100%; height: 100%; }
.g-nav__btn--match.is-locked { color: var(--ink-3); }
.g-nav__btn--match.is-locked .g-nav__lock { display: block; }
.g-nav__btn--match.is-locked .g-ico { opacity: .5; }
.g-hint { flex: none; min-height: 2.7em; padding: 0 20px; text-align: center; font: italic 400 14.5px/1.35 var(--human); color: var(--ink-2); text-wrap: balance; }

/* name card (after the hatch) */
.g-name {
  position: absolute; left: 6px; right: 6px; bottom: 8px; z-index: 6;
  display: grid; justify-items: center; gap: 8px;
  padding: 20px 18px 16px;
  border-radius: 26px;
  background: #FFFDF8;
  text-align: center;
  box-shadow: 0 -2px 0 var(--k-accent) inset, 0 24px 50px -18px rgba(18, 19, 24, .45), 0 0 0 1px var(--line);
}
.g-name[hidden] { display: none; }
.g-name.is-in { animation: g-rise .55s var(--ease-back) both; }
.g-name::before, .g-name::after { content: '✦'; position: absolute; top: 14px; font-size: 18px; color: #F4CF5D; animation: g-twinkle 1.6s ease-in-out infinite; }
.g-name::before { left: 22px; } .g-name::after { right: 24px; animation-delay: .5s; color: var(--k-accent); }
.g-name__eyebrow { font: 600 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--k-ink); }
:is(#game, .g-app) .g-name__title { font: 950 38px/.95 var(--display); letter-spacing: -.045em; }
.g-name__pal { color: var(--k-ink); }
.g-name__line { max-width: 30ch; font: 400 14.5px/1.4 var(--display); color: var(--ink-2); }
.g-name .g-btn { width: 100%; margin-top: 4px; }

/* ───────────────────────────────────────────── quests */
.g-quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.g-quest {
  display: grid; gap: 5px; width: 100%;
  padding: 13px 14px 12px; border: 0; border-radius: 20px;
  background: #FFFDF8; text-align: left;
  box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .1), 0 3px 0 rgba(18, 19, 24, .05);
  transition: transform .22s var(--ease-back), box-shadow .2s;
  animation: g-in .34s var(--ease-swift) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.g-quest__top { display: flex; align-items: center; gap: 8px; }
.g-quest__meta { font: 500 12.5px/1 var(--display); color: var(--ink-3); }
:is(#game, .g-app) .g-quest__title { font: 900 19px/1.1 var(--display); letter-spacing: -.02em; }
.g-quest__blurb { font: 400 13.5px/1.35 var(--display); color: var(--ink-2); }
.g-quest__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.g-quest__status { display: inline-flex; align-items: center; gap: 4px; font: 700 12.5px/1.2 var(--display); color: var(--ink-2); }
.g-quest:is([data-status='new'], [data-status='started']) .g-quest__status { color: var(--cobalt); }
.g-quest[data-status='done'] .g-quest__status { color: var(--g-right-ink); }
.g-quest__ok, .g-quest__ok svg { width: 15px; height: 15px; display: block; }
.g-quest__reward { display: inline-flex; align-items: center; gap: 4px; flex: none; font: 850 13px/1 var(--display); white-space: nowrap; }
.g-quest__coin, .g-quest__coin svg { width: 17px; height: 17px; display: block; }
.g-quest[data-status='done'] .g-quest__reward { color: var(--ink-3); }
.g-pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px;
  font: 600 9.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  background: var(--paper-2); color: var(--ink-2);
}
.g-pill[data-type='homework'] { background: #FCE3EA; color: #A83A60; }
.g-pill[data-type='quiz'] { background: #DFE6F4; color: #34508C; }
.g-pill[data-type='test'] { background: #FFF1C4; color: #7A5A06; }

/* ───────────────────────────────────────────── quiz */
.g-dots { display: flex; gap: 6px; flex: none; padding-right: 4px; }
.g-dots i { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--paper-2); transition: background .25s, transform .3s var(--ease-back); }
.g-dots i.is-now { background: #FFFDF8; box-shadow: inset 0 0 0 2.5px var(--cobalt); }
.g-dots i.is-right { background: var(--g-right-line); transform: scale(1.1); }
.g-dots i.is-wrong { background: var(--g-wrong-line); }
.g-q { flex: 1; gap: 14px; padding-top: 18px; }
.g-q__num { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
:is(#game, .g-app) .g-q__text { font: 850 22px/1.18 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.g-answers { display: grid; gap: 9px; }
.g-answer {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 8px 14px 8px 9px;
  border: 0; border-radius: 18px;
  background: #FFFDF8; text-align: left;
  box-shadow: inset 0 0 0 2px rgba(18, 19, 24, .1), 0 3px 0 rgba(18, 19, 24, .06);
  font: 700 16px/1.25 var(--display) !important;
  transition: transform .2s var(--ease-back), box-shadow .2s, background .2s, opacity .25s;
  animation: g-in .32s var(--ease-swift) both; animation-delay: calc(var(--i, 0) * 50ms);
}
.g-answer:disabled { cursor: default; }
.g-answer__key {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--paper); font: 600 12px/1 var(--mono); color: var(--ink-2);
  transition: background .2s, color .2s;
}
.g-answer__text { flex: 1; min-width: 0; }
.g-answer__mark { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; }
.g-answer__mark:empty { display: none; }
.g-answer__mark svg { width: 16px; height: 16px; display: block; }
.g-answer.is-right { background: var(--g-right); box-shadow: inset 0 0 0 2px var(--g-right-line); animation: g-pop .4s var(--ease-back); }
.g-answer.is-right .g-answer__key { background: var(--g-right-line); color: #FFFFFF; }
.g-answer.is-right .g-answer__mark { background: var(--g-right-line); color: #FFFFFF; }
.g-answer.is-wrong { background: var(--g-wrong); box-shadow: inset 0 0 0 2px var(--g-wrong-line); animation: g-shake .42s ease-out; }
.g-answer.is-wrong .g-answer__key { background: var(--g-wrong-line); color: #FFFFFF; }
.g-answer.is-wrong .g-answer__mark { background: var(--g-wrong-line); color: #FFFFFF; }
.g-answer.is-dim { opacity: .45; }
.g-answer__them {
  position: absolute; top: -9px; right: 12px;
  padding: 4px 8px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF;
  font: 600 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  animation: g-drop .35s var(--ease-back) both;
}
.g-fb {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px 11px 10px; border-radius: 20px;
  background: var(--paper);
  opacity: 0; transform: translateY(8px);
  transition: opacity .22s, transform .32s var(--ease-back), background .2s;
}
.g-fb.is-on { opacity: 1; transform: none; }
.g-fb.is-right { background: var(--g-right); }
.g-fb.is-wrong { background: var(--g-wrong); }
.g-fb__buddy { width: 50px; height: 50px; background: #FFFDF8; }
.g-fb__text { display: grid; gap: 2px; min-width: 0; }
.g-fb__head { font: 900 16px/1.2 var(--display); letter-spacing: -.01em; }
.g-fb.is-right .g-fb__head { color: var(--g-right-ink); }
.g-fb.is-wrong .g-fb__head { color: var(--g-wrong-ink); }
.g-fb__why { font: 400 14px/1.35 var(--display); color: var(--ink-2); }
.g-q__next { margin-top: auto; }
.g-q__next[hidden] { display: none; }
.g-q__next:not([hidden]) { animation: g-in .3s var(--ease-swift) both; }

/* ───────────────────────────────────────────── results */
.g-res { gap: 14px; padding-top: 20px; }
.g-res__head { display: flex; align-items: center; gap: 16px; }
.g-res__msg { margin-top: 6px; font: italic 400 15px/1.35 var(--human); color: var(--ink-2); }
.g-ring { position: relative; flex: none; width: 96px; height: 96px; }
.g-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.g-ring__bg { fill: none; stroke: var(--paper-2); stroke-width: 11; }
.g-ring__fg { fill: none; stroke: var(--g-right-line); stroke-width: 11; stroke-linecap: round; animation: g-ring-in .9s var(--ease-swift) both .15s; }
.g-ring__n { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-ring__n b { font: 950 25px/1 var(--display); letter-spacing: -.03em; }
.g-ring__n small { font: 600 10px/1.4 var(--mono); color: var(--ink-3); }
.g-bd { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; border-radius: 20px; background: var(--paper); }
.g-bd__row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 40px; padding: 7px 10px; border-radius: 14px; background: #FFFDF8;
  animation: g-in .32s var(--ease-swift) both; animation-delay: calc(120ms + var(--i, 0) * 70ms);
}
.g-bd__ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--g-right-line); color: #FFFFFF; }
.g-bd__ico svg { width: 15px; height: 15px; display: block; }
.g-bd__row[data-kind='wrong'] .g-bd__ico { background: var(--g-wrong-line); }
.g-bd__row--rule .g-bd__ico { background: var(--ink); color: var(--mint); }
.g-bd__row--rule .g-bd__ico svg { width: 18px; height: 18px; }
.g-bd__what { display: grid; gap: 2px; font: 600 14px/1.25 var(--display); }
.g-bd__tag { font: 600 8.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.g-bd__pts { font: 900 16px/1 var(--display); font-variant-numeric: tabular-nums; }
.g-bd__row[data-kind='wrong'] .g-bd__pts, .g-bd__row[data-kind='miss'] .g-bd__pts { color: var(--ink-3); }
.g-bd__row[data-kind='miss'] .g-bd__what { color: var(--ink-2); }
.g-bd__row[data-kind='bonus'] { background: var(--g-right); box-shadow: inset 0 0 0 1.5px var(--g-right-line); }
.g-bd__row[data-kind='bonus'] .g-bd__pts { color: var(--g-right-ink); }
.g-bd__row--total { grid-template-columns: minmax(0, 1fr) auto; background: transparent; padding-top: 10px; }
.g-bd__row--total .g-bd__what { font-weight: 850; }
.g-bd__row--total .g-bd__pts { font-size: 21px; color: var(--cobalt); }
.g-res__ready {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 18px;
  background: #FFF1C4; box-shadow: inset 0 0 0 1.5px #F4CF5D;
  font: 500 14px/1.35 var(--display); color: var(--ink-2);
  animation: g-in .35s var(--ease-swift) both .45s;
}
.g-res__ready strong { color: var(--ink); font-weight: 850; }
.g-res__ready .g-ico, .g-res__ready .g-ico svg { flex: none; width: 22px; height: 22px; display: block; color: #C9971F; }
.g-res__btns { display: grid; gap: 8px; margin-top: auto; padding-top: 4px; }
.g-res__btns--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-res__btns--2 .g-btn { padding: 0 10px; font-size: 14.5px !important; }

/* ───────────────────────────────────────────── friendly match: pick */
.g-mates { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.g-mate {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px 10px 10px; border: 0; border-radius: 20px;
  background: #FFFDF8; text-align: left;
  box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .1), 0 3px 0 rgba(18, 19, 24, .05);
  transition: transform .22s var(--ease-back), box-shadow .2s;
  animation: g-in .34s var(--ease-swift) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.g-avatar--mate { width: 52px; height: 52px; }
.g-mate__main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.g-mate__name { font: 500 13px/1.2 var(--display); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-mate__name strong { font: 900 16px/1.2 var(--display); color: var(--ink); letter-spacing: -.01em; }
.g-mate__pal::before { content: ' · '; }
.g-mate__pal > span, .g-mate__rec > span { white-space: nowrap; }
.g-mate__style { font: italic 400 13.5px/1.3 var(--human); color: var(--ink-2); }
.g-mate__rec { font: 500 10px/1.3 var(--mono); letter-spacing: .03em; color: var(--ink-3); }
.g-mate__go { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font: 800 13px/1 var(--display); }

/* ───────────────────────────────────────────── friendly match: arena */
.g-arena { position: relative; flex: none; background: #14151B; color: #FFFDF8; overflow: hidden; }
.g-arena__stage { position: relative; height: 190px; transition: height .35s var(--ease-swift); }
.g-view--match.is-done .g-arena__stage { height: 150px; }
.g-arena__stage::before, .g-arena__stage::after {
  content: ''; position: absolute; bottom: 8px; width: 42%; height: 34px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 214, .34), rgba(255, 244, 214, 0));
}
.g-arena__stage::before { left: 4%; } .g-arena__stage::after { right: 4%; }
.g-arena__cv { position: absolute; inset: 0; z-index: 1; border-radius: 0; }
.g-arena__vs {
  position: absolute; left: 50%; top: 44%; z-index: 2;
  font: italic 950 40px/1 var(--display); letter-spacing: -.04em;
  color: #FFE08A; -webkit-text-stroke: 1.5px #3B2E2E; paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.g-arena.is-intro .g-arena__vs { animation: g-slam .6s var(--ease-back) both .25s; }
.g-arena__sides { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 4px 16px 12px; }
.g-side { position: relative; display: grid; gap: 3px; min-width: 0; }
.g-side--them { justify-items: end; text-align: right; }
.g-side__name { font: 900 16px/1.1 var(--display); letter-spacing: -.01em; }
.g-side__name { overflow-wrap: anywhere; }
.g-side__sub span { white-space: nowrap; }
.g-side__sub { font: 500 10px/1.25 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 253, 248, .6); overflow-wrap: anywhere; }
.g-side__stars { display: flex; gap: 3px; margin-top: 3px; color: rgba(255, 253, 248, .16); }
.g-side__stars i { display: block; width: 18px; height: 18px; }
.g-side__stars i svg { display: block; width: 100%; height: 100%; }
.g-side__stars i svg path { stroke: rgba(255, 253, 248, .25); }
.g-side__stars i.is-on { color: #FFD24A; }
.g-side__stars i.is-on svg path { stroke: #3B2E2E; }
.g-side__stars i.is-pop { animation: g-pop .45s var(--ease-back); }
.g-side__chip {
  position: absolute; top: -30px;
  padding: 5px 9px; border-radius: 999px;
  background: #FFE08A; color: var(--ink);
  font: 700 11px/1 var(--display); white-space: nowrap;
  opacity: 0; transform: translateY(6px) scale(.9);
  transition: opacity .2s, transform .3s var(--ease-back);
}
.g-side--you .g-side__chip { left: 0; }
.g-side--them .g-side__chip { right: 0; }
.g-side__chip.is-on { opacity: 1; transform: none; }
.g-side__chip[data-ok='true'] { background: var(--mint); }
.g-side__chip[data-ok='false'] { background: #F3D3CC; }
.g-side__chip.is-say { background: #FFFDF8; font: italic 500 12.5px/1 var(--human); padding: 6px 10px; }
.g-round { display: flex; flex-direction: column; gap: 12px; }
.g-round[hidden] { display: none; }
.g-round.is-enter { animation: g-in .28s var(--ease-swift) both; }
.g-round__top { display: flex; align-items: center; gap: 12px; }
.g-round__n { flex: none; font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.g-timer { position: relative; flex: 1; height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.g-timer__fill { position: absolute; inset: 0; background: var(--cobalt); transform-origin: left center; transform: scaleX(1); }
.g-timer.is-late .g-timer__fill { background: var(--g-late); }
:is(#game, .g-app) .g-round__q { font: 950 36px/1.05 var(--display); letter-spacing: -.035em; text-align: center; padding: 4px 0 2px; font-variant-numeric: tabular-nums; }
.g-round__choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.g-answer--big { flex-direction: column; justify-content: center; gap: 6px; min-height: 84px; padding: 10px 6px; text-align: center; font: 900 24px/1 var(--display) !important; font-variant-numeric: tabular-nums; }
.g-answer--big .g-answer__key { width: 26px; height: 20px; border-radius: 7px; font-size: 10px; }
.g-answer--big .g-answer__text { flex: none; }
.g-answer--big .g-answer__mark { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; }
.g-answer--big .g-answer__mark svg { width: 12px; height: 12px; }
.g-answer--big .g-answer__them { top: auto; bottom: -9px; right: 50%; transform: translateX(50%); }
.g-round__status { min-height: 2.7em; text-align: center; font: 500 14px/1.35 var(--display); color: var(--ink-2); text-wrap: balance; }
.g-round__status[data-tone] { display: grid; gap: 2px; align-content: center; min-height: 56px; padding: 9px 14px; border-radius: 16px; background: var(--paper); animation: g-pop .4s var(--ease-back); }
.g-round__status[data-tone] strong { font: 900 16px/1.2 var(--display); letter-spacing: -.01em; color: var(--ink); }
.g-round__status[data-tone] span { font-size: 13px; }
.g-round__status[data-tone='you'] { background: var(--g-right); box-shadow: inset 0 0 0 1.5px var(--g-right-line); }
.g-round__status[data-tone='you'] strong { color: var(--g-right-ink); }
.g-round__status[data-tone='both'] { background: #FFF1C4; box-shadow: inset 0 0 0 1.5px #F4CF5D; }
.g-round__status[data-tone='bot'] { background: #ECEFFB; box-shadow: inset 0 0 0 1.5px #C5CDF0; }
.g-round__status[data-tone='bot'] strong { color: #34508C; }
.g-round .g-btn[hidden] { display: none; }
.g-star-fly { position: absolute; left: 0; top: 0; width: 28px; height: 28px; color: #FFD24A; z-index: 40; filter: drop-shadow(0 2px 6px rgba(255, 190, 40, .6)); }
.g-star-fly svg { display: block; width: 100%; height: 100%; }
.g-mres { display: flex; flex-direction: column; gap: 12px; }
.g-mres[hidden] { display: none; }
.g-mres.is-enter { animation: g-in .32s var(--ease-swift) both; }

/* ───────────────────────────────────────────── class board */
.g-goal { display: grid; gap: 8px; padding: 14px 14px 13px; border-radius: 20px; background: #FFF1C4; box-shadow: inset 0 0 0 1.5px #F2D98A; }
.g-goal__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.g-goal__title { display: inline-flex; align-items: center; gap: 6px; font: 900 16px/1.1 var(--display); letter-spacing: -.01em; }
.g-goal__ico, .g-goal__ico svg { width: 18px; height: 18px; display: block; color: #C9971F; }
.g-goal__val { font: 600 11px/1 var(--mono); color: #7A5A06; white-space: nowrap; }
.g-goal__track { position: relative; height: 12px; border-radius: 999px; background: rgba(255, 253, 248, .85); overflow: hidden; }
.g-goal__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: #F4B93D; transition: width 1s var(--ease-swift); }
.g-goal__text { font: 400 13px/1.35 var(--display); color: #6B5A2E; }
.g-goal__chip { display: inline-block; margin-right: 2px; padding: 4px 8px; border-radius: 999px; background: var(--ink); color: #FFE08A; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; vertical-align: 1px; }
.g-goal.is-reached { background: #FFE9A6; box-shadow: inset 0 0 0 2px #F4B93D; }
.g-goal.is-reached .g-goal__text { font-weight: 700; color: #5E4A14; }
.g-goal.is-reached .g-goal__chip { animation: g-pop .5s var(--ease-back) both .9s; }
.g-board__note { font: 800 14px/1.3 var(--display); letter-spacing: -.01em; padding: 2px 2px 0; }
.g-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-row {
  position: relative;
  display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px; border-radius: 18px;
  background: #FFFDF8; box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .08);
  transition: box-shadow .3s, transform .3s var(--ease-back);
}
.g-row__rank { font: 600 12px/1 var(--mono); color: var(--ink-3); text-align: center; }
.g-avatar--row { width: 44px; height: 44px; }
.g-avatar--row[data-kind='none'] { background: var(--paper-2); }
.g-row__main { display: grid; gap: 2px; min-width: 0; }
.g-row__main strong { font: 850 15px/1.15 var(--display); }
.g-row__main span { font: 500 12px/1.2 var(--display); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row__pts { display: grid; justify-items: end; }
.g-row__pts b { font: 900 17px/1 var(--display); font-variant-numeric: tabular-nums; }
.g-row__pts small { font: 500 9px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.g-row.is-you { background: #E9EDFF; box-shadow: inset 0 0 0 2px var(--cobalt); }
.g-row.is-you .g-row__rank { color: var(--cobalt); font-weight: 700; }
.g-row.is-moving { z-index: 2; transform: scale(1.03); box-shadow: inset 0 0 0 2px var(--cobalt), 0 16px 30px -14px rgba(35, 64, 255, .6); }

/* ───────────────────────────────────────────── toast + fx */
.g-toast {
  position: absolute; left: 50%; bottom: 16px; z-index: 12;
  width: max-content; max-width: calc(100% - 32px);
  padding: 11px 15px; border-radius: 16px;
  background: var(--ink); color: #FFFDF8;
  font: 650 13.5px/1.35 var(--display); text-align: center;
  opacity: 0; transform: translate(-50%, 16px);
  transition: opacity .2s, transform .3s var(--ease-back);
  pointer-events: none;
}
.g-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.g-fly { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; pointer-events: none; z-index: 30; }
.g-coin-fly { position: absolute; left: 0; top: 0; width: 22px; height: 22px; will-change: transform; }
.g-coin-fly svg { display: block; width: 100%; height: 100%; }
.g-confetti { position: absolute; left: -4px; top: -3px; width: 8px; height: 6px; border-radius: 1.5px; box-shadow: 0 0 0 1px rgba(59, 46, 46, .12); will-change: transform; }
.g-plus { position: absolute; left: 0; top: 0; font: 950 19px/1 var(--display); letter-spacing: -.02em; color: #B8891B; -webkit-text-stroke: 3px #FFFDF8; paint-order: stroke fill; white-space: nowrap; }

/* ───────────────────────────────────────────── preview strip (outside the device) */
.g-pv {
  display: grid; gap: 8px;
  width: 100%; max-width: 398px;
  padding: 11px;
  border-radius: 22px;
  border: 1.5px dashed rgba(18, 19, 24, .22);
  background: rgba(255, 253, 248, .55);
}
.g-pv__label { display: flex; align-items: center; gap: 8px; padding: 0 3px; font: 600 9.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.g-pv__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); }
.g-pv__shortcut {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 50px; padding: 8px 14px 8px 10px;
  border: 0; border-radius: 16px;
  background: var(--ink); color: #FFFDF8 !important; text-align: left;
  font: 500 13.5px/1.3 var(--display) !important;
  transition: transform .2s var(--ease-back), opacity .2s, background .2s;
}
.g-pv__shortcut:disabled { opacity: .4; cursor: not-allowed; }
.g-pv__shortcut strong { font-weight: 850; }
.g-pv__main { display: grid; gap: 1px; }
.g-pv__shortcut span span { color: rgba(255, 253, 248, .66); font-size: 12.5px; }
.g-pv__coin, .g-pv__coin svg { flex: none; width: 26px; height: 26px; display: block; }
.g-pv__row { display: flex; gap: 8px; }
.g-pv__btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 13px 0 10px;
  border: 0; border-radius: 999px;
  background: #FFFDF8; box-shadow: inset 0 0 0 1.5px rgba(18, 19, 24, .14);
  font: 700 12.5px/1 var(--display) !important;
}
.g-pv__btn .g-ico, .g-pv__btn .g-ico svg { width: 16px; height: 16px; display: block; }
.g-pv__btn[aria-pressed='true'] { background: var(--ink); color: #FFFDF8 !important; box-shadow: none; }

/* ───────────────────────────────────────────── X-ray: behind the scenes */
.g-x {
  --x-bg: #0B0D14; --x-card: #151823; --x-card-2: #1C2030; --x-line: rgba(255, 255, 255, .08);
  --x-ink: #EEEBE4; --x-ink-2: #AAA9B4; --x-ink-3: #8A8C9A; /* 5.8:1 on --x-bg, 5.3:1 on --x-card (AA for the small code lines) */
  --l-server: #93A0FF; --l-database: #F4CF5D; --l-automation: #7FD8B8; --l-game: #F6A9BE;
  position: relative;
  display: flex; flex-direction: column;
  height: 100%; min-height: 560px; min-width: 0;
  padding: 22px 20px 18px;
  border-radius: 30px;
  background: var(--x-bg); color: var(--x-ink);
  font: 400 14px/1.45 var(--display);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  text-align: left;
}
.g-x [data-lane='server'] { --lane: var(--l-server); }
.g-x [data-lane='database'] { --lane: var(--l-database); }
.g-x [data-lane='automation'] { --lane: var(--l-automation); }
.g-x [data-lane='game'] { --lane: var(--l-game); }
.g-x h3, .g-x h4, .g-x p { margin: 0; }
.g-x button { font: inherit; color: inherit; cursor: pointer; }
.g-x__head { display: grid; gap: 7px; }
.g-x__eyebrow { display: flex; align-items: center; gap: 8px; font: 600 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--x-ink-2); }
.g-x__live { width: 8px; height: 8px; border-radius: 50%; background: var(--l-automation); box-shadow: 0 0 0 0 rgba(127, 216, 184, .6); animation: g-live 2s ease-out infinite; }
:is(#xray, .g-x) .g-x__title { font: 900 27px/1 var(--display); letter-spacing: -.035em; }
.g-x__note { font: italic 400 14px/1.35 var(--human); color: var(--x-ink-2); }
.g-x__toggle { display: none; }
.g-x__ticker { display: none; }
.g-x__body { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; margin-top: 16px; }
.g-x__h-ico, .g-x__h-ico svg { width: 15px; height: 15px; display: block; }

/* flow strip: the red thread joins the four lanes */
.g-x__flow { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 4px 12px; border-radius: 20px; background: var(--x-card); }
.g-x__thread { position: absolute; left: 12.5%; right: 12.5%; top: 35px; height: 2px; background: var(--thread); border-radius: 2px; box-shadow: 0 0 10px rgba(229, 53, 43, .45); }
.g-x__thread::before { content: ''; position: absolute; inset: 4px 0 auto; height: 0; border-top: 1.5px dashed rgba(229, 53, 43, .45); }
.g-x__node { position: relative; z-index: 1; display: grid; justify-items: center; gap: 7px; min-width: 0; }
.g-x__nodeico {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--x-card-2); color: var(--lane);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--lane) 45%, transparent);
  transition: background .3s;
}
.g-x__nodeico svg { width: 22px; height: 22px; display: block; }
.g-x__node.is-on .g-x__nodeico { animation: g-node .8s ease-out; }
.g-x__nodelabel { font: 600 9px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--x-ink-2); text-align: center; white-space: nowrap; }
.g-x__node.is-on .g-x__nodelabel { color: var(--lane); }
.g-x__packet { position: absolute; left: 0; top: 0; z-index: 3; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--lane); box-shadow: 0 0 14px 2px var(--lane); pointer-events: none; }
.g-x__blurb { min-height: 2.7em; padding: 0 4px; font: 400 13.5px/1.35 var(--display); color: var(--x-ink-2); }
.g-x__blurb b { font-weight: 800; color: var(--lane, var(--x-ink)); }

.g-x__sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.g-x__sechead h4 { display: inline-flex; align-items: center; gap: 7px; font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--x-ink-2); }
.g-x__sechead code { font: 500 10.5px/1 var(--mono); color: var(--x-ink-3); white-space: nowrap; }
.g-x__hint { font: italic 400 12.5px/1 var(--human); color: var(--x-ink-3); white-space: nowrap; }

/* the database row: a light "paper" record on the dark backstage */
.g-x__db { padding: 12px; border-radius: 18px; background: var(--x-card); }
.g-x__db .g-x__sechead h4 { color: var(--l-database); }
.g-x__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.g-x__cell { position: relative; display: grid; gap: 4px; min-width: 0; padding: 8px 9px 9px; border-radius: 11px; background: #F4F1EA; color: var(--ink); }
.g-x__cell[data-key='lastActivity'] { grid-column: 1 / -1; }
.g-x__k { font: 600 8.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.g-x__v { font: 850 14.5px/1.15 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.g-x__cell[data-key='lastActivity'] .g-x__v { font-weight: 650; white-space: normal; }
.g-x__cell.is-flash { animation: g-flash 1.6s ease-out; }
.g-x__was { position: absolute; top: 7px; right: 8px; font: 500 9px/1 var(--mono); color: #7A5A06; white-space: nowrap; }

/* the live log */
.g-x__events { display: flex; flex-direction: column; flex: 1 1 0px; min-height: 200px; }
.g-x__legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 9px; }
.g-x__legend span { display: inline-flex; align-items: center; gap: 4px; font: 500 9px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--x-ink-3); }
.g-x__legend span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lane); }
.g-x__log {
  list-style: none; margin: 0; padding: 0 4px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1 1 0px; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #2A2E3D transparent;
}
.g-ev {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 9px 11px 10px 9px; border-radius: 14px;
  background: var(--x-card);
  box-shadow: inset 3px 0 0 var(--lane);
  flex: none;
}
.g-ev.is-new { animation: g-ev-in .45s var(--ease-swift) both; }
.g-ev__ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--lane) 14%, transparent); color: var(--lane); }
.g-ev__ico svg { width: 16px; height: 16px; display: block; }
.g-ev__main { display: grid; gap: 3px; min-width: 0; }
.g-ev__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.g-ev__lane { font: 600 8.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lane); }
.g-ev__title { font: 700 13.5px/1.3 var(--display); color: var(--x-ink); }
.g-ev__pts { padding: 2px 6px; border-radius: 999px; background: rgba(127, 216, 184, .16); color: var(--l-automation); font: 700 10.5px/1.2 var(--mono); }
.g-ev__count { padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--x-ink-2); font: 600 10px/1.2 var(--mono); }
.g-ev__count[hidden] { display: none; }
.g-ev__detail { display: block; font: 400 10.5px/1.45 var(--mono); color: var(--x-ink-3); overflow-wrap: anywhere; }

/* the rules */
.g-x__rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.g-x__rule {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px;
  min-height: 38px; padding: 6px 9px 6px 8px; border-radius: 12px;
  background: var(--x-card); color: var(--x-ink-3);
  font: 600 12px/1.25 var(--display);
  transition: color .3s, box-shadow .3s;
}
.g-x__rdot, .g-x__rdot svg { width: 18px; height: 18px; display: block; color: #3A3F52; transition: color .3s; }
.g-x__rn { font: 600 10px/1 var(--mono); color: var(--l-automation); }
.g-x__rule.has-fired { color: var(--x-ink); box-shadow: inset 0 0 0 1px rgba(127, 216, 184, .25); }
.g-x__rule.has-fired .g-x__rdot { color: var(--l-automation); }
.g-x__rule.is-fire { animation: g-rule 1.3s ease-out; }

/* hover lifts only where hovering exists (touch never keeps a stuck hover) */
@media (hover: hover) {
  .g-back:hover { background: var(--paper-2); }
  .g-iconbtn:hover { background: var(--paper-2); }
  .g-btn:not(:disabled):hover { transform: translateY(-1px); }
  .g-btn--primary:not(:disabled):hover { background: var(--cobalt-ink); }
  .g-hud__btn:hover .g-hud__ico { transform: translateY(-2px) scale(1.05); background: #FFFFFF; }
  .g-nav__btn:hover { transform: translateY(-2px); }
  .g-quest:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px rgba(35, 64, 255, .5), 0 10px 20px -14px rgba(18, 19, 24, .4); }
  .g-answer:not(:disabled):hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px rgba(35, 64, 255, .55), 0 8px 16px -10px rgba(18, 19, 24, .35); }
  .g-mate:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px rgba(35, 64, 255, .5), 0 10px 20px -14px rgba(18, 19, 24, .4); }
  .g-pv__shortcut:not(:disabled):hover { background: #262833; transform: translateY(-1px); }
}

/* presses (after the hover lifts so a press always wins) */
.g-btn:not(:disabled):active { transform: translateY(1px) scale(.98); }
.g-hud__btn:active .g-hud__ico { transform: scale(.9); }
.g-nav__btn:active { transform: translateY(1px) scale(.97); }
.g-answer:not(:disabled):active { transform: scale(.98); }
.g-pv__shortcut:not(:disabled):active { transform: scale(.98); }

/* ───────────────────────────────────────────── phones: frameless card + collapsible X-ray */
@media (max-width: 899px) {
  .g-app { gap: 12px; }
  .g-device { max-width: 480px; }
  .g-pv { max-width: 480px; }
  .g-x { height: auto; min-height: 0; padding: 18px 16px 16px; border-radius: 24px; }
  .g-x__title { font-size: 23px; }
  .g-x__toggle {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 48px; margin-top: 6px; padding: 0 14px;
    border: 0; border-radius: 16px;
    background: var(--x-card-2); color: var(--x-ink);
    font: 800 14px/1.2 var(--display); text-align: left;
  }
  .g-x__toggle > span:first-child { flex: 1; }
  .g-x__badge { padding: 3px 7px; border-radius: 999px; background: rgba(127, 216, 184, .18); color: var(--l-automation); font: 600 10.5px/1 var(--mono); }
  .g-x__chev, .g-x__chev svg { width: 18px; height: 18px; display: block; transition: transform .25s var(--ease-swift); }
  .g-x[data-open='true'] .g-x__chev { transform: rotate(180deg); }
  .g-x:not([data-open='true']) .g-x__body { display: none; }
  .g-x:not([data-open='true']) .g-x__ticker { display: flex; }
  .g-x__ticker { align-items: baseline; gap: 8px; min-height: 1.4em; padding: 0 4px; font: 500 13px/1.35 var(--display); color: var(--x-ink-2); white-space: nowrap; overflow: hidden; }
  .g-x__tl { font: 600 8.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lane); }
  .g-x__body { margin-top: 14px; }
  .g-x__events { flex: none; min-height: 0; }
  .g-x__log { flex: none; max-height: 360px; }
  .g-x__nodelabel { font-size: 8px; letter-spacing: .04em; }
  .g-x__rules { grid-template-columns: minmax(0, 1fr); }
}
/* phones: every way around the game is a comfortable 44 px target */
@media (max-width: 599px) {
  .g-back { height: auto; min-height: 44px; }
  .g-iconbtn { width: 44px; height: 44px; }
  .g-pv__btn { min-height: 44px; }
}
@media (max-width: 520px) {
  .g-x__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-x__events .g-x__sechead { flex-direction: column; align-items: flex-start; gap: 7px; }
  .g-x__legend { justify-content: flex-start; }
  /* labels a teacher can read on a phone held at arm's length: nothing under 11 px */
  .g-chip, .g-room__plate, .g-prog__mlabel, .g-mate__rec, .g-side__sub, .g-answer__them, .g-row__pts small { font-size: 11px; }
  .g-hud__label { font-size: 11.5px; }
  .g-chip { padding: 0 8px; letter-spacing: .05em; }
  .g-prog__mlabel, .g-prog__mlabel b { letter-spacing: .02em; }
  .g-side__sub { letter-spacing: .02em; }
}
/* narrow phones: the classmate's pal and stage get their own line instead of an ellipsis; the stage marks stack their
   points under the name so 11 px labels never collide; "You · Class 5A" keeps just "You" beside the stage chip */
@media (max-width: 400px) {
  .g-mate__name { white-space: normal; }
  .g-mate__name strong, .g-mate__pal { display: block; }
  .g-mate__pal::before { content: none; }
  .g-prog__track { margin-bottom: 38px; }
  .g-prog__mlabel { text-align: center; line-height: 1.2; }
  .g-prog__mlabel b { display: block; }
  .g-prog__mark:last-child .g-prog__mlabel { text-align: right; }
  .g-top__name span { display: none; }
}
@media (max-width: 360px) {
  .g-top { padding-left: 10px; padding-right: 10px; }
  .g-top__who { gap: 7px; }
  .g-top__right { gap: 5px; }
  .g-top .g-chip { padding: 0 7px; letter-spacing: .02em; }
  .g-coins { padding-right: 9px; }
}
/* the smallest phones: the pal's face is the "you" — no room for a clipped "Y…" beside a Best-friend chip */
@media (max-width: 340px) {
  .g-top__name { display: none; }
}

/* ───────────────────────────────────────────── keyframes */
@keyframes g-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes g-drop { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes g-rise { from { opacity: 0; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes g-bump { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes g-pop { 0% { transform: scale(1); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes g-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes g-slam { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-8deg); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(.92) rotate(2deg); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } }
@keyframes g-glow { 0%, 100% { transform: scale(.94); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes g-ring { 0% { box-shadow: 0 0 0 0 rgba(244, 207, 93, .7); } 100% { box-shadow: 0 0 0 10px rgba(244, 207, 93, 0); } }
@keyframes g-live { 0% { box-shadow: 0 0 0 0 rgba(127, 216, 184, .55); } 100% { box-shadow: 0 0 0 9px rgba(127, 216, 184, 0); } }
@keyframes g-nudge { 0%, 70%, 100% { box-shadow: 0 8px 18px -10px rgba(35, 64, 255, .9), 0 0 0 0 rgba(35, 64, 255, .35); } 85% { box-shadow: 0 8px 18px -10px rgba(35, 64, 255, .9), 0 0 0 8px rgba(35, 64, 255, 0); } }
@keyframes g-twinkle { 0%, 100% { opacity: .35; transform: scale(.8) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes g-spin { from { transform: rotate(-180deg) scale(.4); } to { transform: none; } }
@keyframes g-cloud { from { transform: translateX(0); } to { transform: translateX(12px); } }
@keyframes g-ring-in { from { stroke-dasharray: 0 100; } }
@keyframes g-node { 0% { background: color-mix(in srgb, var(--lane) 38%, var(--x-card-2)); box-shadow: 0 0 0 1.5px var(--lane), 0 0 0 0 color-mix(in srgb, var(--lane) 60%, transparent); } 100% { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--lane) 45%, transparent), 0 0 0 14px transparent; } }
@keyframes g-ev-in { 0% { opacity: 0; transform: translateY(-10px); background: color-mix(in srgb, var(--lane) 22%, var(--x-card)); } 60% { opacity: 1; transform: none; } 100% { background: var(--x-card); } }
@keyframes g-flash { 0% { background: #BDF0DC; box-shadow: 0 0 0 2px var(--mint); } 100% { background: #F4F1EA; box-shadow: 0 0 0 0 transparent; } }
@keyframes g-rule { 0% { box-shadow: inset 0 0 0 1.5px var(--l-automation), 0 0 18px rgba(127, 216, 184, .45); background: #1E3A33; } 100% { box-shadow: inset 0 0 0 1px rgba(127, 216, 184, .25); background: var(--x-card); } }

/* ───────────────────────────────────────────── reduced motion: instant state changes */
@media (prefers-reduced-motion: reduce) {
  .g-app *:not(.g-timer__fill), .g-app *::before, .g-app *::after, .g-x *, .g-x *::before, .g-x *::after { animation: none !important; transition: none !important; }
}
.g-app[data-reduced='true'] *:not(.g-timer__fill), .g-app[data-reduced='true'] *::before, .g-app[data-reduced='true'] *::after,
.g-x[data-reduced='true'] *, .g-x[data-reduced='true'] *::before, .g-x[data-reduced='true'] *::after { animation: none !important; transition: none !important; }
/* the site's "Pause animation" (html.is-still) pauses every CSS animation in <main> — entrance animations with fill
   'both' would freeze at opacity 0 and hide whole screens, so here it means "no animations" instead */
html.is-still .g-app *:not(.g-timer__fill), html.is-still .g-app *::before, html.is-still .g-app *::after,
html.is-still .g-x *, html.is-still .g-x *::before, html.is-still .g-x *::after { animation: none !important; transition: none !important; }
/* legibility floor for the tiniest mono labels (audit 09-29): nothing under ~10.5 px */
:is(#game, .g-app) .g-kicker, .g-x__eyebrow { font-size: 10.5px; }
.g-pv__label { font-size: 10.5px; }
.g-x__tl { font-size: 10px !important; }
.g-app li > b:first-child { font-size: 10.5px; }
