/**
 * ==============================================================================
 * Free Shorthand Typing - Live 1v1 Typing Battle & Nitro Racer Styles
 * Fully Responsive & Mobile Optimized (320px - 4K)
 * ==============================================================================
 */

:root {
  --fst-primary: #01858E;
  --fst-dark: #00353F;
  --fst-neon-cyan: #06b6d4;
  --fst-neon-gold: #f59e0b;
  --fst-neon-red: #ef4444;
  --fst-asphalt: #0f172a;
}

main {
  overflow-x: clip;
}

/* ==========================================================================
   LOBBY HERO & MODES
   ========================================================================== */

.fst-battle-hero {
  background: linear-gradient(135deg, #00353F 0%, #01858E 100%) !important;
  border-radius: 24px;
  color: #ffffff !important;
  padding: 36px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 53, 63, 0.18);
}

.fst-battle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fef08a;
  font-size: clamp(11.5px, 1.8vw, 13px);
  font-weight: 800;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}

.fst-battle-title {
  color: #ffffff !important;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 900 !important;
  line-height: 1.2;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  word-break: break-word;
}

.fst-battle-desc {
  color: #f1f5f9 !important;
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 500 !important;
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 720px;
}

.fst-battle-desc strong {
  color: #ffffff !important;
  font-weight: 700;
}

.fst-battle-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.fst-battle-stat-pill .label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fst-battle-stat-pill .val {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
}

.fst-battle-stat-pill .divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
}

.fst-battle-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* Battle Matchmaking Cards */
.fst-battle-card {
  border: 1px solid #cbd5e1;
  border-radius: 22px;
  background: #ffffff;
  padding: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 53, 63, 0.04);
}

.fst-battle-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(1, 133, 142, 0.15);
  border-color: var(--fst-primary);
}

.fst-battle-card h4 {
  color: #0f172a !important;
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 800 !important;
  margin-bottom: 2px;
}

.fst-battle-card .text-muted,
.fst-battle-card small {
  color: #475569 !important;
  font-size: 13px;
  font-weight: 500;
}

.fst-battle-card p {
  color: #334155 !important;
  font-size: 14px;
  line-height: 1.65;
}

.fst-battle-card .form-label {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13.5px;
}

/* Site Button & Controls */
.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--fst-primary), var(--fst-dark));
  box-shadow: 0 8px 22px rgba(1, 133, 142, .25);
  border: 0;
  text-decoration: none !important;
  transition: all .25s ease;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}

.site-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 53, 63, .25);
  color: #ffffff !important;
}

.site-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   LIVE RACE ARENA & TRACKS
   ========================================================================== */

.fst-race-arena {
  background: #0b1320;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px;
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.fst-race-top-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

/* Dual Race Tracks */
.fst-race-tracks-container {
  background: #070e17;
  border: 2px solid #1e293b;
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 24px;
  position: relative;
  overflow-x: hidden;
}

.fst-race-lane {
  position: relative;
  height: 64px;
  margin-bottom: 14px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.fst-race-lane:last-child {
  margin-bottom: 0;
}

/* Road Dashed Line */
.fst-lane-road-marking {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15) 16px, transparent 16px, transparent 32px);
  z-index: 1;
}

/* Checkered Finish Line */
.fst-finish-line {
  position: absolute;
  top: 0;
  right: 14px;
  bottom: 0;
  width: 18px;
  background: repeating-linear-gradient(45deg, #ffffff, #ffffff 5px, #000000 5px, #000000 10px);
  opacity: 0.85;
  border-left: 2px solid #ef4444;
  border-right: 2px solid #ef4444;
  z-index: 2;
}

/* Racer Vehicle on Track */
.fst-racer-vehicle {
  position: absolute;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  transform: translateY(-50%);
  top: 50%;
}

.fst-car-sprite {
  font-size: 26px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  animation: carEngineVibrate 0.15s infinite ease-in-out;
}

@keyframes carEngineVibrate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

.fst-racer-tag {
  background: rgba(11, 20, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   TYPING BOX & PASSAGE DISPLAY
   ========================================================================== */

.fst-battle-passage-box {
  background: #ffffff;
  color: #1e293b;
  border-radius: 16px;
  padding: 20px;
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.8;
  font-family: 'Roboto Mono', monospace, sans-serif;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  border: 2px solid #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-height: clamp(150px, 32vh, 220px);
  overflow-y: auto;
  user-select: none;
}

.fst-battle-passage-box .word {
  padding: 2px 4px;
  border-radius: 4px;
  margin-right: 4px;
  display: inline-block;
}

.fst-battle-passage-box .word.active {
  background: #fef08a;
  color: #854d0e;
  border-bottom: 2px solid #ca8a04;
  font-weight: 700;
}

.fst-battle-passage-box .word.correct {
  color: #10b981;
}

.fst-battle-passage-box .word.incorrect {
  color: #ef4444;
  background: #fee2e2;
  text-decoration: line-through;
}

.fst-battle-passage-box .char.correct {
  color: #10b981;
}

.fst-battle-passage-box .char.wrong {
  color: #ef4444;
  background: #fca5a5;
}

.fst-battle-input {
  width: 100%;
  padding: 14px 22px;
  background: #ffffff;
  border: 3px solid #01858E;
  border-radius: 50px;
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-shadow: 0 0 25px rgba(1, 133, 142, 0.35);
  text-align: center;
  transition: all 0.2s ease;
}

.fst-battle-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.6);
}

/* ==========================================================================
   COUNTDOWN OVERLAY & PODIUM
   ========================================================================== */

.fst-countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 14, 23, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.fst-countdown-number {
  font-size: clamp(64px, 16vw, 96px);
  font-weight: 900;
  color: #f59e0b;
  text-shadow: 0 0 40px rgba(245, 158, 11, 0.8);
  animation: countdownZoom 1s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes countdownZoom {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.fst-waiting-pulse {
  animation: pulseWait 1.5s infinite ease-in-out;
}

@keyframes pulseWait {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ==========================================================================
   TOAST NOTIFICATION ENGINE
   ========================================================================== */

.fst-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.fst-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.fst-toast.success { border-left: 5px solid #10b981; }
.fst-toast.warning { border-left: 5px solid #f59e0b; }
.fst-toast.error   { border-left: 5px solid #ef4444; }
.fst-toast.info    { border-left: 5px solid #01858E; }

.fst-toast-icon { font-size: 16px; flex-shrink: 0; }
.fst-toast-msg { flex-grow: 1; line-height: 1.4; }

.fst-toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

.fst-toast-close:hover { color: #ffffff; }

@keyframes toastSlideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablets (max-width: 991px) */
@media (max-width: 991.98px) {
  .fst-battle-hero {
    padding: 28px 20px;
  }
  .fst-race-arena {
    padding: 20px 16px;
  }
  .fst-race-tracks-container {
    padding: 14px;
  }
}

/* Mobile Devices (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .fst-battle-hero {
    padding: 22px 16px;
    border-radius: 18px;
  }
  .fst-battle-stat-pill {
    width: 100%;
    justify-content: space-around;
    padding: 10px 14px;
  }
  .fst-battle-card {
    padding: 18px 16px;
    border-radius: 18px;
  }
  .fst-race-arena {
    padding: 16px 12px;
    border-radius: 18px;
  }
  .fst-race-lane {
    height: 56px;
  }
  .fst-car-sprite {
    font-size: 22px;
  }
  .fst-racer-tag {
    font-size: 9.5px;
    padding: 2px 6px;
  }
  .fst-battle-input {
    padding: 12px 16px;
  }
}

/* Extra Small Phones (max-width: 375px) */
@media (max-width: 375px) {
  .fst-battle-badge {
    font-size: 11px;
    padding: 5px 12px;
  }
  .fst-finish-line {
    width: 14px;
    right: 8px;
  }
}
