/* MadPride — dusk-savanna arcade cabinet. Dark themed to match the site. */
:root {
  --bg: #170f22;
  --ink: #f4e6c2;
  --amber: #ffcf7a;
  --gold: #f2c33a;
  --danger: #e0562a;
  --panel: rgba(28, 18, 38, 0.92);
  --panel-edge: rgba(255, 207, 122, 0.4);
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; width: 100%; height: 100%; height: 100dvh; overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(224, 150, 90, 0.18), transparent),
    var(--bg);
  color: var(--ink); font-family: var(--font);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
#app { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#game-root { position: relative; width: 100%; height: 100%; }
#viewport { position: absolute; inset: 0; overflow: hidden; }
#viewport canvas { display: block; width: 100%; height: 100%; }

/* ---- overlays ---- */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; padding: 1rem; }
.overlay.hidden, .hidden { display: none !important; }
.panel {
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 14px;
  padding: 1.6rem 2rem; text-align: center; max-width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.banner {
  background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 10px;
  padding: 0.6rem 1.4rem; font-weight: 800; letter-spacing: 0.08em; font-size: 1.4rem;
}
.logo {
  margin: 0 0 0.3rem; font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 900; letter-spacing: 0.04em;
  color: var(--amber); text-shadow: 3px 3px 0 #000, 0 0 24px rgba(255, 207, 122, 0.4); line-height: 0.95;
}
.logo span { color: var(--danger); }
.tagline { margin: 0.2rem 0 1rem; color: #d8c6f0; font-size: clamp(0.85rem, 3vw, 1.05rem); }
.arcade-btn {
  font-family: inherit; font-weight: 800; letter-spacing: 0.06em; font-size: 1.1rem;
  color: #1a1020; background: var(--amber); border: 0; border-radius: 8px;
  padding: 0.7rem 1.6rem; cursor: pointer; box-shadow: 0 4px 0 #a9793a;
}
.arcade-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a9793a; }
.controls { list-style: none; margin: 1rem 0 0.4rem; padding: 0; font-size: 0.8rem; color: #b9a9d4; line-height: 1.7; }
.keys { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 4px; padding: 0 0.35rem; font-weight: 700; color: var(--ink); }
.hs { margin: 0.8rem 0 0; color: var(--gold); font-weight: 700; }
#go-dist { font-size: 1.6rem; font-weight: 900; color: var(--amber); margin: 0.2rem 0; }
#gameover-title { margin: 0 0 0.2rem; color: var(--danger); font-size: 1.8rem; }

/* ---- HUD ---- */
#hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 15;
  display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0.9rem;
  font-weight: 800; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, rgba(10, 6, 16, 0.55), transparent); pointer-events: none;
}
.hud-item { display: flex; align-items: baseline; gap: 0.35rem; font-size: 1.05rem; }
.hud-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.hud-unit { font-size: 0.7rem; color: #b9a9d4; }
.health { display: inline-flex; gap: 3px; }
.health .pip { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px rgba(224, 86, 42, 0.6); }
.hud-btn { margin-left: auto; pointer-events: auto; font-family: inherit; font-weight: 800; color: var(--ink); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 0.2rem 0.6rem; cursor: pointer; }

#vignette { position: absolute; inset: 0; pointer-events: none; z-index: 12; box-shadow: inset 0 0 120px rgba(10, 4, 14, 0.5); }
.frame-btn { position: absolute; right: 10px; bottom: 10px; z-index: 16; font-size: 1.1rem; color: var(--ink); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 0.2rem 0.5rem; cursor: pointer; }

/* ---- touch controls (shown only on touch devices) ---- */
#controls { display: none; }
html.touch #controls { display: block; }
html.touch .frame-btn { display: none; }
.pad-group { position: absolute; bottom: 16px; z-index: 18; display: flex; gap: 12px; align-items: flex-end; }
.pad-left { left: 16px; }
.pad-right { right: 16px; }
.pad-actions { right: 20px; bottom: 100px; } /* roar/pounce above the sprint/jump row */
.pad {
  font-family: inherit; font-weight: 800; color: var(--ink);
  background: rgba(30, 18, 40, 0.5); border: 2px solid rgba(255, 207, 122, 0.5); border-radius: 50%;
  width: 64px; height: 64px; font-size: 1.4rem; cursor: pointer; touch-action: none;
  display: flex; align-items: center; justify-content: center;
}
.pad.is-down { background: rgba(255, 207, 122, 0.4); }
.pad-a { width: 76px; height: 76px; background: rgba(224, 86, 42, 0.35); border-color: var(--danger); }
.pad-run { width: 64px; height: 64px; font-size: 0.8rem; background: rgba(255, 207, 122, 0.22); }
.pad-sm { width: 52px; height: 52px; font-size: 0.66rem; }

@media (max-width: 500px) {
  .pad { width: 58px; height: 58px; }
  .pad-a { width: 68px; height: 68px; }
  .pad-run { width: 58px; height: 58px; }
  .pad-sm { width: 48px; height: 48px; font-size: 0.58rem; }
  .pad-actions { bottom: 92px; }
}
