/* Over 9001: the playful edges (src/Fun, public/assets/js/fun.js). Nothing here touches ticking a card.
   Dark first; the light values only differ where contrast needs it. Motion is always optional. */

:root {
  --gold: #ffd24a;
  --gold-strong: #8a6500;
  --lens: #6ee7a0;
  --lens-bg: #0c1f16;
}
@media (prefers-color-scheme: dark) { :root { --gold-strong: #ffd24a; } }

/* ---------- Super Saiyan (Konami code or "kamehameha"): the accent goes gold for the session ---------- */
html.ssj { --accent: #ffd24a; --accent-strong: #8a6500; --accent-soft: #fff3c4; }
@media (prefers-color-scheme: dark) { html.ssj { --accent-strong: #ffe083; --accent-soft: #3a3010; } }
html.ssj .brand img { filter: hue-rotate(14deg) saturate(1.25) brightness(1.15) drop-shadow(0 0 4px rgba(255, 210, 74, .8)); }
.brand img.is-charging { animation: o9k-charge 1.6s ease-in-out; }
@keyframes o9k-charge {
  0%   { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 210, 74, 0)); }
  45%  { transform: scale(1.5) rotate(-6deg); filter: brightness(1.3) drop-shadow(0 0 8px #ffd24a) drop-shadow(0 0 18px #f5b800); }
  60%  { transform: scale(1.5) rotate(5deg); filter: brightness(1.4) drop-shadow(0 0 10px #fff2a8) drop-shadow(0 0 22px #f5b800); }
  100% { transform: scale(1); }
}

/* ---------- The scouter: a power level in a lens ---------- */
.scouter { display: inline-flex; align-items: baseline; padding: .15rem .65rem .2rem; border-radius: 10px; position: relative; overflow: hidden;
  background: var(--lens-bg); border: 1px solid color-mix(in srgb, var(--lens) 55%, transparent); color: var(--lens);
  box-shadow: inset 0 0 14px rgba(110, 231, 160, .12), 0 0 0 1px rgba(0, 0, 0, .25); vertical-align: middle; }
.scouter__num { font-family: var(--mono); font-weight: 750; font-size: 1.15rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.scouter__kaio { margin-left: .5rem; font-size: .72rem; font-weight: 700; color: #ff7a59; vertical-align: middle; }
/* Over 9000: the lens cracks (CSS only) and the readout burns gold */
.scouter--cracked { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 70%, transparent); background: #251a05;
  box-shadow: inset 0 0 16px rgba(255, 210, 74, .2), 0 0 12px rgba(255, 210, 74, .25); }
.scouter--cracked::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .75;
  background:
    linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, .85) 38.6%, transparent 39.4%),
    linear-gradient(64deg, transparent 52%, rgba(255, 255, 255, .65) 52.5%, transparent 53.2%),
    linear-gradient(135deg, transparent 66%, rgba(255, 255, 255, .55) 66.4%, transparent 67%); }
.scouter--cracked .scouter__num { text-shadow: 0 0 10px rgba(255, 210, 74, .6); animation: o9k-flicker 3.2s steps(1, end) infinite; }
@keyframes o9k-flicker { 0%, 88%, 92%, 100% { opacity: 1; } 90% { opacity: .55; } 96% { opacity: .8; } }
.stats-scouter { margin: -.25rem 0 1rem; color: var(--muted); font-size: .9rem; }
.stats-scouter .scouter { margin-left: .35rem; }

/* Form badge: text only */
.form-badge { display: inline-block; font-size: .72rem; font-weight: 750; letter-spacing: .03em; padding: .12rem .55rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent-strong); vertical-align: middle; }

.scouter-panel__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.scouter-panel__label { margin: 0 0 .25rem; font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.scouter-panel .scouter__num { font-size: 2rem; }
.scouter-panel__form { margin: 0; text-align: right; }
.scouter-panel__line { margin: .75rem 0 0; }
.scouter-panel .wish-form { margin-top: .75rem; }
.wish-form legend { font-weight: 700; font-size: .9rem; margin-bottom: .25rem; }
.wish-form .choice-list { margin-bottom: .6rem; }
.profile-fun { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .4rem !important; }
.profile-share { display: flex; align-items: center; gap: .9rem; margin: -.5rem 0 1rem; }

/* Rival scouter */
.rival { max-width: 28rem; padding: .7rem 1rem; }
.rival > summary { cursor: pointer; font-weight: 700; color: var(--accent-strong); }
.rival__row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .8rem; flex-wrap: wrap; }
.rival__who { margin: 0 0 .25rem; font-size: .75rem; color: var(--muted); }
.rival__vs { color: var(--muted); font-weight: 750; font-size: .8rem; }
.rival__gap { margin: .8rem 0 0; font-weight: 650; }

/* Dragon radar */
.radar__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.radar__list a { display: grid; grid-template-columns: .6rem 3.6rem minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .45rem .2rem;
  text-decoration: none; color: var(--text); border-radius: 8px; }
.radar__list a:hover { background: var(--surface-2); }
.radar__code { font-weight: 750; }
.radar__bar { font-size: .9rem; letter-spacing: -.02em; white-space: pre; color: var(--accent-strong); overflow: hidden; }
.radar__left { font-size: .8rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.radar__ping { width: .5rem; height: .5rem; border-radius: 50%; background: var(--lens); box-shadow: 0 0 0 0 rgba(110, 231, 160, .6);
  animation: o9k-ping 2.6s ease-out infinite; animation-delay: calc(var(--i, 0) * .37s); }
@keyframes o9k-ping { 0% { box-shadow: 0 0 0 0 rgba(110, 231, 160, .55); } 70%, 100% { box-shadow: 0 0 0 .55rem rgba(110, 231, 160, 0); } }

/* Set race */
.race-grid { margin-bottom: 1rem; }
.race__list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .15rem; }
.race__list li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; align-items: baseline; gap: .5rem; }
.race__rank { font-weight: 750; color: var(--muted); font-variant-numeric: tabular-nums; }
.race__list li:first-child .race__rank { color: var(--gold-strong); }
.race__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.race__bar { font-size: .85rem; letter-spacing: -.02em; white-space: pre; color: var(--accent-strong); }

/* Countdown to the next set */
.countdown { font-size: .9rem; white-space: pre; font-variant-numeric: tabular-nums; }
.countdown-list { list-style: none; margin: -.25rem 0 1.25rem; padding: 0; display: grid; gap: .1rem; }
.countdown-list a { text-decoration: none; color: var(--accent-strong); }
.game-tile__lines .countdown { color: var(--accent-strong); font-size: .8rem; display: block; }

/* The 404: a Senzu bean and a card */
.error-page--senzu { text-align: center; }
.senzu { display: block; margin: 0 auto .5rem; image-rendering: pixelated; animation: o9k-bob 3s ease-in-out infinite; }
@keyframes o9k-bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
.error-page--senzu .error-code { margin-top: 0; }
.senzu-card { justify-content: center; max-width: 9rem; margin-inline: auto; }

/* Missing-cards line on a shared set */
.missing-note { max-width: 40rem; }

/* Set complete: a shimmer along the bar, once */
.progress--flourish .progress__bar { position: relative; overflow: hidden; }
.progress--flourish .progress__bar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .85) 50%, transparent 80%); transform: translateX(-120%);
  animation: o9k-shimmer 1.1s ease-out 1; }
.progress--flourish .progress__bar > span { animation: o9k-coil .9s ease-out 1; transform-origin: left center; }
@keyframes o9k-shimmer { to { transform: translateX(120%); } }
@keyframes o9k-coil { 0% { transform: scaleY(1); } 30% { transform: scaleY(1.9); filter: brightness(1.4); } 60% { transform: scaleY(.8); } 100% { transform: scaleY(1); } }

/* It's over 9000! (once ever): a burst over the page that never takes a tap */
.burst { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; animation: o9k-burst-life 3.2s ease-out forwards; }
.burst::before { content: ""; position: absolute; width: 140vmax; height: 140vmax; opacity: .55;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 74, .55) 0 4deg, transparent 4deg 14deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 8%, transparent 55%); mask-image: radial-gradient(circle, #000 0 8%, transparent 55%);
  animation: o9k-rays 3.2s ease-out forwards; }
.burst__art { position: relative; margin: 0; padding: 1rem 1.25rem; font: 700 clamp(.95rem, 4.6vw, 1.5rem)/1.25 var(--mono); color: var(--gold); text-align: center;
  background: rgba(10, 8, 2, .78); border: 1px solid rgba(255, 210, 74, .6); border-radius: 12px; text-shadow: 0 0 12px rgba(255, 210, 74, .8);
  animation: o9k-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes o9k-burst-life { 0%, 80% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes o9k-rays { from { transform: scale(.3) rotate(0); } to { transform: scale(1) rotate(25deg); } }
@keyframes o9k-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* The Dragon Ball hunt: small orange balls, no hints */
.dball-slot { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1rem; display: flex; }
.dball-slot:has(.dball) { height: 1.9rem; align-items: center; }
.dball { appearance: none; border: 0; background: none; padding: .25rem; margin: 0; cursor: pointer; line-height: 0; border-radius: 50%; opacity: .85;
  transition: transform .15s ease, opacity .15s ease; }
.dball:hover, .dball:focus-visible { opacity: 1; transform: scale(1.18); }
.dball--found { animation: o9k-ball-out .6s ease-in forwards; pointer-events: none; }
@keyframes o9k-ball-out { to { transform: translateY(-1.5rem) scale(1.6); opacity: 0; } }
.hunt-toast { position: fixed; left: 50%; bottom: 4.5rem; transform: translateX(-50%); z-index: 80; padding: .45rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 650;
  background: var(--surface); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.shenron { width: min(34rem, calc(100vw - 2rem)); padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.shenron::backdrop { background: rgba(0, 0, 0, .7); }
.shenron__art { margin: 0 0 .75rem; font: 700 clamp(.5rem, 2.4vw, .8rem)/1.15 var(--mono); color: #6ee7a0; white-space: pre; overflow-x: auto; text-shadow: 0 0 8px rgba(110, 231, 160, .45); }
.shenron h2 { margin: 0 0 .25rem; }
.shenron form .choice-list { margin: .5rem 0; display: grid; gap: .1rem; }
.shenron__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

@media (prefers-reduced-motion: reduce) {
  .senzu, .scouter--cracked .scouter__num, .radar__ping, .brand img.is-charging { animation: none; }
  .burst::before { animation: none; }
  .burst__art { animation: none; }
  .progress--flourish .progress__bar::after { animation: none; transform: none; opacity: 0; }
  .progress--flourish .progress__bar > span { animation: none; box-shadow: 0 0 0 2px var(--gold); }
  .dball, .dball--found { transition: none; animation-duration: .01s; }
}
