/* GODIMS Typing - games. Builds on practice.css (panels, live stats, results). */
.game-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.game-card { border: 2px solid var(--ink); border-radius: 16px; padding: 22px; background: var(--paper-2); display: flex; flex-direction: column; gap: 6px; }
.game-card h3 { margin: 0; }
.game-card p { color: var(--ink-2); margin: 0 0 8px; }
.game-card .btn { margin-top: auto; align-self: flex-start; }
.game-card label { display: grid; gap: 4px; margin-bottom: 8px; }
.game-card input[type="text"] { font: 600 1rem var(--font-body); padding: .5em .8em; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink); width: 100%; }
.game-emoji { font-size: 2.6rem; line-height: 1; }

.arena-wrap { position: relative; }
.arena { position: relative; height: 430px; overflow: hidden; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper-2); cursor: text; user-select: none; }
.arena.focus { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 30%, transparent); }
.arena-wrap:has(.arena.focus) .display-hint { opacity: 0; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; font: 800 5rem var(--font-display); color: var(--ink); background: color-mix(in srgb, var(--paper) 55%, transparent); z-index: 5; pointer-events: none; }

/* bubbles */
.arena-bubble { background: linear-gradient(180deg, #d9f3ff, #eefaf8); }
[data-theme="dark"] .arena-bubble { background: linear-gradient(180deg, #0d2230, #0f2623); }
.bubble { position: absolute; left: 0; top: 0; min-width: 84px; padding: 22px 18px; border-radius: 999px; font: 700 1.25rem var(--font-mono); text-align: center; color: #000; border: 2px solid rgba(0,0,0,.55); box-shadow: inset -6px -8px 14px rgba(255,255,255,.55), inset 6px 6px 12px rgba(255,255,255,.35); will-change: transform; }
.bubble.b0 { background: rgba(53,183,168,.75); } .bubble.b1 { background: rgba(255,200,87,.8); } .bubble.b2 { background: rgba(255,138,160,.8); }
.bubble.b3 { background: rgba(140,170,255,.8); } .bubble.b4 { background: rgba(170,230,120,.85); }
.bubble .done { color: #b3002a; text-decoration: underline; }
.bubble.target { border-color: #000; outline: 3px solid var(--ink); }
.bubble.pop { animation: pop .25s ease-out forwards; }
.bubble.miss { animation: pop .3s ease-in forwards; opacity: .6; }
@keyframes pop { to { transform: var(--tf) scale(1.5); opacity: 0; } }

/* race */
.arena-race { background: #3a3f45; display: flex; flex-direction: column; justify-content: space-evenly; padding: 6px 0; }
.lane { position: relative; flex: 1; border-top: 3px dashed rgba(255,255,255,.35); }
.lane:first-child { border-top: 0; }
.lane-me { flex: 1.5; }
.finish { position: absolute; right: 10px; top: 0; bottom: 0; width: 16px; background: repeating-conic-gradient(#fff 0 25%, #000 0 50%) 0 0 / 16px 16px; opacity: .95; }
.car { position: absolute; left: 0; bottom: 8px; width: 68px; will-change: transform; }
.car svg { width: 68px; height: auto; display: block; }
.car .tag { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; font: 700 .72rem var(--font-body); padding: 0 6px; white-space: nowrap; }
.car.crash { animation: shake .12s linear 8; filter: grayscale(.6); }
.car.boost::after { content: "💨"; position: absolute; right: 100%; top: 8px; }
@keyframes shake { 0%,100% { margin-bottom: 0; } 50% { margin-bottom: 6px; } }
.obs { position: absolute; bottom: 8px; width: 60px; text-align: center; }
.obs-ic { display: block; font-size: 2rem; line-height: 1; }
.obs-word { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); background: #fff; color: #000; border: 2px solid #000; border-radius: 10px; padding: 1px 10px; font: 700 1.1rem var(--font-mono); white-space: nowrap; margin-bottom: 4px; }
.obs-word .done { color: #d6334c; text-decoration: underline; }
.obs.next .obs-word { background: var(--teal); }
.obs.boom .obs-ic { animation: boom .4s ease-out forwards; }
.obs.boom .obs-word { display: none; }
@keyframes boom { to { transform: scale(2.2); opacity: 0; } }

/* unscramble */
.arena-scramble { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 16px; text-align: center; }
.scr-hint { font: 600 1.15rem var(--font-body); color: var(--ink-2); max-width: 40ch; }
.scr-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile, .slot { width: 52px; height: 58px; display: grid; place-items: center; font: 800 1.7rem var(--font-mono); text-transform: uppercase; border: 2px solid var(--ink); border-radius: 10px; }
.tile { background: var(--teal); color: #000; border-bottom-width: 5px; }
.slot { background: var(--paper); color: var(--ink); border-style: solid; }
.slot.cur { box-shadow: 0 0 0 3px var(--teal); }
.slot.hint { color: var(--ink-3); }
.arena-scramble.wrong .slot { border-color: var(--bad); animation: wob .3s; }
.arena-scramble.right .slot { border-color: var(--good); background: var(--teal-soft); }
@keyframes wob { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.scr-tools { display: flex; gap: 10px; }

@media (max-width: 800px) {
    .game-cards { grid-template-columns: 1fr; }
    .arena { height: 380px; }
    .bubble { font-size: 1.05rem; padding: 18px 14px; }
    .tile, .slot { width: 40px; height: 48px; font-size: 1.3rem; }
    .overlay { font-size: 3.5rem; }
}
