/* Battlet 2.0 - retro-arcade Telegram mini-app theme.
   Dark space-blue, sky-cyan + lime accents, chunky pixel type,
   Wii / Pokedex-style card UI. Tokens follow the owner's style sheet. */

:root {
  --bg: #020617;
  --panel: #0c1e3e;
  --input: #172554;
  --text: #f8fafc;
  --muted: #94a3b8;
  --link: #38bdf8;
  --cyan: #38bdf8;
  --lime: #a3e635;
  --red: #ef4444;
  --yellow: #facc15;
  --border: #1e3a8a;
  --live: #ff2a2a;
  --mythic: #a44dff;
  --head: "Press Start 2P", Silkscreen, ui-monospace, monospace;
  --body: VT323, Silkscreen, ui-monospace, monospace;
  --radius: 0.75rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.35;
  -webkit-font-smoothing: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

h1, h2, h3, .head {
  font-family: var(--head);
  line-height: 1.15;
  word-spacing: -0.05em;
  text-transform: uppercase;
}

#gameShell { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* CRT scanlines + soft vignette over everything */
#crt {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.35) 100%);
}

/* ---------------------------------------------------------------- LEDs --- */

.led {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: inset 0 0 2px rgba(0,0,0,.8);
  vertical-align: middle;
  flex: none;
}
.led.green { background: var(--lime); box-shadow: 0 0 6px var(--lime); animation: blink 1.1s steps(2) infinite; }
.led.red { background: var(--red); box-shadow: 0 0 6px var(--red); animation: blink .7s steps(2) infinite; }
.led.yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); animation: blink .9s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ----------------------------------------------------------------- HUD --- */
/* One shared bar, Head Ball style: lime hearts push from the left, red from
   the right, and the split slides toward whoever is losing. */

#hud {
  position: absolute;
  top: calc(6px + env(safe-area-inset-top));
  left: 8px; right: 8px;
  background: rgba(12,30,62,.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(56,189,248,.22);
  padding: 7px 9px 6px;
  pointer-events: none;
  z-index: 2;
}
.tugNames { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tugNames .side { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.tugNames .side.foe { justify-content: flex-end; }
.clock {
  flex: none;
  font-family: var(--head);
  font-size: 12px;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 0 8px rgba(56,189,248,.5);
  padding: 2px 6px 1px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(2,6,23,.55);
  font-variant-numeric: tabular-nums;
}
.clock.warn { color: var(--yellow); text-shadow: 0 0 8px rgba(250,204,21,.6); border-color: rgba(250,204,21,.5); }
.clock.danger { color: var(--live); text-shadow: 0 0 10px rgba(255,42,42,.8); border-color: var(--live); animation: blink .5s steps(2) infinite; }
.clock.over { color: var(--live); border-color: var(--live); }
.tugNames small {
  font-family: var(--head);
  font-size: 7px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.pwrTag {
  font-family: var(--head);
  font-size: 6px;
  color: #020617;
  background: var(--yellow);
  border-radius: 4px;
  padding: 3px 4px 2px;
  white-space: nowrap;
}
.pwrTag.mythic { background: var(--mythic); color: var(--text); box-shadow: 0 0 8px rgba(164,77,255,.6); }
.pwrTag.rare { background: var(--cyan); }
.tugRow { display: flex; align-items: center; gap: 7px; }
.hearts { font-family: var(--head); font-size: 9px; width: 16px; text-align: center; flex: none; }
.hearts.you { color: var(--lime); }
.hearts.foe { color: var(--red); }
.tug {
  position: relative;
  display: flex;
  flex: 1;
  height: 18px;
  border-radius: 9px;
  background: var(--input);
  border: 1px solid var(--border);
  overflow: hidden;
}
.tug i {
  display: flex; align-items: center;
  overflow: hidden;
  font-family: var(--head); font-size: 8px; line-height: 1;
  letter-spacing: 2px;
  white-space: nowrap;
  transition: flex-grow .35s cubic-bezier(.2,.9,.3,1.2);
  min-width: 0;
}
.tug i.you { justify-content: flex-start; padding-left: 7px; color: #1a2e05; background: linear-gradient(90deg, #65a30d, var(--lime)); }
.tug i.foe { justify-content: flex-end; padding-right: 7px; color: #fff1f2; background: linear-gradient(90deg, var(--red), #b91c1c); }
.tug::after {
  content: "";
  position: absolute; top: -2px; bottom: -2px;
  left: calc(var(--split, 50%) - 1px);
  width: 0;
}
.tug.youLead i.you { box-shadow: inset 0 0 12px rgba(255,255,255,.25); }
.tug.foeLead i.foe { box-shadow: inset 0 0 12px rgba(255,255,255,.25); }
.chargeRow { display: flex; justify-content: space-between; min-height: 10px; margin-top: 4px; }
.charge {
  font-family: var(--head); font-size: 6px;
  color: var(--mythic);
  text-shadow: 0 0 8px rgba(164,77,255,.8);
  animation: blink .8s steps(2) infinite;
}
.charge:last-child { margin-left: auto; }

#centerChip {
  position: absolute;
  top: calc(88px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  width: min(300px, 86vw);
  background: rgba(12,30,62,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(56,189,248,.22), 0 0 18px rgba(56,189,248,.12);
  padding: 6px 10px 7px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
#chipLabel { display: block; font-family: var(--head); font-size: 8px; color: var(--cyan); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chipLabel.hot { color: var(--yellow); }
#chipLabel.danger { color: var(--live); }
.chipBar { height: 6px; border-radius: 3px; background: var(--input); border: 1px solid var(--border); overflow: hidden; }
.chipBar i { display: block; height: 100%; width: 100%; background: var(--cyan); transition: width .08s linear; }
.chipBar i.warn { background: var(--yellow); }
.chipBar i.danger { background: var(--live); }

/* --------------------------------------------------------------- meter --- */
/* The timing bar under the arena. One lime zone whose width is your PWR, a
   purple sliver when a charged mythic is tapping, red tinted on the rival's
   turn so you can watch their cursor against their band. */

#meter {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
#meterHint {
  display: block;
  font-family: var(--head);
  font-size: 6px;
  color: var(--lime);
  text-shadow: 0 0 8px rgba(163,230,53,.55);
  margin-bottom: 12px;
  animation: blink 1.2s steps(2) infinite;
}
#meter.foe #meterHint { color: var(--red); text-shadow: 0 0 8px rgba(239,68,68,.55); animation: none; }
.meterTrack {
  position: relative;
  height: 18px;
  border-radius: 9px;
  background: #334155;
  border: 1px solid #64748b;
  box-shadow: inset 0 1px 0 rgba(56,189,248,.18), 0 0 14px rgba(2,6,23,.6);
  transition: opacity .18s ease;
}
.meterTrack .band {
  position: absolute; top: 0; bottom: 0;
  overflow: hidden;
  font-family: var(--head); font-size: 6px; line-height: 18px;
  text-align: center; white-space: nowrap;
  color: #020617;
  transition: left .28s ease, width .28s ease;
}
.meterTrack .band.perfect { background: var(--lime); box-shadow: 0 0 12px rgba(163,230,53,.7); border-radius: 4px; }
#meter.foe .meterTrack .band.perfect { background: var(--red); box-shadow: 0 0 12px rgba(239,68,68,.6); color: var(--text); }
/* the 2x sliver never animates from zero width (it snaps into place and pops),
   keeps a minimum size on narrow phones, and carries a pale outline so it
   reads against the track and the cursor */
.meterTrack .band.krak {
  background: var(--mythic);
  box-shadow: 0 0 10px var(--mythic), inset 0 0 0 2px #ede9fe;
  border-radius: 3px;
  min-width: 14px;
  transition: none;
  transform-origin: center;
}
.meterTrack .band.krak.pop { animation: krakPop .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes krakPop { 0% { transform: scale(.3, 1.6); opacity: 0; } 60% { transform: scale(1.25, 1.15); opacity: 1; } 100% { transform: none; opacity: 1; } }
#meterCursor {
  position: absolute; top: -3px; bottom: -3px;
  width: 5px;
  margin-left: -2px;
  background: var(--text);
  box-shadow: 0 0 8px var(--cyan), 0 0 2px var(--text);
  border-radius: 2px;
}
#meter.locked #meterCursor { background: var(--lime); box-shadow: 0 0 12px var(--lime); width: 7px; margin-left: -3px; }
#meter.foe.locked #meterCursor { background: var(--red); box-shadow: 0 0 12px var(--red); }
#meter.locked .meterTrack .band.perfect { filter: brightness(1.2); }
#meter.idle .meterTrack { opacity: .4; }
#meterKrakTag {
  position: absolute; top: -13px;
  transform: translateX(-50%);
  font-family: var(--head); font-size: 7px; line-height: 1;
  color: #f5f3ff;
  background: var(--mythic);
  border-radius: 3px;
  padding: 2px 3px 1px;
  text-shadow: none;
  box-shadow: 0 0 8px rgba(164,77,255,.9);
  white-space: nowrap;
  transition: none;
}
#meterKrakTag::after { content: ""; display: block; width: 0; height: 0; margin: 1px auto 0; border: 3px solid transparent; border-top-color: var(--mythic); border-bottom: 0; }
#meterResult {
  display: block;
  min-height: 12px;
  margin-top: 7px;
  font-family: var(--head);
  font-size: 8px;
  color: var(--text);
  text-shadow: 0 0 8px rgba(248,250,252,.4);
}
#meterResult.good { color: var(--lime); text-shadow: 0 0 10px rgba(163,230,53,.7); }
#meterResult.krak { color: var(--mythic); text-shadow: 0 0 12px rgba(164,77,255,.85); }
#meterResult.foe { color: var(--red); text-shadow: 0 0 10px rgba(239,68,68,.6); }
#meterResult.bad { color: var(--muted); text-shadow: none; }

/* ----------------------------------------------------------------- pad --- */
/* One big TAP button. Lit lime on your sweep, purple when the 2x is up,
   dim and labelled on the rival's turn. */

#pad {
  position: absolute;
  left: 8px; right: 8px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 2;
}
#btnTap {
  position: relative;
  width: 100%;
  font-family: var(--head);
  font-size: 13px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 0 9px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 0 #0a1230, inset 0 1px 0 rgba(56,189,248,.18);
  transition: filter .12s ease, transform .06s ease, box-shadow .06s ease, border-color .12s ease;
  touch-action: manipulation;
}
#btnTap b { display: block; font-size: 24px; line-height: 1; margin-bottom: 6px; }
#btnTap small { display: block; margin-top: 5px; font-family: var(--body); font-size: 13px; color: var(--muted); letter-spacing: .04em; }
#btnTap:active { transform: translateY(5px); box-shadow: 0 1px 0 #0a1230; filter: brightness(1.25); }
#btnTap.live { border-color: var(--lime); background: #1c3a12; box-shadow: 0 6px 0 #0a1230, 0 0 22px rgba(163,230,53,.45); animation: padPulse .5s ease-in-out infinite alternate; }
#btnTap.live small { color: var(--lime); }
#btnTap.live.krak { border-color: var(--mythic); background: #2a1050; box-shadow: 0 6px 0 #0a1230, 0 0 24px rgba(164,77,255,.5); }
#btnTap.live.krak small { color: var(--mythic); }
#btnTap.theirs { filter: grayscale(.6) brightness(.6); }
@keyframes padPulse { from { filter: brightness(1); } to { filter: brightness(1.3); } }

/* ------------------------------------------------------------- overlays --- */

.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(2,6,23,.82);
  z-index: 5;
}
.panel {
  width: min(372px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 18px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(56,189,248,.25), 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(56,189,248,.08);
}

h1 { font-size: clamp(1.25rem, 4vw, 2rem); color: var(--cyan); text-shadow: 0 0 16px rgba(56,189,248,.6); }
h1 span { color: var(--lime); text-shadow: 0 0 16px rgba(163,230,53,.6); }
h2 { font-size: 13px; color: var(--cyan); text-shadow: 0 0 12px rgba(56,189,248,.55); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tagline { margin: 10px 0 12px; font-size: 15px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.lore { font-size: 17px; color: var(--muted); line-height: 1.35; margin-bottom: 12px; }
.lore code { color: var(--link); font-family: var(--body); }
.demoBtn { display: block; width: 100%; margin: 0 0 12px; font-family: var(--head); font-size: 7px; color: var(--yellow); background: var(--input); border: 1px solid rgba(250,204,21,.35); border-radius: var(--radius); padding: 10px 12px 9px; cursor: pointer; box-shadow: 0 3px 0 #0a1230; letter-spacing: .04em; }
.demoBtn:active { transform: translateY(3px); box-shadow: none; }
/* DEMO card: sits over the arena, the duel holds until NEXT / GO */
#coach {
  position: absolute; left: 16px; right: 16px; top: 21%;
  z-index: 7;
  background: var(--panel);
  border: 1px solid rgba(250,204,21,.5); border-radius: var(--radius);
  padding: 12px 14px 10px; text-align: left;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 30px rgba(250,204,21,.12);
}
#coach.end { top: auto; bottom: 22%; }
#coach.pop { animation: coachPop .28s cubic-bezier(.2,1.4,.4,1); }
@keyframes coachPop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
#coach b { display: block; font-family: var(--head); font-size: 9px; color: var(--yellow); text-shadow: 0 0 10px rgba(250,204,21,.5); margin-bottom: 8px; }
#coach p { font-size: 17px; line-height: 1.35; color: var(--text); margin: 0 0 10px; }
#coach p i { font-style: normal; font-weight: bold; }
#coach p i.g { color: var(--lime); } #coach p i.m { color: var(--mythic); } #coach p i.y { color: var(--yellow); } #coach p i.r { color: var(--red); }
.coachRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.coachRow small { font-family: var(--head); font-size: 6px; color: var(--muted); letter-spacing: .08em; }
#coachNext { font-family: var(--head); font-size: 8px; color: #020617; background: var(--yellow); border: 0; border-radius: 8px; padding: 10px 16px 9px; box-shadow: 0 4px 0 #a16207; cursor: pointer; }
#coachNext:active { transform: translateY(3px); box-shadow: 0 1px 0 #a16207; }



/* telegramon picker: the card shows PWR, rarity and how wide the lime will be */
.traineeRow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.traineeCard { background: var(--input); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px 9px; box-shadow: inset 0 1px 0 rgba(56,189,248,.15); }
.traineeCard span { display: block; font-family: var(--head); font-size: 6px; color: var(--muted); }
.traineeCard strong { display: block; font-family: var(--head); font-size: 10px; color: var(--cyan); margin-top: 6px; }
.fighterMeta { display: block; font-family: var(--head); font-style: normal; font-size: 7px; margin-top: 6px; color: var(--yellow); }
.fighterMeta.rare { color: var(--cyan); }
.fighterMeta.mythic { color: var(--mythic); text-shadow: 0 0 10px rgba(164,77,255,.6); }
.bandPreview { position: relative; height: 10px; margin: 8px 6px 4px; border-radius: 5px; background: var(--panel); border: 1px solid var(--border); overflow: hidden; }
.bandPreview i { position: absolute; top: 0; bottom: 0; background: var(--lime); box-shadow: 0 0 10px rgba(163,230,53,.7); border-radius: 3px; transition: width .25s ease, left .25s ease; }
.traineeCard small { display: block; font-size: 13px; color: var(--muted); }
.arrowBtn {
  font-family: var(--head); font-size: 11px;
  color: var(--lime);
  background: var(--input);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 13px;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a1230;
}
.arrowBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a1230; }

.bestCard { background: var(--input); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 9px; margin-bottom: 14px; box-shadow: inset 0 1px 0 rgba(56,189,248,.15); }
.bestCard span { font-family: var(--head); font-size: 6px; color: var(--muted); }
.bestCard strong { display: block; font-family: var(--head); font-size: 16px; color: var(--cyan); text-shadow: 0 0 14px rgba(56,189,248,.5); margin: 6px 0 3px; }
.bestCard small { font-size: 14px; color: var(--lime); }

.primaryBtn {
  position: relative;
  width: 100%;
  overflow: hidden;
  font-family: var(--head); font-size: 11px;
  color: #020617;
  background: var(--lime);
  border: 0; border-radius: var(--radius);
  padding: 15px 0 14px;
  box-shadow: 0 6px 0 #4d7c0f, inset 0 -3px 0 rgba(0,0,0,.18), 0 10px 24px rgba(163,230,53,.3);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
}
.primaryBtn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: sheen 3.2s linear infinite;
  pointer-events: none;
}
@keyframes sheen { from { background-position: 200% 0; } to { background-position: -50% 0; } }
.primaryBtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #4d7c0f; }
.primaryBtn:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; cursor: default; }
.build { margin-top: 10px; padding: 8px 0 2px; font-family: var(--head); font-size: 6px; color: var(--muted); letter-spacing: .1em; cursor: pointer; }

/* ?debug=1 readout: build, turn, 2x state and the sliver element's box */
#debug {
  position: fixed; left: 6px; right: 6px; bottom: calc(2px + env(safe-area-inset-bottom));
  z-index: 9; pointer-events: none;
  font: 12px/1.2 var(--body); color: var(--yellow);
  background: rgba(2,6,23,.85); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 6px; word-break: break-word; white-space: pre-wrap;
}

.secondaryBtn {
  font-family: var(--head); font-size: 8px;
  color: var(--cyan);
  background: var(--input);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 18px 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a1230;
}
.secondaryBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a1230; }

/* ---------------------------------------------------------------- offer --- */
/* The Stars offer before a PvP match: 8 seconds to buy the first tap. */
.offerPanel { padding: 18px 16px 16px; border-color: rgba(250,204,21,.4); box-shadow: inset 0 1px 0 rgba(250,204,21,.3), 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(250,204,21,.1); }
.offerPanel h2 { color: var(--yellow); text-shadow: 0 0 12px rgba(250,204,21,.55); margin-bottom: 10px; }
.offerRing {
  --p: 100%;
  width: 72px; height: 72px; margin: 0 auto 12px;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) var(--p), rgba(250,204,21,.15) 0);
  display: grid; place-items: center;
  box-shadow: 0 0 18px rgba(250,204,21,.35);
}
.offerRing b { width: 58px; height: 58px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-family: var(--head); font-size: 22px; color: var(--yellow); text-shadow: 0 0 12px rgba(250,204,21,.6); }
#offer.bought .offerRing { background: conic-gradient(var(--lime) var(--p), rgba(163,230,53,.15) 0); box-shadow: 0 0 18px rgba(163,230,53,.35); }
#offer.bought .offerRing b { color: var(--lime); text-shadow: 0 0 12px rgba(163,230,53,.6); }
.offerPitch { font-size: 17px; color: var(--text); line-height: 1.35; margin: 0 0 14px; }
.offerPitch b { color: var(--yellow); }
.starsBtn {
  position: relative; display: block; width: 100%;
  font-family: var(--head); font-size: 9px; line-height: 1.5;
  color: #1c1917;
  background: var(--yellow);
  border: 0; border-radius: var(--radius);
  padding: 13px 10px 11px;
  box-shadow: 0 6px 0 #a16207, inset 0 -3px 0 rgba(0,0,0,.18), 0 10px 24px rgba(250,204,21,.3);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
}
.starsBtn small { display: block; font-family: var(--body); font-size: 14px; color: rgba(28,25,23,.75); margin-top: 3px; letter-spacing: .04em; }
.starsBtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #a16207; }
.starsBtn:disabled { cursor: default; }
#offer.bought .starsBtn { background: var(--lime); color: #052e16; box-shadow: 0 6px 0 #4d7c0f, inset 0 -3px 0 rgba(0,0,0,.18), 0 10px 24px rgba(163,230,53,.3); }
.offerState { font-family: var(--head); font-size: 6px; color: var(--muted); letter-spacing: .06em; margin: 12px 0 12px; }
#offer.bought .offerState { color: var(--lime); }
.offerPanel .secondaryBtn { display: block; width: 100%; }

/* -------------------------------------------------------------- results --- */
/* No closing window: the arena stays visible and one word says how it went. */

.resultsOverlay { background: rgba(2,6,23,.45); }
.resultWrap { text-align: center; }
.resultWord {
  display: block;
  font-family: var(--head); font-size: clamp(34px, 11vw, 56px);
  letter-spacing: .06em;
  margin-bottom: 18px;
  animation: resultPop .45s cubic-bezier(.2,1.4,.4,1) both;
}
.resultWord.win { color: var(--lime); text-shadow: 0 0 22px rgba(163,230,53,.7), 0 4px 0 #365314; }
.resultWord.lose { color: var(--red); text-shadow: 0 0 22px rgba(239,68,68,.7), 0 4px 0 #7f1d1d; }
.resultWord.draw { color: var(--yellow); text-shadow: 0 0 22px rgba(250,204,21,.7), 0 4px 0 #713f12; }
@keyframes resultPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.resultRating { font-family: var(--head); font-size: 10px; color: var(--lime); text-shadow: 0 0 10px rgba(163,230,53,.5); margin: -4px 0 16px; }
.resultRating.down { color: var(--red); text-shadow: 0 0 10px rgba(239,68,68,.5); }
.retryHint { font-size: 14px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }

.pvpGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.pvpGrid div { background: var(--input); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pvpGrid small { font-family: var(--head); font-size: 5.5px; color: var(--muted); }
.pvpGrid strong { font-family: var(--head); font-size: 13px; color: var(--cyan); }
.miniBtn { font-family: var(--head); font-size: 6px; color: var(--cyan); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 7px 8px 6px; cursor: pointer; box-shadow: 0 2px 0 #0a1230; }
.miniBtn:active { transform: translateY(2px); box-shadow: none; }
.miniBtn.toggle.on { color: var(--lime); border-color: rgba(163,230,53,.5); }
.linkBtn { display: block; width: 100%; margin: -4px 0 10px; font-family: var(--head); font-size: 6px; color: var(--yellow); background: none; border: 0; cursor: pointer; letter-spacing: .04em; }
.pvpLog { max-height: 118px; overflow-y: auto; }
.pvpLog div { padding: 2px 0; }
.pvpLog b.w { color: var(--lime); } .pvpLog b.l { color: var(--red); } .pvpLog b.d { color: var(--yellow); }
.pvpNote { font-size: 15px; color: var(--muted); text-align: left; background: var(--input); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; line-height: 1.3; }
.pvpNote b { color: var(--yellow); }

/* Sound: one small round mute button, tucked in a corner, never over the bar or the pad. */
.soundToggle { position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 30; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font-size: 16px; line-height: 1; color: var(--cyan); background: rgba(12,30,62,.7); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; opacity: .8; }
.soundToggle:active { transform: scale(.94); }
.soundToggle[aria-pressed="true"] { color: var(--muted); }
.soundToggle:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.soundToggle.inBattle { top: calc(146px + env(safe-area-inset-top)); bottom: auto; }
