/* Sophie's game corner (/play and /play/{id}, src/pages/play.mjs). The games themselves are styled
   where they also appear: the city games in city.css, the around-the-world games in main.css. */

/* The hero: Surprise Me! and how many stamps so far ------------------------------------------ */
.phero--play .phero__actions { align-items: center; }
.gcount { display: inline-flex; align-items: center; gap: 0.7rem; min-height: 58px; padding: 0.45rem 1.3rem 0.45rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.62); box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 600; transition: transform 0.45s var(--ease), background 0.3s; }
.gcount:hover { transform: translateY(-2px); background: #fff; }
.gcount__ring { display: grid; place-items: center; width: 44px; height: 44px; border: 2px dashed var(--teal); border-radius: 50%; color: var(--teal); }
.gcount__ring .icon { width: 18px; height: 18px; rotate: -30deg; }
.gcount strong { font-family: var(--font-display); font-size: 1.2em; font-weight: 600; }

/* While Surprise Me! spins through the cities, the label keeps its size. */
[data-surprise].is-spinning { pointer-events: none; }
[data-surprise].is-picked { --btn-bg: var(--teal-deep); }

/* The two lists of games ---------------------------------------------------------------- */
.gpick { padding: clamp(20px, 3vw, 44px) 0 clamp(44px, 6vw, 84px); }
.gpick--world { padding-top: clamp(28px, 4vw, 56px); }
.gpick__head { max-width: 46rem; margin: 0 auto clamp(26px, 4vw, 48px); text-align: center; }
.gpick__head .h2 { margin: 0.8rem 0 0.9rem; font-size: clamp(2.2rem, 4.6vw, 4rem); }

/* A tile for each game: its picture, its city, how to play, and the city's stamp once it's won.
   Rows that don't fill up stay centred. */
.gtiles { --cols: 2; --gap: clamp(14px, 2vw, 26px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .gtiles { --cols: 3; } }
@media (min-width: 1040px) { .gtiles { --cols: 4; } }
@media (min-width: 1240px) { .gtiles { --cols: 5; } }
.gtile { display: flex; flex: 0 0 calc((100% - var(--gap) * (var(--cols) - 1)) / var(--cols)); min-width: 0; }
.gtile__link {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(7px, 0.8vw, 10px);
  border-radius: 26px;
  background: var(--tint, var(--paper-2));
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.55s var(--ease-spring), box-shadow 0.5s var(--ease);
}
.gtile__link:hover, .gtile__link:focus-visible { transform: rotate(0deg) translateY(-6px); box-shadow: var(--shadow); }
.gtile__link:focus-visible { outline-offset: 4px; border-radius: 26px; }
.gtile__link:active { transform: rotate(0deg) translateY(-2px) scale(0.98); }
.gtile__pic { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 19px; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 8px 16px -10px rgba(29, 54, 64, 0.4); }
.gtile__pic > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.gtile__link:hover .gtile__pic > img { transform: scale(1.06); }
.gtile__body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 0.45rem 0.2rem; }
.gtile__city { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tone-ink, var(--teal-deep)); }
.gtile__name { font-family: var(--font-display); font-size: clamp(1.06rem, 1.45vw, 1.3rem); font-weight: 600; font-variation-settings: 'SOFT' 100; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
.gtile__how { font-size: 0.88rem; line-height: 1.42; color: var(--ink-2); }
.gtile__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding: 0.75rem 0.45rem 0.35rem; }
.gtile__play { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1.05rem 0.5rem 0.8rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.92rem; font-weight: 700; transition: background 0.3s, transform 0.45s var(--ease-spring); }
.gtile__link:hover .gtile__play { background: var(--coral-deep); transform: scale(1.06); }
.gtile__tri { flex: none; width: 0.95em; height: 0.95em; fill: currentColor; }
.gtile__stamp { width: clamp(44px, 3.8vw, 54px); }
@media (max-width: 560px) {
  .gtile__link { border-radius: 20px; }
  .gtile__link:focus-visible { border-radius: 20px; }
  .gtile__pic { border-radius: 14px; }
  .gtile__how { display: none; }
  .gtile__body { padding-top: 0.75rem; }
  .gtile__play { padding: 0.42rem 0.85rem 0.42rem 0.65rem; font-size: 0.86rem; }
  .gtile__stamp { width: 40px; }
}
/* The smallest phones: the Play button and the stamp still fit side by side. */
@media (max-width: 360px) {
  .gtile__foot { gap: 0.3rem; padding-inline: 0.3rem; }
  .gtile__play { padding: 0.4rem 0.7rem 0.4rem 0.55rem; }
  .gtile__stamp { width: 34px; }
}

/* A city's stamp, or a dashed ring where it goes until it's won ------------------------------- */
.gslot { position: relative; display: block; flex: none; aspect-ratio: 1; }
.gslot::before { content: ''; position: absolute; inset: 7%; border: 2px dashed color-mix(in srgb, var(--tone) 55%, transparent); border-radius: 50%; transition: opacity 0.3s; }
.gslot .stamp { position: absolute; inset: 0; opacity: 0; transform: rotate(var(--rot)) scale(1.5); transition: opacity 0.25s, transform 0.55s var(--ease-spring); }
.gslot.is-won::before { opacity: 0; }
.gslot.is-won .stamp { opacity: 1; transform: rotate(var(--rot)) scale(1); }

/* The around-the-world tiles' pictures, made from the books' art */
.gart { position: absolute; inset: 0; overflow: hidden; }
.gart--match { background: radial-gradient(circle at 50% 40%, #fffaf0, #fbe7a8); }
.gart--where { background: radial-gradient(circle at 50% 40%, #f5fafe, #cfe5f5); }
.gart--puzzle { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fff6f6, #f5d3d7); }
.gart__card, .gart__cover { position: absolute; top: 50%; left: 50%; transition: transform 0.6s var(--ease-spring); }
.gart__card { display: grid; place-items: center; width: 29%; aspect-ratio: 0.8; padding: 9% 7%; border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.gart__card img { width: 100%; height: 100%; object-fit: contain; }
.gart__card--back {
  color: var(--paper);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.16) 1.2px, transparent 1.6px) 0 0 / 10px 10px,
    var(--teal);
}
.gart__card--back .icon { width: 42%; height: 42%; rotate: -30deg; }
.gart__card--match { background: var(--mint); box-shadow: inset 0 0 0 3px #7cc49b, var(--shadow-sm); }
.gart__card:nth-child(1) { transform: translate(-128%, -48%) rotate(-10deg); }
.gart__card:nth-child(2) { transform: translate(-50%, -54%) rotate(2deg); }
.gart__card:nth-child(3) { transform: translate(28%, -47%) rotate(11deg); }
.gtile__link:hover .gart__card:nth-child(1) { transform: translate(-140%, -50%) rotate(-15deg); }
.gtile__link:hover .gart__card:nth-child(3) { transform: translate(40%, -49%) rotate(16deg); }
.gart__cover { width: 26%; }
.gart__cover img { display: block; width: 100%; height: auto; border-radius: 3px 6px 6px 3px; box-shadow: var(--shadow); }
.gart__cover:nth-child(1) { transform: translate(-142%, -46%) rotate(-9deg); }
.gart__cover:nth-child(2) { z-index: 1; transform: translate(-50%, -54%); }
.gart__cover:nth-child(3) { transform: translate(42%, -46%) rotate(9deg); }
.gtile__link:hover .gart__cover:nth-child(1) { transform: translate(-150%, -48%) rotate(-13deg); }
.gtile__link:hover .gart__cover:nth-child(3) { transform: translate(50%, -48%) rotate(13deg); }
.gart__ask { position: absolute; z-index: 2; top: 9%; right: 9%; display: grid; place-items: center; width: 21%; aspect-ratio: 1; border-radius: 50%; background: var(--coral); color: #fff; font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 2.1rem); font-weight: 700; box-shadow: var(--shadow); rotate: 8deg; transition: rotate 0.6s var(--ease-spring); }
.gtile__link:hover .gart__ask { rotate: -6deg; }
.gart__board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 44%; aspect-ratio: 900 / 1218; padding: 3px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); rotate: -4deg; transition: rotate 0.6s var(--ease-spring); }
.gart__board span { border-radius: 2px; background-image: url(/assets/img/covers/rome-sm.webp); background-size: 300% 300%; }
.gtile__link:hover .gart__board { rotate: 3deg; }

/* The game passport: every city's stamp ------------------------------------------------- */
.gpass { padding: clamp(36px, 5vw, 80px) 0 clamp(20px, 3vw, 40px); }
.gpass__page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(26px, 5vw, 80px);
  padding: clamp(28px, 4.6vw, 66px);
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(135deg, rgba(60, 120, 140, 0.045) 0 2px, transparent 2px 14px), var(--paper-2);
  box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-sm);
}
/* The page's stitched edge, like a real passport's. */
.gpass__page::before { content: ''; position: absolute; inset: 12px; border: 2px dashed var(--line-2); border-radius: calc(var(--radius-lg) - 10px); pointer-events: none; }
.gpass__head .h2 { margin: 0.8rem 0 1rem; font-size: clamp(2.1rem, 4.2vw, 3.6rem); }
.gpass__count { margin-top: 1.4rem; font-weight: 600; color: var(--ink-2); }
.gpass__count strong { margin-right: 0.15rem; font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; color: var(--ink); }
/* Print My Stamps, once a stamp is won: the stamps so far as stickers (src/stickers.mjs) */
.gpass__print { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1rem; margin-top: 1.1rem; }
.gpass__print[hidden] { display: none; }
.gpass__print p { flex: 1 1 12rem; max-width: 21rem; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }
.gpass__print a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .gpass__print { flex-direction: column; } .gpass__print p { flex: none; } }
.gpass__done { display: grid; justify-items: start; gap: 0.5rem; margin-top: 1rem; padding: 0.9rem 1.1rem; border-radius: 16px; background: var(--mint); font-weight: 600; }
@media (max-width: 900px) { .gpass__done { justify-items: center; } }
.gpass__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px) clamp(8px, 1.6vw, 20px); margin: 0; padding: 0; list-style: none; }
.gpass__slot { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; border-radius: 16px; transition: transform 0.45s var(--ease-spring); }
.gpass__slot:hover { transform: translateY(-4px); }
.gpass__stamp { width: 100%; max-width: 112px; }
/* An empty slot shows the city's airport code. */
.gpass__stamp:not(.is-won)::after { content: attr(data-code); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: clamp(0.85rem, 1.5vw, 1.25rem); font-weight: 600; letter-spacing: 0.04em; color: color-mix(in srgb, var(--tone) 60%, var(--paper-2)); }
.gpass__name { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-align: center; text-transform: uppercase; color: var(--ink-3); }
.gpass__note { grid-column: 1 / -1; font-size: 0.86rem; text-align: center; color: var(--ink-3); }
@media (max-width: 900px) {
  .gpass__page { grid-template-columns: minmax(0, 1fr); text-align: center; }
}
@media (max-width: 480px) {
  .gpass__grid { gap: 14px 6px; }
  .gpass__name { font-size: 0.6rem; letter-spacing: 0.04em; }
}

/* A game's own page ------------------------------------------------------------------- */
/* Below the floating navigation, then straight into the game. */
.gtop { padding-top: 100px; background: linear-gradient(180deg, #cde5f6 0%, #e6f1f9 50%, var(--paper) 100%); }
.gtop__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.4rem; padding-block: 1rem 0.2rem; }
.gtop__back { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.15rem 0.6rem 0.9rem; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); font-weight: 700; transition: transform 0.4s var(--ease), box-shadow 0.4s; }
.gtop__back:hover { transform: translateX(-3px); box-shadow: var(--shadow); }
.gtop__stamp { display: inline-flex; align-items: center; gap: 0.7rem; margin: 0; font-weight: 600; color: var(--ink-2); }
.gtop__slot { width: 54px; }
.page-game .ccoin { padding-top: clamp(20px, 3vw, 44px); }
.page-game .games { padding-block: clamp(18px, 2.6vw, 36px) 0; }
.page-game .game__head { margin-bottom: 1.6rem; }
.quiz__end h2 { margin: 0.8rem 0; font-size: clamp(1.6rem, 3vw, 2.4rem); }
@media (max-width: 560px) {
  .gtop__stamp { font-size: 0.9rem; }
  .gtop__slot { width: 44px; }
}

/* More games */
.gmore { padding: clamp(56px, 8vw, 120px) 0; }
.gmore__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(24px, 3vw, 40px); }
.gmore__head .h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.gmore__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.gmore .gtiles { --cols: 2; }
@media (min-width: 960px) { .gmore .gtiles { --cols: 4; } }

/* The book the game comes from */
.gfrom { padding: 0 0 var(--section); }
.gfrom__inner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding: clamp(28px, 4.6vw, 64px); border-radius: var(--radius-lg); background: var(--tint); }
.gfrom__cover { display: block; width: clamp(130px, 16vw, 210px); transform: rotate(-4deg); transition: transform 0.6s var(--ease-spring); }
.gfrom__cover img { display: block; width: 100%; height: auto; border-radius: 4px 9px 9px 4px; box-shadow: var(--shadow-book); }
.gfrom__inner:hover .gfrom__cover { transform: rotate(-1deg) translateY(-4px); }
.gfrom__copy .eyebrow { color: var(--tone-ink); }
.gfrom__copy .h2 { margin: 0.8rem 0 1rem; font-size: clamp(2rem, 4vw, 3.4rem); }
.gfrom__copy .h2 em { color: var(--tone-ink); }
.gfrom__copy .lead { max-width: 40rem; }
.gfrom__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
@media (max-width: 640px) {
  .gfrom__inner { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .gfrom__actions { justify-content: center; }
}

/* "You won the … stamp!" — pops up as a round ends, the first time */
.stoast { position: fixed; z-index: 1100; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: min(460px, calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)))); translate: -50% 0; }
.stoast__card { position: relative; display: flex; align-items: center; gap: 1rem; padding: 0.9rem 3.2rem 0.9rem 0.9rem; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow-lg), inset 0 0 0 1.5px var(--line); }
.stoast__stamp { width: 88px; }
.stoast__copy { min-width: 0; }
.stoast__title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }
.stoast__count { margin: 0.25rem 0 0.5rem; font-size: 0.95rem; color: var(--ink-2); }
.stoast__close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink-2); transition: background 0.3s; }
.stoast__close:hover { background: var(--paper-2); }
html.motion .stoast.is-on .stoast__card { animation: stoast-in 0.6s var(--ease-spring) both; }
html.motion .stoast.is-on .stoast__stamp .stamp { animation: stoast-thump 0.62s 0.28s var(--ease-spring) both; }
html.motion .stoast.is-leaving .stoast__card { animation: stoast-out 0.38s var(--ease) both; }
@keyframes stoast-in { from { opacity: 0; transform: translateY(40px) scale(0.9); } }
@keyframes stoast-thump {
  from { opacity: 0; transform: rotate(calc(var(--rot) - 25deg)) scale(2.4); }
  55% { opacity: 1; }
  to { opacity: 1; transform: rotate(var(--rot)) scale(1); }
}
@keyframes stoast-out { to { opacity: 0; transform: translateY(30px) scale(0.95); } }
@media (max-width: 420px) {
  .stoast__stamp { width: 70px; }
  .stoast__title { font-size: 1.12rem; }
}

/* ===================== Levels, and three new games (2026-11-07) ===================== */

/* Tiles: "New" and "Levels" ribbons, and the stars won so far */
.gtile__new { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--coral); color: #fff; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; box-shadow: var(--shadow-sm); rotate: -4deg; }
.gtile__new--levels { background: var(--ink); }
.gtile__stars { font-size: 0.78rem; font-weight: 700; color: var(--ink-2); }
.gtile__got { color: var(--coral-deep); letter-spacing: 0.06em; }

/* A game's levels: pick one, see the stars each needs, and the stars won */
.glevels { display: grid; gap: 0.45rem; margin: 0.2rem 0 1.1rem; }
.glevels__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.glevel { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0.45rem 0.95rem; border-radius: 999px; background: #fff; color: var(--ink); font-size: 0.9rem; font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: background 0.25s, color 0.25s, transform 0.35s var(--ease-spring); }
.glevel:hover:not([aria-disabled='true']) { transform: translateY(-2px); }
.glevel.is-on { background: var(--ink); color: var(--paper); box-shadow: none; }
.glevel[aria-disabled='true']:not(.is-on) { opacity: 0.5; cursor: not-allowed; }
.glevel__stars { color: var(--coral-deep); letter-spacing: 0.04em; }
.glevel.is-on .glevel__stars { color: var(--butter); }
.glevels__goal { font-size: 0.86rem; color: var(--ink-2); }
.glevels__result { min-height: 1.5em; font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.2; color: var(--teal-deep); }
.glevels__result strong { font-family: var(--font-body); font-size: 0.95rem; color: var(--coral-deep); }
.glevels__got { color: var(--coral); letter-spacing: 0.08em; }
.glevel__stars .is-empty, .gtile__got .is-empty, .glevels__got .is-empty { opacity: 0.4; }
html.motion .glevels__result.is-pop { animation: glevels-pop 0.6s var(--ease-spring); }
@keyframes glevels-pop { from { opacity: 0; transform: scale(0.7); } }
@media (max-width: 900px) { .glevels__row { justify-content: center; } }
/* Phones: the three levels on one line */
@media (max-width: 420px) {
  .glevels__row { gap: 0.4rem; }
  .glevel { gap: 0.3rem; padding-inline: 0.68rem; font-size: 0.82rem; }
}

/* Boston's scoreboard has a third box here (Best): room for "Home runs", and the numbers in line */
.cbat .cbat__board div { display: flex; flex-direction: column; justify-content: space-between; padding-inline: 0.5rem; }

/* Rome's levels: a gold wish spot in the pool, and the ring that slides across it (city.js) */
.ccoin__stage.is-aiming { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ccoin__wish, .ccoin__aim { position: absolute; top: 55%; left: var(--x, 50%); translate: -50% -50%; border-radius: 50%; pointer-events: none; transition: opacity 0.4s; }
/* (The gold rim is where a coin still counts.) */
.ccoin__wish { width: calc(var(--half, 0.14) * 200%); height: 80%; background: radial-gradient(closest-side, #fffbe6 0 16%, rgba(250, 204, 64, 0.95) 46%, rgba(245, 190, 40, 0.6) 82%, rgba(245, 190, 40, 0.25) 100%); box-shadow: 0 0 0 2.5px rgba(255, 233, 150, 0.95), 0 0 16px 5px rgba(255, 210, 80, 0.55); }
.ccoin__wish::after { content: '✦'; position: absolute; left: 50%; top: 50%; translate: -50% -55%; color: #fff; font-size: clamp(13px, 1.8vw, 20px); line-height: 1; text-shadow: 0 0 8px rgba(255, 214, 90, 0.95); }
html.motion .ccoin__wish { animation: wish-glow 1.3s ease-in-out infinite alternate; }
@keyframes wish-glow { from { scale: 0.9; } to { scale: 1.06; } }
.ccoin__aim { z-index: 2; width: clamp(28px, 10%, 56px); height: 70%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(29, 54, 64, 0.4), inset 0 0 0 2px rgba(29, 54, 64, 0.25); }
.ccoin__aim::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(29, 54, 64, 0.35); }
.ccoin__stage.is-wished .ccoin__wish, .ccoin__stage.is-wished .ccoin__aim { opacity: 0; }
.ccoin__glint { position: absolute; z-index: 5; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #ffe58a; box-shadow: 0 0 6px 2px rgba(255, 214, 90, 0.85); pointer-events: none; animation: coin-glint 0.85s var(--ease) forwards; }
@keyframes coin-glint { to { translate: var(--dx) var(--dy); scale: 0.2; opacity: 0; } }

/* ---------------- Picture hunt ---------------- */
.hunt__play { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
.hunt__pic { position: relative; isolation: isolate; overflow: hidden; border: clamp(5px, 0.7vw, 9px) solid #fff; border-radius: 20px; background: var(--paper-2); box-shadow: var(--shadow-lg); cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.hunt__img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.hunt__thing { position: absolute; display: block; padding: 0; transform: rotate(var(--r, 0deg)); cursor: pointer; transition: transform 0.4s var(--ease-spring); }
/* A bigger target than the picture itself, for small fingers. */
.hunt__thing::before { content: ''; position: absolute; inset: -22%; }
.hunt__thing img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hunt__pic.is-blend .hunt__thing:not(.is-found) { mix-blend-mode: multiply; }
.hunt__thing.is-found { z-index: 2; transform: rotate(0deg) scale(1.12); cursor: default; }
.hunt__thing.is-found::after { content: ''; position: absolute; inset: -14%; border: 4px solid var(--coral); border-radius: 50%; box-shadow: 0 0 0 3px #fff; }
.hunt__thing.is-hint::after { content: ''; position: absolute; inset: -30%; border: 4px dashed var(--butter); border-radius: 50%; animation: hunt-hint 1.8s var(--ease) both; }
@keyframes hunt-hint { 0%, 100% { opacity: 0; scale: 1.6; } 20%, 80% { opacity: 1; scale: 1; } }
.hunt__miss { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid rgba(255, 255, 255, 0.95); border-radius: 50%; pointer-events: none; animation: hunt-miss 0.7s var(--ease) forwards; }
@keyframes hunt-miss { from { opacity: 1; scale: 0.4; } to { opacity: 0; scale: 1.5; } }
.hunt__side { display: flex; flex-direction: column; gap: 1rem; }
.hunt__round { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-deep); }
.hunt__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.hunt__want { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.7rem 0.45rem 0.45rem; border-radius: 14px; background: #fff; font-weight: 600; font-size: 0.92rem; line-height: 1.2; box-shadow: var(--shadow-sm); transition: background 0.3s, opacity 0.3s; }
.hunt__chip { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--paper-2); }
.hunt__chip img { max-width: 36px; max-height: 36px; object-fit: contain; }
.hunt__want.is-found { background: var(--mint); text-decoration: line-through; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.hunt__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hunt__count { font-size: 0.88rem; color: var(--ink-2); }
.hunt__count strong, .paint__count strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
@media (max-width: 860px) {
  .hunt__play { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .hunt__want { font-size: 0.84rem; }
  .hunt__chip { width: 38px; height: 38px; }
}

/* ---------------- Magic paintbrush ---------------- */
.paint__play { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: start; }
.paint__pic { --ar: 1.48; position: relative; justify-self: center; width: min(100%, calc(70svh * var(--ar))); aspect-ratio: var(--ar); overflow: hidden; border: clamp(5px, 0.7vw, 9px) solid #fff; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); }
.paint__painted { display: block; width: 100%; height: 100%; object-fit: cover; }
.paint__pic.is-loading .paint__painted { visibility: hidden; }
.paint__sketch { position: absolute; inset: 0; width: 100%; height: 100%; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='15' fill='none' stroke='%231d3640' stroke-width='2.5'/%3E%3Ccircle cx='18' cy='18' r='2.5' fill='%23e5604f'/%3E%3C/svg%3E") 18 18, crosshair; touch-action: none; transition: opacity 0.9s var(--ease); }
.paint__sketch.is-done { opacity: 0; pointer-events: none; }
.paint__side { display: flex; flex-direction: column; gap: 1rem; }
.paint__meter { display: grid; gap: 0.4rem; font-weight: 600; color: var(--ink-2); }
.paint__meter strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }
.paint__bar { display: block; height: 14px; overflow: hidden; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.paint__bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f7b7c8, #fbe3a3, #bfe3b4, #a9d8ef, #d9c8f2); transition: width 0.25s; }
.paint__caption { padding: 0.8rem 1rem; border-radius: 14px; background: #fff; font-size: 0.95rem; line-height: 1.5; box-shadow: var(--shadow-sm); }
.paint__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.paint__count { font-size: 0.88rem; color: var(--ink-2); }
.paint__spark { position: fixed; z-index: 3000; width: 10px; height: 10px; margin: -5px; border-radius: 50%; pointer-events: none; animation: paint-spark 0.75s ease-out forwards; }
@keyframes paint-spark { to { translate: var(--dx) var(--dy); scale: 0; opacity: 0.4; } }
@media (max-width: 860px) {
  .paint__play { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- Nesting dolls ---------------- */
.dolls__play { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem); align-items: center; }
.dolls__stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: clamp(5px, 0.7vw, 9px) solid #fff; border-radius: 20px; background: #fbeef0; box-shadow: var(--shadow-lg); }
.dolls__back { position: absolute; inset: 0; opacity: 0.3; }
.dolls__back img { width: 100%; height: 100%; object-fit: cover; }
.dolls__shelf { position: absolute; left: 3%; right: 3%; bottom: 13%; height: 5%; border-radius: 8px; background: linear-gradient(180deg, #c48b57, #9a6438); box-shadow: 0 7px 0 #74482a, 0 14px 18px -8px rgba(29, 54, 64, 0.4); }
.dolls__row { position: absolute; z-index: 1; left: 4%; right: 4%; bottom: 18%; display: flex; align-items: flex-end; justify-content: center; gap: 1.2%; }
.doll { position: relative; flex: none; height: calc(var(--h, 120px) * var(--s, 1)); aspect-ratio: 548 / 667; padding: 0; transform-origin: 50% 100%; transition: transform 0.4s var(--ease-spring); }
.doll img { display: block; width: 100%; height: 100%; object-fit: contain; filter: hue-rotate(var(--hue, 0deg)) drop-shadow(0 4px 3px rgba(29, 54, 64, 0.25)); pointer-events: none; }
.doll:hover:not(.is-lined) { transform: translateY(-6%) rotate(-3deg); }
.doll.is-lined::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: -9%; height: 6%; border-radius: 999px; background: var(--coral); }
.doll.is-wrong { animation: shake 0.5s var(--ease); }
.doll.is-gulp { animation: doll-gulp 0.45s var(--ease-spring); }
.doll.is-happy { animation: doll-happy 0.9s var(--ease-spring) 2; }
.doll.is-nested { visibility: hidden; }
html.motion .dolls__row.is-dealt .doll { animation: doll-in 0.6s var(--ease-spring) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes doll-in { from { opacity: 0; transform: translateY(-40%) rotate(-12deg); } }
@keyframes doll-gulp { 40% { transform: scaleX(1.12) scaleY(0.9); } }
@keyframes doll-happy { 30% { transform: translateY(-14%) rotate(-6deg); } 60% { transform: translateY(-6%) rotate(5deg); } }
.dolls__side { display: flex; flex-direction: column; gap: 0.9rem; }
.dolls__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 860px) {
  .dolls__play { grid-template-columns: minmax(0, 1fr); }
  .dolls__side { text-align: center; align-items: center; }
}
