/* ==========================================================================
   Speed Typing Game & Word Rain Arcade Styles
   Fully Responsive & Mobile Optimized (320px - 4K)
   ========================================================================== */

:root {
  --fst-primary: #01858E;
  --fst-dark: #00353F;
  --fst-accent: #96BA04;
  --fst-light: #F7FAFA;
}

main.fst-game-main-wrapper {
  overflow-x: clip;
}

/* ==========================================================================
   LOBBY & CONFIGURATION CARDS
   ========================================================================== */

/* Category Pills in Lobby */
.fst-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  gap: 10px;
}

.fst-cat-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.fst-cat-btn.active {
  background: #f0fdfa;
  border-color: #01858e;
  box-shadow: 0 4px 14px rgba(1, 133, 142, 0.12);
}

.fst-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e6f6f7;
  color: #01858e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.fst-cat-btn.active .fst-cat-icon {
  background: #01858e;
  color: #ffffff;
}

/* Pill Buttons (Timers & Speeds) */
.fst-pill-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1.2;
}

.fst-pill-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.fst-pill-btn.active {
  background: #00353f;
  color: #ffffff;
  border-color: #00353f;
  box-shadow: 0 4px 12px rgba(0, 53, 63, 0.2);
}

/* Range Slider Styling */
.form-range::-webkit-slider-thumb {
  background-color: #01858e;
  box-shadow: 0 0 0 4px rgba(1, 133, 142, 0.2);
}

/* Site Button & Action Buttons */
.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);
}

/* Locked Card / Icon */
.fst-locked-badge-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #e6f6f7;
  color: #01858e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* ==========================================================================
   FULLSCREEN ARCADE PLAYFIELD (STAGE 2)
   ========================================================================== */

.fst-arcade-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  background-color: #070e17;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* Top HUD */
.fst-arcade-top-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(11, 20, 32, 0.90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  flex-wrap: wrap;
  gap: 8px;
}

.fst-hud-left,
.fst-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fst-hud-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.fst-hud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.fst-hud-chip {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.fst-hud-chip.cat-chip {
  background: rgba(1, 133, 142, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.fst-hud-chip.timer-chip {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-family: 'Roboto Mono', Courier, monospace;
  font-size: 13px;
}

.fst-hud-chip.timer-chip.danger {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
  animation: pulseDanger 1s infinite;
}

.fst-hud-chip.speed-chip {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

@keyframes pulseDanger {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.04); }
}

/* Live Stats */
.fst-hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.fst-hud-stat span {
  font-size: 9.5px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fst-hud-stat strong {
  font-size: 13.5px;
  color: #f8fafc;
  line-height: 1.1;
}

/* Playfield Area */
.fst-arcade-playfield {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 200px;
}

.fst-laser-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* Falling Word Cards */
.fst-word-card {
  position: absolute;
  padding: 6px 14px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: clamp(13px, 2.5vw, 15.5px);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: none;
  transition: transform 0.1s linear;
  border: 2px solid #e2e8f0;
  z-index: 10;
  transform: translate(-50%, 0);
  max-width: 90vw;
}

.fst-word-card.target-match {
  background: #fef08a;
  border-color: #eab308;
  color: #854d0e;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.8);
}

.fst-word-card.exploding {
  animation: wordDestroy 0.35s forwards ease-out;
}

@keyframes wordDestroy {
  0% { transform: translate(-50%, 0) scale(1); opacity: 1; filter: brightness(1.5); }
  50% { transform: translate(-50%, -15px) scale(1.3); opacity: 0.9; filter: brightness(2); }
  100% { transform: translate(-50%, -30px) scale(0.2); opacity: 0; }
}

.fst-word-card.missed {
  animation: wordMiss 0.4s forwards ease-in;
}

@keyframes wordMiss {
  0% { transform: translate(-50%, 0); background: #ef4444; color: #fff; }
  25% { transform: translate(-55%, 5px); }
  50% { transform: translate(-45%, 10px); }
  100% { transform: translate(-50%, 25px); opacity: 0; }
}

/* Floating Score Indicator */
.fst-floating-score {
  position: absolute;
  color: #22c55e;
  font-weight: 800;
  font-size: 17px;
  z-index: 60;
  pointer-events: none;
  animation: floatUpFade 0.7s forwards ease-out;
}

@keyframes floatUpFade {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -40px) scale(1.2); opacity: 0; }
}

/* Bottom Gun Zone */
.fst-arcade-bottom-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 18px;
  background: rgba(11, 20, 32, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 100;
}

.fst-bottom-controls-wrap {
  width: 100%;
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 12px;
  flex-wrap: wrap;
}

.fst-bottom-submit-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid #34d399;
  color: #ffffff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.fst-bottom-submit-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.7);
  transform: scale(1.03);
}

.fst-bottom-submit-btn:active {
  transform: scale(0.98);
}

.fst-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 260px;
}

.fst-game-input {
  width: 100%;
  padding: 11px 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #01858e;
  border-radius: 50px;
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  box-shadow: 0 0 25px rgba(1, 133, 142, 0.35);
  outline: none;
  transition: all 0.2s ease;
}

.fst-game-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.6);
  background: #ffffff;
}

.fst-fire-turret-btn {
  margin-top: -8px;
  background: #0f172a;
  border: 2px solid #01858e;
  color: #38bdf8;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 4px 20px;
  border-radius: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.fst-turret-laser-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Result Modal Custom */
.fst-result-header {
  background: linear-gradient(135deg, #00353f 0%, #01858e 100%);
}

.fst-result-trophy-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffb703;
  color: #00353f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 991.98px) {
  .fst-cat-btn {
    padding: 10px 14px;
  }
}

@media (max-width: 767.98px) {
  .fst-arcade-top-hud {
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .fst-hud-left {
    justify-content: space-between;
    width: 100%;
  }

  .fst-hud-right {
    justify-content: space-between;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .fst-hud-stat {
    padding: 2px 6px;
    flex: 1;
    min-width: 50px;
  }

  .fst-hud-stat span {
    font-size: 8.5px;
  }

  .fst-hud-stat strong {
    font-size: 12px;
  }

  .fst-word-card {
    font-size: 13px;
    padding: 5px 10px;
  }

  .fst-bottom-controls-wrap {
    flex-direction: column;
    gap: 8px;
  }

  .fst-input-wrapper {
    max-width: 100%;
  }

  .fst-bottom-submit-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
  }
}

@media (max-width: 575.98px) {
  .fst-cat-btn strong {
    font-size: 14px;
  }
  .fst-cat-btn .small {
    font-size: 11.5px;
  }
  .fst-pill-btn {
    padding: 6px 14px;
    font-size: 12px;
  }
}
