/* Games page and game player */
.games-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.game-skill { align-self: flex-start; font-size: 11px; }
.card-body .game-best { color: var(--gold-2); font-weight: 800; }

.game-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.game-head .page-title { margin: 0; flex: 1; }
.game-hud { display: flex; gap: 14px; align-items: center; font-weight: 800; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.game-hud b { color: var(--gold); }

.game-wrap { position: relative; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 0 24px var(--glow); background: linear-gradient(180deg, #081232, #040a1c); overflow: hidden; min-height: 420px; }
.game-stage { position: relative; width: 100%; min-height: 420px; display: flex; flex-direction: column; touch-action: manipulation; }
.game-stage canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3, 8, 24, 0.82); backdrop-filter: blur(3px); z-index: 5; padding: 16px; }
.game-overlay[hidden] { display: none; }
.go-box { text-align: center; max-width: 420px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.go-box img { border-radius: 12px; width: 100%; max-width: 320px; height: auto; }
.go-box h2 { margin: 4px 0 0; font-family: var(--font-head); color: var(--gold); font-size: 30px; }
.go-big { font-size: 64px; line-height: 1; }
.go-score { font-size: 24px; margin: 0; }
.go-score b { color: var(--gold); }
.go-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Shared bits for DOM-based games */
.g-pad { padding: 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; flex: 1; }
.g-question { font-family: var(--font-head); font-size: clamp(28px, 6vw, 48px); color: var(--ink); text-align: center; margin: 0; }
.g-sub { color: var(--muted); text-align: center; margin: 0; }
.g-options { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 12px; width: min(520px, 100%); }
.g-options button { font: 800 22px var(--font-body); padding: 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; transition: transform .1s, background .2s; }
.g-options button:hover, .g-options button:focus-visible { transform: translateY(-2px); border-color: var(--gold); outline: none; }
.g-options button.good { background: var(--green-2); border-color: var(--green); }
.g-options button.bad { background: #7f1d1d; border-color: var(--red); }
.g-timer { width: min(520px, 100%); height: 10px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.g-timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .1s linear; }
.g-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.g-word { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.g-word span { width: 44px; height: 52px; display: grid; place-items: center; font: 800 26px var(--font-head); border-bottom: 3px solid var(--gold); text-transform: uppercase; }
.g-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 560px; }
.g-keys button { width: 40px; height: 44px; font: 800 18px var(--font-body); border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; text-transform: uppercase; }
.g-keys button:disabled { opacity: .35; cursor: default; }
.g-keys button.good { background: var(--green-2); }
.g-keys button.bad { background: #7f1d1d; }
.g-emoji { font-size: 64px; line-height: 1; }
.g-lives { letter-spacing: 2px; }
.g-touch { display: flex; gap: 10px; justify-content: center; padding: 8px; }
.g-touch button { min-width: 64px; min-height: 52px; font-size: 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
