/* Playable games, styled after the Verb Blitz apps (grouped grey background, white rounded cards,
   small-caps labels, per-language accent). Loaded on /play/ only; relies on tokens from site.css. */

.game-shell { max-width: 520px; margin: 0 auto; }

.game {
  /* app palette */
  --g-bg: #f2f2f7;
  --g-card: #ffffff;
  --g-ink: #000000;
  --g-soft: #8a8a8e;
  --g-line: #e5e5ea;
  --g-chip: #ffffff;
  --g-good: #1f8a3b;
  --g-good-bg: #d9efe0;
  --g-bad: #c62828;
  --g-bad-bg: #fbe0e0;
  /* per-language accent (flag-inspired), set by play.js: --g-base = main, --g-b = secondary stripe */
  --g-base: #a8131c; --g-b: #f2c200;
  --g-a: var(--g-base);
  --g-tint: color-mix(in srgb, var(--g-a) 12%, var(--g-card));

  position: relative;
  background: var(--g-bg);
  color: var(--g-ink);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 640px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .game {
    --g-bg: #000000; --g-card: #1c1c1e; --g-ink: #ffffff; --g-soft: #98989f; --g-line: #38383a; --g-chip: #1c1c1e;
    --g-good: #5bd67e; --g-good-bg: #12351d; --g-bad: #ff7b72; --g-bad-bg: #3d1717;
    --g-a: color-mix(in srgb, var(--g-base) 55%, #fff);
  }
  :root:not([data-theme="light"])   :root:not([data-theme="light"])   :root:not([data-theme="light"])   :root:not([data-theme="light"])   /* bright dark-mode accents need dark text on filled controls */
  :root:not([data-theme="light"]) .game .go,
  :root:not([data-theme="light"]) .game .chip[aria-checked="true"] { color: #000; }
  :root:not([data-theme="light"]) .game .go--ghost { color: var(--g-a); }
}

:where(.game button) { font: inherit; color: inherit; }
.screen { padding: 1.5rem 1.25rem 1.75rem; display: flex; flex-direction: column; min-height: 640px; }
.label { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--g-soft); }
.card { background: var(--g-card); border: 1px solid var(--g-line); border-radius: 22px; }

/* ---------- Menu ---------- */
.app-head { margin-bottom: 1.1rem; }
.app-eyebrow { display: flex; align-items: center; gap: .6rem; }
.app-title { margin: .25rem 0 0; font-family: var(--font); font-size: clamp(2.2rem, 9vw, 2.8rem); font-weight: 800; color: var(--g-ink); letter-spacing: -.02em; line-height: 1.1; }


.votm { display: flex; align-items: stretch; gap: 1rem; width: 100%; text-align: left; padding: 1rem 1.1rem; cursor: pointer; margin-bottom: 1.5rem; }
.votm .bar { width: 5px; border-radius: 3px; background: linear-gradient(to bottom, var(--g-a) 50%, var(--g-b) 50%); flex: none; }
.votm .body { flex: 1; min-width: 0; }
.votm .verb { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin: .2rem 0 .1rem; }
.votm .gloss { display: block; font-size: 1.15rem; font-weight: 600; color: var(--g-soft); }
.chev { align-self: center; color: var(--g-soft); flex: none; width: 20px; height: 20px; }

.list { overflow: hidden; margin-top: .6rem; }
.row { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; background: none; border: 0; padding: .85rem 1rem; cursor: pointer; }
.row + .row { border-top: 1px solid var(--g-line); }
.row:hover { background: var(--g-tint); }
.tile { width: 46px; height: 46px; border-radius: 12px; background: var(--g-tint); color: var(--g-a); display: grid; place-items: center; flex: none; }
.tile svg { width: 24px; height: 24px; }
.row .t { flex: 1; min-width: 0; }
.row strong { display: block; font-size: 1.12rem; line-height: 1.25; }
.row .s { display: block; color: var(--g-soft); font-size: .98rem; }
.menu-foot { margin-top: auto; padding-top: 1.5rem; text-align: center; color: var(--g-soft); font-size: .9rem; }

/* ---------- Top bar & progress (shared by game screens) ---------- */
.g-top { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; margin-bottom: 1rem; }
.back { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--g-line); background: var(--g-tint); color: var(--g-a); display: grid; place-items: center; cursor: pointer; }
.back svg { width: 22px; height: 22px; }
.g-title { margin: 0; text-align: center; font-family: var(--font); font-size: 1.12rem; font-weight: 700; color: var(--g-ink); }
.g-count { text-align: right; color: var(--g-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.g-bar { height: 8px; border-radius: 4px; background: var(--g-line); overflow: hidden; }
.g-bar i { display: block; height: 100%; border-radius: 4px; background: var(--g-a); transition: width .3s ease; }
.g-stats { display: flex; justify-content: space-between; align-items: baseline; margin: .8rem 0 1rem; }
.g-stats strong { color: var(--g-a); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.g-clock { color: var(--g-soft); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.prompt { text-align: center; padding: 1.4rem 1rem 1.3rem; margin-bottom: 1rem; }
.prompt .q-en { margin: .8rem 0 .5rem; font-size: clamp(1.45rem, 6vw, 1.85rem); font-weight: 800; line-height: 1.2; }
.prompt .q-pron { margin: 0; font-size: clamp(1.35rem, 5.5vw, 1.7rem); color: var(--g-soft); font-weight: 400; }
.blank { display: inline-block; width: 4.2ch; border-bottom: 2px solid var(--g-soft); margin-left: .35em; transform: translateY(-.12em); }

/* ---------- Conjugation Quiz options ---------- */
.opts { display: grid; gap: .8rem; flex: 1; align-content: start; }
.opt { position: relative; background: var(--g-card); border: 1px solid var(--g-line); border-radius: 22px; min-height: 76px; padding: .9rem 3rem; font-size: clamp(1.3rem, 5.5vw, 1.6rem); font-weight: 700; cursor: pointer; text-align: center; transition: background .15s, border-color .15s, color .15s, opacity .15s; }
.opt:hover { border-color: var(--g-a); }
.opt:focus-visible { outline: 3px solid var(--g-a); outline-offset: 2px; }
.opts.is-done .opt { cursor: default; color: var(--g-soft); opacity: .65; background: var(--g-bg); }
.opts.is-done .opt:hover { border-color: var(--g-line); }
.opts.is-done .opt.is-right { opacity: 1; background: var(--g-good-bg); border: 2.5px solid var(--g-good); color: var(--g-good); }
.opts.is-done .opt.is-wrong { opacity: 1; background: var(--g-bad-bg); border: 2.5px solid var(--g-bad); color: var(--g-bad); }
.opt.is-right::after, .opt.is-wrong::after { position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; }
.opt.is-right::after { content: "✓"; }
.opt.is-wrong::after { content: "✕"; }

/* ---------- Gapfill ---------- */
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1rem 0 .2rem; }
.slot { width: 46px; height: 54px; border-radius: 12px; border: 2px solid var(--g-line); background: var(--g-bg); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }
.slot.is-next { border-color: var(--g-a); background: var(--g-card); }
.slot.is-filled { border-color: var(--g-good); background: var(--g-good-bg); color: var(--g-good); }
.tiles-label { text-align: center; margin: 1rem 0 .9rem; font-weight: 700; color: var(--g-soft); font-size: 1.05rem; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.ltile { width: 62px; height: 62px; border-radius: 16px; border: 1px solid var(--g-line); background: var(--g-card); font-size: 1.7rem; font-weight: 800; cursor: pointer; transition: transform .1s; }
.ltile:hover { border-color: var(--g-a); }
.ltile:active { transform: scale(.94); }
.ltile.is-used { visibility: hidden; }
.ltile.shake, .slot.shake { animation: shake .35s; border-color: var(--g-bad); background: var(--g-bad-bg); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Feedback + Next ---------- */
.g-foot { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; }
.fb { font-weight: 700; font-size: 1.05rem; }
.fb.good { color: var(--g-good); }
.fb.bad { color: var(--g-bad); }
.go { background: var(--g-a); color: #fff; border: 0; border-radius: 999px; padding: .8rem 1.5rem; font-weight: 700; cursor: pointer; margin-left: auto; }
.go:hover { filter: brightness(1.1); }
.go--ghost { background: transparent; color: var(--g-a); border: 1.5px solid var(--g-line); }

/* ---------- Results ---------- */
.result { text-align: center; }
.result .big { display: block; font-size: 4.6rem; font-weight: 900; color: var(--g-a); line-height: 1; margin-top: .4rem; }
.result .of { color: var(--g-soft); font-weight: 600; font-size: 1.3rem; }
.result h2 { margin: .2rem 0 0; font-family: var(--font); font-size: 2rem; font-weight: 800; color: var(--g-ink); }
.result .meta { color: var(--g-soft); font-weight: 600; margin: .5rem 0 1.4rem; }
.review { text-align: left; margin: 0 0 1.4rem; overflow: hidden; }
.review h3 { margin: 0; padding: .9rem 1rem .2rem; font-family: var(--font); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--g-soft); }
.review ul { list-style: none; margin: 0; padding: 0; }
.review li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; padding: .7rem 1rem; border-top: 1px solid var(--g-line); }
.review li:first-of-type { border-top: 0; }
.review .vb { font-weight: 700; }
.review .en { color: var(--g-soft); flex: 1; }
.review .ans { color: var(--g-good); font-weight: 700; }
.perfect { color: var(--g-good); font-weight: 700; margin: 0 0 1.4rem; }
.result-actions { display: grid; gap: .7rem; }
.result-actions .go { margin: 0; padding: 1rem 1.5rem; }
.result-cta { margin-top: 1.5rem; color: var(--g-soft); font-size: .93rem; }
.result-cta a { color: var(--g-a); font-weight: 700; }

/* ---------- Verb card (reference) ---------- */
.vcard { padding: 1.25rem 1.1rem 1rem; margin-bottom: 1rem; }
.vcard h2 { margin: 0; font-family: var(--font); font-size: 2.2rem; font-weight: 800; color: var(--g-ink); }
.vcard .gl { margin: .1rem 0 1rem; color: var(--g-soft); font-size: 1.15rem; }
.vcard table { width: 100%; border-collapse: collapse; }
.vcard td { padding: .55rem 0; border-top: 1px solid var(--g-line); font-size: 1.15rem; }
.vcard td:first-child { text-align: right; color: var(--g-soft); width: 42%; padding-right: 1rem; }
.vcard td:last-child { font-weight: 600; }
.vcard .tense { margin: 0 0 .1rem; font-weight: 800; font-size: 1.05rem; }
.vcard .tg { margin: 0 0 .5rem; color: var(--g-soft); font-style: italic; }

@media (prefers-reduced-motion: reduce) { .shake { animation: none !important; } }
@media (max-width: 420px) { .slot { width: 40px; height: 48px; } .ltile { width: 56px; height: 56px; } }

/* ---------- Language row and picker ---------- */
.langrow { display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: .7rem 1rem; cursor: pointer; margin-bottom: .9rem; }
.langrow:hover { border-color: var(--g-a); }
.langrow img, .langopt img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.langrow .body { flex: 1; min-width: 0; display: block; }
.langrow .name { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.langrow .count { color: var(--g-soft); font-size: .85rem; white-space: nowrap; }
.langgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.langopt { display: flex; align-items: center; gap: .7rem; background: var(--g-card); border: 1.5px solid var(--g-line); border-radius: 16px; padding: .5rem .8rem .5rem .5rem; font-weight: 700; cursor: pointer; text-align: left; min-width: 0; }
.langopt:hover { border-color: var(--g-a); }
.langopt[aria-checked="true"] { border-color: var(--g-a); background: var(--g-tint); }
.langopt span { line-height: 1.2; min-width: 0; }
.langopt .tick { margin-left: auto; width: 20px; height: 20px; flex: none; color: var(--g-a); }

/* ---------- Gapfill: punctuation slots and long phrases ---------- */
.slot.is-fixed { width: 16px; border: 0; background: none; color: var(--g-soft); }
.slot.is-space { width: 14px; border: 0; background: none; }
.slots--sm .slot { width: 36px; height: 44px; font-size: 1.35rem; }
.slots--sm .slot.is-fixed { width: 14px; }
.slots--sm .slot.is-space { width: 10px; }
.slots { row-gap: .6rem; }

@media (max-width: 480px) {
  .langgrid { gap: .5rem; }
  .langopt { gap: .5rem; padding: .45rem .5rem; font-size: .95rem; }
  .langopt img { width: 34px; height: 34px; border-radius: 9px; }
  .langopt .tick { display: none; } /* selection is shown by the accent border and tint */
}
