/* Create By Asking: styles for the playable games on the Breakout and "Where on Earth?" pages.
   Loaded after style.css; reuses its tokens and the dark .game-shell look from the Snake page. */

.game-overlay[hidden], .geo [hidden] { display: none !important; }

/* ---------- Breakout ---------- */
.game-stage.wide { max-width: 720px; aspect-ratio: 4 / 3; }
.game-stage.wide canvas { image-rendering: auto; cursor: none; }
.power-key { display: grid; gap: 6px; font-size: var(--step--1); color: #CBBFE8; }
.power-key span { display: flex; align-items: center; gap: 8px; }
.power-key i { font: 800 0.75rem/1 var(--display); font-style: normal; color: #1C0F3F; border-radius: 99px; padding: 4px 9px; }
.sound-btn { justify-self: start; }

/* ---------- Where on Earth? ---------- */
.geo { position: relative; background: var(--screen); border-radius: 18px; padding: clamp(12px, 2.5vw, 22px); color: #F2ECFF; display: grid; gap: 14px; }
.geo-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.geo-bar .score { padding: 8px 14px; min-width: 110px; }
.geo-bar .score strong { font-size: 1.5rem; }
.geo-bar .sp { flex: 1; }
.geo-main { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }
.geo-photo { position: relative; border-radius: 12px; overflow: hidden; background: #0A0520; aspect-ratio: 4 / 3; }
.geo-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.4s, transform 6s ease-out; }
.geo-photo img.fade { opacity: 0; }
.geo-photo:hover img:not(.fade) { transform: scale(1.04); }
.geo-photo:fullscreen img { object-fit: contain; transform: none; }
.geo-loading { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #CBBFE8; font-size: var(--step--1); }
.geo-loading::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: #FFC93C; animation: geo-spin 0.9s linear infinite; margin: 0 auto 10px; display: block; }
.geo-loading:has(button)::before { display: none; }
.geo-loading .btn { margin-top: 10px; }
@keyframes geo-spin { to { transform: rotate(360deg); } }
.geo-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; font-size: 0.7rem; color: rgba(255, 255, 255, 0.75); background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-full { position: absolute; top: 10px; right: 10px; }
.geo-mapcol { display: grid; grid-template-rows: 1fr auto; gap: 10px; min-height: 0; }
.geo-mapwrap { position: relative; border-radius: 12px; overflow: hidden; background: #0A0520; min-height: 240px; }
.geo-mapwrap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; user-select: none; }
.geo-grat line { stroke: #1E1442; stroke-width: 1; vector-effect: non-scaling-stroke; }
.geo-land path { fill: #2E1F63; stroke: #5A479E; stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: fill 0.2s; }
.geo-land path:hover { fill: #3B2A7A; }
.geo-land path.hit { fill: #FF2E7E; fill-opacity: 0.45; }
.pin-guess circle { fill: #FFC93C; stroke: #1C0F3F; stroke-width: 2; vector-effect: non-scaling-stroke; }
.pin-answer circle { fill: #FF2E7E; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.pin-answer .pulse { fill: #FF2E7E; fill-opacity: 0.35; stroke: none; transform-box: fill-box; transform-origin: center; animation: geo-pulse 1.4s ease-out infinite; }
@keyframes geo-pulse { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.geo-line { stroke: #FFC93C; fill: none; animation: geo-dash 1s linear infinite; }
@keyframes geo-dash { to { stroke-dashoffset: -60; } }
.geo-zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 6px; }
.geo-zoom .icon-btn { background: rgba(15, 8, 39, 0.8); }
.geo-hint { position: absolute; left: 10px; bottom: 8px; font-size: 0.7rem; color: #A597CC; pointer-events: none; }
.geo-guess { width: 100%; }
.geo-guess:disabled { opacity: 0.55; cursor: default; }
.geo-result { background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.geo-result .pts { font: 800 2rem/1 var(--display); color: #FFC93C; font-variant-numeric: tabular-nums; }
.geo-result .pts small { font: 600 0.8rem var(--body); color: #CBBFE8; margin-left: 4px; }
.geo-result p { margin: 0; font-size: var(--step--1); color: #CBBFE8; }
.geo-result a { color: #FFC93C; }
.geo-result .bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.geo-result .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FF2E7E, #FFC93C); border-radius: 99px; transition: width 0.8s ease-out; }
.geo .game-overlay { z-index: 3; border-radius: 18px; }
.geo .btn { background: #FFC93C; color: #1C0F3F; }
.geo-list { list-style: none; padding: 0; margin: 0 auto 16px; max-width: 320px; display: grid; gap: 4px; text-align: left; font-size: var(--step--1); }
.geo-list li { display: flex; justify-content: space-between; gap: 12px; background: rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 6px 10px; color: #CBBFE8; }
.geo-list b { color: #fff; font-variant-numeric: tabular-nums; }
.geo-note { font-size: 0.78rem; color: #A597CC; margin: 0; }
@media (max-width: 820px) {
  .geo-main { grid-template-columns: 1fr; }
  .geo-mapwrap { min-height: 0; aspect-ratio: 16 / 10; }
}
.geo-photo::before { content: ""; position: absolute; inset: -40px; background: var(--bg, none) center / cover; filter: blur(28px) brightness(0.55); }
.geo-photo img { position: relative; object-fit: contain; }
.geo-photo:hover img:not(.fade) { transform: none; }
.geo-credit a { color: inherit; }
.geo-modes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 16px; }
