:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: white;
  font-synthesis: none;
  --primary: #d4ff78;
  --primary-glow: rgba(212, 255, 120, 0.35);
  --primary-dark: #244b46;
  --bg-dark: #0a2f3f;
  --bg-card: rgba(14, 48, 64, 0.85);
  --border-glass: rgba(255, 255, 255, 0.22);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1baac6;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: none;
  outline: none;
  background: none;
  transition: all 0.16s ease;
}

button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

button:active {
  transform: translateY(1.5px);
}

#world, #world canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* Loading Screen */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  background: #124e60;
  z-index: 50;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   STAGE INTRO BANNER (Cinematic Drop-in)
   ========================================================================== */
.stage-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 36, 48, 0.88);
  border: 1px solid rgba(212, 255, 120, 0.4);
  backdrop-filter: blur(12px);
  padding: 14px 36px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 15;
  pointer-events: none;
  animation: bannerGlide 3.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bannerGlide {
  0% { opacity: 0; transform: translate(-50%, -24px) scale(0.96); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -16px) scale(0.96); pointer-events: none; }
}

.banner-sub {
  font-size: 9px;
  letter-spacing: 2.8px;
  font-weight: 900;
  color: var(--primary);
  display: block;
  margin-bottom: 3px;
}

.stage-banner h2 {
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 2px;
}

.stage-banner p {
  font-size: 11px;
  color: #b5dbe0;
}

/* ==========================================================================
   COMPACT IN-GAME HUD
   ========================================================================== */
.hud {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

/* Top-Left Stage Mini Badge */
.hud-stage-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 42, 54, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 1px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
}

.badge-sep {
  color: rgba(255, 255, 255, 0.35);
}

.hud-stage-badge b {
  color: #e5f8f9;
}

/* Top-Center Compact Sleek HUD (Timer + Altitude) */
.hud-top-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 36, 48, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 18px;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.timer-icon {
  font-size: 15px;
}

.timer-pill b {
  font-size: 17px;
  letter-spacing: 0.8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #f8fafc;
}

.breaks-tag {
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 800;
  color: #ff9d76;
  background: rgba(255, 120, 80, 0.15);
  padding: 2px 7px;
  border-radius: 10px;
}

/* Top-Center Altitude Pill */
.altitude-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(10, 36, 48, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 14px;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.altitude-pill .alt-icon {
  font-size: 11px;
  color: #38bdf8;
}

.altitude-pill .alt-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 800;
  color: #94a3b8;
}

.altitude-pill b {
  font-size: 15px;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #38bdf8;
}

/* Top-Center Ping / RTT Latency Pill */
.ping-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(10, 36, 48, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 12px;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ping-pill .ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
  animation: pingPulse 2s infinite ease-in-out;
}

.ping-pill.medium .ping-dot { background: #eab308; box-shadow: 0 0 8px #eab308; }
.ping-pill.high .ping-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.ping-pill b {
  font-size: 13px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #cbd5e1;
}

@keyframes pingPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* Reconnect Notification Banner */
.reconnect-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  pointer-events: none;
  animation: bannerPulse 1.2s infinite ease-in-out;
}

@keyframes bannerPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

/* Top-Right Glass Meter & Pause */
.hud-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.glass-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 42, 54, 0.76);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 6px 14px 6px 10px;
  border-radius: 12px;
}

.glass-icon-wrapper {
  width: 26px;
  height: 26px;
  color: #72ecff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-icon {
  width: 22px;
  height: 22px;
}

.glass-meter-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tiny-label {
  font-size: 7.5px;
  font-weight: 850;
  letter-spacing: 1.5px;
  color: #9cd4db;
}

.meter-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meter-bar-wrapper b {
  font-size: 14px;
  font-weight: 900;
  width: 38px;
}

.health-track {
  width: 65px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
}

.health-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.hud-icon-btn {
  width: 34px;
  height: 34px;
  background: rgba(12, 42, 54, 0.76);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5f8f9;
}

.hud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--primary);
}

/* Floating Gameplay Hints & Active Worker */
.hud-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(10, 36, 48, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 9px;
  letter-spacing: 0.8px;
  color: #d1ecee;
  pointer-events: none;
  z-index: 10;
}

.hud-hint span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.active-status {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--primary);
  background: rgba(12, 44, 56, 0.85);
  border: 1px solid rgba(212, 255, 120, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

kbd {
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  color: #ffffff;
}

/* Notifications */
#checkpoint {
  position: absolute;
  left: 50%;
  top: 76px;
  transform: translate(-50%, -10px);
  background: rgba(205, 250, 114, 0.94);
  color: #174221;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 12px 26px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1.2px;
  opacity: 0;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 25;
}

#checkpoint.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

#message {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 42, 54, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #f1fcfe;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 25;
}

#message.visible {
  opacity: 1;
}

#damage-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(255, 90, 50, 0.7);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 30;
}

/* ==========================================================================
   MAIN MENU (Carry The Glass Beach Lobby Aesthetic)
   ========================================================================== */
.menu {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.menu-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(14, 38, 56, 0.40) 0%,
    rgba(14, 38, 56, 0.20) 28%,
    rgba(14, 38, 56, 0.04) 50%,
    transparent 70%
  );
}

.menu-content {
  position: absolute;
  left: 4.5vw;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  max-width: 40vw;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Stylized Chunky Cracked-Ice Logo */
.game-logo {
  position: relative;
  margin-bottom: 6px;
}

.logo-hat {
  position: absolute;
  top: -24px;
  left: -14px;
  transform: rotate(-14deg);
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.logo-title {
  display: flex;
  flex-direction: column;
  line-height: 0.88;
}

.logo-row-1 {
  font-size: 50px;
  font-weight: 1000;
  letter-spacing: -1.5px;
  color: #72ecff;
  text-shadow:
    3px 3px 0 #07475c,
    -1px -1px 0 #07475c,
    1px -1px 0 #07475c,
    -1px 1px 0 #07475c,
    1px 1px 0 #07475c,
    0 8px 16px rgba(0, 0, 0, 0.4);
}

.logo-row-2 {
  font-size: 34px;
  font-weight: 1000;
  letter-spacing: 0.5px;
  color: #facc15;
  margin: 1px 0 1px 2px;
  text-shadow:
    3px 3px 0 #713f12,
    -1px -1px 0 #713f12,
    1px -1px 0 #713f12,
    -1px 1px 0 #713f12;
}

.logo-row-3 {
  font-size: 58px;
  font-weight: 1000;
  letter-spacing: -2px;
  color: #ffffff;
  text-shadow:
    4px 4px 0 #07475c,
    -1px -1px 0 #07475c,
    1px -1px 0 #07475c,
    -1px 1px 0 #07475c,
    1px 1px 0 #07475c,
    0 10px 20px rgba(0, 0, 0, 0.45);
}

.logo-badge {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2.2px;
  color: #244b46;
  background: var(--primary);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  margin-top: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Mode Selection Ribbon */
.mode-ribbon {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.mode-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  background: rgba(14, 48, 64, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.8px;
  color: #b3d7de;
}

.mode-tab.active {
  background: rgba(212, 255, 120, 0.16);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(212, 255, 120, 0.2);
}

.mode-tab.locked {
  opacity: 0.65;
  cursor: not-allowed;
}

.mode-icon {
  font-size: 14px;
}

.lock-tag {
  font-size: 6.5px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  color: #ffd8a8;
}

/* Navigation Menu Action List */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 850;
  letter-spacing: 0.8px;
  color: #ffffff;
  text-align: left;
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.40);
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateX(5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.menu-btn.primary-glow {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.menu-btn.primary-glow:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: #ffffff;
}

.menu-divider {
  height: 6px;
}

.menu-btn.secondary-btn {
  padding: 11px 22px;
  font-size: 13.5px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.menu-btn.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.menu-btn.danger-hover:hover {
  background: rgba(244, 63, 94, 0.6);
  border-color: #f87171;
  color: #ffffff;
}

/* Stage Section */
.stage-section {
  margin-top: 2px;
}

.stage-label {
  font-size: 8.5px;
  letter-spacing: 1.8px;
  font-weight: 850;
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  color: #a8cfd4;
}

.stage-picker {
  display: flex;
  gap: 6px;
}

.stage-picker button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 42, 56, 0.6);
  border-radius: 9px;
  padding: 8px 10px;
  flex: 1;
  text-align: left;
  font-size: 9.5px;
  line-height: 1.3;
  color: #d8ecef;
}

.stage-picker button>span {
  float: right;
  color: #8bb5be;
  font-size: 9px;
  font-weight: 800;
}

.stage-picker button.selected {
  border-color: var(--primary);
  background: rgba(212, 255, 120, 0.18);
  color: #ffffff;
}

/* Bottom Left Keys */
.bottom-left-hints {
  position: absolute;
  bottom: 24px;
  left: 4.5vw;
  display: flex;
  gap: 16px;
  pointer-events: none;
}

.key-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.7);
}

/* Bottom Right Action Pills (Inventory, Leaderboard, Version) */
.bottom-right-actions {
  position: absolute;
  right: 28px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.hud-pill-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(10, 36, 48, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hud-pill-btn:hover {
  background: rgba(20, 60, 78, 0.95);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pill-icon {
  font-size: 14px;
}

.game-version {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 4px;
}

.sound-button {
  position: absolute;
  right: 28px;
  top: 24px;
  background: rgba(12, 42, 54, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1px;
  pointer-events: auto;
}

.sound-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   MODALS (Create Lobby, Find Lobby, Settings, Inventory, Leaderboard)
   ========================================================================== */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(6, 28, 38, 0.75);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 40;
}

.modal-card {
  width: 440px;
  max-width: 90vw;
  padding: 28px;
  background: #113f50;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-tag {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 900;
  color: var(--primary);
}

.modal-card h2 {
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: #ffffff;
}

.modal-card p {
  color: #b9dfe4;
  font-size: 13px;
  line-height: 1.5;
}

/* Room Code Showcase in Lobby */
.room-code-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(6, 24, 32, 0.6);
  border: 1px dashed rgba(212, 255, 120, 0.4);
  padding: 16px;
  border-radius: 12px;
}

.room-code-label {
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 850;
  color: #9cd4db;
}

.room-code-display {
  font-size: 32px;
  font-weight: 950;
  letter-spacing: 8px;
  color: var(--primary);
  font-family: monospace;
}

.copy-code-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1px;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Roster Slots */
.lobby-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(8, 30, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 10px;
}

.slot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.orange-avatar {
  background: #ea580c;
}

.blue-avatar {
  background: #0284c7;
}

.green-avatar {
  background: #16a34a;
}

.yellow-avatar {
  background: #ca8a04;
}

.pulse-avatar {
  animation: pulseSlot 1.5s infinite ease-in-out;
}

@keyframes pulseSlot {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.slot-details {
  display: flex;
  flex-direction: column;
}

.slot-name {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1px;
}

.slot-status {
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 800;
  color: #7dd3fc;
}

.roster-slot.ready .slot-status {
  color: var(--primary);
}

/* Find Lobby Inputs */
.join-input-group {
  display: flex;
  gap: 8px;
}

#join-room-code {
  flex: 1;
  background: #072a38;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  text-transform: uppercase;
  text-align: center;
  font-family: monospace;
}

#join-room-code:focus {
  outline: 2px solid var(--primary);
}

.join-status-msg {
  font-size: 11px;
  color: #a4d2d8;
  text-align: center;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
}

.tab-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1px;
  color: #9cd4db;
}

.tab-btn.active {
  background: rgba(212, 255, 120, 0.18);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.control-schema {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.schema-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(8, 30, 40, 0.4);
  padding: 12px;
  border-radius: 9px;
}

.schema-title {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 4px;
}

.key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #d1ecee;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  background: rgba(8, 30, 40, 0.4);
  padding: 12px;
  border-radius: 9px;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 850;
}

.setting-row input[type="range"] {
  width: 120px;
  accent-color: var(--primary);
}

/* Inventory Grid */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.inventory-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(8, 30, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}

.inventory-item.active {
  border-color: var(--primary);
  background: rgba(212, 255, 120, 0.12);
}

.item-icon {
  font-size: 30px;
}

.item-title {
  font-size: 11px;
  font-weight: 800;
}

.item-badge {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #b9e3e7;
}

.item-badge.equipped {
  background: var(--primary);
  color: #1a423e;
}

/* Leaderboard List */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(8, 30, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 10px;
}

.rank {
  font-size: 14px;
  font-weight: 900;
  width: 28px;
}

.rank.gold { color: #facc15; }
.rank.silver { color: #e2e8f0; }
.rank.bronze { color: #d97706; }

.leader-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.leader-details b {
  font-size: 11px;
}

.leader-details small {
  font-size: 9px;
  color: #9cd4db;
}

.leader-time {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Standard Modal Buttons */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.primary {
  width: 100%;
  border-radius: 9px;
  padding: 14px;
  background: var(--primary);
  color: #1a423e;
  box-shadow: 0 4px 14px rgba(184, 242, 85, 0.35);
  font-size: 11.5px;
  letter-spacing: 1.2px;
  font-weight: 900;
  text-align: center;
}

.primary:hover:not(:disabled) {
  background: #e2ffa2;
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 1px;
  text-align: center;
}

.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.text-button {
  border: none;
  background: none;
  width: 100%;
  padding: 10px 0;
  color: #aad0d7;
  font-size: 9.5px;
  letter-spacing: 1px;
  font-weight: 700;
  text-align: center;
}

.text-button:hover {
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 850px) {
  .menu-content {
    left: 4vw;
    width: 290px;
    max-width: 48vw;
  }
  .logo-row-1 { font-size: 42px; }
  .logo-row-3 { font-size: 48px; }
  .hud { left: 12px; right: 12px; top: 12px; }
  .bottom-right-actions { right: 14px; bottom: 14px; }
  .bottom-left-hints { left: 14px; bottom: 14px; }
}

@media (max-width: 580px) {
  .menu-shade {
    background: rgba(8, 38, 52, 0.88);
  }
  .menu-content {
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    max-width: 90vw;
  }
  .hud-stage-badge { display: none; }
  .bottom-right-actions { display: none; }
  .bottom-left-hints { display: none; }
}
