/* Carnival Darts — flat candy-vector UI chrome over the rendered dartboard. */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #120c22; font-family: 'Segoe UI', system-ui, sans-serif; overflow: hidden; }

#stage { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 0; }
canvas { max-width: 100vw; max-height: calc(100vh - 16px); aspect-ratio: 520 / 760; touch-action: none; border-radius: 14px; min-height: 0; flex: 0 1 auto; background: #120c22; }
#hud:not(.hide) ~ * canvas, #stage:has(#hud:not(.hide)) canvas { max-height: calc(100vh - 90px); }

.hide { display: none !important; }

/* HUD — in flow above the canvas so chips never cover the board */
#hud { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(96vw, 640px); }
.chip { background: #fff; border-radius: 999px; padding: 10px 14px; font-weight: 700; font-size: 15px; color: #3a2c5e; box-shadow: 0 3px 0 rgba(0,0,0,.25); border: none; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; }
.chip.btn { cursor: pointer; }
.chip.home { background: #ffd166; }
.chip.wide { max-width: 40vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip.alt { background: #4db9ff; color: #10243a; }

/* Menu */
#menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, #ff6fa5 0%, #a077ff 55%, #4db9ff 130%); text-align: center; padding: 20px; }
#menu h1 { font-size: clamp(34px, 7vw, 56px); color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.tag { color: #fff8ec; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.banner { background: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 800; color: #3a2c5e; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.modes { display: flex; flex-direction: column; gap: 12px; width: min(86vw, 340px); }
.cta { background: #ffd166; color: #3a2c5e; font-size: 20px; font-weight: 800; border: none; border-radius: 16px; padding: 16px; cursor: pointer;
  box-shadow: 0 5px 0 #c98a2e; min-height: 56px; }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #c98a2e; }
.cta.alt { background: #3fc463; color: #fff; box-shadow: 0 5px 0 #1f8f43; }
.cta small { display: block; font-size: 12px; font-weight: 600; opacity: .85; }
.ghost { background: transparent; border: 2px solid rgba(255,255,255,.8); color: #fff; border-radius: 12px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none; }
.hint { color: rgba(255,255,255,.85); font-size: 13px; line-height: 1.5; max-width: 380px; }

/* Overlays */
#overlay { position: absolute; inset: 0; background: rgba(18, 12, 34, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.panel { background: #fff; border-radius: 20px; padding: 24px; width: min(92vw, 420px); text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.panel h2 { color: #3a2c5e; margin-bottom: 6px; }
.panel .big { font-size: 18px; font-weight: 700; color: #3a2c5e; margin: 6px 0; line-height: 1.5; }
.panel .rec { color: #d94a80; font-weight: 800; margin: 4px 0 10px; }
.panel .cta { width: 100%; margin-top: 10px; font-size: 18px; }
.panel .ghost { display: inline-block; margin-top: 10px; border-color: #3a2c5e; color: #3a2c5e; }
