:root {
  --bg-deep: #060913;
  --bg-card: rgba(13, 20, 36, 0.75);
  --bg-card-hover: rgba(22, 33, 58, 0.85);
  --border-neon: rgba(0, 243, 255, 0.25);
  --border-neon-strong: rgba(0, 243, 255, 0.7);

  --color-cyan: #00f3ff;
  --color-magenta: #ff007f;
  --color-amber: #ffaa00;
  --color-green: #00ff88;
  --color-red: #ff3366;
  --color-purple: #bd00ff;

  --text-main: #f1f5f9;
  --text-dim: #94a3b8;
  --text-dark: #475569;

  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;

  --shadow-glow-cyan: 0 0 20px rgba(0, 243, 255, 0.35);
  --shadow-glow-magenta: 0 0 20px rgba(255, 0, 127, 0.35);
  --shadow-glow-green: 0 0 20px rgba(0, 255, 136, 0.4);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(189, 0, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0, 243, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 0, 127, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Background Stars Canvas */
#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1.2rem;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-neon);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px var(--color-cyan));
  animation: rocketHover 3s ease-in-out infinite;
}

@keyframes rocketHover {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(3deg); }
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #00f3ff, #bd00ff, #ff007f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Glass Buttons */
.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.btn-glass:hover {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #00f3ff, #0066cc);
  border: 1px solid #00f3ff;
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #33f6ff, #0088ff);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.7);
  transform: translateY(-2px);
  color: #000;
}

.btn-accent {
  background: linear-gradient(135deg, #ff007f, #bd00ff);
  border: 1px solid #ff007f;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #ff3399, #d033ff);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.7);
  transform: translateY(-2px);
}

.btn-abort {
  background: rgba(255, 51, 102, 0.08);
  border-color: rgba(255, 51, 102, 0.4);
  color: #ff88a3;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.btn-abort:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: #ff3366;
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
  transform: translateY(-2px);
}

/* Views Management */
.view-section {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

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

/* ==================================================
   LOBBY VIEW
   ================================================== */
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .lobby-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--color-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.input-cyber {
  width: 100%;
  background: rgba(5, 10, 25, 0.8);
  border: 1px solid rgba(0, 243, 255, 0.3);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: all 0.25s ease;
}

.input-cyber:focus {
  outline: none;
  border-color: var(--color-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.4);
  background: rgba(10, 20, 45, 0.9);
}

/* Selection Cards (Destinations & Difficulties) */
.options-grid-dest {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.option-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.option-card:hover {
  background: rgba(0, 243, 255, 0.08);
  border-color: rgba(0, 243, 255, 0.4);
  transform: translateY(-2px);
}

.option-card.active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

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

.option-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.option-icon {
  font-size: 1.1rem;
}

.option-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Difficulties */
.options-grid-diff {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.diff-card {
  border-left: 3px solid var(--text-dim);
  padding: 0.45rem 0.65rem;
}

.diff-card.active[data-diff="leicht"] {
  border-color: var(--color-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}
.diff-card.active[data-diff="mittel"] {
  border-color: var(--color-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
}
.diff-card.active[data-diff="schwer"] {
  border-color: var(--color-amber);
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}
.diff-card.active[data-diff="extrem"] {
  border-color: var(--color-magenta);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.3);
}

/* Room List */
.room-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.rooms-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding-right: 0.4rem;
}

.rooms-container::-webkit-scrollbar {
  width: 5px;
}
.rooms-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.rooms-container::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.3);
  border-radius: 4px;
}

.room-item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.room-item-card:hover {
  background: rgba(0, 243, 255, 0.07);
  border-color: var(--color-cyan);
}

.room-item-info h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-meta-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.tag-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.tag-dest {
  background: rgba(0, 243, 255, 0.15);
  color: var(--color-cyan);
}
.tag-diff {
  background: rgba(189, 0, 255, 0.15);
  color: #d066ff;
}
.tag-players {
  background: rgba(255, 170, 0, 0.15);
  color: var(--color-amber);
}

.no-rooms-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

/* ==================================================
   GAME ROOM / PRE-RACE LOBBY
   ================================================== */
.room-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-neon);
  border-radius: 12px;
  padding: 0.7rem 1.2rem;
  margin-bottom: 0.8rem;
}

.room-code-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.room-code-badge span {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.room-code-badge h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-cyan);
  letter-spacing: 1.5px;
}

.room-meta-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Host Settings Bar */
.host-settings-bar {
  background: rgba(13, 20, 36, 0.6);
  border: 1px dashed rgba(0, 243, 255, 0.3);
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.host-badge-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-amber);
  font-family: var(--font-display);
  font-size: 0.8rem;
}

.host-controls-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.select-cyber {
  background: rgba(5, 10, 25, 0.9);
  border: 1px solid rgba(0, 243, 255, 0.3);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
}

.select-cyber:focus {
  outline: none;
  border-color: var(--color-cyan);
}

/* Players Grid in Room */
.room-players-panel {
  margin-bottom: 0.8rem;
  padding: 1rem 1.4rem;
}

.players-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
}

@media (max-width: 900px) {
  .players-slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.player-slot-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.8rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.player-slot-card.is-me {
  border-color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.25);
}

.slot-rocket-avatar {
  width: 38px;
  height: 38px;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 0 6px currentColor);
}

.slot-player-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.slot-host-star {
  color: var(--color-amber);
  font-size: 0.75rem;
}

.slot-color-picker {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.color-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 6px #fff;
}

.empty-slot {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  min-height: 105px;
}

/* ==================================================
   RACE TRACK (ABOVE TEXT)
   ================================================== */
.race-arena-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
  justify-content: flex-start;
}

.race-track-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  padding: 0.65rem 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.race-track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.track-dest-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--color-amber);
}

.tracks-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}

.lane-wrapper {
  position: relative;
  background: rgba(0, 5, 18, 0.6);
  border: 1px solid rgba(0, 243, 255, 0.12);
  border-radius: 8px;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  overflow: hidden;
}

.lane-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to right, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
  background-size: 10% 100%;
  pointer-events: none;
}

.lane-finish-line {
  position: absolute;
  right: 36px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(
    45deg,
    #ffaa00,
    #ffaa00 6px,
    #000 6px,
    #000 12px
  );
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.lane-destination-icon {
  position: absolute;
  right: 8px;
  font-size: 1.2rem;
  filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.6));
}

.rocket-slider {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: left 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 5;
}

.rocket-svg-box {
  width: 32px;
  height: 24px;
  position: relative;
  filter: drop-shadow(0 0 6px var(--rocket-color));
}

.rocket-svg-box svg {
  width: 100%;
  height: 100%;
}

.thruster-flame {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 8px;
  background: linear-gradient(to left, #ff3300, #ffaa00, transparent);
  border-radius: 50% 0 0 50%;
  filter: blur(1px);
  animation: thrustPulse 0.15s infinite alternate;
}

@keyframes thrustPulse {
  0% { transform: translateY(-50%) scaleX(0.7); opacity: 0.7; }
  100% { transform: translateY(-50%) scaleX(1.3); opacity: 1; }
}

.rocket-pilot-tag {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.rocket-pilot-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.rocket-pilot-stats {
  font-size: 0.6rem;
  color: var(--color-cyan);
  font-family: var(--font-mono);
  line-height: 1.1;
}

/* ==================================================
   TYPING ARENA (SHARED TEXT & INPUT)
   ================================================== */
.typing-arena-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Multiplier & Race Live Stats Header */
.race-live-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.15);
  flex-wrap: wrap;
  gap: 0.6rem;
  flex-shrink: 0;
}

.stats-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-value.highlight-cyan {
  color: var(--color-cyan);
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.stat-value.highlight-green {
  color: var(--color-green);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* Multiplier Badge with Flame */
.multiplier-badge-box {
  background: rgba(255, 170, 0, 0.12);
  border: 1px solid rgba(255, 170, 0, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.multiplier-badge-box.high-flame {
  background: rgba(255, 0, 127, 0.2);
  border-color: var(--color-magenta);
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.5);
  animation: flameShake 0.4s ease-in-out infinite alternate;
}

@keyframes flameShake {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

.multiplier-flame-icon {
  font-size: 1.1rem;
}

.multiplier-title {
  font-size: 0.62rem;
  color: var(--color-amber);
  text-transform: uppercase;
  font-weight: 700;
}

.multiplier-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

/* Target Text Display Container */
.target-text-container {
  background: rgba(4, 8, 20, 0.85);
  border: 1px solid rgba(0, 243, 255, 0.2);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  line-height: 1.7;
  letter-spacing: 0.4px;
  position: relative;
  user-select: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  word-break: break-word;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.target-text-container::-webkit-scrollbar {
  width: 5px;
}
.target-text-container::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.3);
  border-radius: 4px;
}

/* Individual Character States */
.char-correct {
  color: var(--color-green);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.char-error {
  color: #fff;
  background-color: var(--color-red);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.8);
  animation: errorShake 0.2s ease-in-out;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.char-cursor {
  background: rgba(0, 243, 255, 0.3);
  border-bottom: 3px solid var(--color-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
  animation: cursorBlink 0.9s infinite;
}

@keyframes cursorBlink {
  0%, 100% { border-bottom-color: var(--color-cyan); }
  50% { border-bottom-color: transparent; }
}

.char-pending {
  color: var(--text-dim);
}

/* Hidden Real Input for Mobile & Key Handling */
.hidden-race-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

/* User Input Notice & Focus Area */
.input-focus-zone {
  background: rgba(0, 243, 255, 0.05);
  border: 1px dashed rgba(0, 243, 255, 0.3);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.input-focus-zone:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--color-cyan);
}

.input-hint-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.keyboard-shortcut-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-cyan);
}

.error-warning-badge {
  display: none;
  background: rgba(255, 51, 102, 0.2);
  border: 1px solid var(--color-red);
  color: #ff6688;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  animation: pulse 1s infinite;
}

.error-warning-badge.active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ==================================================
   COUNTDOWN OVERLAY
   ================================================== */
.countdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 9, 19, 0.88);
  backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.countdown-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.countdown-number {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #00f3ff, #ff007f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(0, 243, 255, 0.7));
  animation: countZoom 0.8s ease-out;
}

@keyframes countZoom {
  0% { transform: scale(2.2); opacity: 0; }
  60% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-label {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 4px;
}

/* ==================================================
   VICTORY CEREMONY (PODIUM & RESULTS)
   ================================================== */
.ceremony-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-neon);
  border-radius: 16px;
  padding: 1.1rem 1.5rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.ceremony-card::-webkit-scrollbar {
  width: 5px;
}
.ceremony-card::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.3);
  border-radius: 4px;
}

.ceremony-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ffaa00, #ff007f, #00f3ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.2rem;
  letter-spacing: 1.5px;
}

.ceremony-sub {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

/* 3D Podium Layout */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.2rem;
  margin: 0.5rem 0 0.8rem 0;
  height: 140px;
  flex-shrink: 0;
}

.podium-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 105px;
  position: relative;
}

.podium-rank-badge {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
  animation: floatRank 2s infinite ease-in-out;
}

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

.podium-pilot-name {
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
  margin-bottom: 0.1rem;
}

.podium-stats-tag {
  font-size: 0.65rem;
  color: var(--color-cyan);
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.podium-block {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.podium-first {
  height: 85px;
  background: linear-gradient(to top, rgba(255, 170, 0, 0.8), rgba(255, 220, 100, 0.95));
  color: #000;
  border: 1px solid #ffcc00;
  box-shadow: 0 0 20px rgba(255, 200, 0, 0.5);
}

.podium-second {
  height: 65px;
  background: linear-gradient(to top, rgba(160, 174, 192, 0.7), rgba(226, 232, 240, 0.9));
  color: #000;
  border: 1px solid #cbd5e1;
  box-shadow: 0 0 15px rgba(226, 232, 240, 0.3);
}

.podium-third {
  height: 50px;
  background: linear-gradient(to top, rgba(180, 83, 9, 0.7), rgba(245, 158, 11, 0.85));
  color: #000;
  border: 1px solid #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.8rem 0;
  text-align: left;
}

.results-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.45rem 0.65rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.results-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.ceremony-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

/* ==================================================
   HIGHSCORE MODAL
   ================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-neon);
  border-radius: 18px;
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

.modal-header h3 {
  font-family: var(--font-display);
  color: var(--color-cyan);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem 1.8rem;
  overflow-y: auto;
}

.highscore-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Waiting / Orbit Status */
.waiting-badge {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid var(--color-green);
  color: var(--color-green);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin-top: 1rem;
  animation: pulse 1.5s infinite;
}

/* ==================================================
   DEVELOPER MODE STYLES
   ================================================== */
.dev-mode-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
}

.btn-dev-subtle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-dev-subtle:hover {
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.dev-badge-orange {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: #ff7700;
  text-shadow: 0 0 10px rgba(255, 119, 0, 0.65), 0 0 20px rgba(255, 119, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 119, 0, 0.4);
  background: rgba(255, 119, 0, 0.12);
  user-select: none;
  animation: devGlow 2s ease-in-out infinite alternate;
}

@keyframes devGlow {
  0% { box-shadow: 0 0 5px rgba(255, 119, 0, 0.2); }
  100% { box-shadow: 0 0 14px rgba(255, 119, 0, 0.6); }
}

.btn-hs-delete {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: #ff3366;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hs-delete:hover {
  background: #ff3366;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
  transform: scale(1.05);
}
