/* BYTE BATTLE theme — tokens and animations taken from the Claude Design artboards in /design.
   Page markup keeps the designs' inline styles; this file holds what is shared. */

:root {
  /* light: website + admin */
  --bb-red: #E0002B;
  --bb-red-dark: #B00024;
  --bb-red-hover: #A80020;
  --bb-ink: #141414;
  --bb-bg: #F6F6F7;
  --bb-line: #E5E5E8;
  --bb-line-2: #D2D2D8;
  --bb-muted: #66666E;
  --bb-text-2: #4A4A52;
  --bb-pink-bg: #FFE8EC;
  --bb-green: #127A3E;
  --bb-green-bright: #2BD576;
  --bb-amber: #A35F00;
  /* dark: phones + projector */
  --bb-dark: #0F0F11;
  --bb-dark-2: #18181B;
  --bb-dark-3: #212126;
  --bb-dark-line: #2E2E34;
  --bb-neon: #FF3355;
  --bb-neon-soft: #FF8099;
  --bb-wrong: #FF5468;
  --bb-warn: #FFC857;

  --font-head: 'Sora', sans-serif;
  --font-body: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-hi: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); }
body.bb-light { background: var(--bb-bg); color: var(--bb-ink); }
body.bb-dark { background: var(--bb-dark); color: #F5F5F7; }

body.bb-light a { color: var(--bb-red); }
body.bb-light a:hover { color: var(--bb-red-hover); }
body.bb-dark a { color: var(--bb-neon); }
body.bb-dark a:hover { color: var(--bb-neon-soft); }

input::placeholder, textarea::placeholder { color: #7A7A82; }
body.bb-dark input::placeholder { color: #8A8A94; }

[hidden] { display: none !important; }
button { font-family: inherit; }
button:disabled { cursor: not-allowed; }
.hi { font-family: var(--font-hi); }
.mono { font-family: var(--font-mono); }
.head { font-family: var(--font-head); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* visible keyboard focus everywhere */
:focus-visible { outline: 3px solid var(--bb-red); outline-offset: 2px; }
body.bb-dark :focus-visible { outline-color: var(--bb-neon-soft); }

/* form errors */
.bb-error { color: #C4002A; font-size: 13px; font-weight: 600; }
body.bb-dark .bb-error { color: var(--bb-wrong); }
.bb-input-error { border-color: #D1002A !important; }

.bb-alert {
  padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600;
  display: flex; gap: 10px; align-items: flex-start;
}
.bb-alert--warn { background: #FFF3D6; color: #7A4F00; border: 1px solid #EED7A8; }
.bb-alert--ok { background: #E5F6EC; color: var(--bb-green); border: 1px solid #BFE5CD; }
.bb-alert--err { background: var(--bb-pink-bg); color: var(--bb-red-dark); border: 1px solid #F3B8C3; }

/* ── Animations (names prefixed per design file where the artboards define them differently) ── */
@keyframes bbglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(224,0,43,0); } 50% { box-shadow: 0 0 32px 2px rgba(224,0,43,.35); } }
@keyframes bbblink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes bbblink3 { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes bbspin { to { transform: rotate(360deg); } }
@keyframes bbfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bbfadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bbpop-reg { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bbpop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bbpop-proj { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bbpulse {
  0% { box-shadow: 0 0 0 0 rgba(255,64,87,.65), 0 12px 0 #8E1424; }
  70% { box-shadow: 0 0 0 34px rgba(255,64,87,0), 0 12px 0 #8E1424; }
  100% { box-shadow: 0 0 0 0 rgba(255,64,87,0), 0 12px 0 #8E1424; }
}
@keyframes bbwave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes bbfall { 0% { transform: translateY(-40px) rotate(0deg); opacity: 1; } 100% { transform: translateY(1120px) rotate(540deg); opacity: .9; } }
@keyframes bbglow-ring { 0%, 100% { filter: drop-shadow(0 0 10px rgba(255,51,85,.5)); } 50% { filter: drop-shadow(0 0 26px rgba(255,51,85,.9)); } }
@keyframes bbrise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bbrise-podium { from { transform: translateY(120%); } to { transform: none; } }
@keyframes bbshine { 0%, 100% { filter: drop-shadow(0 0 18px rgba(255,200,87,.45)); } 50% { filter: drop-shadow(0 0 40px rgba(255,200,87,.9)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Participant phone shell: the artboards are 390×844; the real page fills the phone ── */
.bb-phone {
  position: relative; width: 100%; max-width: 480px; min-height: 100vh; min-height: 100dvh;
  margin: 0 auto; overflow: hidden; background: var(--bb-dark); color: #F5F5F7;
  display: flex; flex-direction: column;
}

/* ── Projector: authored at 1920×1080 and scaled to fit any screen ── */
.bb-stage-wrap { position: fixed; inset: 0; background: var(--bb-dark); overflow: hidden; }
.bb-stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }

/* ── Print ── */
@media print {
  .no-print { display: none !important; }
  body.bb-light { background: #FFFFFF; }
}

/* Tighter card padding on phones (registration form etc.) */
@media (max-width: 520px) {
  .bb-card-pad { padding: 20px !important; border-radius: 18px !important; }
}

/* Radio/checkbox choices styled as buttons (Question Bank editor, Round Setup) */
.bb-choice { position: relative; display: inline-flex; }
.bb-choice > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bb-choice > span { display: flex; align-items: center; justify-content: center; width: 100%; font-weight: 700; font-family: inherit; background: #FFFFFF; color: #33333B; border: 1px solid #D2D2D8; pointer-events: none; }
.bb-choice > input:focus-visible + span { outline: 3px solid #E0002B; outline-offset: 2px; }
.bb-choice--seg > span { height: 40px; border-radius: 10px; font-size: 14px; }
.bb-choice--seg > input:checked + span { background: #141414; color: #FFFFFF; border-color: #141414; }
.bb-choice--pill > span { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.bb-choice--pill > input:checked + span { background: #E0002B; color: #FFFFFF; border-color: #E0002B; }
.bb-choice--key > span { width: 42px; height: 42px; border-radius: 10px; font-size: 15px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: #4A4A52; }
.bb-choice--key > input:checked + span { background: #127A3E; color: #FFFFFF; border-color: #127A3E; }
body.bb-light a.bb-qrow, body.bb-light a.bb-qrow:hover { color: #141414; }
.bb-qrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 140px 150px 84px 92px 70px; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; color: #141414; text-decoration: none; background: #F6F6F7; border: 1px solid transparent; }
.bb-qrow:hover { border-color: #D2D2D8; color: #141414; }
.bb-qrow[aria-current] { background: #FFF4F6; border: 1.5px solid #E0002B; }
