:root {
  --bg: #1a1520;
  --panel: #2a2233;
  --text: #f4efe8;
  --muted: #b9aeb8;
  --accent: #e8a0bf;
  --jump: #5a8f7b;
  --duck: #6b7fd7;
  --danger: #c45c5c;
  --pixel: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--pixel);
  overflow: hidden;
  touch-action: manipulation;
}

#app {
  position: relative;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.mute-btn {
  /* Overlay every screen (including gameplay canvas) — not a bar above play */
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1000;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.55rem 0.7rem;
  font-size: 1.35rem;
  line-height: 1;
  background: rgba(42, 34, 51, 0.92);
  box-shadow: 2px 2px 0 #000;
  pointer-events: auto;
}

.mute-note {
  position: relative;
  display: inline-block;
}

.mute-btn.is-muted .mute-note::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.35em;
  height: 3px;
  background: var(--danger);
  border: 1px solid #000;
  transform: translate(-50%, -50%) rotate(-42deg);
  pointer-events: none;
}

.screen {
  height: 100%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.screen.hidden { display: none; }

.brand {
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--accent);
  image-rendering: pixelated;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 22rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  font: inherit;
  font-size: 1rem;
  padding: 0.85rem 0.9rem;
  border: 2px solid #4a3f55;
  background: var(--panel);
  color: var(--text);
  border-radius: 0;
}

.btn {
  font: inherit;
  font-size: 1rem;
  padding: 0.9rem 1rem;
  border: 2px solid #000;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.btn.primary { background: var(--accent); color: #1a1520; font-weight: bold; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.tiny {
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  min-width: 2rem;
}

.error { color: #ff8f8f; margin: 0; font-size: 0.85rem; }
.hidden { display: none !important; }

.bar {
  height: 12px;
  background: var(--panel);
  border: 2px solid #000;
}
.bar-fill {
  height: 100%;
  width: 10%;
  background: var(--accent);
  transition: width 0.2s linear;
}

.score-big {
  font-size: 2.4rem;
  margin: 0.25rem 0;
  color: var(--accent);
}

.board-list {
  flex: 1;
  overflow: auto;
  background: var(--panel);
  border: 2px solid #000;
  padding: 0.5rem;
  font-size: 0.8rem;
  min-height: 40vh;
}

.board-row {
  display: grid;
  grid-template-columns: 2rem 1fr 1fr 3.5rem;
  gap: 0.35rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #3d3448;
}

.board-row.head {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* Play layout 50 / 25 / 25 */
.play-screen {
  padding: 0;
  gap: 0;
  display: grid;
  grid-template-rows: 50% 25% 25%;
}

.zone {
  width: 100%;
  border: none;
  margin: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.game-zone {
  position: relative;
  background: #87ceeb;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #87ceeb;
}

.hud {
  position: absolute;
  top: 0.4rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  font-size: 1.1rem;
  text-shadow: 1px 1px 0 #000;
}

.hud .btn { pointer-events: auto; }

.skip {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.45);
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
}

.control-zone {
  font: inherit;
  font-size: 1.4rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  border-top: 3px solid #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.jump-zone { background: var(--jump); }
.duck-zone { background: var(--duck); }

.control-zone:active {
  filter: brightness(1.15);
}
