/* ==========================================
   GeoGuessr TR - Ultra Premium Dark Theme v2
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-dark: #060a13;
  --bg-surface: #0c1220;
  --bg-card: rgba(12, 18, 32, 0.85);
  --bg-card-solid: #0f1729;
  --bg-elevated: rgba(20, 30, 52, 0.92);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.12);
  --primary: #34d399;
  --primary-dark: #059669;
  --primary-glow: rgba(52, 211, 153, 0.35);
  --primary-subtle: rgba(52, 211, 153, 0.08);
  --secondary: #60a5fa;
  --secondary-glow: rgba(96, 165, 250, 0.3);
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.3);
  --rose: #fb7185;
  --rose-glow: rgba(251, 113, 133, 0.3);
  --amber: #fbbf24;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.7);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.dark-theme {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* ================= ANIMATED BACKGROUND ================= */
.animated-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-dark);
}

.animated-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(52, 211, 153, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(96, 165, 250, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(167, 139, 250, 0.04) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-3%, 2%) rotate(1deg); }
  100% { transform: translate(2%, -3%) rotate(-1deg); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: orbFloat 15s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px; height: 500px;
  background: var(--primary);
  top: -10%; left: -5%;
  animation-duration: 18s;
}

.orb-2 {
  width: 400px; height: 400px;
  background: var(--secondary);
  bottom: -10%; right: -5%;
  animation-duration: 22s;
  animation-delay: -5s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: var(--accent);
  top: 40%; right: 20%;
  animation-duration: 16s;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
  100% { transform: translate(15px, -15px) scale(1.02); }
}

/* ================= GLASS CARD SYSTEM ================= */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}

/* ================= BUTTON SYSTEM ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--primary-glow);
  filter: brightness(1.08);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-glow {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--primary-glow); }
  50% { box-shadow: 0 4px 36px var(--primary-glow), 0 0 60px rgba(52, 211, 153, 0.15); }
}

.btn-secondary {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--secondary-glow);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--secondary-glow);
}

.btn-accent {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-outline {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glow);
  color: var(--text-secondary);
}

.btn-outline::after { display: none; }

.btn-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}

.btn-block { width: 100%; }

.btn-lg {
  padding: 16px 36px;
  font-size: 1.08rem;
  border-radius: var(--radius-lg);
}

/* ================= FORM ELEMENTS ================= */
select, input[type="text"] {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-body);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

select:focus, input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

select:hover, input[type="text"]:hover {
  border-color: rgba(255,255,255,0.16);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
  border-radius: 4px;
}

.rules-checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  width: 100%;
}

/* ================= VIEWS ================= */
.view {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.view.active {
  display: flex;
}

/* ================= LANDING VIEW ================= */
#view-landing {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 50px 20px;
}

.landing-hero {
  max-width: 780px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-icon {
  font-size: 3.6rem;
  color: var(--primary);
  filter: drop-shadow(0 0 24px var(--primary-glow));
  animation: logoSpin 30s linear infinite;
}

@keyframes logoSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  background: linear-gradient(135deg, #f1f5f9 40%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-title span {
  -webkit-text-fill-color: var(--primary);
}

.badge-tag {
  font-size: 0.75rem;
  -webkit-text-fill-color: #fff;
  background: linear-gradient(135deg, var(--rose), #e11d48);
  padding: 4px 10px;
  border-radius: 6px;
  vertical-align: middle;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px var(--rose-glow);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.6;
}

/* Player Name Card */
.player-input-card {
  width: 100%;
  max-width: 440px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.player-input-card label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-input-card input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.player-input-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 560px;
  background: rgba(0,0,0,0.3);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.tab-btn {
  flex: 1;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.tab-btn:not(.active):hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

/* Tab Content */
.tab-content {
  display: none;
  width: 100%;
  max-width: 640px;
  padding: 28px;
  flex-direction: column;
  gap: 22px;
  text-align: left;
}

.tab-content.active {
  display: flex;
  animation: fadeInUp 0.3s ease-out;
}

.tab-content h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-subtle), transparent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.category-card:hover::before,
.category-card.selected::before {
  opacity: 1;
}

.category-card:hover, .category-card.selected {
  border-color: rgba(52, 211, 153, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.12);
}

.category-card h4 {
  font-size: 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
}

.category-card p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  position: relative;
}

.game-settings-row {
  display: flex;
  gap: 14px;
}

.setting-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.setting-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Multiplayer Create/Join Boxes */
.multi-actions {
  display: flex;
  gap: 20px;
}

.multi-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.multi-box h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}

.multi-box p {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.divider-vertical {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
}

.divider-vertical::before, .divider-vertical::after {
  content: '';
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, transparent, var(--border-glow), transparent);
  position: absolute;
}

.divider-vertical::before { top: 20%; }
.divider-vertical::after { bottom: 20%; }

.input-code {
  letter-spacing: 6px;
  font-weight: 700;
  text-align: center;
  font-size: 1.5rem;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

/* ================= LOBBY VIEW ================= */
#view-lobby {
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.lobby-container {
  max-width: 880px;
  width: 92%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeInUp 0.4s ease-out;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
}

.lobby-header h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
}

.text-muted {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.room-code-badge {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed rgba(52, 211, 153, 0.5);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: 2px;
}

.room-code-badge button {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.room-code-badge button:hover {
  background: rgba(52, 211, 153, 0.2);
  border-color: var(--primary);
}

.lobby-body {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 24px;
  width: 100%;
}

.players-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.players-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.players-header-row h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}

.team-selector-box {
  display: flex;
  gap: 8px;
}

.team-btn {
  padding: 7px 16px;
  border-radius: 24px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-glass);
  background: rgba(0,0,0,0.3);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-smooth);
  font-family: var(--font-heading);
}

.team-btn.btn-red.active, .team-btn.btn-red:hover {
  background: rgba(251, 113, 133, 0.15);
  border-color: var(--rose);
  color: var(--rose);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.2);
}

.team-btn.btn-blue.active, .team-btn.btn-blue:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.2);
}

.player-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.player-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast);
}

.player-card:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--border-glow);
}

.player-card.team-red {
  border-left: 3px solid var(--rose);
}

.player-card.team-blue {
  border-left: 3px solid var(--secondary);
}

.player-card.host {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.05);
}

.player-card i.fa-circle-user {
  color: var(--text-tertiary);
}

.host-tag {
  font-size: 0.65rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-badge-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.team-badge-tag.red {
  background: rgba(251, 113, 133, 0.2);
  color: var(--rose);
}

.team-badge-tag.blue {
  background: rgba(96, 165, 250, 0.2);
  color: var(--secondary);
}

/* Lobby Details Panel */
.lobby-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lobby-details h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
}

.lobby-controls-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.details-card {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.restrictions-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.restriction-badge {
  font-size: 0.72rem;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: var(--rose);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.mt-2 { margin-top: 8px; }

/* ================= GAMEPLAY HUD ================= */
#view-game {
  flex-direction: column;
}

.game-header {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-elevated);
  backdrop-filter: blur(24px);
  padding: 10px 24px;
  border-radius: 50px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
}

.stat-value.highlight {
  color: var(--primary);
}

.timer-box {
  flex-direction: row !important;
  gap: 8px !important;
  color: var(--amber);
}

.timer-box .stat-value {
  color: var(--amber);
  font-size: 1.2rem;
}

.restriction-hud-pill {
  background: rgba(251, 113, 133, 0.15);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: var(--rose);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* TEAM HEALTH BARS */
.hud-team-hp-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hp-team-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}

.hp-team-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hp-bar-outer {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.hp-bar-inner {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-bar-inner.red {
  background: linear-gradient(90deg, #f43f5e, #fb7185);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.hp-bar-inner.blue {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.hp-val-text {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-tertiary);
}

.vs-badge {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.82rem;
  color: var(--amber);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

/* STREET VIEW VIEWPORT WITH SEAMLESS TOP-CLIP */
.streetview-viewport {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  overflow: hidden;
}

.streetview-viewport iframe {
  width: 100vw !important;
  height: calc(100vh + 80px) !important;
  position: absolute !important;
  top: -75px !important;
  left: 0 !important;
  border: 0 !important;
}

.no-move-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  background: transparent;
  cursor: grab;
}

.no-move-overlay:active {
  cursor: grabbing;
}

.streetview-quick-actions {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 500;
}

.btn-floating {
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-md);
}

.btn-floating:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

/* ================= MAP WIDGET ================= */
.map-widget {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  width: 360px;
  height: 270px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-widget.collapsed:hover {
  width: 480px;
  height: 360px;
}

.map-widget.expanded {
  width: 660px;
  height: 500px;
}

.map-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.82rem;
  font-weight: 600;
  gap: 8px;
}

.map-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.map-layer-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.layer-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.layer-btn:hover { color: var(--text-primary); }

.layer-btn.active {
  background: var(--primary);
  color: #fff;
}

.btn-icon-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  transition: color var(--transition-fast);
}

.btn-icon-toggle:hover {
  color: var(--primary);
}

.map-render-area {
  flex: 1;
  width: 100%;
  background: #0a0f1a;
}

.map-widget-footer {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
}

/* ================= MODALS ================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 520px;
  width: 100%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-content.modal-large {
  max-width: 640px;
}

.animate-pop {
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

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

.result-header h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.6rem;
}

.eval-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 4px;
}

.team-damage-banner {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.3);
  padding: 14px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  animation: damageFlash 0.5s ease;
}

@keyframes damageFlash {
  0%, 100% { background: rgba(251, 113, 133, 0.12); }
  50% { background: rgba(251, 113, 133, 0.25); }
}

.result-summary-map-box {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  overflow: hidden;
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.breakdown-card {
  background: rgba(0, 0, 0, 0.3);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  transition: all var(--transition-fast);
}

.breakdown-card.highlight {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.06);
}

.b-label {
  font-size: 0.76rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.b-value {
  font-size: 1rem;
  font-weight: 700;
}

.b-value.animated-score {
  font-size: 1.3rem;
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 800;
}

/* Leaderboard */
.mp-round-leaderboard {
  border-top: 1px solid var(--border-glass);
  padding-top: 14px;
}

.mp-round-leaderboard h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

.mp-round-leaderboard ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.mp-round-leaderboard li {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid var(--border-glass);
}

.modal-actions {
  margin-top: 6px;
}

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

/* Game Over Modal */
.trophy-icon {
  font-size: 4.5rem;
  color: var(--amber);
  filter: drop-shadow(0 0 24px rgba(251, 191, 36, 0.4));
}

.final-score-box {
  text-align: center;
  padding: 12px 0;
}

.final-score-number {
  font-size: 3.2rem;
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--primary);
  filter: drop-shadow(0 0 20px var(--primary-glow));
}

.podium-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.podium-card {
  text-align: center;
  min-width: 120px;
}

/* ================= TOAST NOTIFICATIONS ================= */
.mp-toast-container {
  position: absolute;
  top: 80px;
  left: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-toast {
  background: var(--bg-elevated);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
}

@keyframes slideInLeft {
  0% { transform: translateX(-120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .lobby-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .category-grid, .multi-actions, .result-breakdown {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .map-widget {
    width: 260px;
    height: 200px;
  }
  .map-widget.expanded {
    width: 92vw;
    height: 55vh;
  }
  .logo-title {
    font-size: 2.6rem;
  }
  .game-header {
    padding: 8px 16px;
    gap: 12px;
  }
}
