:root {
  --ds-ink: #f6fbff;
  --ds-muted: #a8bed3;
  --ds-navy: #061226;
  --ds-panel: rgba(7, 22, 43, .94);
  --ds-cyan: #58ebff;
  --ds-blue: #2086ff;
  --ds-coral: #ff5b67;
  --ds-yellow: #ffd45d;
  --ds-green: #65efad;
  --ds-border: rgba(113, 226, 255, .22);
  --ds-shadow: 0 28px 70px rgba(0, 5, 20, .42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f6f5fb;
}

button, input { font: inherit; }

#dodgeballShowdownGame {
  width: 100%;
  max-width: none;
  min-height: var(--abz-game-stage-height, 100dvh);
  color: var(--ds-ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(42, 198, 255, .2), transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(255, 89, 103, .15), transparent 29%),
    linear-gradient(150deg, #061125, #0a2440 52%, #071426);
  font-family: Poppins, Inter, ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  isolation: isolate;
}

#dodgeballShowdownGame button,
#dodgeballShowdownGame a {
  -webkit-tap-highlight-color: transparent;
}

.ds-screen {
  position: relative;
  display: none;
  width: 100%;
  min-height: var(--abz-game-stage-height, 100dvh);
  padding: clamp(20px, 4vw, 52px);
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.ds-screen.is-active { display: grid; }

.ds-panel {
  position: relative;
  z-index: 2;
  width: min(1100px, 100%);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--ds-border);
  border-radius: clamp(24px, 3vw, 38px);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .07), transparent 45%),
    var(--ds-panel);
  box-shadow: var(--ds-shadow), inset 0 1px rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px);
}

.ds-kicker {
  margin: 0 0 8px;
  color: var(--ds-cyan);
  font-size: clamp(.73rem, 1.6vw, .9rem);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ds-btn {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, background .18s ease;
}

.ds-btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.ds-btn:active { transform: translateY(0) scale(.98); }
.ds-btn:focus-visible,
.ds-back:focus-visible,
.ds-difficulty:focus-visible,
.ds-skill-card:focus-visible,
.ds-answer:focus-visible,
.ds-touch-actions button:focus-visible,
.ds-pause-button:focus-visible {
  outline: 4px solid var(--ds-yellow);
  outline-offset: 4px;
}

.ds-btn-primary {
  color: #061225;
  background: linear-gradient(135deg, #63edff, #37bce9);
  box-shadow: 0 13px 32px rgba(54, 205, 241, .28);
}

.ds-btn-quiet {
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
}

.ds-btn-large {
  min-height: 58px;
  padding-inline: clamp(24px, 5vw, 40px);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.ds-back {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
}

/* Start */
.ds-screen[data-screen="start"] {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr);
  gap: clamp(28px, 6vw, 90px);
  background:
    linear-gradient(90deg, rgba(2, 10, 27, .98) 0%, rgba(5, 18, 38, .8) 52%, rgba(8, 31, 51, .62)),
    radial-gradient(circle at 85% 30%, rgba(39, 210, 255, .2), transparent 34%);
}

.ds-start-backdrop { position: absolute; inset: 0; overflow: hidden; }
.ds-light { position: absolute; width: 5px; height: 72%; top: -8%; background: linear-gradient(transparent, rgba(88, 235, 255, .7), transparent); filter: blur(2px); transform: rotate(24deg); }
.ds-light-one { left: 22%; }
.ds-light-two { right: 16%; transform: rotate(-24deg); background: linear-gradient(transparent, rgba(255, 91, 103, .52), transparent); }
.ds-court-line { position: absolute; bottom: -16%; width: 7px; height: 70%; background: linear-gradient(var(--ds-cyan), transparent); opacity: .23; transform-origin: bottom; }
.ds-line-one { left: 31%; transform: rotate(37deg); }
.ds-line-two { right: 31%; transform: rotate(-37deg); }

.ds-start-copy {
  position: relative;
  z-index: 2;
  width: min(690px, 100%);
  justify-self: end;
}

.ds-start-copy h2 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.8rem);
  font-weight: 950;
  letter-spacing: -.065em;
  line-height: .85;
  text-transform: uppercase;
  text-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

.ds-start-copy h2 span {
  display: block;
  color: #fff;
  font-size: .57em;
  letter-spacing: -.045em;
}

.ds-start-copy h2::first-line { color: white; }
.ds-start-copy h2 { color: var(--ds-coral); }

.ds-lead {
  max-width: 660px;
  margin: clamp(20px, 3vw, 30px) 0;
  color: #c7d9e8;
  font-size: clamp(1rem, 1.9vw, 1.22rem);
  font-weight: 600;
  line-height: 1.65;
}

.ds-feature-pills,
.ds-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ds-feature-pills { margin-bottom: 28px; }
.ds-feature-pills span {
  padding: 8px 13px;
  border: 1px solid rgba(102, 231, 255, .22);
  border-radius: 999px;
  color: #dffbff;
  background: rgba(28, 143, 174, .12);
  font-size: .8rem;
  font-weight: 800;
}

.ds-start-art {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  aspect-ratio: 4 / 5;
  align-self: center;
}

.ds-arena-card {
  position: absolute;
  inset: 3%;
  border: 1px solid rgba(96, 225, 255, .38);
  border-radius: 42px;
  background:
    linear-gradient(155deg, transparent 35%, rgba(55, 212, 255, .12)),
    linear-gradient(#0a2340 0 44%, #17485d 44% 100%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .44), inset 0 0 80px rgba(59, 225, 255, .1);
  overflow: hidden;
  transform: perspective(900px) rotateY(-7deg) rotateX(3deg);
}

.ds-arena-card::before {
  content: "";
  position: absolute;
  inset: 44% -30% -35%;
  border: 3px solid rgba(95, 235, 255, .26);
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(255, 255, 255, .45) 50%, transparent 50.3%),
    repeating-linear-gradient(90deg, transparent 0 24%, rgba(255, 255, 255, .12) 24.4% 24.8%);
  transform: perspective(500px) rotateX(48deg);
}

.ds-score-banner {
  position: absolute;
  z-index: 4;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: var(--ds-yellow);
  background: rgba(4, 13, 29, .82);
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .12em;
  white-space: nowrap;
}

.ds-arena-card img {
  position: absolute;
  z-index: 4;
  right: 17%;
  bottom: 22%;
  width: 36%;
  filter: drop-shadow(0 22px 16px rgba(0, 0, 0, .45));
}

.ds-platform,
.ds-cover { position: absolute; background: #163752; border: 3px solid rgba(83, 227, 255, .38); box-shadow: inset 0 8px rgba(255, 255, 255, .06); }
.ds-platform { bottom: 17%; width: 28%; height: 15%; transform: skewY(-13deg); }
.ds-platform-left { left: -2%; }
.ds-platform-right { right: -2%; transform: skewY(13deg); }
.ds-cover { bottom: 14%; width: 15%; height: 17%; }
.ds-cover-a { left: 26%; }
.ds-cover-b { right: 29%; height: 12%; }

.ds-hero-ball {
  position: absolute;
  z-index: 6;
  left: 23%;
  top: 36%;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffb09d, transparent 20%),
    repeating-conic-gradient(from 12deg, #ff5b67 0 13deg, #b92043 13deg 18deg);
  box-shadow: 0 0 45px rgba(255, 91, 103, .72);
  transform: rotate(18deg);
}

.ds-crosshair-art {
  position: absolute;
  z-index: 8;
  left: 45%;
  top: 46%;
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(88, 235, 255, .7);
}
.ds-crosshair-art::before,
.ds-crosshair-art::after { content: ""; position: absolute; inset: 50% auto auto 50%; background: white; transform: translate(-50%, -50%); }
.ds-crosshair-art::before { width: 76px; height: 3px; }
.ds-crosshair-art::after { width: 3px; height: 76px; }

/* How */
.ds-how-panel { text-align: center; }
.ds-how-panel > .ds-back { position: absolute; left: clamp(20px, 3vw, 34px); top: clamp(20px, 3vw, 34px); }
.ds-how-panel > h2 {
  margin: 0 0 30px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}
.ds-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.ds-how-grid article {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  background: rgba(255, 255, 255, .055);
}
.ds-how-grid article > span { display: block; margin-bottom: 9px; font-size: clamp(2rem, 4vw, 3rem); }
.ds-how-grid h3 { margin: 0 0 8px; font-size: 1.1rem; }
.ds-how-grid p { margin: 0; color: var(--ds-muted); font-size: .9rem; line-height: 1.55; }
.ds-control-summary { display: grid; gap: 9px; margin: 0 auto 24px; max-width: 840px; text-align: left; }
.ds-control-summary div { display: grid; grid-template-columns: 100px 1fr; gap: 13px; padding: 12px 16px; border-radius: 15px; color: var(--ds-muted); background: rgba(0, 0, 0, .16); font-size: .85rem; }
.ds-control-summary strong { color: var(--ds-yellow); }

/* Shared setup headers */
.ds-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.ds-panel-header h2 { margin: 0 0 5px; font-size: clamp(1.8rem, 4vw, 3.1rem); line-height: 1.05; }
.ds-panel-header p:last-child { margin: 0; color: var(--ds-muted); }

/* Skills */
.ds-skill-panel {
  max-height: calc(var(--abz-game-stage-height, 100dvh) - 40px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}
.ds-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 10px 0 18px;
  border: 2px solid rgba(117, 224, 255, .2);
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
}
.ds-search span { color: var(--ds-cyan); font-size: 1.5rem; }
.ds-search input { min-width: 0; border: 0; outline: 0; color: #fff; background: transparent; font-size: 1rem; font-weight: 700; }
.ds-search input::placeholder { color: #829bb1; }
.ds-search button { min-height: 38px; border: 0; border-radius: 12px; padding: 7px 12px; color: #dffaff; background: rgba(255, 255, 255, .09); font-weight: 800; cursor: pointer; }
.ds-result-count { margin: 9px 2px 11px; color: var(--ds-muted); font-size: .82rem; font-weight: 750; }
.ds-skill-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 3px 4px 12px;
  overflow: auto;
  scrollbar-color: var(--ds-cyan) rgba(255, 255, 255, .08);
}
.ds-skill-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 21px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  text-align: left;
  cursor: pointer;
}
.ds-skill-card:hover { border-color: rgba(88, 235, 255, .5); transform: translateY(-2px); }
.ds-skill-card > span {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 14px;
  background: rgba(88, 235, 255, .12);
  font-size: 1.45rem;
}
.ds-skill-card strong { display: block; margin-bottom: 3px; font-size: 1rem; }
.ds-skill-card em { color: var(--ds-yellow); font-size: .72rem; font-style: normal; font-weight: 850; text-transform: uppercase; }
.ds-skill-card p { grid-column: 1 / -1; margin: -2px 0 0; color: var(--ds-muted); font-size: .8rem; line-height: 1.42; }
.ds-custom-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 7px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 212, 93, .25);
  border-radius: 18px;
  background: rgba(255, 212, 93, .07);
}
.ds-custom-entry > span { color: var(--ds-yellow); font-size: 1.8rem; }
.ds-custom-entry strong,
.ds-custom-entry small { display: block; }
.ds-custom-entry small { margin-top: 2px; color: var(--ds-muted); font-size: .75rem; }
.ds-custom-entry a { min-height: 44px; display: inline-grid; place-items: center; padding: 9px 15px; border-radius: 999px; color: #071426; background: var(--ds-yellow); font-size: .8rem; font-weight: 900; text-decoration: none; }

/* Difficulty */
.ds-setup-panel { width: min(1040px, 100%); text-align: center; }
.ds-setup-panel .ds-panel-header { text-align: left; }
.ds-difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.ds-difficulty {
  position: relative;
  min-height: 210px;
  padding: 24px 18px;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  color: #fff;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
}
.ds-difficulty.is-selected { border-color: var(--ds-cyan); background: linear-gradient(150deg, rgba(88, 235, 255, .17), rgba(255, 255, 255, .05)); box-shadow: 0 0 0 5px rgba(88, 235, 255, .08); }
.ds-rank-icon { display: block; min-height: 44px; color: var(--ds-yellow); font-size: 1.55rem; letter-spacing: .1em; }
.ds-difficulty strong,
.ds-difficulty small,
.ds-difficulty i { display: block; }
.ds-difficulty strong { margin: 6px 0; font-size: 1.28rem; }
.ds-difficulty small { min-height: 55px; color: var(--ds-muted); line-height: 1.45; }
.ds-difficulty i { margin-top: 12px; color: var(--ds-cyan); font-size: .76rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.ds-setup-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto 22px;
}
.ds-setup-summary > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 10px;
  padding: 13px 16px;
  border-radius: 17px;
  background: rgba(0, 0, 0, .18);
  text-align: left;
}
.ds-setup-summary span { grid-row: 1 / 3; font-size: 1.35rem; }
.ds-setup-summary small { color: var(--ds-muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.ds-setup-summary strong { min-width: 0; overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }

/* Question */
.ds-question-screen {
  background:
    radial-gradient(circle at 50% 110%, rgba(48, 211, 250, .24), transparent 43%),
    linear-gradient(165deg, #071226, #0b2b45);
}
.ds-question-arena { position: absolute; inset: 0; overflow: hidden; opacity: .42; }
.ds-question-arena::before { content: ""; position: absolute; left: -15%; right: -15%; bottom: -38%; height: 78%; border: 4px solid rgba(89, 233, 255, .18); background: repeating-linear-gradient(90deg, transparent 0 19.7%, rgba(89, 233, 255, .12) 20%); transform: perspective(500px) rotateX(55deg); }
.ds-question-arena span { position: absolute; bottom: 15%; width: 18%; height: 20%; background: rgba(22, 67, 92, .72); border: 2px solid rgba(88, 235, 255, .17); }
.ds-question-arena span:nth-child(1) { left: 3%; }
.ds-question-arena span:nth-child(2) { right: 3%; }
.ds-question-arena span:nth-child(3) { left: 42%; width: 16%; height: 10%; }
.ds-question-panel { width: min(920px, 100%); }
.ds-question-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ds-question-top h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); }
.ds-momentum-meter { min-width: 150px; padding: 10px 13px; border-radius: 15px; background: rgba(255, 255, 255, .07); }
.ds-momentum-meter small { display: block; margin-bottom: 5px; color: var(--ds-muted); font-size: .69rem; font-weight: 850; text-transform: uppercase; }
#dsMomentumPips { display: flex; gap: 6px; }
#dsMomentumPips i { width: 34px; height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
#dsMomentumPips i.is-filled { background: linear-gradient(90deg, var(--ds-yellow), #ff8e4a); box-shadow: 0 0 13px rgba(255, 212, 93, .45); }
.ds-question-skill { display: inline-flex; margin: 20px 0 13px; padding: 7px 12px; border-radius: 999px; color: var(--ds-cyan); background: rgba(88, 235, 255, .09); font-size: .76rem; font-weight: 850; }
.ds-passage { margin: 0 0 16px; padding: 18px 20px; border-left: 4px solid var(--ds-yellow); border-radius: 5px 17px 17px 5px; color: #e6f0f8; background: rgba(255, 255, 255, .06); font-size: clamp(.95rem, 2vw, 1.08rem); font-weight: 600; line-height: 1.65; }
.ds-prompt { margin: 0 0 16px; color: #fff; font-size: clamp(1.2rem, 2.7vw, 1.65rem); font-weight: 850; line-height: 1.35; }
.ds-answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.ds-answer {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 17px;
  color: #fff;
  background: rgba(255, 255, 255, .055);
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.ds-answer span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--ds-cyan); background: rgba(88, 235, 255, .1); font-size: .8rem; font-weight: 950; }
.ds-answer.is-selected { border-color: var(--ds-cyan); background: rgba(88, 235, 255, .12); }
.ds-answer.is-correct { border-color: var(--ds-green); background: rgba(101, 239, 173, .13); }
.ds-answer.is-wrong { border-color: var(--ds-coral); background: rgba(255, 91, 103, .12); }
.ds-answer:disabled { cursor: default; }
.ds-question-feedback { min-height: 44px; margin: 13px 0 8px; color: var(--ds-muted); font-size: .9rem; font-weight: 700; line-height: 1.5; }
.ds-question-feedback.is-correct { color: var(--ds-green); }
.ds-question-feedback.is-wrong { color: #ffadb5; }
.ds-question-submit { width: min(330px, 100%); }
.ds-question-submit:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }

/* Gameplay */
.ds-game-screen {
  min-height: var(--abz-game-stage-height, 100dvh);
  padding: 0;
  background: #071326;
  touch-action: none;
  user-select: none;
}
.ds-game-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: none; }
.ds-game-vignette { pointer-events: none; position: absolute; inset: 0; background: radial-gradient(circle, transparent 45%, rgba(0, 5, 18, .55) 125%); }
.ds-hit-flash {
  position: absolute;
  z-index: 11;
  inset: 0;
  border: 0 solid transparent;
  opacity: 0;
  pointer-events: none;
}
.ds-hit-flash.is-player-hit {
  animation: dsPlayerHitFlash .72s ease-out;
}
.ds-hit-flash.is-rival-hit {
  animation: dsRivalHitFlash .72s ease-out;
}
@keyframes dsPlayerHitFlash {
  0% { opacity: 1; border-width: 24px; border-color: #ff5b67; background: rgba(255, 46, 77, .42); }
  38% { opacity: .72; border-width: 10px; background: rgba(255, 46, 77, .12); }
  100% { opacity: 0; border-width: 0; background: transparent; }
}
@keyframes dsRivalHitFlash {
  0% { opacity: 1; border-width: 20px; border-color: #58ebff; background: rgba(88, 235, 255, .25); }
  38% { opacity: .68; border-width: 8px; background: rgba(88, 235, 255, .08); }
  100% { opacity: 0; border-width: 0; background: transparent; }
}
.ds-hud {
  position: absolute;
  z-index: 7;
  top: clamp(10px, 2vw, 20px);
  left: 50%;
  width: min(720px, calc(100% - 120px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: start;
  transform: translateX(-50%);
  pointer-events: none;
}
.ds-score-side,
.ds-round-status {
  min-height: 66px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(3, 13, 29, .8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  backdrop-filter: blur(12px);
}
.ds-score-side { display: grid; grid-template-columns: auto auto; align-items: center; gap: 1px 10px; }
.ds-score-player { border-radius: 18px 8px 8px 18px; }
.ds-score-rival { border-radius: 8px 18px 18px 8px; direction: rtl; }
.ds-score-side small { color: var(--ds-muted); font-size: .65rem; font-weight: 900; letter-spacing: .12em; }
.ds-score-side > strong { grid-row: 1 / 3; font-size: 2rem; line-height: 1; }
.ds-score-player > strong { grid-column: 1; }
.ds-score-player small,
.ds-score-player .ds-score-dots { grid-column: 2; }
.ds-score-rival > strong { grid-column: 1; }
.ds-score-rival small,
.ds-score-rival .ds-score-dots { grid-column: 2; }
.ds-score-dots { display: flex; gap: 4px; direction: ltr; }
.ds-score-dots i { width: 16px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.ds-score-dots b { color: var(--ds-muted); font-size: .55rem; letter-spacing: .14em; }
.ds-score-player .ds-score-dots i.is-filled { background: var(--ds-cyan); box-shadow: 0 0 8px rgba(88, 235, 255, .7); }
.ds-score-rival .ds-score-dots i.is-filled { background: var(--ds-coral); box-shadow: 0 0 8px rgba(255, 91, 103, .7); }
.ds-score-side.is-scoring {
  animation: dsScorePop .72s cubic-bezier(.2, .9, .25, 1.2);
}
.ds-score-player.is-scoring { border-color: var(--ds-cyan); box-shadow: 0 0 34px rgba(88, 235, 255, .58); }
.ds-score-rival.is-scoring { border-color: var(--ds-coral); box-shadow: 0 0 34px rgba(255, 91, 103, .58); }
@keyframes dsScorePop {
  0% { transform: scale(1); }
  28% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.ds-round-status { min-width: 124px; display: grid; justify-items: center; border-radius: 8px; text-align: center; }
.ds-round-status small { color: var(--ds-yellow); font-size: .62rem; font-weight: 950; letter-spacing: .12em; }
.ds-round-status strong { font-size: 1.2rem; }
.ds-round-status span { max-width: 130px; color: var(--ds-muted); font-size: .62rem; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ds-crosshair {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, .8));
}
.ds-crosshair::before { content: ""; position: absolute; inset: 12px; border: 2px solid #fff; border-radius: 50%; }
.ds-crosshair i,
.ds-crosshair b { position: absolute; top: 50%; left: 50%; background: #fff; transform: translate(-50%, -50%); }
.ds-crosshair i { width: 34px; height: 2px; }
.ds-crosshair b { width: 2px; height: 34px; }
.ds-crosshair.is-hot::before {
  inset: 9px;
  border-color: var(--ds-yellow);
  border-width: 3px;
  box-shadow: 0 0 6px var(--ds-yellow), 0 0 18px var(--ds-cyan);
}
.ds-crosshair.is-hot i,
.ds-crosshair.is-hot b {
  background: var(--ds-yellow);
  box-shadow: 0 0 9px var(--ds-cyan);
}

.ds-charge-wrap {
  position: absolute;
  z-index: 7;
  bottom: 21px;
  left: 50%;
  width: min(290px, 38%);
  transform: translateX(-50%);
  pointer-events: none;
}
.ds-charge-wrap > span { display: block; margin-bottom: 4px; color: #d9e7f2; font-size: .58rem; font-weight: 900; letter-spacing: .11em; text-align: center; }
.ds-charge-wrap > div { height: 13px; padding: 3px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; background: rgba(2, 9, 22, .82); }
.ds-charge-wrap i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ds-cyan), var(--ds-yellow), var(--ds-coral)); box-shadow: 0 0 13px rgba(88, 235, 255, .62); transition: width .06s linear; }
.ds-game-screen.is-charging .ds-charge-wrap {
  filter: drop-shadow(0 0 13px rgba(88, 235, 255, .62));
}
.ds-game-screen.is-charging .ds-crosshair {
  transform: translate(-50%, -50%) scale(1.15);
}

.ds-cooldowns {
  position: absolute;
  z-index: 7;
  right: clamp(12px, 2vw, 20px);
  bottom: clamp(12px, 2vw, 20px);
  display: grid;
  gap: 7px;
  pointer-events: none;
}
.ds-cooldowns > div {
  min-width: 130px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 13px;
  background: rgba(3, 13, 29, .77);
  backdrop-filter: blur(10px);
}
.ds-cooldowns > div.is-cooling { opacity: .47; }
.ds-cooldowns span { font-size: 1rem; text-align: center; }
.ds-cooldowns small { color: #dceaf4; font-size: .61rem; font-weight: 900; letter-spacing: .04em; }
.ds-pause-button {
  position: absolute;
  z-index: 10;
  top: clamp(12px, 2vw, 20px);
  right: clamp(12px, 2vw, 20px);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 15px;
  color: #fff;
  background: rgba(3, 13, 29, .76);
  font-weight: 950;
  cursor: pointer;
}
.ds-announcement {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  min-width: min(440px, 82%);
  padding: 18px 28px;
  border-block: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  background: linear-gradient(90deg, transparent, rgba(3, 13, 29, .9) 20% 80%, transparent);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.ds-announcement[hidden] { display: none; }
.ds-announcement small { color: var(--ds-yellow); font-size: .7rem; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.ds-announcement strong { font-size: clamp(2.6rem, 8vw, 6.5rem); font-style: italic; font-weight: 950; letter-spacing: -.05em; line-height: .95; text-shadow: 0 0 30px rgba(88, 235, 255, .45); text-transform: uppercase; }
.ds-announcement span { color: var(--ds-muted); font-size: .86rem; font-weight: 750; }
.ds-point-toast {
  position: absolute;
  z-index: 13;
  top: 25%;
  left: 50%;
  min-width: min(360px, 78%);
  display: grid;
  justify-items: center;
  padding: 12px 22px;
  border: 2px solid currentColor;
  border-radius: 18px;
  color: var(--ds-cyan);
  background: rgba(3, 13, 29, .92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .34), 0 0 30px currentColor;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: dsPointToast .9s cubic-bezier(.16, .8, .25, 1);
}
.ds-point-toast[hidden] { display: none; }
.ds-point-toast.is-rival-point { color: var(--ds-coral); }
.ds-point-toast small { font-size: .65rem; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
.ds-point-toast strong { color: #fff; font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1.05; }
.ds-point-toast span { font-size: .78rem; font-weight: 850; }
@keyframes dsPointToast {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(.78); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.ds-pointer-prompt {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 54px;
  display: grid;
  justify-items: center;
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 15px;
  color: #fff;
  background: rgba(3, 13, 29, .8);
  transform: translateX(-50%);
  pointer-events: none;
}
.ds-pointer-prompt span { color: var(--ds-muted); font-size: .7rem; }
.ds-pointer-prompt[hidden] { display: none; }

.ds-touch-controls { display: none; }
.ds-pause-overlay,
.ds-loading-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  place-items: center;
  padding: 20px;
  background: rgba(2, 9, 22, .74);
  backdrop-filter: blur(10px);
}
.ds-pause-overlay:not([hidden]),
.ds-loading-overlay:not([hidden]) { display: grid; }
.ds-pause-panel { width: min(460px, 100%); text-align: center; }
.ds-pause-panel h2 { margin: 0 0 8px; font-size: clamp(2rem, 6vw, 3.5rem); }
.ds-pause-panel p:not(.ds-kicker) { margin: 0 0 24px; color: var(--ds-muted); }
.ds-pause-panel .ds-btn { width: 100%; margin-top: 9px; }
.ds-loading-overlay { color: #fff; text-align: center; }
.ds-loading-overlay strong,
.ds-loading-overlay small { display: block; }
.ds-loading-overlay small { margin-top: 5px; color: var(--ds-muted); }
.ds-loading-ball {
  width: 70px;
  aspect-ratio: 1;
  margin-bottom: 18px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 10deg, var(--ds-coral) 0 14deg, #981d3d 14deg 20deg);
  box-shadow: 0 0 35px rgba(255, 91, 103, .5);
  animation: dsLoadingBounce .8s ease-in-out infinite alternate;
}
@keyframes dsLoadingBounce { to { transform: translateY(-18px) rotate(28deg); } }

/* Results */
.ds-screen[data-screen="results"] {
  align-items: start;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 212, 93, .18), transparent 30%),
    linear-gradient(150deg, #061226, #0b2b45);
}
.ds-results-layout { z-index: 2; width: min(900px, 100%); display: grid; gap: 20px; }
.ds-results-panel { text-align: center; }
.ds-result-emblem { width: 76px; height: 76px; display: grid; place-items: center; margin: -9px auto 12px; border: 2px solid rgba(255, 212, 93, .35); border-radius: 50%; background: rgba(255, 212, 93, .1); font-size: 2.5rem; box-shadow: 0 0 36px rgba(255, 212, 93, .15); }
.ds-results-panel h2 { margin: 0; font-size: clamp(2.3rem, 7vw, 5rem); letter-spacing: -.05em; line-height: .95; }
.ds-result-message { margin: 13px auto 20px; max-width: 660px; color: var(--ds-muted); font-weight: 650; }
.ds-final-score { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0 auto 20px; }
.ds-final-score div { min-width: 104px; padding: 11px 18px; border-radius: 18px; background: rgba(255, 255, 255, .06); }
.ds-final-score small,
.ds-final-score strong { display: block; }
.ds-final-score small { color: var(--ds-muted); font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.ds-final-score strong { font-size: 2.6rem; line-height: 1; }
.ds-final-score > span { color: var(--ds-yellow); font-size: 2rem; font-weight: 950; }
.ds-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ds-stat-grid > div { padding: 15px 10px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 17px; background: rgba(255, 255, 255, .045); }
.ds-stat-grid span,
.ds-stat-grid strong,
.ds-stat-grid small { display: block; }
.ds-stat-grid span { margin-bottom: 4px; font-size: 1.35rem; }
.ds-stat-grid strong { color: #fff; font-size: 1.28rem; }
.ds-stat-grid small { color: var(--ds-muted); font-size: .68rem; }
.ds-learning-recap { display: grid; gap: 3px; margin: 13px 0 16px; padding: 13px; border-radius: 17px; background: rgba(88, 235, 255, .07); }
.ds-learning-recap small { color: var(--ds-muted); font-size: .69rem; font-weight: 850; text-transform: uppercase; }
.ds-learning-recap strong { color: var(--ds-cyan); }
.ds-learning-recap span { color: #d1deea; font-size: .8rem; }
.ds-assignment-status { margin: 10px 0; padding: 12px; border-radius: 14px; color: #061226; background: var(--ds-yellow); font-weight: 850; }
.ds-assignment-status.is-error { color: #fff; background: #a82a47; }
.ds-results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.ds-account-recap { margin-top: 16px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 17px; color: var(--ds-muted); background: rgba(255, 255, 255, .04); font-size: .83rem; line-height: 1.5; }
.ds-account-recap a { color: var(--ds-cyan); font-weight: 850; }
.ds-confetti { position: fixed; z-index: 20; inset: 0; overflow: hidden; pointer-events: none; }
.ds-confetti i { position: absolute; top: -20px; width: 10px; height: 18px; border-radius: 2px; animation: dsConfettiFall 2.5s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes dsConfettiFall { to { transform: translate3d(var(--drift), 110vh, 0) rotate(760deg); opacity: .2; } }

abz-game-feedback { color-scheme: light; }

/* Mobile and compact stages */
@media (max-width: 900px) {
  .ds-screen[data-screen="start"] { grid-template-columns: 1fr; padding-block: 34px; text-align: center; overflow: auto; }
  .ds-start-copy { justify-self: center; }
  .ds-lead { margin-inline: auto; }
  .ds-feature-pills,
  .ds-primary-actions { justify-content: center; }
  .ds-start-art { width: min(440px, 84vw); max-height: 48vh; }
  .ds-how-grid { grid-template-columns: 1fr; }
  .ds-how-grid article { display: grid; grid-template-columns: auto 1fr; text-align: left; }
  .ds-how-grid article > span { grid-row: 1 / 3; margin: 0 12px 0 0; }
  .ds-skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-difficulty-grid { grid-template-columns: 1fr; }
  .ds-difficulty { min-height: 132px; display: grid; grid-template-columns: 70px 1fr; text-align: left; }
  .ds-difficulty .ds-rank-icon { grid-row: 1 / 4; align-self: center; }
  .ds-difficulty strong,
  .ds-difficulty small,
  .ds-difficulty i { grid-column: 2; min-height: 0; }
}

@media (hover: none), (pointer: coarse) {
  .ds-touch-controls { position: absolute; z-index: 9; inset: 0; display: block; pointer-events: none; }
  .ds-joystick { position: absolute; left: 20px; bottom: 22px; width: 112px; height: 112px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 50%; background: rgba(3, 13, 29, .45); box-shadow: inset 0 0 20px rgba(88, 235, 255, .12); pointer-events: auto; }
  .ds-joystick i { position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; border: 2px solid rgba(255, 255, 255, .5); border-radius: 50%; background: rgba(88, 235, 255, .32); transform: translate(-50%, -50%); }
  .ds-touch-actions { position: absolute; right: 14px; bottom: 18px; display: grid; grid-template-columns: repeat(3, 58px) 74px; gap: 8px; align-items: end; pointer-events: auto; }
  .ds-touch-actions button { min-width: 54px; min-height: 54px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; color: #fff; background: rgba(3, 13, 29, .68); font-size: .56rem; font-weight: 950; }
  .ds-touch-actions .ds-touch-throw { width: 74px; height: 74px; color: #071426; background: linear-gradient(145deg, var(--ds-cyan), #26a9e6); font-size: .64rem; }
  .ds-pointer-prompt { display: none; }
  .ds-charge-wrap { bottom: 15px; width: 28%; }
  .ds-cooldowns { display: none; }
}

@media (max-width: 620px) {
  .ds-screen { padding: 14px; overflow: auto; align-items: start; }
  .ds-panel { padding: 20px 16px; border-radius: 24px; }
  .ds-screen[data-screen="start"] { align-items: center; padding: 22px 16px; }
  .ds-start-copy h2 { font-size: clamp(2.7rem, 15vw, 4.8rem); }
  .ds-start-art { display: none; }
  .ds-how-panel { padding-top: 72px; }
  .ds-control-summary div { grid-template-columns: 1fr; gap: 3px; }
  .ds-panel-header { gap: 10px; }
  .ds-panel-header .ds-back { width: 46px; height: 46px; }
  .ds-skill-panel { max-height: none; display: block; }
  .ds-skill-grid { grid-template-columns: 1fr; overflow: visible; }
  .ds-skill-card { min-height: 120px; }
  .ds-custom-entry { grid-template-columns: auto 1fr; }
  .ds-custom-entry a { grid-column: 1 / -1; }
  .ds-setup-summary { grid-template-columns: 1fr; }
  .ds-question-screen { align-items: center; overflow: auto; }
  .ds-question-top { align-items: center; }
  .ds-momentum-meter { min-width: 120px; }
  #dsMomentumPips i { width: 25px; }
  .ds-answer-grid { grid-template-columns: 1fr; }
  .ds-hud { top: 7px; width: calc(100% - 72px); gap: 4px; }
  .ds-score-side,
  .ds-round-status { min-height: 56px; padding: 7px 8px; }
  .ds-score-side > strong { font-size: 1.45rem; }
  .ds-score-side small { font-size: .53rem; }
  .ds-score-dots i { width: 9px; }
  .ds-round-status { min-width: 84px; }
  .ds-round-status strong { font-size: .9rem; }
  .ds-round-status span { max-width: 82px; }
  .ds-pause-button { top: 7px; right: 7px; width: 42px; height: 42px; }
  .ds-charge-wrap { display: none; }
  .ds-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ds-touch-actions { grid-template-columns: repeat(2, 56px); }
  .ds-touch-actions .ds-touch-throw { grid-row: 1 / 3; grid-column: 3; align-self: center; }
  .ds-joystick { left: 12px; bottom: 14px; width: 100px; height: 100px; }
}

@media (max-width: 380px) {
  .ds-start-copy h2 { font-size: 2.9rem; }
  .ds-feature-pills span { font-size: .68rem; }
  .ds-primary-actions .ds-btn { width: 100%; }
  .ds-question-top { display: grid; }
  .ds-momentum-meter { width: 100%; }
  .ds-touch-actions { right: 6px; gap: 5px; grid-template-columns: repeat(2, 50px); }
  .ds-touch-actions button { min-width: 50px; min-height: 50px; }
  .ds-touch-actions .ds-touch-throw { width: 66px; height: 66px; }
}

@media (max-height: 620px) and (min-width: 700px) {
  .ds-screen:not(.ds-game-screen) { align-items: start; overflow: auto; padding: 15px; }
  .ds-panel { padding: 20px 24px; }
  .ds-how-grid article { padding: 16px; }
  .ds-difficulty { min-height: 150px; padding: 16px; }
  .ds-setup-summary { margin-bottom: 12px; }
  .ds-question-panel { padding-block: 18px; }
  .ds-passage { max-height: 120px; overflow: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-btn,
  .ds-skill-card,
  .ds-loading-ball,
  .ds-confetti i,
  .ds-hit-flash,
  .ds-point-toast,
  .ds-score-side { animation: none !important; transition: none !important; }
}
