/* Danger Blocks v2 (Minipret rebuild) — 2026-05-17
   Layout: 1280×720 viewport, fills available window. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: #3E97FF;
  font-family: 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.db-app { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.db-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3E97FF;
  overflow: hidden;
}

#dbCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 4 / 3;
  image-rendering: -webkit-optimize-contrast;
}

/* ── Overlays ─────────────────────────────────────────────────── */
.db-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  z-index: 10;
  background: rgba(62,151,255, 0.92);
  animation: dbFadeIn .25s ease-out;
}
.db-overlay[hidden] { display: none; }
@keyframes dbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.db-home-panel {
  background: #FFFCE5;
  border: 5px solid #2D8A25;
  border-radius: 22px;
  padding: 26px 28px 22px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  color: #1F2A37;
  box-shadow: 0 10px 0 rgba(0,0,0,.18), 0 18px 36px rgba(0,0,0,.25);
}

.db-home-logo {
  max-width: 90%;
  height: auto;
  margin: 0 auto 10px;
  display: block;
}
.db-home-tag { font-size: 1rem; margin-bottom: 10px; line-height: 1.35; }
.db-home-record { font-size: 1rem; color: #2D8A25; margin-bottom: 14px; font-weight: 700; }
.db-home-record strong { color: #D97706; }
.db-home-controls { font-size: .85rem; color: #555; margin-top: 12px; }

.db-pause-title { font-size: 1.6rem; color: #2065A3; margin-bottom: 14px; font-weight: 900; }

.db-over-title { font-size: 1.5rem; color: #D4422E; margin-bottom: 14px; font-weight: 900; }
.db-over-scores { display: flex; gap: 14px; margin-bottom: 8px; }
.db-over-cell {
  flex: 1;
  background: #fff;
  border: 3px solid #2D8A25;
  border-radius: 14px;
  padding: 8px 6px;
  min-width: 0;
}
.db-over-label {
  display: block;
  font-size: .8rem;
  color: #2D8A25;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.db-over-val {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: #D97706;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.db-over-newbest {
  color: #2D8A25;
  font-weight: 800;
  margin: 10px 0 14px;
  font-size: 1.1rem;
}

/* Boot/preload */
.db-overlay--boot { background: #3E97FF; }
.db-boot-inner { color: #fff; text-align: center; }
.db-boot-spinner {
  width: 48px; height: 48px;
  border: 5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: dbSpin .8s linear infinite;
}
@keyframes dbSpin { to { transform: rotate(360deg); } }

/* ── Buttons ─────────────────────────────────────────────────── */
.db-btn {
  appearance: none;
  border: 0;
  background: #FF6B35;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  padding: 12px 24px;
  border-radius: 14px;
  cursor: pointer;
  margin: 6px 4px;
  box-shadow: 0 5px 0 #C4521E;
  transition: transform .12s, box-shadow .12s;
  font-family: inherit;
}
.db-btn:hover { background: #FF7E4F; }
.db-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #C4521E; }
.db-btn--cta { font-size: 1.25rem; padding: 14px 28px; }
.db-btn--ghost {
  background: #fff;
  color: #1F2A37;
  border: 2px solid #C9D2DC;
  box-shadow: 0 4px 0 #C9D2DC;
}
.db-btn--ghost:hover { background: #F1F5F9; }
.db-btn--ghost:active { box-shadow: 0 2px 0 #C9D2DC; }
.db-btn--submit {
  background: #2D8A25;
  color: #fff;
  box-shadow: 0 5px 0 #1F5E18;
}
.db-btn--submit:hover { background: #38A030; }
.db-btn--submit:active { box-shadow: 0 2px 0 #1F5E18; }

/* ── HUD ─────────────────────────────────────────────────────── */
.db-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}
.db-hud-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.db-hud-pill {
  background: rgba(255, 252, 229, 0.94);
  border: 4px solid #2D8A25;
  border-radius: 14px;
  padding: 6px 18px;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  min-width: 130px;
}
.db-hud-pill--highscore { border-color: #D97706; }
.db-hud-pill--highscore .db-hud-label { color: #9A3412; }
.db-hud-pill--highscore .db-hud-val   { color: #D97706; }
.db-hud-label {
  font-size: .7rem;
  color: #2D8A25;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.db-hud-val {
  font-size: 1.7rem;
  font-weight: 900;
  color: #D97706;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
}

.db-hud-btn {
  pointer-events: auto;
  appearance: none;
  border: 3px solid #2D8A25;
  background: rgba(255, 252, 229, 0.94);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  font-family: inherit;
}
.db-hud-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.db-hud-btn--sound { margin-left: 8px; }
.db-hud-btn-row { display: flex; }

/* ── Touch buttons (mobile) ──────────────────────────────────── */
.db-touch {
  position: absolute;
  inset: auto 0 0 0;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  display: flex;
}
.db-touch[hidden] { display: none; }
.db-touch-btn {
  pointer-events: auto;
  flex: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.db-touch-btn:active {
  background: rgba(255, 255, 255, 0.10);
}
@media (max-width: 600px) {
  .db-home-panel { padding: 18px 18px 16px; }
  .db-over-val { font-size: 1.6rem; }
  .db-hud-val { font-size: 1.3rem; }
  .db-hud-label { font-size: .6rem; }
  .db-hud-btn { width: 42px; height: 42px; font-size: 1.15rem; }
}
