/* ========================================================
   HARDWARE BATTLE TOUCHSCREEN — GAME STYLESHEET
   Desain Arcade Cyberpunk Futuristik, Responsif Touchscreen
   ======================================================== */

:root {
  --bg-dark: #070b13;
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-panel: #0d1527;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Theme Colors */
  --p1-color: #00f2fe;
  --p1-grad: linear-gradient(135deg, #00f2fe, #4facfe);
  --p2-color: #ff0844;
  --p2-grad: linear-gradient(135deg, #ff0844, #ff4b2b);
  --p3-color: #00f5a0;
  --p3-grad: linear-gradient(135deg, #00f5a0, #00d9e9);
  --p4-color: #ffe259;
  --p4-grad: linear-gradient(135deg, #ffe259, #ffa751);

  --font-display: 'Rajdhani', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace, Consolas;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-display);
  touch-action: manipulation;
}

/* Background Cyber Grid */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 50%, rgba(20, 35, 65, 0.45) 0%, rgba(5, 8, 15, 0.95) 100%),
    linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Screen Wrapper */
.screen-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.screen-wrapper.hidden {
  display: none !important;
}

/* ========================================================
   1. START SCREEN
   ======================================================== */
.start-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 24px;
}

.start-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--p1-color);
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.game-main-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 35px rgba(0, 242, 254, 0.5);
  margin-bottom: 8px;
  line-height: 1.1;
}

.game-sub-slogan {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  letter-spacing: 5px;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 36px;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.start-avatars-preview {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.avatar-preview-item {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 4px;
  animation: floatAvatars 3s ease-in-out infinite alternate;
}
.avatar-preview-item:nth-child(2) { animation-delay: 0.5s; }
.avatar-preview-item:nth-child(3) { animation-delay: 1.0s; }
.avatar-preview-item:nth-child(4) { animation-delay: 1.5s; }

@keyframes floatAvatars {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-10px) scale(1.05); }
}

.avatar-preview-item img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.start-actions {
  display: flex;
  gap: 20px;
}

.btn-arcade-play {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #050b14;
  border: none;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 20px 60px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.6);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-arcade-play:active, .touch-pressed {
  transform: scale(0.96) !important;
}

.btn-arcade-outline {
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 18px 40px;
  border-radius: 16px;
  cursor: pointer;
}

/* ========================================================
   2. SETUP SCREEN
   ======================================================== */
.setup-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  justify-content: space-between;
}

.setup-header {
  text-align: center;
  margin-bottom: 20px;
}

.setup-header h2 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  overflow-y: auto;
  padding-right: 6px;
}

.setup-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.setup-card.span-2 {
  grid-column: span 2;
}

.setup-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-group-toggle {
  display: flex;
  gap: 12px;
}

.toggle-btn {
  flex: 1;
  background: #1e293b;
  border: 2px solid transparent;
  color: #94a3b8;
  padding: 14px 10px;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--p1-color);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.player-name-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.player-input-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 12px;
}

.input-card-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.input-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.input-card-body label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.input-card-body input {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  outline: none;
  padding: 4px 0;
}

.input-card-body input:focus {
  border-bottom-color: var(--p1-color);
}

.setup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
}

/* ========================================================
   3. RACE TRACK & GAMEPLAY HEADER
   ======================================================== */
.gameplay-header-bar {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 28, 0.95);
  border-bottom: 2px solid rgba(0, 242, 254, 0.3);
  padding: 8px 16px;
  gap: 16px;
  height: 90px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.race-tracks-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  height: 100%;
}

.race-track-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 3px 8px;
  height: 34px;
}

.track-label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 140px;
  flex-shrink: 0;
}

.track-pbadge {
  background: #334155;
  color: #fff;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.p-theme-1 .track-pbadge { background: var(--p1-color); color: #000; }
.p-theme-2 .track-pbadge { background: var(--p2-color); color: #fff; }
.p-theme-3 .track-pbadge { background: var(--p3-color); color: #000; }
.p-theme-4 .track-pbadge { background: var(--p4-color); color: #000; }

.track-pname {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-lane {
  position: relative;
  flex: 1;
  height: 22px;
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
}

.track-car-wrapper {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.track-car img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.track-finish-line {
  position: absolute;
  right: 6px;
  font-size: 0.75rem;
  font-weight: 900;
  color: #f59e0b;
  letter-spacing: 1px;
}

.track-progress-text {
  width: 45px;
  text-align: right;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: #38bdf8;
}

.header-controls {
  display: flex;
  gap: 8px;
}

.btn-ctrl {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* ========================================================
   4. PLAYERS ARENA (RESPONSIVE GRID)
   ======================================================== */
.players-arena {
  flex: 1;
  display: grid;
  padding: 12px;
  gap: 12px;
  height: calc(100vh - 90px);
  overflow: hidden;
}

/* 2 Pemain: 2 Kolom Kiri - Kanan */
.players-arena.grid-2-players {
  grid-template-columns: 1fr 1fr;
}

/* 3 Pemain: 3 Kolom */
.players-arena.grid-3-players {
  grid-template-columns: 1fr 1fr 1fr;
}

/* 4 Pemain: Grid 2x2 */
.players-arena.grid-4-players {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* Player Panel Card */
.player-panel {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.player-panel.p-theme-1 { border-color: rgba(0, 242, 254, 0.4); }
.player-panel.p-theme-2 { border-color: rgba(255, 8, 68, 0.4); }
.player-panel.p-theme-3 { border-color: rgba(0, 245, 160, 0.4); }
.player-panel.p-theme-4 { border-color: rgba(255, 226, 89, 0.4); }

/* Player Header inside Panel */
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar-wrap {
  position: relative;
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
}

.player-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  font-size: 0.65rem;
  font-weight: 900;
  background: #000;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.player-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.player-progress-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.player-metrics {
  display: flex;
  gap: 10px;
}

.metric-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  text-align: right;
}

.metric-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 800;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 900;
  font-family: var(--font-mono);
}

.score-val { color: #38bdf8; }
.combo-val { color: #f59e0b; }
.combo-val.combo-active {
  color: #ff007f;
  animation: pulseScale 0.5s infinite alternate;
}

@keyframes pulseScale {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* Timer Bar */
.player-timer-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timer-bar-track {
  flex: 1;
  height: 10px;
  background: #1e293b;
  border-radius: 6px;
  overflow: hidden;
}

.timer-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.05s linear;
}

.player-panel.timer-warn .timer-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #eab308);
}

.player-panel.timer-danger .timer-bar-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  animation: timerBlink 0.3s infinite alternate;
}

@keyframes timerBlink {
  0% { opacity: 0.7; }
  100% { opacity: 1; filter: drop-shadow(0 0 6px #ef4444); }
}

.timer-display-num {
  font-size: 1rem;
  font-family: var(--font-mono);
  font-weight: 800;
  width: 50px;
  text-align: right;
  color: #38bdf8;
}

.player-panel.timer-danger .timer-display-num {
  color: #ef4444;
  animation: shakeNum 0.2s infinite;
}

/* Question Card */
.player-question-card {
  flex: 1;
  display: flex;
  gap: 14px;
  background: rgba(10, 16, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
  align-items: center;
  min-height: 110px;
}

.hardware-preview-box {
  position: relative;
  width: 130px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #000;
}

.hardware-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hardware-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: #38bdf8;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  padding: 2px 4px;
  letter-spacing: 1px;
}

.question-text {
  flex: 1;
  font-size: clamp(0.95rem, 1.4vw, 1.35rem);
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
}

/* 4 Answer Options (Touch Targets Besar) */
.options-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  height: clamp(140px, 22vh, 220px);
}

/* Jika 4 pemain (2x2 grid), compact options */
.grid-4-players .options-container {
  height: clamp(110px, 16vh, 160px);
  gap: 6px;
}

.grid-4-players .hardware-preview-box {
  width: 90px;
  height: 85px;
}

.grid-4-players .player-question-card {
  min-height: 85px;
  padding: 6px;
}

.grid-4-players .question-text {
  font-size: clamp(0.85rem, 1vw, 1.05rem);
}

.option-btn {
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.option-btn .opt-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
  font-size: 1.05rem;
  color: #38bdf8;
  margin-right: 10px;
  flex-shrink: 0;
}

.option-btn .opt-text {
  font-size: clamp(0.85rem, 1.15vw, 1.15rem);
  font-weight: 700;
  line-height: 1.25;
}

/* Tombol Jawaban Benar */
.option-btn.correct {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.8) !important;
  transform: scale(1.02);
}

/* Tombol Jawaban Salah */
.option-btn.wrong {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.8) !important;
}

/* Highlight Kunci Jawaban Benar saat Salah/Timeout */
.option-btn.reveal-correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.2) !important;
}

/* Banner Penjelasan Feedback */
.feedback-banner {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  padding: 10px 16px;
  border: 1px solid #38bdf8;
  z-index: 50;
  animation: slideUpFade 0.25s ease-out;
}

.feedback-banner.hidden { display: none !important; }

.feedback-banner.banner-wrong {
  border-color: #ef4444;
  background: rgba(30, 10, 15, 0.95);
}

.feedback-banner.banner-timeout {
  border-color: #f59e0b;
  background: rgba(30, 20, 10, 0.95);
}

.feedback-title {
  font-size: 1rem;
  font-weight: 900;
  color: #ef4444;
  margin-bottom: 2px;
}

.feedback-banner.banner-timeout .feedback-title {
  color: #f59e0b;
}

.feedback-desc {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.3;
}

/* Finished Player Card */
.player-finished-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  padding: 20px;
}

.finish-check-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.player-finished-card h3 {
  font-size: 2rem;
  font-weight: 900;
  color: #10b981;
  letter-spacing: 2px;
}

.final-score-pill {
  margin-top: 12px;
  background: rgba(0, 242, 254, 0.2);
  border: 1px solid var(--p1-color);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 1.2rem;
  font-family: var(--font-mono);
}

/* ========================================================
   5. FLOATING FEEDBACK & ANIMATIONS
   ======================================================== */
.floating-feedback-tag {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  z-index: 100;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  animation: floatUpAndFade 1.1s ease-out forwards;
}

.tag-correct {
  color: #00f5a0;
  text-shadow: 0 0 25px rgba(0, 245, 160, 0.8);
}

.tag-wrong {
  color: #ff0844;
  text-shadow: 0 0 25px rgba(255, 8, 68, 0.8);
}

@keyframes floatUpAndFade {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  75% { opacity: 1; transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(0.9); }
}

.anim-shake {
  animation: shakePanel 0.4s ease-in-out;
}

@keyframes shakePanel {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.anim-success-pulse {
  animation: successPulse 0.4s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.6)); }
  100% { transform: scale(1); }
}

/* ========================================================
   6. COUNTDOWN OVERLAY
   ======================================================== */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.countdown-overlay.hidden { display: none !important; }

.countdown-num {
  font-size: clamp(6rem, 18vw, 15rem);
  font-weight: 900;
  color: #00f2fe;
  text-shadow: 0 0 50px rgba(0, 242, 254, 0.8);
}

.countdown-num.pop-in {
  animation: popCount 0.85s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.countdown-num.go-text {
  color: #ffe259;
  text-shadow: 0 0 70px rgba(255, 226, 89, 0.9);
}

@keyframes popCount {
  0% { transform: scale(0.2); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.countdown-subtext {
  font-size: 2rem;
  letter-spacing: 6px;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
}

/* ========================================================
   7. VICTORY / RESULTS SCREEN
   ======================================================== */
.victory-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  justify-content: space-between;
}

.victory-header {
  text-align: center;
}

.victory-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffe259;
  text-shadow: 0 0 30px rgba(255, 226, 89, 0.7);
}

.winner-champion-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(15, 23, 42, 0.85);
  border: 3px solid #ffe259;
  border-radius: 24px;
  padding: 16px 36px;
  margin: 16px auto;
  box-shadow: 0 0 40px rgba(255, 226, 89, 0.3);
}

.winner-avatar-wrap img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(255, 226, 89, 0.8);
}

.winner-champion-info {
  text-align: left;
}

.winner-badge {
  display: inline-block;
  background: #ffe259;
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.winner-name {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
}

.winner-score {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  color: #38bdf8;
  font-weight: 800;
}

.victory-table-wrap {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 18px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.ranking-table td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 1.15rem;
  font-weight: 700;
}

.rank-row-champion {
  background: rgba(255, 226, 89, 0.08);
}

.rank-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.9rem;
}

.rank-1 { background: #ffe259; color: #000; }
.rank-2 { background: #cbd5e1; color: #000; }
.rank-3 { background: #b45309; color: #fff; }
.rank-4 { background: #475569; color: #fff; }

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.victory-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 14px;
}

/* ========================================================
   8. HOW TO PLAY MODAL
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.modal-overlay.hidden { display: none !important; }

.modal-box {
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 20px;
  padding: 28px 36px;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.4);
}

.modal-box h2 {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #38bdf8;
  margin-bottom: 18px;
  text-align: center;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.rule-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
