﻿:root {
  color-scheme: dark;
  --bg: #1a0f0a;
  --panel: #2a1810;
  --ink: #f5e6c8;
  --accent: #e8a838;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, Segoe UI, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(0.4rem, env(safe-area-inset-top)) max(0.4rem, env(safe-area-inset-right)) max(0.4rem, env(safe-area-inset-bottom)) max(0.4rem, env(safe-area-inset-left));
  gap: 0.4rem;
  overflow: hidden;
}
#hud {
  width: min(100%, var(--stage-w, 448px));
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: clamp(0.95rem, 2vw, 1.35rem);
}
.music-btn {
  flex: 0 0 auto;
  border: 1px solid #5a3a28;
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font: inherit;
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
}
.music-btn[aria-pressed="false"] { opacity: 0.45; }
.sound-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  cursor: pointer;
}
#stage {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game {
  display: block;
  outline: none;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  background: #0d0806;
  border: 3px solid var(--accent);
  border-radius: 8px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 4, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  text-align: center;
  z-index: 2;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
#overlay.hidden { display: none; }
#overlay p { margin: 0; }
#game-logo {
  width: min(220px, 42vw);
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#title-art {
  width: min(360px, 86vw);
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#overlay h1.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#overlay h1:not(.sr-only) {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
}
.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 360px;
}
.picks button {
  width: 92px;
  height: 92px;
  padding: 4px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--panel);
  cursor: pointer;
}
.picks button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.picks button.selected { border-color: var(--accent); }
#start-btn {
  background: var(--accent);
  color: #1a0f0a;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
}
#install-btn.ghost,
.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #5a3a28;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
#install-btn.hidden,
.hidden { display: none !important; }
.hint { opacity: 0.7; font-size: 0.85rem; max-width: 280px; margin: 0; }
.hint-touch { display: none; }
.install-hint {
  max-width: 320px;
  line-height: 1.35;
  margin: 0;
}
#stick {
  position: fixed;
  left: 0;
  top: 0;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  margin-top: -48px;
  pointer-events: none;
  z-index: 3;
}
#stick.hidden { display: none; }
#stick-base {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(232, 168, 56, 0.5);
  background: rgba(42, 24, 16, 0.38);
}
#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: rgba(232, 168, 56, 0.9);
}
#name-pop {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(10, 6, 4, 0.72);
  text-align: center;
}
#name-pop.hidden { display: none; }
#player-name {
  width: min(240px, 80vw);
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  text-align: center;
}
.name-actions { display: flex; gap: 0.5rem; }
#name-save {
  background: var(--accent);
  color: #1a0f0a;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
#name-skip.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid #5a3a28;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
@media (min-height: 780px) {
  #overlay { justify-content: center; }
}
@media (max-height: 760px) {
  #overlay { gap: 0.4rem; }
  #game-logo { width: min(120px, 22vh); }
  #title-art { width: min(280px, 78vw); }
  .picks button { width: 72px; height: 72px; }
}
@media (max-height: 640px) {
  #game-logo { display: none; }
  #title-art { width: min(240px, 70vw); }
  .picks button { width: 64px; height: 64px; }
  #overlay { gap: 0.3rem; }
  #start-btn { padding: 0.55rem 1.25rem; font-size: 1rem; }
}
@media (hover: none) and (pointer: coarse) {
  .hint-desk { display: none; }
  .hint-touch { display: block; }
}
