/* Bloopy web preview - default theme "Bloopy Radiance"
   (packages/design_tokens/lib/src/generated_tokens.dart, theme/bloopy_theme.dart). */
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("assets/fonts/Poppins-Medium.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("assets/fonts/Poppins-Bold.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 800; font-display: swap; src: url("assets/fonts/Poppins-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "AzeretMono"; font-weight: 100 900; font-display: swap; src: url("assets/fonts/AzeretMono-Variable.ttf") format("truetype"); }

:root {
  --bg: linear-gradient(165deg,#12093a 0%,#2a1160 42%,#4a1a86 78%,#2a0f4e 100%);
  --bloom: radial-gradient(90% 55% at 82% -8%,rgba(255,94,196,.32),transparent 62%),radial-gradient(70% 45% at 8% 108%,rgba(255,175,46,.20),transparent 60%);
  --glass: rgba(255,255,255,.07);
  --glass-border: rgba(255,255,255,.16);
  --text: #F8F4FF;
  --dim: rgba(248,244,255,.62);
  --a1: #FFAF2E;
  --a2: #FF5EC4;
  --a3: #8B5CFF;
  --glow: rgba(139,92,255,.55);
  --track: rgba(248,244,255,.16);
  --on-accent: #1A0B2E;
  --s: 1;
}

html, body { height: 100%; margin: 0; overflow: hidden; background: #12093a; }
* { box-sizing: border-box; }

#app {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 500;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.bloom { position: absolute; inset: 0; background: var(--bloom); pointer-events: none; }
canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; display: block; }
#depth { z-index: 1; }
#game { z-index: 2; }
#results { z-index: 3; }
#fx { z-index: 4; }
#flash { z-index: 6; }
.preview-pill, .mute { z-index: 7; }

.micro { font-weight: 800; font-size: 10px; letter-spacing: 1.6px; line-height: 1.3; }
.dim { color: var(--dim); }
.mono { font-family: "AzeretMono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Glass (widgets/glass.dart): soft top-lit frost + 1px luminous border. */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0)), var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
}

/* ---- top chrome (preview label + mute) ---- */
.preview-pill {
  position: absolute; left: 16px; top: 8px; height: 36px;
  display: flex; align-items: center; gap: 7px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--dim);
}
.preview-pill .micro { font-size: 9.5px; letter-spacing: 1.4px; }
.preview-pill .mono { font-size: 11.5px; color: var(--text); }
.mute {
  position: absolute; right: 16px; top: 8px; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0)), var(--glass);
  color: var(--text); cursor: pointer; touch-action: manipulation;
  display: grid; place-items: center;
}
.mute svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; }
.mute .spk { stroke: none; }
.mute .off { display: none; }
.mute[aria-pressed="false"] .on { display: none; }
.mute[aria-pressed="false"] .off { display: block; }
.mute[aria-pressed="false"] { color: var(--dim); }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--a1); outline-offset: 3px; }

/* ---- game screen (screens/game_screen.dart) ---- */
#game { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 46px; }
.hud { display: flex; gap: 10px; margin: 6px 16px 0; height: calc(76px * var(--s)); flex: none; }
.score-card { flex: 1; min-width: 0; padding: 0 14px; display: flex; flex-direction: column; justify-content: center; }
.score-val {
  font-family: "AzeretMono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700; font-size: calc(30px * var(--s)); line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 0 0 24px var(--glow);
}
.status {
  flex: none; width: calc(76px * var(--s)); border-radius: 18px;
  padding: 0 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--glass-border); background: var(--glass);
  position: relative; overflow: hidden;
  transition: border-color .26s ease-out;
}
.status::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .26s ease-out;
  background: linear-gradient(135deg, rgba(255,175,46,.24), rgba(255,94,196,.20));
}
.status.boosted { border-color: rgba(255,175,46,.8); }
.status.boosted::before { opacity: 1; }
.status > * { position: relative; }
.status-mult { font-weight: 700; font-size: calc(22px * var(--s)); line-height: 1; }
.status-label { font-size: calc(7.5px * var(--s)); letter-spacing: calc(1px * var(--s)); margin-top: calc(5px * var(--s)); white-space: nowrap; }
.status-eff {
  font-family: "AzeretMono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600;
  font-size: 12px; line-height: 1.2; color: var(--dim); font-variant-numeric: tabular-nums;
  transition: color .26s ease-out;
}
.status.boosted .status-eff { color: var(--a1); }

.checkpoint { padding: calc(10px * var(--s)) 18px 0; flex: none; }
.checkpoint-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cp-label { flex: 1 1 auto; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cp-count { font-size: 9.5px; color: var(--dim); white-space: nowrap; }
.cp-track { margin-top: 4px; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.cp-fill { height: 100%; width: 100%; background: var(--a1); transform-origin: 0 50%; transform: scaleX(0); }

#arena { position: relative; flex: 1; min-height: 0; cursor: pointer; touch-action: manipulation; }
#drops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.drop {
  position: absolute; left: 0; top: 0; width: 58px; height: 58px; border-radius: 50%;
  box-shadow: 0 0 18px 1px var(--glow), 0 4px 10px rgba(0,0,0,.35);
  will-change: transform;
}
.drop img { display: block; width: 58px; height: 58px; object-fit: contain; -webkit-user-drag: none; }
#tapBtn {
  position: absolute; border-radius: 50%; border: 0; padding: 0; margin: 0;
  background: transparent; cursor: pointer; touch-action: none;
  -webkit-appearance: none; appearance: none;
}
#tapBtn:focus-visible { outline: 2px solid var(--a1); outline-offset: 6px; }
.badge {
  position: absolute; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  padding: 5px 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  box-shadow: 0 0 22px var(--glow);
  color: var(--on-accent); font-weight: 800; font-size: 10px; letter-spacing: 1.6px; line-height: 1.3;
}

/* "Beat your best" (widgets/best_challenge_card.dart) */
.challenge {
  position: absolute; left: 16px; right: 16px; pointer-events: none;
  border-radius: 20px; padding: 10px 16px; border: 1px solid var(--glass-border);
  background:
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,0) 55%, rgba(255,94,196,.05)),
    linear-gradient(rgba(255,175,46,.08), rgba(255,175,46,.08)),
    var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: border-color .3s, box-shadow .7s ease-out;
}
.challenge.beaten { border-color: rgba(255,175,46,.7); }
.challenge.glow { box-shadow: 0 0 22px 1.5px rgba(255,175,46,.35); }
.ch-head { display: flex; align-items: center; justify-content: space-between; }
.ch-title { font-size: 10.5px; letter-spacing: 1.4px; color: var(--a1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.challenge.beaten .ch-title { color: var(--text); }
.ch-trophy { width: 18px; height: 18px; fill: var(--a1); flex: none; }
.ch-target { font-weight: 700; font-size: 15px; line-height: 1.2; margin-top: 2px; }
.ch-track { margin-top: 6px; height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.ch-fill { height: 100%; width: 100%; background: var(--a1); transform-origin: 0 50%; transform: scaleX(0); }
.ch-foot { margin-top: 5px; font-size: 11px; line-height: 1.2; color: var(--dim); }
.challenge.compact { border-radius: 16px; padding: 5px 14px 6px; }
.challenge.compact .ch-full { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 6px; }
.challenge.compact .ch-head { display: contents; }
.challenge.compact .ch-trophy { width: 14px; height: 14px; order: -1; }
.challenge.compact .ch-title { font-size: 10px; letter-spacing: 1px; }
.challenge.compact .ch-target { display: none; }
.challenge.compact .ch-foot { margin: 0; font-size: 10.5px; grid-column: 3; grid-row: 1; white-space: nowrap; }
.challenge.compact .ch-track { grid-column: 1 / -1; grid-row: 2; margin-top: 4px; height: 4px; }
.challenge.compact.beaten .ch-foot { display: none; }

.hint {
  flex: none; margin: 0; padding: 4px 16px calc(10px * var(--s)); text-align: center;
  font-size: max(10px, calc(12px * var(--s))); line-height: 1.35; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- penalty flash (game_screen.dart _penaltyFlash) ---- */
.flash {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(rgba(255,45,85,.2), rgba(255,45,85,.2)), rgba(6,3,18,.62);
}
.flash.skull { background: linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.15)), rgba(6,3,18,.62); }
.flash img { width: calc(132px * var(--s)); height: calc(132px * var(--s)); object-fit: contain; }
.flash-title { font-weight: 700; font-size: 30px; line-height: 1.25; }
.flash-sub { font-size: 12px; color: var(--dim); padding: 0 16px; }
[hidden] { display: none !important; }

/* ---- results (screens/results_screen.dart) ---- */
.results {
  position: absolute; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; padding: 52px 18px 16px;
}
.res-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.res-title { margin: 0; text-align: center; font-weight: 700; font-size: calc(30px * var(--s)); line-height: 1.2; }
.res-card {
  margin-top: calc(18px * var(--s)); border-radius: 22px; padding: 16px 12px; text-align: center;
  background:
    linear-gradient(135deg, rgba(139,92,255,.08), rgba(139,92,255,.045)),
    linear-gradient(180deg, rgba(255,255,255,.063), rgba(255,255,255,0)),
    var(--glass);
}
.res-card.pb {
  border-color: rgba(255,175,46,.42);
  background:
    linear-gradient(135deg, rgba(255,175,46,.08), rgba(255,175,46,.045)),
    linear-gradient(180deg, rgba(255,255,255,.063), rgba(255,255,255,0)),
    var(--glass);
}
.res-score {
  font-family: "AzeretMono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700;
  font-size: calc(44px * var(--s)); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.res-pb { color: var(--a1); margin-top: 2px; }
.res-stats { display: flex; margin-top: 12px; }
.stat { flex: 1; min-width: 0; padding: 0 3px; display: flex; flex-direction: column; align-items: center; }
.stat-v { font-size: 15px; line-height: 1.3; }
.stat-k { font-size: calc(8.5px * var(--s)); letter-spacing: 1px; line-height: 1.25; margin-top: 2px; text-align: center; }
.res-best {
  margin-top: 12px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.res-best-v { font-size: 15px; }
.res-note { margin: 10px 4px 0; text-align: center; font-size: 12px; line-height: 1.4; color: var(--dim); }
.accent-btn {
  position: relative; flex: none; width: 100%; min-height: 48px; margin-top: 12px; padding: 12px 16px;
  border: 0; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  box-shadow: 0 0 22px var(--glow);
  color: var(--on-accent); font-family: inherit; font-weight: 800; font-size: 14px;
  transition: transform .09s ease-out, opacity .2s;
}
.accent-btn:active { transform: scale(.97); }
.accent-btn:disabled { opacity: .6; cursor: default; }

@media (max-height: 520px) {
  .res-best { margin-top: 8px; padding: 7px 14px; }
  .res-note { margin-top: 6px; font-size: 11px; }
  .res-card { padding: 10px 10px; }
  .results { padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .status, .status::before, .status-eff, .challenge, .accent-btn { transition: none; }
}

@media (max-width: 300px) {
  .stat-k { letter-spacing: .4px; }
  .preview-pill { left: 12px; padding: 0 10px; }
  .mute { right: 12px; }
}
