/* Owanly picture games. Builds on home.css tokens. */

.games { padding: clamp(28px, 4vw, 56px) 0 clamp(64px, 8vw, 110px); }
.games__grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.games__grid > * { min-width: 0; }

/* ── Side: title, modes, topics ── */
.games__side { position: sticky; top: 100px; }
.games__side h1 { font: 500 clamp(40px, 4.4vw, 60px)/1 var(--display); letter-spacing: -.035em; margin: 0 0 12px; }
.games__side h1 em { font-style: italic; font-weight: 400; }
.games__side > p { color: var(--muted); margin: 0 0 28px; }
.modes { display: grid; gap: 10px; margin-bottom: 30px; }
.mode { display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; align-items: center; text-align: left; padding: 14px 16px; border: 0; border-radius: 20px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font: inherit; color: var(--ink); transition: box-shadow .2s, transform .2s var(--ease), background .2s; }
.mode:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -20px rgba(0, 0, 0, .35); }
.mode[aria-pressed="true"] { background: var(--ink); color: var(--white); box-shadow: none; }
.mode__icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--paper-2); }
.mode__icon svg { width: 22px; height: 22px; }
.mode[aria-pressed="true"] .mode__icon { background: var(--saffron); color: var(--ink); }
.mode b { font-size: 16px; }
.mode small { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.mode[aria-pressed="true"] small { color: var(--on-ink-muted); }
.mode__best { justify-self: end; }
.topics__label { font: 700 12px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); font: 600 14px var(--body); color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.topic:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.topic[aria-pressed="true"] { background: var(--ink); color: var(--white); box-shadow: none; }

/* ── Stage ── */
.stage { background: var(--white); border-radius: 36px; padding: clamp(18px, 2.6vw, 30px); box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .4), inset 0 0 0 1px var(--line); min-height: 620px; display: flex; flex-direction: column; }
.stage__top { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.bar10 { flex: 1; display: flex; gap: 5px; }
.bar10 i { flex: 1; height: 6px; border-radius: 4px; background: var(--line); transition: background .3s; }
.bar10 i.ok { background: var(--ink); }
.bar10 i.no { background: #D9826F; }
.bar10 i.now { background: var(--saffron); }
.streak { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.streak b { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--paper-2); font-size: 14px; transition: background .3s, transform .3s var(--ease); }
.streak.hot b { background: var(--saffron); transform: scale(1.08); }

.prompt { text-align: center; padding: 16px 0 18px; }
.prompt__ask { font: 700 12.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.prompt__word { font: italic 500 clamp(52px, 6vw, 84px)/1 var(--display); letter-spacing: -.035em; margin: 0; animation: pop .5s var(--ease); }
.prompt__en { margin: 10px 0 0; color: var(--muted); font-weight: 600; min-height: 1.6em; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* Find the picture: four tiles */
.tiles4 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.4vw, 14px); width: min(100%, 520px, calc((100svh - 330px) * 1.2)); min-width: min(100%, 300px); margin: auto auto 0; }
.pic { position: relative; aspect-ratio: 1 / .82; border: 0; border-radius: 26px; cursor: pointer; display: grid; place-items: center; padding: 0; background: var(--tint, var(--paper-2));
  transition: transform .25s var(--ease), box-shadow .25s, opacity .35s, filter .35s; animation: tile-in .55s var(--ease) both; animation-delay: calc(var(--n) * 60ms); }
.pic:nth-child(1) { --tint: #FFF1C4; } .pic:nth-child(2) { --tint: #E4EEE1; } .pic:nth-child(3) { --tint: #F7E4D8; } .pic:nth-child(4) { --tint: #E2EBF4; }
.pic img { width: 58%; height: 58%; object-fit: contain; pointer-events: none; transition: transform .35s var(--ease); }
.pic:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 18px 34px -22px rgba(0, 0, 0, .45); }
.pic:hover:not(:disabled) img { transform: scale(1.06); }
.pic:disabled { cursor: default; }
.pic__cap { position: absolute; left: 0; right: 0; bottom: 10px; font: 700 14px var(--body); color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease); }
.pic__key { position: absolute; top: 12px; left: 14px; font: 700 12px var(--body); color: rgba(29, 29, 31, .35); }
.answered .pic__cap { opacity: 1; transform: none; }
.answered .pic:not(.is-right):not(.is-wrong) { opacity: .45; filter: saturate(.6); }
@keyframes tile-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.is-right { box-shadow: inset 0 0 0 3px var(--ink) !important; }
.is-right::after { content: "✓"; position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--saffron); color: var(--ink); font: 800 15px var(--body); animation: badge .4s var(--ease); }
.is-wrong { box-shadow: inset 0 0 0 3px #C2412D !important; animation: nope .4s !important; }
@keyframes badge { from { transform: scale(.4); opacity: 0; } }
@keyframes nope { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* Name it: one picture, four words */
.hero-pic { width: min(100%, 340px); aspect-ratio: 1 / .78; margin: 6px auto 22px; border-radius: 30px; background: #FFF1C4; display: grid; place-items: center; animation: pop .5s var(--ease); }
.hero-pic img { width: 56%; height: 70%; object-fit: contain; }
.words4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 560px); margin: auto auto 0; }
.wordbtn { position: relative; height: 76px; border: 0; border-radius: 20px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; color: var(--ink);
  font: italic 500 28px/1 var(--display); letter-spacing: -.02em; transition: box-shadow .2s, transform .2s var(--ease), opacity .3s; animation: tile-in .5s var(--ease) both; animation-delay: calc(var(--n) * 50ms); }
.wordbtn small { display: block; font: 600 12.5px var(--body); color: var(--muted); letter-spacing: 0; margin-top: 4px; height: 0; opacity: 0; transition: opacity .3s; }
.answered .wordbtn small { height: auto; opacity: 1; }
.wordbtn:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-2px); }
.wordbtn:disabled { cursor: default; }
.answered .wordbtn:not(.is-right):not(.is-wrong) { opacity: .45; }
.wordbtn.is-right { background: #FFF6D6; }
.wordbtn.is-right::after { top: 50%; margin-top: -16px; right: 14px; }
.wordbtn.is-wrong { background: #FBE9E5; }

/* Spell it */
.slots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 26px; }
.slot { width: 56px; height: 66px; border-radius: 16px; display: grid; place-items: center; font: italic 500 32px/1 var(--display); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .25s, box-shadow .25s; }
.slot.next { box-shadow: inset 0 0 0 2px var(--saffron-2); animation: breathe 1.4s ease-in-out infinite; }
.slot.filled { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); animation: drop .3s var(--ease); }
.spelled .slot.filled { background: var(--saffron); box-shadow: none; }
@keyframes breathe { 50% { box-shadow: inset 0 0 0 2px transparent; } }
@keyframes drop { from { transform: translateY(-10px) scale(1.1); } }
.bank { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; width: min(100%, 560px); margin: auto auto 0; }
.key { width: 60px; height: 60px; border: 0; border-radius: 16px; background: var(--ink); color: var(--white); font: 700 22px var(--body); cursor: pointer; transition: transform .2s var(--ease), opacity .25s, background .2s; animation: tile-in .45s var(--ease) both; animation-delay: calc(var(--n) * 35ms); }
.key:hover:not(:disabled) { transform: translateY(-2px); }
.key:disabled { opacity: .12; cursor: default; }
.key.is-wrong { background: #C2412D; box-shadow: none !important; }
.spell__skip { display: block; margin: 18px auto 0; background: none; border: 0; font: 700 14px var(--body); color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

/* ── Round over ── */
.done { text-align: center; padding: 24px 0 8px; animation: pop .5s var(--ease); }
.done__score { font: 500 clamp(80px, 11vw, 140px)/.9 var(--display); letter-spacing: -.05em; margin: 10px 0 8px; }
.done__score span { font-style: italic; font-weight: 400; color: var(--muted); font-size: .45em; letter-spacing: -.02em; }
.done__line { color: var(--muted); font-weight: 600; margin: 0 0 30px; }
.review { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0 0 32px; text-align: center; }
.review div { border-radius: 18px; background: var(--paper); padding: 12px 6px 10px; position: relative; }
.review img { width: 48px; height: 48px; object-fit: contain; margin: 0 auto 6px; }
.review b { display: block; font: italic 500 19px/1.1 var(--display); }
.review small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.review .missed { background: #FBE9E5; }
.review .missed::before { content: "Missed"; position: absolute; top: 6px; right: 8px; font: 700 9.5px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #9A2F1F; }
.done__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.games__note { margin: 18px 4px 0; font-size: 14px; color: var(--muted); }
.games__note a { font-weight: 700; }

@media (max-width: 960px) {
  .games__grid { grid-template-columns: 1fr; }
  .games__side { position: static; }
  .games__side > p { margin-bottom: 18px; }
  .modes { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .mode { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 12px 8px; gap: 6px; }
  .mode__icon { grid-row: auto; width: 38px; height: 38px; }
  .mode small, .mode__best { display: none; }
  .mode b { font-size: 13px; line-height: 1.2; }
  .games__side h1 { font-size: 38px; }
  .topics__label { display: none; }
  .topics { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .topic { flex: none; }
  .stage { min-height: 0; border-radius: 28px; }
  .review { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .wordbtn { height: 66px; font-size: 24px; }
  .slot { width: 46px; height: 56px; font-size: 27px; }
  .key { width: 52px; height: 54px; font-size: 20px; }
  .prompt { padding: 14px 0 16px; }
}
