/* ==========================================================
   BATTLE OF MINDS - MULTIPLAYER QUICK QUIZ
   Optimized for 1920x1080 Interactive Touchscreen Displays
   ========================================================== */

:root {
  /* Common Palette */
  --font-heading: 'Cinzel', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --bg-deep: #070913;
  --bg-dark: #0d1124;
  --bg-panel: rgba(16, 22, 44, 0.75);
  
  --gold-accent: #f5c451;
  --gold-glow: rgba(245, 196, 81, 0.4);
  
  /* Player 1 (Blue - Frost/Arcane) */
  --p1-base: #0088ff;
  --p1-glow: rgba(0, 162, 255, 0.6);
  --p1-glow-soft: rgba(0, 136, 255, 0.15);
  --p1-surface: rgba(10, 36, 75, 0.65);
  --p1-surface-hover: rgba(18, 56, 115, 0.85);
  --p1-border: rgba(64, 180, 255, 0.45);
  --p1-border-bright: #64c8ff;
  --p1-text: #e1f3ff;
  
  /* Player 2 (Red - Flame/Crimson) */
  --p2-base: #ff3344;
  --p2-glow: rgba(255, 51, 68, 0.6);
  --p2-glow-soft: rgba(255, 51, 68, 0.15);
  --p2-surface: rgba(75, 15, 25, 0.65);
  --p2-surface-hover: rgba(115, 25, 40, 0.85);
  --p2-border: rgba(255, 90, 105, 0.45);
  --p2-border-bright: #ff6b7d;
  --p2-text: #ffebeb;
  
  /* Correct / Wrong Accents */
  --color-correct: #00e676;
  --color-correct-glow: rgba(0, 230, 118, 0.6);
  --color-correct-bg: rgba(0, 150, 70, 0.75);
  
  --color-wrong: #ff1744;
  --color-wrong-glow: rgba(255, 23, 68, 0.6);
  --color-wrong-bg: rgba(160, 10, 30, 0.75);

  --timer-urgent: #ff3d00;
}

/* Reset & Touch Friendly Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

body.is-dragging-active,
body.is-dragging-active * {
  cursor: grabbing !important;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: #ffffff;
  font-family: var(--font-body);
  touch-action: manipulation;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Screen Wrapper */
.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.game-screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* Top Utility Buttons (Mute / Fullscreen) */
.top-controls {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 100;
  display: flex;
  gap: 12px;
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(16, 24, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.ctrl-btn svg {
  width: 24px;
  height: 24px;
}

.ctrl-btn:active {
  transform: scale(0.92);
  background: rgba(40, 56, 95, 0.9);
}

/* ==========================================================
   START / SETUP SCREEN
   ========================================================== */
#screen-start {
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.start-container {
  width: 100%;
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-logo {
  text-align: center;
  margin-bottom: 24px;
}

.logo-sub {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--gold-accent);
  text-shadow: 0 0 12px var(--gold-glow);
  margin-bottom: 6px;
  font-weight: 700;
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffffff 30%, #9fc9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(0, 136, 255, 0.4);
}

.logo-title span {
  background: linear-gradient(180deg, #ffc570 20%, #ff4b4b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 12px;
}

.logo-desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 2px;
  margin-top: 6px;
  text-transform: uppercase;
}

.match-setup-panel {
  width: 100%;
  background: rgba(13, 20, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 36px 48px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 136, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  gap: 32px;
  align-items: center;
  margin-bottom: 36px;
}

/* Player Setup Columns */
.player-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px;
  border-radius: 20px;
  transition: all 0.3s;
}

.p1-setup {
  background: linear-gradient(160deg, rgba(10, 40, 85, 0.5) 0%, rgba(5, 20, 45, 0.7) 100%);
  border: 2px solid var(--p1-border);
  box-shadow: 0 0 30px var(--p1-glow-soft);
}

.p2-setup {
  background: linear-gradient(160deg, rgba(85, 15, 30, 0.5) 0%, rgba(45, 8, 15, 0.7) 100%);
  border: 2px solid var(--p2-border);
  box-shadow: 0 0 30px var(--p2-glow-soft);
}

.p-setup-badge {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 3px;
  font-weight: 700;
  padding: 4px 18px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.p1-setup .p-setup-badge {
  background: var(--p1-base);
  color: #fff;
  box-shadow: 0 0 15px var(--p1-glow);
}

.p2-setup .p-setup-badge {
  background: var(--p2-base);
  color: #fff;
  box-shadow: 0 0 15px var(--p2-glow);
}

.avatar-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.avatar-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  margin-bottom: 12px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p1-avatar {
  background: radial-gradient(circle, rgba(0, 160, 255, 0.4) 0%, rgba(0, 70, 160, 0.2) 100%);
  border: 3px solid var(--p1-border-bright);
  box-shadow: 0 0 25px var(--p1-glow);
}

.p2-avatar {
  background: radial-gradient(circle, rgba(255, 70, 80, 0.4) 0%, rgba(160, 20, 30, 0.2) 100%);
  border: 3px solid var(--p2-border-bright);
  box-shadow: 0 0 25px var(--p2-glow);
}

.avatar-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.p1-setup .avatar-name { color: #8fd0ff; }
.p2-setup .avatar-name { color: #ff9da6; }

.avatar-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.avatar-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-btn.active {
  transform: scale(1.12);
}

.p1-setup .avatar-btn.active {
  background: rgba(0, 136, 255, 0.4);
  border-color: var(--p1-border-bright);
  box-shadow: 0 0 12px var(--p1-glow);
}

.p2-setup .avatar-btn.active {
  background: rgba(255, 51, 68, 0.4);
  border-color: var(--p2-border-bright);
  box-shadow: 0 0 12px var(--p2-glow);
}

.player-name-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.player-name-input:focus {
  border-color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Center Match Options */
.match-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.vs-emblem-large {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold-accent);
  text-shadow: 0 0 25px var(--gold-glow);
  margin-bottom: 20px;
}

.setting-item {
  width: 100%;
  margin-bottom: 18px;
  text-align: center;
}

.setting-item label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.pill-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-btn:active {
  transform: scale(0.95);
}

.pill-btn.active {
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.3) 0%, rgba(245, 196, 81, 0.15) 100%);
  border-color: var(--gold-accent);
  color: #fff;
  box-shadow: 0 0 15px var(--gold-glow);
}

/* Big Start Button */
.cta-start-btn {
  position: relative;
  overflow: hidden;
  width: 380px;
  height: 72px;
  border-radius: 36px;
  background: linear-gradient(135deg, #f5c451 0%, #ff8c00 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(245, 196, 81, 0.4), 0 0 25px rgba(255, 140, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}

.cta-start-btn:active {
  transform: scale(0.96);
  box-shadow: 0 5px 15px rgba(245, 196, 81, 0.6);
}

.cta-text {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #1a0f00;
  position: relative;
  z-index: 2;
}

.cta-pulse {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  animation: shinePulse 2.8s infinite;
}

@keyframes shinePulse {
  0% { left: -100%; }
  40% { left: 150%; }
  100% { left: 150%; }
}

.touch-hint {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  letter-spacing: 1px;
}

/* ==========================================================
   COUNTDOWN OVERLAY
   ========================================================== */
.overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  background: rgba(5, 7, 16, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.countdown-pre {
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 6px;
  color: var(--gold-accent);
  margin-bottom: 12px;
}

.countdown-num {
  font-family: var(--font-heading);
  font-size: 150px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.8), 0 0 100px var(--gold-accent);
  animation: numPop 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

@keyframes numPop {
  0% { transform: scale(0.6); opacity: 0; }
  40% { transform: scale(1.1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.countdown-players {
  margin-top: 24px;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 16px;
}

.countdown-players .p1-tag {
  color: #58b6ff;
  text-shadow: 0 0 15px var(--p1-glow);
}

.countdown-players .vs-tag {
  color: var(--gold-accent);
}

.countdown-players .p2-tag {
  color: #ff5c6d;
  text-shadow: 0 0 15px var(--p2-glow);
}

/* ==========================================================
   IN-GAME BATTLE SPLIT SCREEN
   ========================================================== */
#screen-game {
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Synchronized Top HUD */
.battle-header {
  height: 96px;
  padding: 12px 36px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(8, 12, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 20;
}

/* P1 Header Zone */
.header-p1 {
  display: flex;
  align-items: center;
  gap: 16px;
}

.h-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.header-p1 .h-avatar {
  border: 2px solid var(--p1-border-bright);
  box-shadow: 0 0 15px var(--p1-glow);
}

.header-p2 .h-avatar {
  border: 2px solid var(--p2-border-bright);
  box-shadow: 0 0 15px var(--p2-glow);
}

.h-info {
  display: flex;
  flex-direction: column;
}

.h-info.text-right {
  align-items: flex-end;
}

.h-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-p1 .h-name { color: #8fd0ff; }
.header-p2 .h-name { color: #ff9da6; }

.h-score {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
}

.score-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-body);
}

/* Streak Indicator Badge */
.streak-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0.8;
  transition: transform 0.2s, opacity 0.2s;
}

.streak-indicator.active {
  opacity: 1;
  animation: streakPulse 1.2s infinite alternate;
}

.header-p1 .streak-indicator.active {
  border-color: var(--p1-border-bright);
  background: rgba(0, 136, 255, 0.25);
  box-shadow: 0 0 14px var(--p1-glow);
}

.header-p2 .streak-indicator.active {
  border-color: var(--p2-border-bright);
  background: rgba(255, 51, 68, 0.25);
  box-shadow: 0 0 14px var(--p2-glow);
}

@keyframes streakPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Center HUD Orb */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.round-counter {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2px;
}

.timer-orb-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 6;
}

.timer-fill {
  fill: none;
  stroke: var(--gold-accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s;
}

.timer-orb-wrapper.urgent .timer-fill {
  stroke: var(--timer-urgent);
  filter: drop-shadow(0 0 8px var(--timer-urgent));
  animation: timerUrgentFlash 0.5s infinite alternate;
}

@keyframes timerUrgentFlash {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.timer-number {
  position: absolute;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.timer-orb-wrapper.urgent .timer-number {
  color: #ff5252;
  transform: scale(1.1);
}

.q-category-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-accent);
  margin-top: 2px;
}

/* P2 Header Zone */
.header-p2 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

/* Linear Top Progress Bar */
.battle-progress-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 19;
}

.progress-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--p1-base), var(--gold-accent), var(--p2-base));
  box-shadow: 0 0 10px rgba(245, 196, 81, 0.6);
  transition: width 0.1s linear;
}

/* ==========================================================
   ARENA SPLIT-SCREEN LAYOUT
   ========================================================== */
.battle-arena {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  height: calc(100vh - 101px);
}

/* Central Divider */
.battle-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.divider-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.4) 40%, 
    rgba(245, 196, 81, 0.8) 50%, 
    rgba(255, 255, 255, 0.4) 60%, 
    rgba(255, 255, 255, 0.1) 100%
  );
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.divider-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
  position: absolute;
}
.divider-node.top { top: 20px; }
.divider-node.bottom { bottom: 20px; }

.divider-gem {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16, 22, 44, 0.95);
  border: 2px solid var(--gold-accent);
  box-shadow: 0 0 20px var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  color: var(--gold-accent);
  z-index: 16;
}

/* Player Zones (Left P1, Right P2) */
.player-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 48px;
  overflow: hidden;
  justify-content: space-between;
}

/* Ambient Zone Auras */
.zone-aura {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.p1-aura {
  left: 0;
  background: radial-gradient(circle at 30% 40%, rgba(0, 100, 220, 0.35) 0%, transparent 70%);
}

.p2-aura {
  right: 0;
  background: radial-gradient(circle at 70% 40%, rgba(220, 20, 40, 0.35) 0%, transparent 70%);
}

.zone-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Question Cards */
.question-card {
  padding: 24px 32px;
  border-radius: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  transition: all 0.3s;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.p1-q-card {
  background: rgba(10, 32, 68, 0.72);
  border: 2px solid var(--p1-border);
  box-shadow: 0 10px 30px var(--p1-glow-soft);
}

.p2-q-card {
  background: rgba(68, 12, 22, 0.72);
  border: 2px solid var(--p2-border);
  box-shadow: 0 10px 30px var(--p2-glow-soft);
}

.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.q-marker {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
}

.p1-q-card .q-marker { color: #75c2ff; }
.p2-q-card .q-marker { color: #ff8591; }

.q-diff-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.q-text {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Answer Options Grid (4 large buttons) */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.answer-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 98px;
  padding: 18px 24px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  border: 2px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.answer-letter {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.12);
  transition: all 0.2s;
}

.answer-text {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  flex: 1;
}

/* P1 Answer Style (Translucent Blue) */
.p1-zone .answer-btn {
  background: var(--p1-surface);
  border-color: var(--p1-border);
  color: var(--p1-text);
}

.p1-zone .answer-btn .answer-letter {
  color: #7accff;
  border: 1px solid rgba(122, 204, 255, 0.4);
}

.p1-zone .answer-btn:active:not(.locked) {
  transform: scale(0.97);
  background: var(--p1-surface-hover);
  border-color: var(--p1-border-bright);
  box-shadow: 0 0 25px var(--p1-glow);
}

/* P2 Answer Style (Translucent Red) */
.p2-zone .answer-btn {
  background: var(--p2-surface);
  border-color: var(--p2-border);
  color: var(--p2-text);
}

.p2-zone .answer-btn .answer-letter {
  color: #ffa1aa;
  border: 1px solid rgba(255, 161, 170, 0.4);
}

.p2-zone .answer-btn:active:not(.locked) {
  transform: scale(0.97);
  background: var(--p2-surface-hover);
  border-color: var(--p2-border-bright);
  box-shadow: 0 0 25px var(--p2-glow);
}

/* Selected state (Waiting for other player or locked) */
.answer-btn.selected {
  transform: scale(1.02);
}

.p1-zone .answer-btn.selected {
  border-color: #ffffff;
  background: rgba(0, 150, 255, 0.85);
  box-shadow: 0 0 35px var(--p1-glow);
}

.p2-zone .answer-btn.selected {
  border-color: #ffffff;
  background: rgba(255, 40, 60, 0.85);
  box-shadow: 0 0 35px var(--p2-glow);
}

/* Feedback States: Correct / Wrong */
.answer-btn.correct-reveal {
  background: var(--color-correct-bg) !important;
  border-color: var(--color-correct) !important;
  box-shadow: 0 0 35px var(--color-correct-glow) !important;
  transform: scale(1.03);
  animation: correctPop 0.4s ease;
}

.answer-btn.correct-reveal .answer-letter {
  background: var(--color-correct) !important;
  color: #000 !important;
  font-weight: 900;
}

.answer-btn.wrong-reveal {
  background: var(--color-wrong-bg) !important;
  border-color: var(--color-wrong) !important;
  box-shadow: 0 0 30px var(--color-wrong-glow) !important;
  animation: wrongShake 0.45s ease;
}

.answer-btn.dimmed {
  opacity: 0.35;
  filter: grayscale(40%);
  transform: scale(0.97);
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1.03); }
}

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

/* Status Bar in Player Zone */
.player-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #aaa;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  animation: statusPulse 1.4s infinite;
}

@keyframes statusPulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.6; }
}

.p1-zone .status-pulse-dot { background: var(--p1-border-bright); box-shadow: 0 0 10px var(--p1-glow); }
.p2-zone .status-pulse-dot { background: var(--p2-border-bright); box-shadow: 0 0 10px var(--p2-glow); }

.status-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.8);
}

.player-status-bar.locked {
  background: rgba(20, 25, 45, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}

.player-status-bar.locked .status-pulse-dot {
  background: #ffd166;
  box-shadow: 0 0 12px #ffd166;
}

/* Score Popups */
.score-popup-container {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 25;
}

.score-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: floatScore 1.4s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

.score-popup-pts {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 900;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.score-popup-pts.pos {
  color: #00e676;
  text-shadow: 0 0 25px rgba(0, 230, 118, 0.8);
}

.score-popup-pts.neg {
  color: #ff3d00;
  text-shadow: 0 0 25px rgba(255, 61, 0, 0.8);
}

.score-popup-msg {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 14px;
  border-radius: 12px;
  margin-top: 4px;
}

@keyframes floatScore {
  0% { transform: translateY(20px) scale(0.6); opacity: 0; }
  25% { transform: translateY(-10px) scale(1.15); opacity: 1; }
  60% { transform: translateY(-30px) scale(1); opacity: 1; }
  100% { transform: translateY(-70px) scale(0.9); opacity: 0; }
}

/* Between-Question Feedback Banner */
.feedback-banner {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(12, 18, 38, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--gold-accent);
  box-shadow: 0 0 35px var(--gold-glow);
  border-radius: 20px;
  padding: 14px 32px;
  text-align: center;
  max-width: 800px;
  animation: bannerSlideUp 0.35s ease;
}

@keyframes bannerSlideUp {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.fb-explanation {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

/* ==========================================================
   SUMMARY / GAME OVER SCREEN
   ========================================================== */
#screen-summary {
  justify-content: center;
  align-items: center;
  padding: 30px 40px;
}

.summary-container {
  width: 100%;
  max-width: 1380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.winner-crown-section {
  text-align: center;
  margin-bottom: 24px;
}

.crown-icon {
  font-size: 58px;
  filter: drop-shadow(0 0 25px var(--gold-glow));
  animation: crownBob 2s infinite ease-in-out;
}

@keyframes crownBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.winner-title {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.winner-subtitle {
  font-size: 18px;
  color: var(--gold-accent);
  letter-spacing: 2px;
  font-weight: 700;
  margin-top: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: 100%;
  gap: 36px;
  align-items: stretch;
  margin-bottom: 32px;
}

.summary-card {
  padding: 28px 36px;
  border-radius: 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.p1-summary-card {
  background: linear-gradient(160deg, rgba(10, 40, 85, 0.7) 0%, rgba(5, 18, 42, 0.85) 100%);
  border: 2px solid var(--p1-border);
  box-shadow: 0 10px 40px rgba(0, 136, 255, 0.2);
}

.p2-summary-card {
  background: linear-gradient(160deg, rgba(85, 15, 30, 0.7) 0%, rgba(42, 8, 15, 0.85) 100%);
  border: 2px solid var(--p2-border);
  box-shadow: 0 10px 40px rgba(255, 51, 68, 0.2);
}

.summary-card.winner-glow {
  transform: scale(1.02);
  border-color: var(--gold-accent) !important;
  box-shadow: 0 0 50px var(--gold-glow), 0 20px 40px rgba(0, 0, 0, 0.5) !important;
}

.sum-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.sum-avatar {
  font-size: 38px;
}

.sum-name {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  flex: 1;
}

.sum-badge {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 4px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
}

.summary-card.winner-glow .sum-badge {
  background: var(--gold-accent);
  color: #000;
  box-shadow: 0 0 15px var(--gold-glow);
}

.sum-total-score {
  font-family: var(--font-heading);
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  margin-bottom: 2px;
}

.p1-summary-card .sum-total-score { color: #8fd0ff; }
.p2-summary-card .sum-total-score { color: #ff9da6; }

.sum-score-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

.sum-stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.stat-name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.stat-val {
  font-size: 17px;
  font-weight: 800;
}

.p1-accent { color: #66b5ff; }
.p2-accent { color: #ff7584; }

/* Summary Center */
.summary-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.sum-vs-icon {
  font-size: 40px;
  margin-bottom: 20px;
}

.match-summary-stats {
  background: rgba(16, 22, 44, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 20px 24px;
  width: 220px;
  text-align: center;
}

.ms-title {
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold-accent);
  margin-bottom: 14px;
  font-weight: 800;
}

.ms-item {
  margin-bottom: 12px;
}

.ms-lbl {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.ms-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.ms-val.highlight-val {
  color: var(--gold-accent);
}

/* Summary Action Buttons */
.summary-actions {
  display: flex;
  gap: 24px;
}

.btn-summary-action {
  padding: 16px 36px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-summary-action:active {
  transform: scale(0.95);
}

.btn-summary-action.primary {
  background: linear-gradient(135deg, #f5c451 0%, #ff8c00 100%);
  border: none;
  color: #1a0f00;
  box-shadow: 0 8px 25px rgba(245, 196, 81, 0.4);
}

.btn-summary-action.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}


/* ==========================================================
   GAME SELECTION HUB & TOP NAVIGATION
   ========================================================== */

.top-left-controls {
  position: fixed;
  top: 16px;
  left: 24px;
  z-index: 100;
  display: flex;
  gap: 12px;
}

.btn-back-hub {
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(16, 24, 48, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.btn-back-hub:active {
  transform: scale(0.94);
  background: rgba(30, 45, 80, 0.95);
}

/* SCREEN: MAIN GAME SELECTION HUB */
#screen-hub {
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.hub-container {
  width: 100%;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hub-header {
  text-align: center;
  margin-bottom: 40px;
}

.hub-badge {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--gold-accent);
  text-shadow: 0 0 12px var(--gold-glow);
  font-weight: 800;
  margin-bottom: 8px;
}

.hub-title {
  font-family: var(--font-heading);
  font-size: 58px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #ffffff 40%, #9fc9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-title span {
  background: linear-gradient(180deg, #ffc570 20%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 10px;
}

.hub-desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
  margin-top: 8px;
}

/* Two Games Grid */
.hub-games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  width: 100%;
}

.game-hub-card {
  position: relative;
  background: rgba(14, 20, 44, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.25s, box-shadow 0.25s;
}

.game-hub-card:active {
  transform: scale(0.98);
}

.card-quiz {
  border-color: rgba(0, 136, 255, 0.4);
}

.card-quiz:hover {
  border-color: var(--p1-border-bright);
  box-shadow: 0 20px 50px rgba(0, 136, 255, 0.25);
}

.card-drag {
  border-color: rgba(0, 190, 255, 0.4);
}

.card-drag:hover {
  border-color: #38ef7d;
  box-shadow: 0 20px 50px rgba(56, 239, 125, 0.25);
}

.hub-card-badge {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}

.badge-h2h {
  background: linear-gradient(90deg, #0088ff, #ff3344);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 136, 255, 0.5);
}

.badge-dd {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 198, 255, 0.5);
}

.hub-card-preview {
  height: 160px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

/* Quiz Preview Mockup */
.preview-split-vis {
  display: flex;
  width: 90%;
  height: 80%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.split-vis-left {
  flex: 1;
  background: linear-gradient(135deg, rgba(0, 100, 220, 0.7), rgba(0, 40, 120, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.split-vis-right {
  flex: 1;
  background: linear-gradient(135deg, rgba(220, 40, 60, 0.7), rgba(120, 20, 30, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* Drag Drop Preview Mockup */
.preview-drag-vis {
  display: flex;
  width: 90%;
  height: 80%;
  border-radius: 12px;
  background: linear-gradient(135deg, #b8dcff, #99c6ff);
  align-items: center;
  justify-content: space-around;
  padding: 10px;
}

.vis-dd-item {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.vis-dd-arrow {
  font-size: 24px;
  color: #1a4a88;
  font-weight: 900;
}

.vis-dd-slot {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  border: 2px dashed #1a4a88;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.hub-card-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
}

.hub-card-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
  margin-bottom: 24px;
  flex: 1;
}

.hub-card-btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hub-card-btn:active {
  transform: scale(0.96);
}

.btn-play-quiz {
  background: linear-gradient(135deg, #0088ff 0%, #00bfff 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(0, 136, 255, 0.4);
}

.btn-play-drag {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: #042512;
  box-shadow: 0 8px 25px rgba(56, 239, 125, 0.4);
}

/* ==========================================================
   GAME 2: DRAG & DROP COCOKKAN GAMBAR (MENGENAL MESIN PENCARI)
   Designed after reference screenshot
   ========================================================== */

#screen-dragdrop {
  justify-content: center;
  align-items: center;
  padding: 30px 40px;
}

.dd-main-container {
  width: 100%;
  max-width: 1360px;
  display: flex;
  flex-direction: column;
}

.dd-page-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.dd-breadcrumb {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.dd-level-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.dd-top-actions {
  display: flex;
  gap: 12px;
}

.dd-btn-sub {
  padding: 8px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.dd-btn-sub:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.22);
}

/* The Authentic Light-Blue Canvas Card */
.dd-board-canvas {
  background: linear-gradient(135deg, #d3eaff 0%, #b8dcff 40%, #e0f0ff 100%);
  border-radius: 28px;
  border: 3px solid #8abeff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 160, 255, 0.2);
  padding: 28px 36px;
  color: #103460;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.dd-instruction-header {
  text-align: center;
  font-family: 'Arial Black', Impact, var(--font-heading);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #175496;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  margin-bottom: 24px;
}

.dd-board-arena {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 32px;
  flex: 1;
  align-items: center;
}

/* Clues List (Left) */
.dd-clues-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dd-clue-row {
  display: grid;
  grid-template-columns: 380px 1fr 120px;
  align-items: center;
  gap: 20px;
}

.dd-clue-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Arial Black', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #143e70;
  letter-spacing: 0.5px;
}

.clue-icon {
  font-size: 24px;
}

.clue-text {
  text-transform: uppercase;
}

/* Arrow Line with pointer */
.dd-arrow-line {
  display: flex;
  align-items: center;
  width: 100%;
}

.arrow-body {
  flex: 1;
  height: 3px;
  background: #143e70;
}

.arrow-head {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #143e70;
}

/* Target Drop Zone */
.dd-drop-zone {
  width: 116px;
  height: 82px;
  border: 2px dashed rgba(20, 62, 112, 0.45);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
}

.drop-placeholder {
  font-size: 11px;
  font-weight: 800;
  color: rgba(20, 62, 112, 0.5);
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dd-drop-zone.occupied {
  border-style: solid;
  border-color: #2b7cd4;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.dd-drop-zone.correct-zone {
  border-color: #00c853 !important;
  background: #e8f5e9 !important;
  box-shadow: 0 0 20px rgba(0, 200, 83, 0.5) !important;
  animation: correctZonePulse 0.4s ease;
}

.dd-drop-zone.wrong-zone {
  border-color: #d50000 !important;
  background: #ffebee !important;
  box-shadow: 0 0 20px rgba(213, 0, 0, 0.4) !important;
  animation: wrongShake 0.4s ease;
}

@keyframes correctZonePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Dropped card inside zone */
.dropped-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.remove-chip {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff3344;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Draggable Items Tray (Right Column) */
.dd-items-tray {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.3);
  padding: 16px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  min-height: 460px;
}

.dd-item-card {
  width: 112px;
  height: 82px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 40, 80, 0.2);
  border: 2px solid #e0e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  padding: 4px;
}

.dd-item-card:active {
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(0, 40, 80, 0.35);
}

.dd-item-card.selected-for-place {
  border-color: #007bff;
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.6);
  transform: scale(1.08);
}

.dd-item-card.dragging {
  opacity: 0.3;
}

.card-svg-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-label-sub {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #333333;
  margin-top: 2px;
  text-align: center;
}

/* Floating Drag Ghost Clone */
.dd-item-card.floating-ghost {
  position: fixed;
  z-index: 99999;
  pointer-events: none !important;
  opacity: 0.92;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  transform: scale(1.08);
  transition: none !important;
  cursor: grabbing !important;
}

/* Bottom Actions & "Periksa" Button */
.dd-board-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-dd-check {
  padding: 14px 34px;
  border-radius: 28px;
  background: #0072ec;
  border: none;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 114, 236, 0.4);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-dd-check svg {
  width: 20px;
  height: 20px;
}

.btn-dd-check:active {
  transform: scale(0.95);
  background: #005bbd;
}

.btn-dd-reset {
  padding: 12px 24px;
  border-radius: 24px;
  background: rgba(20, 62, 112, 0.15);
  border: 1px solid rgba(20, 62, 112, 0.3);
  color: #143e70;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dd-reset:active {
  transform: scale(0.95);
  background: rgba(20, 62, 112, 0.25);
}

/* Result Toast Banner */
.dd-result-toast {
  flex: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #2b7cd4;
  border-radius: 20px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #103460;
  animation: bannerSlideUp 0.3s ease;
}

/* ==========================================================
   5-SESSION PROGRESS & FINAL RECAP STYLES
   ========================================================== */

.dd-top-badges {
  display: flex;
  gap: 14px;
  align-items: center;
}

.dd-badge-session {
  padding: 8px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0072ec 0%, #00bfff 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(0, 114, 236, 0.4);
}

.dd-badge-score {
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(245, 196, 81, 0.2);
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 0 15px var(--gold-glow);
}

/* Button to Advance to Next Session */
.btn-dd-next-session {
  padding: 14px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, #00c853 0%, #69f0ae 100%);
  border: none;
  color: #05260c;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 200, 83, 0.4);
  animation: nextSessionPulse 1.2s infinite alternate;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes nextSessionPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.btn-dd-next-session:active {
  transform: scale(0.96);
}

/* Final Summary Modal Card */
.dd-final-card {
  background: rgba(14, 20, 44, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--gold-accent);
  border-radius: 32px;
  padding: 48px 60px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 50px var(--gold-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
  width: 90%;
  animation: numPop 0.4s ease;
}

.dd-final-crown {
  font-size: 64px;
  filter: drop-shadow(0 0 25px var(--gold-glow));
  margin-bottom: 12px;
  animation: crownBob 2s infinite ease-in-out;
}

.dd-final-title {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  margin-bottom: 16px;
}

.dd-final-score-val {
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: 900;
  color: var(--gold-accent);
  text-shadow: 0 0 30px var(--gold-glow);
  line-height: 1;
}

.dd-final-score-lbl {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  margin-bottom: 20px;
}

.dd-final-desc {
  font-size: 18px;
  font-weight: 700;
  color: #e0f0ff;
  line-height: 1.5;
  margin-bottom: 32px;
}

.dd-final-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================
   GAME 3: DRAG THE WORDS / LENGKAPI KODE HTML
   Designed after the reference fill-in-the-blank concept
   ========================================================== */

/* 3 Cards in Hub */
.hub-games-grid.three-cards {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.card-code {
  border-color: rgba(142, 68, 173, 0.4);
}

.card-code:hover {
  border-color: #bb86fc;
  box-shadow: 0 20px 50px rgba(187, 134, 252, 0.25);
}

.badge-code {
  background: linear-gradient(90deg, #8e44ad, #d35400);
  color: #fff;
  box-shadow: 0 0 15px rgba(142, 68, 173, 0.5);
}

.btn-play-code {
  background: linear-gradient(135deg, #8e44ad 0%, #e056fd 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(142, 68, 173, 0.4);
}

/* SCREEN: CODE GAME BOARD */
#screen-codegame {
  justify-content: center;
  align-items: center;
  padding: 24px 36px;
}

.cg-main-container {
  width: 100%;
  max-width: 1380px;
  display: flex;
  flex-direction: column;
}

.cg-page-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.cg-breadcrumb {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.cg-level-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* The Code Game Canvas Card (Clean Light Blue theme) */
.cg-board-canvas {
  background: linear-gradient(135deg, #eaf4ff 0%, #d8ecff 50%, #edf6ff 100%);
  border-radius: 28px;
  border: 3px solid #8abeff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 160, 255, 0.2);
  padding: 24px 32px;
  color: #103460;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.cg-instruction-header {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 800;
  color: #175496;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cg-instruction-header span.inst-icon {
  font-size: 24px;
}

/* Code Game Arena: Code Block (Left) + Words Tray (Right) */
.cg-arena {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 28px;
  flex: 1;
  align-items: stretch;
}

/* Code Snippet Box (Editor Style) */
.code-snippet-box {
  background: #ffffff;
  border: 2px solid #b8d9f8;
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 40, 80, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow-x: auto;
}

.code-line {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 20px;
  line-height: 1.6;
  color: #1e293b;
  min-height: 42px;
}

.code-line.code-comment {
  color: #64748b;
  font-style: italic;
}

.line-num {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  min-width: 24px;
  text-align: right;
  user-select: none;
}

.line-code {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.indent-1 { padding-left: 32px; }
.indent-2 { padding-left: 64px; }
.indent-3 { padding-left: 96px; }

/* Inline Drop Slots (Matching the light-blue pill slots in screenshot) */
.code-drop-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: #e2f0fd;
  border: 2px dashed #64b5f6;
  color: #1976d2;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.code-drop-slot:hover {
  background: #bbdefb;
  border-color: #2196f3;
}

.code-drop-slot.occupied {
  background: #ffffff;
  border: 2px solid #0072ec;
  color: #0d47a1;
  box-shadow: 0 4px 12px rgba(0, 114, 236, 0.2);
}

.code-drop-slot.correct-slot {
  background: #e8f5e9 !important;
  border: 2px solid #00c853 !important;
  color: #1b5e20 !important;
  box-shadow: 0 0 18px rgba(0, 200, 83, 0.4) !important;
  animation: correctZonePulse 0.4s ease;
}

.code-drop-slot.wrong-slot {
  background: #ffebee !important;
  border: 2px solid #d50000 !important;
  color: #b71c1c !important;
  box-shadow: 0 0 18px rgba(213, 0, 0, 0.35) !important;
  animation: wrongShake 0.4s ease;
}

/* Words Tray on the Right (Matching screenshot gray pill buttons) */
.cg-words-tray {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
}

.cg-word-pill {
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background-color 0.18s;
  user-select: none;
}

.cg-word-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.cg-word-pill:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.cg-word-pill.selected-word {
  border-color: #0072ec;
  background: #ffffff;
  color: #0072ec;
  box-shadow: 0 0 18px rgba(0, 114, 236, 0.5);
  transform: scale(1.06);
}

.cg-word-pill.dragging {
  opacity: 0.3;
}

.cg-word-pill.floating-ghost {
  position: fixed;
  z-index: 99999;
  pointer-events: none !important;
  opacity: 0.95;
  background: #ffffff;
  border-color: #0072ec;
  color: #0072ec;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  transform: scale(1.08);
  cursor: grabbing !important;
}

/* Bottom Actions */
.btn-cg-next-level {
  padding: 14px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, #00c853 0%, #69f0ae 100%);
  border: none;
  color: #05260c;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 200, 83, 0.4);
  animation: nextSessionPulse 1.2s infinite alternate;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-cg-next-level:active {
  transform: scale(0.96);
}

/* ==========================================================
   MAGNETIC ACTIVE DROP TARGET HOVER STYLES
   Provides immediate visual feedback when hovering near drop zones
   ========================================================== */

.dd-drop-zone.active-drop-target {
  border-color: #0072ec !important;
  border-style: solid !important;
  background: #c8e6c9 !important;
  transform: scale(1.12);
  box-shadow: 0 0 30px rgba(0, 114, 236, 0.6), 0 8px 20px rgba(0, 0, 0, 0.2) !important;
  z-index: 10;
}

.dd-drop-zone.active-drop-target .drop-placeholder {
  color: #0072ec !important;
  font-weight: 900;
}

.code-drop-slot.active-drop-target {
  border-color: #0072ec !important;
  border-style: solid !important;
  background: #bbdefb !important;
  color: #0d47a1 !important;
  transform: scale(1.12);
  box-shadow: 0 0 25px rgba(0, 114, 236, 0.6) !important;
  z-index: 10;
}

/* ==========================================================
   GAME 2: 2-PLAYER SCRAMBLE BATTLE (BEREBUT TAG MELAYANG)
   Multi-touch floating tags arena for 1920x1080 display
   ========================================================== */

/* Mode Selection Modal on Game 2 */
.mode-select-modal {
  background: rgba(14, 20, 44, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--gold-accent);
  border-radius: 32px;
  padding: 44px 56px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 50px var(--gold-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 640px;
  width: 90%;
  animation: numPop 0.35s ease;
}

.mode-modal-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 8px;
}

.mode-modal-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 28px;
}

.mode-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  margin-bottom: 24px;
}

.mode-option-card {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mode-option-card:hover, .mode-option-card:active {
  transform: scale(1.04);
}

.mode-card-solo:hover {
  border-color: #38ef7d;
  background: rgba(56, 239, 125, 0.15);
  box-shadow: 0 0 25px rgba(56, 239, 125, 0.4);
}

.mode-card-duel:hover {
  border-color: #ff3344;
  background: rgba(255, 51, 68, 0.15);
  box-shadow: 0 0 25px rgba(255, 51, 68, 0.4);
}

.mode-icon-big {
  font-size: 46px;
  margin-bottom: 12px;
}

.mode-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}

.mode-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* SCREEN: 2-PLAYER DRAG BATTLE ARENA */
#screen-dragbattle {
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Top Battle Arena HUD */
.db-header {
  height: 90px;
  padding: 10px 32px;
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: center;
  background: rgba(10, 15, 34, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 20;
}

.db-player-hud {
  display: flex;
  align-items: center;
  gap: 14px;
}

.db-p1-hud { justify-content: flex-start; }
.db-p2-hud { justify-content: flex-end; }

.db-hud-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.db-p1-hud .db-hud-avatar {
  background: rgba(0, 136, 255, 0.25);
  border: 2px solid var(--p1-border-bright);
  box-shadow: 0 0 15px var(--p1-glow);
}

.db-p2-hud .db-hud-avatar {
  background: rgba(255, 51, 68, 0.25);
  border: 2px solid var(--p2-border-bright);
  box-shadow: 0 0 15px var(--p2-glow);
}

.db-hud-meta {
  display: flex;
  flex-direction: column;
}

.db-p2-hud .db-hud-meta {
  align-items: flex-end;
}

.db-hud-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
}

.db-p1-hud .db-hud-name { color: #8fd0ff; }
.db-p2-hud .db-hud-name { color: #ff9da6; }

.db-hud-score {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.db-hud-progress {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-accent);
}

.db-center-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.db-badge-vs {
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--gold-accent);
  font-weight: 900;
}

.db-round-name {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}

/* 3-Column Arena: P1 Slots (Left) - Floating Sky (Center) - P2 Slots (Right) */
.db-arena-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 310px 1fr 310px;
  height: calc(100vh - 90px);
  position: relative;
  overflow: hidden;
}

/* Left & Right Target Slot Columns */
.db-slots-column {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  z-index: 2;
}

.db-p1-column {
  background: linear-gradient(90deg, rgba(10, 32, 68, 0.6) 0%, rgba(5, 18, 42, 0.2) 100%);
  border-right: 1px solid rgba(0, 136, 255, 0.2);
}

.db-p2-column {
  background: linear-gradient(270deg, rgba(68, 12, 22, 0.6) 0%, rgba(42, 8, 15, 0.2) 100%);
  border-left: 1px solid rgba(255, 51, 68, 0.2);
}

/* Battle Target Slots */
.battle-target-slot {
  background: rgba(14, 20, 44, 0.8);
  border-radius: 16px;
  padding: 12px 14px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.p1-target-slot {
  border-color: rgba(0, 136, 255, 0.35);
}

.p2-target-slot {
  border-color: rgba(255, 51, 68, 0.35);
}

.bts-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bts-icon {
  font-size: 18px;
}

.bts-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.p1-target-slot .bts-label { color: #8fd0ff; }
.p2-target-slot .bts-label { color: #ff9da6; }

.bts-drop-box {
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 900;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bts-placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

/* Claimed state when tag is dropped correctly */
.bts-drop-box.claimed {
  border-style: solid;
  color: #fff;
  font-size: 20px;
  animation: correctZonePulse 0.4s ease;
}

.bts-drop-box.claimed-p1 {
  background: rgba(0, 136, 255, 0.85);
  border-color: #64c8ff;
  box-shadow: 0 0 20px var(--p1-glow);
}

.bts-drop-box.claimed-p2 {
  background: rgba(255, 51, 68, 0.85);
  border-color: #ff6b7d;
  box-shadow: 0 0 20px var(--p2-glow);
}

/* Center Floating Sky Area */
.battle-sky-area {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(20, 30, 65, 0.4) 0%, transparent 70%);
}

/* Floating Tag Orbs Drifting in Air */
.floating-tag-orb {
  position: absolute;
  width: 96px;
  height: 52px;
  border-radius: 26px;
  color: #ffffff;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 17px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
  will-change: transform, left, top;
  z-index: 5;
}

.floating-tag-orb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

.floating-tag-orb.is-grabbed {
  position: fixed !important;
  z-index: 999999 !important;
  cursor: grabbing !important;
  transform: scale(1.22);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 255, 255, 0.9) !important;
  border-color: #ffffff !important;
  pointer-events: none !important;
}

.hub-card-actions-dual {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.btn-play-battle {
  background: linear-gradient(135deg, #ff3344 0%, #ff8c00 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 51, 68, 0.4);
}

.btn-play-battle:active {
  transform: scale(0.96);
}

/* Guaranteed Multi-touch gesture disable for simultaneous 2-player touchscreen gaming */
#screen-dragbattle,
.db-arena-grid,
.battle-sky-area,
.db-slots-column,
.battle-target-slot,
.bts-drop-box,
.floating-tag-orb {
  touch-action: none !important;
  -webkit-touch-callout: none !important;
}

/* ==========================================================================
   GAME 3 MULTIPLAYER: SPEED CODER RACE (2-PLAYER SPLIT-SCREEN ARENA)
   ========================================================================== */
#screen-codebattle {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: transparent;
  user-select: none;
}

/* Top Synchronized HUD Bar */
.scb-top-hud {
  height: 85px;
  padding: 8px 32px;
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  align-items: center;
  background: rgba(10, 15, 34, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 25;
}

.scb-player-hud {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scb-p1-hud { justify-content: flex-start; }
.scb-p2-hud { justify-content: flex-end; }

.scb-hud-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.scb-p1-hud .scb-hud-avatar {
  background: rgba(0, 136, 255, 0.25);
  border: 2px solid var(--p1-border-bright);
  box-shadow: 0 0 15px var(--p1-glow);
}

.scb-p2-hud .scb-hud-avatar {
  background: rgba(255, 51, 68, 0.25);
  border: 2px solid var(--p2-border-bright);
  box-shadow: 0 0 15px var(--p2-glow);
}

.scb-hud-meta {
  display: flex;
  flex-direction: column;
}

.scb-hud-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
}

.scb-p1-hud .scb-hud-name { color: #8fd0ff; }
.scb-p2-hud .scb-hud-name { color: #ff9da6; }

.scb-hud-score {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.scb-hud-progress {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-accent);
}

.scb-center-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scb-round-badge {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  color: #ffc570;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 197, 112, 0.5);
  text-transform: uppercase;
}

.scb-timer-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 320px;
}

.scb-timer-val {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  min-width: 38px;
  text-align: right;
}

.scb-timer-track {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.scb-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #38ef7d 0%, #ffc570 60%, #ff3344 100%);
  border-radius: 5px;
  transition: width 0.1s linear;
}

/* Split-Screen Arena Grid */
.scb-arena-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  padding: 14px 20px 20px 20px;
  gap: 12px;
  height: calc(100vh - 85px);
  overflow: hidden;
  position: relative;
}

/* Player Column */
.scb-player-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.scb-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-shrink: 0;
}

.scb-col-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scb-col-tag {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 5px 14px;
  border-radius: 20px;
}

.p1-tag {
  background: rgba(0, 136, 255, 0.25);
  color: #8fd0ff;
  border: 1px solid rgba(0, 136, 255, 0.5);
}

.p2-tag {
  background: rgba(255, 51, 68, 0.25);
  color: #ff9da6;
  border: 1px solid rgba(255, 51, 68, 0.5);
}

.scb-hint-tag {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
}

/* Compile / Run Button */
.btn-scb-run {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  touch-action: manipulation;
}

.btn-scb-run:active {
  transform: scale(0.95);
}

.btn-scb-run-p1 {
  background: linear-gradient(135deg, #0088ff 0%, #00c6ff 100%);
  box-shadow: 0 4px 20px rgba(0, 136, 255, 0.5);
}

.btn-scb-run-p2 {
  background: linear-gradient(135deg, #ff3344 0%, #ff8c00 100%);
  box-shadow: 0 4px 20px rgba(255, 51, 68, 0.5);
}

/* Player Workspace (Editor on left, Tray on right) */
.scb-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 12px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

/* Player Editor Box */
.scb-editor-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.p1-editor-box {
  border: 3px solid #90caf9;
}

.p2-editor-box {
  border: 3px solid #ef9a9a;
}

.scb-editor-box .code-line {
  font-size: 17px;
  min-height: 36px;
  gap: 10px;
}

.scb-editor-box .line-num {
  font-size: 13px;
  min-width: 20px;
}

/* Word Tray Box */
.scb-tray-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.p1-tray-box {
  border-color: rgba(0, 136, 255, 0.3);
}

.p2-tray-box {
  border-color: rgba(255, 51, 68, 0.3);
}

/* Word Pills in Battle */
.scb-word-pill {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #1e293b;
  text-align: center;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.p1-word-pill:hover,
.p1-word-pill.selected-word {
  border-color: #0088ff;
  box-shadow: 0 0 14px rgba(0, 136, 255, 0.6);
  transform: scale(1.04);
}

.p2-word-pill:hover,
.p2-word-pill.selected-word {
  border-color: #ff3344;
  box-shadow: 0 0 14px rgba(255, 51, 68, 0.6);
  transform: scale(1.04);
}

/* Drop Slots in Code Battle */
.scb-drop-slot {
  min-width: 90px;
  height: 34px;
  padding: 0 12px;
  font-size: 15px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 2px dashed #94a3b8;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p1-slot.active-drop-target {
  background: #e1f5fe !important;
  border-color: #0088ff !important;
  box-shadow: 0 0 18px rgba(0, 136, 255, 0.7) !important;
  transform: scale(1.08);
}

.p2-slot.active-drop-target {
  background: #ffebee !important;
  border-color: #ff3344 !important;
  box-shadow: 0 0 18px rgba(255, 51, 68, 0.7) !important;
  transform: scale(1.08);
}

.scb-drop-slot.occupied {
  background: #ffffff;
  color: #0f172a;
}

.p1-slot.occupied {
  border: 2px solid #0088ff;
  color: #0066cc;
}

.p2-slot.occupied {
  border: 2px solid #ff3344;
  color: #cc2233;
}

/* Center VS Separator */
.scb-vs-separator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}

.scb-vs-line {
  flex: 1;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.3) 30%, rgba(255, 255, 255, 0.3) 70%, transparent 100%);
}

.scb-vs-badge {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, #0088ff 0%, #ff3344 100%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.4);
}

/* Toast Notifications for Compile Status */
.scb-toast {
  position: absolute;
  bottom: 8px;
  left: 20px;
  right: 20px;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: slideToastUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scb-toast.toast-success {
  background: linear-gradient(135deg, #00b09b, #96c93d);
  color: #ffffff;
  border: 2px solid #a8ff78;
  box-shadow: 0 0 25px rgba(56, 239, 125, 0.6);
}

.scb-toast.toast-error {
  background: linear-gradient(135deg, #d31027, #ea384d);
  color: #ffffff;
  border: 2px solid #ff7b88;
  box-shadow: 0 0 25px rgba(255, 51, 68, 0.6);
  animation: wrongShake 0.4s ease;
}

@keyframes slideToastUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Multi-touch and Touchscreen Lock */
#screen-codebattle,
.scb-arena-split,
.scb-player-col,
.scb-workspace,
.scb-editor-box,
.scb-tray-box,
.scb-word-pill,
.scb-drop-slot {
  touch-action: none !important;
  -webkit-touch-callout: none !important;
}
