:root {
  --bg: #0c0706;
  --ash: #1a0e0a;
  --ember: #ff6a1a;
  --cream: #f4e6c8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--cream);
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 8px env(safe-area-inset-bottom);
  gap: 8px;
}

#hud {
  width: min(100vw - 16px, calc((100vh - 72px) * 390 / 700));
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.start-btn {
  flex: 0 0 auto;
  border: 1px solid #ff6a1a;
  background: #5a2a16;
  color: #ffb347;
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.start-btn.hidden {
  display: none;
}

.music-btn {
  flex: 0 0 auto;
  border: 1px solid #5a3a28;
  background: #2a1810;
  color: var(--cream);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  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;
  color: var(--cream);
}

#music-menu.hidden {
  display: none;
}

#stage {
  position: relative;
}

#game {
  display: block;
  width: min(100vw - 16px, calc((100vh - 72px) * 390 / 700));
  height: auto;
  background: #101010;
  border: 2px solid #3a1c12;
  box-shadow: 0 0 0 1px #000, 0 12px 40px rgba(0, 0, 0, 0.55);
  image-rendering: auto;
}

#name-pop {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(10, 6, 4, 0.78);
  text-align: center;
  touch-action: auto;
  user-select: text;
}

#name-pop.hidden {
  display: none;
}

#name-pop p {
  margin: 0;
  max-width: 16rem;
  font-weight: 700;
}

#player-name {
  width: min(240px, 80vw);
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--ember);
  border-radius: 8px;
  background: #2a1810;
  color: var(--cream);
  font: inherit;
  font-size: 1.1rem;
  text-align: center;
  touch-action: auto;
  user-select: text;
}

.name-actions {
  display: flex;
  gap: 0.5rem;
}

#name-save {
  background: var(--ember);
  color: #1a0f0a;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

#name-skip.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid #5a3a28;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

#name-status.hint {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: #ffb347;
}

#name-status a {
  color: #ffb347;
  font-weight: 700;
}

