/* Keep It Lit (Bible word game). Same look as the quiz: cream paper, white cards with a thick bottom edge, gold = tap me, green = good. */
.lit { max-width: 560px; margin: 0 auto; }
.lt-card { background: #fff; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 24px; padding: 20px 18px; text-align: center; animation: rise .35s ease; }
.lt-home h2 { margin: 6px 0 12px; font-size: 1.6rem; color: var(--ink); letter-spacing: -0.01em; }
.lt-home .lt-lamp { width: 210px; max-width: 70%; }
.lt-how { margin: 0 auto 10px; padding: 0; max-width: 340px; list-style: none; counter-reset: s; text-align: left; }
.lt-how li { counter-increment: s; position: relative; padding: 8px 0 8px 40px; font-size: 1rem; color: var(--ink); line-height: 1.4; }
.lt-how li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: #7A5B1E; font-weight: 800; font-size: .9rem; }
.lt-pts { margin: 4px 0 14px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.lt-best { display: inline-block; margin-bottom: 4px; padding: 4px 12px; border-radius: 999px; background: var(--green-bg); color: var(--green-deep); font-size: .9rem; font-weight: 700; }
.lt-go { width: 100%; margin-top: 14px; min-height: 58px; font-size: 1.15rem; letter-spacing: .08em; }

/* Play: everything that matters fits above the phone keyboard */
.lt-play { padding: 12px 14px 16px; }
.lt-top { display: flex; justify-content: space-between; align-items: center; }
.lt-hearts { display: flex; gap: 4px; font-size: 1.35rem; }
.lt-h { transition: transform .3s; }
.lt-h.gone { transform: scale(.8); opacity: .5; }
.lt-score { font-size: .95rem; font-weight: 700; color: var(--muted); }
.lt-score b { font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.lt-stage { --f: 1; position: relative; margin: 0 auto; }
.lt-stage .lt-lamp { display: block; height: 112px; width: auto; margin: 0 auto; }
.lt-flame { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(calc(.3 + .7 * var(--f))); transition: transform .12s linear; }
.lt-flame path:first-child { animation: lt-flick 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.lt-glow { opacity: calc(.15 + .85 * var(--f)); }
.lt-stage.low .lt-flame path:first-child { animation-duration: .35s; }
.lt-stage.low .lt-oil i { background: linear-gradient(90deg, #E5531A, #F08A3E); }
.lt-stage.out .lt-flame, .lt-stage.out .lt-glow { opacity: 0; transition: opacity .3s; }
.lt-stage.refill .lt-glow { animation: lt-bloom .5s ease-out; }
@keyframes lt-flick { 0%, 100% { transform: scaleY(1) skewX(0); } 30% { transform: scaleY(1.06) skewX(-3deg); } 60% { transform: scaleY(.95) skewX(2deg); } }
@keyframes lt-bloom { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.lt-oil { width: 70%; height: 8px; margin: 2px auto 0; border-radius: 4px; background: #ECE6D9; overflow: hidden; }
.lt-oil i { display: block; height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, #E3C88E, #C9A45C); }
.lt-prompt { display: flex; justify-content: center; gap: 8px; margin: 16px 0 12px; }
.lt-prompt span { display: grid; place-items: center; width: 54px; height: 60px; border-radius: 14px; background: linear-gradient(160deg, #E3C88E, #C9A45C); box-shadow: 0 4px 0 #A8853F; color: var(--blue-deep, #142A46); font-size: 2rem; font-weight: 800; animation: lt-pop .35s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes lt-pop { from { transform: scale(.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lt-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.lt-msg { min-height: 1.5em; margin: 10px 0 6px; font-size: .95rem; font-weight: 600; color: var(--muted); }
.lt-msg.yes { color: var(--green-deep); }
.lt-msg.no { color: #B3261E; }
.lt-msg.warn { color: #8A6A12; }
.lt-plus { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 800; animation: lt-pop .3s ease both; }
.lt-used { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-height: 96px; overflow: hidden; }
.lt-chip { padding: 4px 10px; border-radius: 999px; background: var(--green-bg); color: var(--green-deep); font-size: .85rem; font-weight: 700; animation: lt-pop .3s ease both; }
.lt-chip.sp { background: var(--gold-soft); color: #7A5B1E; }

/* End */
.lt-newbest { display: inline-block; margin-bottom: 8px; padding: 4px 14px; border-radius: 999px; background: var(--gold-soft); color: #7A5B1E; font-weight: 800; }
.lt-final b { display: block; font-size: 3.6rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.lt-final span { font-weight: 700; color: var(--muted); }
.lt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.lt-stats div { padding: 10px 4px; border: 2px solid var(--line); border-radius: 16px; }
.lt-stats b { display: block; font-size: 1.2rem; color: var(--ink); overflow-wrap: anywhere; }
.lt-stats span { font-size: .75rem; font-weight: 700; color: var(--muted); }
.lt-used.end { max-height: none; margin-bottom: 8px; }
.lt-bestline { margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.lt-share { width: 100%; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .lt-flame path:first-child, .lt-prompt span, .lt-chip, .lt-plus, .lt-stage.refill .lt-glow { animation: none; }
}

/* Typing without a bar: the input is hidden, the word shows as tiles (prompt letters lit gold) */
.lt-form { position: relative; height: 0; overflow: hidden; }
.lt-in { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; padding: 0; border: 0; font-size: 16px; }
.lt-typed { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 52px; padding: 4px 0; }
.lt-tl { display: grid; place-items: center; min-width: 34px; height: 44px; padding: 0 2px; border-radius: 10px; background: #F3EFE6; border: 2px solid var(--line); color: var(--ink); font-size: 1.45rem; font-weight: 800; animation: lt-pop .18s ease both; }
.lt-tl.hit { background: #FFF3D1; border-color: var(--gold); color: #7A5B1E; box-shadow: 0 0 0 2px rgba(201,164,92,.25); }
.lt-typed.has .lt-tl.hit { background: var(--green-bg); border-color: var(--green); color: var(--green-deep); box-shadow: none; }
.lt-caret { width: 3px; height: 36px; margin-left: 2px; border-radius: 2px; background: var(--blue); animation: lt-blink 1s steps(1) infinite; }
@keyframes lt-blink { 50% { opacity: 0; } }
.lt-typed.shake { animation: lt-shake .16s; }
.lt-typed.shake .lt-tl { border-color: #C2412D; background: #FBE9E6; color: #B3261E; }
.lt-kb { width: 100%; min-height: 54px; margin-top: 6px; font-size: 1.05rem; }
.lt-deskhint { display: none; margin: 2px 0 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.lt-deskhint kbd { padding: 1px 6px; border: 2px solid var(--line); border-bottom-width: 3px; border-radius: 6px; font-family: inherit; font-size: .8rem; color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .lt-deskhint { display: block; } }
@media (prefers-reduced-motion: reduce) { .lt-tl, .lt-caret, .lt-typed.shake { animation: none; } }

/* ===== Pass the phone ===== */
.lt-mp { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 14px 16px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; background: #fff; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 20px; -webkit-tap-highlight-color: transparent; }
.lt-mp:hover { border-color: var(--line-dark); }
.lt-mp:active { transform: translateY(2px); border-bottom-width: 3px; margin-bottom: 2px; }
.lt-mp-ic { font-size: 1.7rem; line-height: 1; }
.lt-mp > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lt-mp strong { font-size: 1.05rem; }
.lt-mp small { font-size: .85rem; line-height: 1.35; color: var(--muted); }
.lt-mp-go { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: var(--paper); font-size: .85rem; box-shadow: 0 3px 0 var(--blue-lip); }
.lt-setup h2 { margin: 2px 0 6px; font-size: 1.5rem; color: var(--ink); }
.lt-count { grid-template-columns: repeat(3, 1fr); margin: 14px 0; }
.lt-names { display: flex; flex-direction: column; gap: 8px; }
.lt-name { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: #FBF8F1; border: 2px solid var(--line); border-radius: 16px; }
.lt-name:focus-within { border-color: var(--blue); background: #fff; }
.lt-name input { flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; outline: none; font-family: inherit; font-size: 16px; font-weight: 700; color: var(--ink); }
.lt-av { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--c, var(--line)); font-size: 1.35rem; line-height: 1; }
.lt-back { width: 100%; margin-top: 8px; }

/* Play: one chip per player. The one holding the lamp is lifted, ringed in gold, and bobs. */
.lt-players { display: flex; justify-content: center; gap: 6px; }
.lt-pl { flex: 1 1 0; min-width: 0; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border: 2px solid var(--line); border-radius: 16px; background: #fff; transition: transform .25s cubic-bezier(.3,1.6,.5,1), border-color .2s; }
.lt-pl strong { max-width: 100%; font-size: .78rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-pl .lt-av { width: 34px; height: 34px; font-size: 1.15rem; }
.lt-plh { font-size: .7rem; letter-spacing: -1px; }
.lt-pl.on { border-color: var(--gold); background: #FFF8E6; transform: translateY(-4px) scale(1.06); box-shadow: 0 6px 14px rgba(201,164,92,.35); }
.lt-pl.on .lt-av { animation: lt-bob 1s ease-in-out infinite; }
.lt-pl.out { opacity: .45; filter: grayscale(1); }
@keyframes lt-bob { 50% { transform: translateY(-3px); } }
.lt-turn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; margin: 10px 0 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.lt-turn .lt-av { width: 28px; height: 28px; font-size: 1rem; }
.lt-turn.pop { animation: lt-pop .35s cubic-bezier(.3,1.6,.5,1); }
.lt-play.mp .lt-stage .lt-lamp { height: 96px; }

/* Winner */
.lt-win { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 14px; }
.lt-crown { font-size: 2.2rem; line-height: 1; animation: lt-bob 1.4s ease-in-out infinite; }
.lt-av.big { width: 76px; height: 76px; font-size: 2.4rem; box-shadow: 0 0 0 4px var(--c); }
.lt-win strong { margin-top: 6px; font-size: 1.6rem; color: var(--ink); }
.lt-win small { font-weight: 600; color: var(--muted); }
.lt-rank { display: flex; flex-direction: column; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.lt-rank li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 14px; text-align: left; }
.lt-rank li:first-child { border-color: var(--gold); background: #FFF8E6; }
.lt-rk { min-width: 18px; font-weight: 800; color: var(--muted); }
.lt-rank .lt-av { width: 32px; height: 32px; font-size: 1.05rem; }
.lt-rkn { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-rkw { font-size: .85rem; font-weight: 600; color: var(--muted); }
.lt-rkw b { font-size: 1.05rem; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .lt-pl.on .lt-av, .lt-crown, .lt-turn.pop { animation: none; } }
.lt-kb[hidden] { display: none; }

/* Menu (quit) button on the play screen + the "Leave this game?" check */
.lt-play { position: relative; }
.lt-quit { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 6px 10px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-family: inherit; font-size: .85rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.lt-quit:hover { color: var(--ink); border-color: var(--line-dark); }
.lt-play .lt-top { padding-left: 84px; }
.lt-play.mp .lt-players { margin-top: 38px; }
.lt-quitask { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 24px; background: rgba(255,253,248,.96); border-radius: 22px; animation: rise .2s ease; }
.lt-quitask[hidden] { display: none; }
.lt-quitask strong { font-size: 1.35rem; color: var(--ink); }
.lt-quitask span { color: var(--muted); font-weight: 600; margin-bottom: 8px; }

/* Your stats on the home screen */
.lt-mystats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.lt-mystats div { padding: 10px 6px; border: 2px solid var(--line); border-radius: 16px; background: #FBF8F1; }
.lt-mystats div.wide { grid-column: 1 / -1; }
.lt-mystats b { display: block; font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lt-mystats span { font-size: .75rem; font-weight: 700; color: var(--muted); }
@media (min-width: 520px) { .lt-mystats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* New award note on the end screen (links to the shared Awards tab). Green = earned. */
.lt-award { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 0; padding: 12px 14px; text-decoration: none; background: var(--green-bg); border: 2px solid rgba(47,143,78,.45); border-radius: 16px; animation: lt-pop .4s cubic-bezier(.3,1.6,.5,1) both; }
.lt-award span { font-weight: 800; color: var(--green-deep); }
.lt-award span b { font-size: 1.2rem; }
.lt-award small { font-weight: 700; color: var(--green-deep); opacity: .8; }

/* Back link on the start screen (same pill as the in-game Menu button) */
.lt-home { position: relative; padding-top: 44px; }
.lt-home .lt-quit { text-decoration: none; }

/* No text highlighting on the game (same rule as every AmISaved game). Name boxes still take typing. */
.lt-card { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.lt-card input { -webkit-user-select: text; user-select: text; }
.lt-lblink { display: inline-block; margin-top: 8px; padding: 6px 14px; font-size: .92rem; font-weight: 700; color: var(--blue); text-decoration: none; background: var(--gold-soft); border-radius: 999px; }
.lt-lblink:hover { background: rgba(201,164,92,.3); }
.lt-lvl { max-width: 260px; margin: 4px auto 12px; }
.lt-lvl button { padding: 8px 0; font-size: .9rem; }

/* ===== Level and XP (xp.js), shared by Keep It Lit and Build the Ark ===== */
.xp-end { margin: 14px 0 4px; }
.xp-row { display: flex; align-items: center; gap: 12px; }
.xp-main { flex: 1; min-width: 0; }
.xp-of { display: block; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.xp-end .xp-n { font-variant-numeric: tabular-nums; }
.xp-end.leveled .xp-badge { animation: xp-badgepop .6s cubic-bezier(.3,1.6,.5,1); }
.lt-xpnote { margin: 4px 0 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.lt-main { display: flex; align-items: center; justify-content: center; text-decoration: none; }
/* Live bar in Build the Ark */
.xp-mini { position: relative; display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.xp-mini .qz-badge { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.xp-mini .qz-badge small { font-size: .42rem; letter-spacing: .08em; }
.xp-mini .qz-badge b { font-size: .95rem; }
.xp-mbar { flex: 1; height: 8px; border-radius: 4px; background: #ECE6D9; overflow: hidden; }
.xp-mbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #E3C88E, #C9A45C); transition: width .7s cubic-bezier(.3,.9,.4,1); }
.xp-mtxt { flex: none; font-size: .75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.xp-mini.gain .qz-badge { animation: xp-badgepop .5s cubic-bezier(.3,1.6,.5,1); }
.xp-float { position: absolute; left: calc(50% - 30px); top: 4px; padding: 1px 9px; border-radius: 999px; background: var(--green); color: #fff; font-size: .78rem; font-weight: 800; pointer-events: none; animation: xp-float 1.3s ease-out both; }
@keyframes xp-float { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
@keyframes xp-badgepop { 40% { transform: scale(1.25) rotate(-6deg); } }
/* Level up moment over the Ark */
.ak-play { position: relative; }
.xp-lvup { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(255, 252, 244, .78); backdrop-filter: blur(2px); border-radius: inherit; animation: xp-fade .2s ease both; cursor: pointer; }
.xp-lvup.out { animation: xp-fade .25s ease reverse both; }
.xp-lvcard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 30px; background: #fff; border: 2px solid var(--gold); border-bottom-width: 5px; border-radius: 22px; animation: xp-cardin .55s cubic-bezier(.3,1.6,.5,1) both; }
.xp-lvcard strong { font-size: 1.5rem; color: #8A6A12; }
.xp-lvcard span { font-weight: 600; color: var(--ink); }
.xp-bigbadge { width: 76px; height: 76px; border-radius: 24px; animation: xp-badgepop .7s cubic-bezier(.3,1.6,.5,1) .15s both; }
.xp-bigbadge b { font-size: 2.1rem; }
@keyframes xp-fade { from { opacity: 0; } }
@keyframes xp-cardin { from { opacity: 0; transform: scale(.6); } }
.ak-arkmenu { display: block; margin: 10px auto 0; padding: 4px 8px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .xp-float, .xp-lvup, .xp-lvcard, .xp-bigbadge, .xp-mini.gain .qz-badge, .xp-end.leveled .xp-badge { animation: none !important; } .xp-mbar i { transition: none; } }
.lt-quitask a.btn { display: flex; align-items: center; justify-content: center; white-space: nowrap; text-decoration: none; }

/* ===== Full screen games (gamescreen.js): the screen is the game, page locked.
   The layer is always the full screen (it never resizes when the keyboard opens, so nothing jumps).
   On phones the game is laid out so everything you need sits in the top part, above where the keyboard comes up. ===== */
html.gm-lock, html.gm-lock body { overflow: hidden; overscroll-behavior: none; }
.lt-card.gm-full { position: fixed; z-index: 70; left: 0; right: 0; top: var(--gm-top, 0px); height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, calc(50% - 280px)) calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; overflow: hidden; background: var(--paper); animation: none; }
.lt-card.gm-full.gm-scroll { display: block; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.gm-full .lt-quit { left: max(12px, calc(50% - 276px)); top: calc(8px + env(safe-area-inset-top)); }
.gm-full .lt-quitask, .gm-full .ak-big, .gm-full .xp-lvup { border-radius: 0; }
.gm-full .lt-quitask { padding-left: max(24px, calc(50% - 260px)); padding-right: max(24px, calc(50% - 260px)); }
/* The hidden typing box sits near the top, so a phone never scrolls the screen up to show it */
.gm-full .lt-form { position: absolute; top: 60px; left: 50%; }
.gm-full.lt-play > * { flex-shrink: 0; }
/* Keep It Lit: the used words take whatever room is left */
.gm-full.lt-play > .lt-used { flex: 1 1 0; flex-shrink: 1; min-height: 0; max-height: none; align-content: flex-start; }
.gm-full.lt-play .lt-stage .lt-lamp { height: clamp(60px, 13dvh, 120px); }
/* Build the Ark: the ark keeps its shape and scales with the screen */
.gm-full.ak-play .ak-stage, .gm-full.ak-play.kb .ak-stage { flex: none; width: auto; max-width: 100%; aspect-ratio: 320 / 200; height: clamp(64px, 12.5dvh, 130px); margin: 0; }
.gm-full.ak-play .ak-svg { width: 100%; height: 100%; }
.gm-full.ak-play .ak-pairbox { margin-top: auto; padding-top: 8px; }
@media (hover: hover) and (pointer: fine) {
  .gm-full.lt-play .lt-stage .lt-lamp { height: clamp(90px, 18dvh, 150px); }
  .gm-full.ak-play .ak-stage { height: clamp(110px, 26dvh, 240px); }
}
/* Typed letters stay on one line: long words shrink to fit (gamescreen.js fitTiles sets --tw) */
.lt-typed { flex-wrap: nowrap; }
.lt-typed.fit { gap: 3px; }
.lt-typed.fit .lt-tl { min-width: 0; width: var(--tw); height: calc(var(--tw) * 1.3); padding: 0; border-radius: calc(var(--tw) * .28); font-size: calc(var(--tw) * .64); }
.lt-typed.fit .ak-sp { width: calc(var(--tw) * .4); }
.gm-full.ak-play .ak-kbt { display: flex; margin: 8px auto 0; }
/* The ark scene spans the full width (sky behind), the ark drawing sits in the middle, the tags sit in the corners */
.gm-full.ak-play .ak-scene { width: 100%; }
.gm-full.ak-play .ak-stage, .gm-full.ak-play.kb .ak-stage { width: 100%; aspect-ratio: auto; display: flex; justify-content: center; }
.gm-full.ak-play .ak-svg { width: auto; height: 100%; aspect-ratio: 320 / 200; }
.gm-full.ak-play .ak-stage { background: linear-gradient(to top, #D9C9A3 calc(18% - 1px), #B9A57A calc(18% - 1px), #B9A57A calc(18% + 1.5px), transparent calc(18% + 1.5px)), linear-gradient(180deg, #EAF2F8, #FBF8F1 75%); }
.gm-full.ak-play .ak-stage.flood { background: linear-gradient(180deg, #EAF2F8, #FBF8F1 75%); }
/* With the keyboard up, the big question and the level up card center in the space above the keyboard */
.gm-full .ak-big { padding-bottom: calc(24px + var(--gm-kb, 0px)); }
.gm-full .xp-lvup { padding-bottom: var(--gm-kb, 0px); }

/* ===== On-screen keyboard (keys.js), phones and iPads. iPhone style: white keys on a gray tray, gray function keys, blue Enter. ===== */
.lt-card.gm-full.has-keys { padding-bottom: calc(var(--ks-h, 260px) + 6px); }
.lt-card.gm-full.has-keys.ks-hw { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.ks { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 11px; padding: 9px 3px calc(9px + env(safe-area-inset-bottom)); background: #D1D4DA; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ks-hw .ks { display: none; }
/* Every row is the same width and keys are a tenth of it, so all rows line up edge to edge on phones AND iPads
   (Ethan 2026-11-07: on iPad the keys hit a size cap and each row ended up a different width). */
.ks-row { display: flex; justify-content: center; gap: 6px; width: 100%; max-width: 980px; margin: 0 auto; padding: 0 3px; box-sizing: border-box; }
.ks-k { position: relative; flex: 0 0 calc((100% - 54px) / 10); min-width: 0; height: clamp(44px, 6.2dvh, 60px); padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 0 #898A8D; color: #000; font: 400 1.5rem -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ks-nums .ks-k { flex-basis: calc((100% - 30px) / 6); }
.ks-fn { background: #ABB0BC; }
.ks-fn svg { width: 26px; height: 20px; vertical-align: middle; }
.ks-gap { flex: 1 1 0; }
.ks-back { flex: 1 1 0; color: #000; }
.ks-mode { flex: 0 0 24%; font-size: 1.05rem; }
.ks-space { flex: 1 1 0; max-width: none; font-size: 1.05rem; color: #000; }
.ks-fill { flex: 1 1 0; }
.ks-go { flex: 0 0 26%; background: #007AFF; color: #fff; box-shadow: 0 1px 0 #00489A; }
.ks-go svg { width: 26px; height: 22px; vertical-align: middle; }
.ks-k.on { background: #ABB0BC; }
.ks-fn.on { background: #fff; }
.ks-go.on { background: #0062CC; }
/* The bigger letter above your finger */
.ks-k:not(.ks-fn):not(.ks-go):not(.ks-space).on { background: #fff; }
.ks-pop { position: absolute; z-index: 4; left: 50%; bottom: -1px; width: 150%; height: 215%; transform: translateX(-50%); display: flex; justify-content: center; padding-top: 10px; box-sizing: border-box; background: #fff; border-radius: 10px 10px 8px 8px; box-shadow: 0 1px 6px rgba(0,0,0,.28); font-size: 2.3rem; pointer-events: none; animation: ks-pop .07s ease-out; }
.ks-row > .ks-k:first-child .ks-pop { left: 0; transform: none; }
.ks-row > .ks-k:last-child .ks-pop { left: auto; right: 0; transform: none; }
@keyframes ks-pop { from { transform: translateX(-50%) scale(.85); opacity: .6; } }
.ks-row > .ks-k:first-child .ks-pop, .ks-row > .ks-k:last-child .ks-pop { animation: none; }
/* The old keyboard buttons are not needed with the on-screen keyboard */
.has-keys .ak-kbt, .has-keys .lt-kb, .has-keys .lt-deskhint { display: none !important; }
/* Build the Ark with the keyboard: the animals row only shows on tall screens */
@media (max-height: 900px) { .has-keys .ak-pairbox { display: none; } }
@media (prefers-reduced-motion: reduce) { .ks-pop { animation: none; } }
/* Typed letters: only the newest one pops in, so fast typing never flickers the whole word */
.lt-typed .lt-tl { animation: none; }
.lt-typed .lt-tl.nw { animation: lt-pop .14s ease both; }
@media (prefers-reduced-motion: reduce) { .lt-typed .lt-tl.nw { animation: none; } }
/* The keyboard takes every finger as a key press: no pinch, no double tap zoom, no scrolling on it */
.ks, .ks * { touch-action: none; }
