﻿:root {
  color-scheme: dark;
  --bg: #121318;
  --panel: #1e1f25;
  --border: #292a2f;
  --primary: #ffc174;
  --action: #f59e0b;
  --text: #e3e1e9;
  --muted: #a8a5b0;
  --success: #34d399;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0 auto;
  padding: 24px 16px 40px;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Chivo', sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.3;
}

h1 {
  color: var(--primary);
  font-size: 28px;
  text-align: center;
  letter-spacing: 2px;
}

h2 {
  font-size: 22px;
}

button, input {
  font: inherit;
}

button {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--action);
  border-radius: 12px;
  background: var(--action);
  color: var(--bg);
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

#join, section {
  padding: 20px;
  margin: 16px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

#join label {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

#join input {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #454650;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

#join input[name="code"] {
  text-transform: uppercase;
  letter-spacing: 3px;
}

#status, #survival-outcome {
  text-align: center;
}

#return-home {
  display: block;
  margin: 24px auto;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

/* Warrior branding */

.warrior-brand {
  text-align: center;
  margin: 12px 0 28px;
}

.warrior-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.warrior-brand h1 {
  margin: 4px 0 0;
  font-size: 48px;
  letter-spacing: 8px;
}

.warrior-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
}

#join h2 {
  margin: 0 0 24px;
  text-align: center;
  font-size: 22px;
}

#join input::placeholder {
  color: #777680;
}


/* Compact branding during gameplay */

body:has(#join[hidden]) .warrior-brand {
  margin: 0 0 18px;
}

body:has(#join[hidden]) .warrior-logo {
  width: 42px;
  height: 42px;
}

body:has(#join[hidden]) .warrior-brand h1 {
  font-size: 28px;
  letter-spacing: 5px;
}

body:has(#join[hidden]) .warrior-brand p {
  display: none;
}

/* Gameplay status */

#status {
  padding: 12px;
  background: var(--panel);
  border-radius: 10px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

#status:empty {
  display: none;
}

/* Survival */

#question-number {
  margin: 24px 0 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
}

#question {
  margin: 8px 0 20px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

#answer-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

#answer-timer {
  margin: 0 0 6px;
  color: var(--primary);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}

#answer-panel button {
  min-height: 60px;
  background: #292b34;
  color: var(--text);
  border: 1px solid #454650;
  text-align: left;
  overflow-wrap: anywhere;
}

#answer-panel button:hover:not(:disabled) {
  border-color: var(--primary);
}

#answer-panel button:active:not(:disabled) {
  background: var(--action);
  color: var(--bg);
}

#answer-panel button:disabled {
  opacity: .55;
}

#answer-choice {
  margin: 0;
  text-align: center;
  color: var(--primary);
  font-size: 14px;
}

#survival-result {
  text-align: center;
}

#answer-outcome {
  font-size: 24px;
  font-weight: 700;
}

#remaining-lives {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
}

/* Final Battle */

#final-battle {
  padding: 24px 16px;
  text-align: center;
}

#final-battle-title {
  margin: 0 0 20px;
  color: var(--primary);
  font-size: 30px;
  letter-spacing: 2px;
}

#final-battle-message {
  font-size: 22px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#final-battle-submessage {
  color: var(--muted);
  font-size: 15px;
}

#buzz-button {
  display: block;
  width: 190px;
  height: 190px;
  margin: 28px auto 12px;
  border-radius: 50%;
  border: 5px solid var(--primary);
  background: var(--action);
  color: var(--bg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 42px;
  font-weight: 700;
  box-shadow: 0 0 28px rgba(245,158,11,.25);
  touch-action: manipulation;
}

#buzz-button:active:not(:disabled) {
  transform: scale(.96);
}


/* Game completion */

#final-battle[data-result] {
  padding: 36px 20px;
}

#final-battle[data-result="champion"] {
  background: radial-gradient(ellipse at top, #503819, #1e1f25 75%);
  border: 1px solid var(--primary);
  box-shadow: 0 0 32px rgba(245,158,11,.18);
}

#final-battle[data-result="champion"]::before {
  content: "\1F3C6";
  display: block;
  font-size: 64px;
  margin-bottom: 16px;
}

#final-battle[data-result="champion"] #final-battle-title {
  color: #ffd580;
}

#final-battle[data-result="draw"] {
  background: radial-gradient(ellipse at top, #353b48, #1e1f25 75%);
  border-color: #a8b4c8;
}

#final-battle[data-result="draw"]::before {
  content: "\2694\FE0F";
  display: block;
  font-size: 56px;
  margin-bottom: 16px;
}

#final-battle[data-result="draw"] #final-battle-title {
  color: #cbd5e1;
}

#final-battle[data-result="game-over"] #final-battle-title {
  color: var(--muted);
}


/* Premium cyan embossed buzzer */

#buzz-button {
  border: 4px solid #a5f3fc;
  background: radial-gradient(
    ellipse at 35% 20%,
    #a5f3fc 0%,
    #22d3ee 38%,
    #06b6d4 68%,
    #0891b2 100%
  );
  color: #083344;
  text-shadow: 0 1px 1px rgba(255,255,255,.4);
  box-shadow:
    inset 0 5px 10px rgba(255,255,255,.55),
    inset 0 -10px 18px rgba(8,51,68,.35),
    0 9px 0 #155e75,
    0 14px 20px rgba(0,0,0,.5),
    0 0 32px rgba(34,211,238,.22);
  transition:
    transform .08s ease,
    box-shadow .08s ease;
}

#buzz-button:active:not(:disabled) {
  transform: translateY(7px);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,.3),
    inset 0 -5px 12px rgba(8,51,68,.4),
    0 2px 0 #155e75,
    0 4px 10px rgba(0,0,0,.4),
    0 0 18px rgba(34,211,238,.2);
}


/* Buzzer winner instruction */

#final-battle-submessage.answer-now {
  color: #22d3ee;
  font-size: 20px;
  font-weight: 700;
  margin-top: 12px;
}


/* Warrior life indicator */

#status:has(.warrior-hearts) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.warrior-name {
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
  min-width: 0;
}

.warrior-hearts {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.heart {
  font-size: 30px;
  line-height: 1;
}

.heart.alive {
  color: #f87171;
  text-shadow: 0 0 8px rgba(248,113,113,.25);
}

.heart.lost {
  color: #454650;
}


/* Final Battle score indicator */

#status:has(.warrior-score) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
}

.warrior-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.score-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
}

.score-value {
  color: var(--primary);
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}


/* Champion celebration typography */

#final-battle[data-result="champion"] #final-battle-message {
  font-size: 26px;
}

#final-battle[data-result="champion"] #final-battle-submessage {
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

#final-battle[data-result="draw"] #final-battle-submessage {
  color: #cbd5e1;
  font-size: 20px;
  font-weight: 600;
}

