/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #111;
  display: flex; justify-content: center; align-items: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}

/* ── Wrapper — phone portrait ─────────────────────────────── */
#game-wrapper {
  position: relative;
  width:  min(430px, 100vw);
  height: min(800px, 100svh);
  background: #F5C59F;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
@media (max-width: 430px) {
  #game-wrapper { border-radius: 0; }
}

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 16px; z-index: 10;
}
.screen.active { display: flex; }

#start-screen, #gameover-screen { background: #F5C59F; }
#game-screen { background: transparent; pointer-events: auto; }

/* ── HUD ──────────────────────────────────────────────────── */
#hud {
  position: absolute;
  top: 36px; left: 50%; transform: translateX(-50%);
  z-index: 20; pointer-events: none;
}
#score {
  font-size: 56px; font-weight: 900;
  letter-spacing: -2px;
  color: rgba(0,0,0,.15);
}

/* ── Canvas ───────────────────────────────────────────────── */
#canvas {
  display: block; width: 100%; height: 100%;
}

/* ── Logo arc on start screen ─────────────────────────────── */
.logo {
  width: 100px; height: 100px;
  position: relative; margin-bottom: -8px;
}
.logo-arc {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 14px solid transparent;
  border-top-color: #3a2a1a;
  border-right-color: #3a2a1a;
  border-bottom-color: #C4956A;
  animation: spin 2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Typography ───────────────────────────────────────────── */
.title {
  font-size: 56px; font-weight: 900;
  letter-spacing: -3px; color: #3a2a1a;
}
.subtitle {
  font-size: 18px; line-height: 1.5;
  color: #7a5a3a; text-align: center;
}
.hint {
  font-size: 13px; color: #aaa;
  letter-spacing: 1px; margin-top: -6px;
}

/* ── Score block ──────────────────────────────────────────── */
.score-block {
  background: rgba(0,0,0,.08);
  border-radius: 20px;
  padding: 20px 40px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: center;
}
.score-row {
  display: flex; flex-direction: column; align-items: center;
}
.score-lbl {
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; color: #9a7a5a;
}
.score-val {
  font-size: 64px; font-weight: 900;
  line-height: 1; letter-spacing: -3px;
  color: #3a2a1a;
}
.score-val.accent { color: #C4956A; font-size: 44px; }

/* ── Button ───────────────────────────────────────────────── */
.btn {
  padding: 18px 52px;
  border: none; border-radius: 50px;
  background: #3a2a1a; color: #F5C59F;
  font-size: 17px; font-weight: 800;
  letter-spacing: 2px; cursor: pointer;
  transition: transform .1s, background .15s;
  touch-action: manipulation;
}
.btn:hover  { background: #5a4030; }
.btn:active { transform: scale(.95); }
