:root {
  --primary-color: #ff0054;
  --primary-hover: #ff3b61;
  --secondary-color: #4361ee;
  --secondary-glow: #4cc9f0;
  --accent-gold: #ffbe0b;
  --accent-cyan: #00f5d4;
  --accent-green: #38b000;
  --toon-card-bg: #ff6b35;
  --toon-card-dark: #4361ee;
  --toon-border: #0f172a;
  --text-color: #0f172a;
  --text-dark: #0f172a;
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Outfit', sans-serif;
  --gloss: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.0) 60%);
  --shine: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 0 rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0f19;
  font-family: var(--font-body);
  color: var(--text-color);
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Bright Candy Gloss Card Panel */
.glass-panel {
  background: #ff6b35;
  border: 4px solid #0f172a;
  border-radius: 26px;
  box-shadow: 0 8px 0 #0f172a, 0 12px 25px rgba(0,0,0,0.15), var(--shine);
  position: relative;
  overflow: hidden;
}
.glass-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 22px 22px 0 0;
  pointer-events: none;
  z-index: 1;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(180deg, #ff7e96 0%, #ff5e7e 40%, #e0003e 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px 28px;
  border: 3px solid #0f172a;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 0 #0f172a, var(--shine);
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 1px 2px 2px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 50px 50px 0 0;
  pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #0f172a, var(--shine);
  background: linear-gradient(180deg, #ff9aad 0%, #ff708d 40%, #cc0044 100%);
}
.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0f172a;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
}

/* PUBG 3D Sky Lobby Interface */
.lobby-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  padding: clamp(12px, 2.5vw, 24px) clamp(16px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  background: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  cursor: default;
  overflow: hidden;
}

.lobby-container * {
  pointer-events: auto;
}

/* Floating Header Bar */
.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
  z-index: 10;
}

.lobby-brand {
  display: flex;
  flex-direction: column;
}

.lobby-logo-badge {
  font-family: var(--font-heading);
  font-size: clamp(0.6rem, 1vw, 0.75rem);
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 190, 11, 0.6);
}

.lobby-logo-title {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  color: #fff;
  line-height: 1;
  letter-spacing: 1px;
}

.lobby-logo-title span {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(76, 201, 240, 0.8);
}

.lobby-nav {
  display: flex;
  gap: clamp(2px, 0.5vw, 6px);
  background: linear-gradient(180deg, #ff3a6e 0%, #ff0054 50%, #cc0044 100%);
  padding: 4px 8px;
  border-radius: 30px;
  border: 3px solid #0f172a;
  box-shadow: 0 5px 0 #0f172a, var(--shine);
  position: relative;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.lobby-nav::-webkit-scrollbar {
  display: none;
}
.lobby-nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 26px 26px 0 0;
  pointer-events: none;
}

.nav-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-heading);
  font-size: clamp(0.75rem, 1.1vw, 0.95rem);
  font-weight: 800;
  padding: clamp(5px, 0.8vw, 8px) clamp(10px, 1.5vw, 18px);
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.25);
}

.nav-tab.active {
  background: #ffffff;
  color: #ff0054;
  border: 2.5px solid #0f172a;
  box-shadow: 0 3px 0 #0f172a;
}

.lobby-currency {
  display: flex;
  gap: clamp(6px, 1vw, 14px);
}

.currency-pill {
  position: relative;
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  border: 3px solid #0f172a;
  border-radius: 24px;
  padding: clamp(4px, 0.6vw, 8px) clamp(10px, 1.2vw, 20px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.2vw, 1.15rem);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 0 #0f172a, var(--shine);
  transition: all 0.15s ease;
  overflow: hidden;
}
.currency-pill::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}
.currency-pill:hover {
  transform: translateY(-2px);
}

.gold-pill {
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  color: #0f172a;
  border-color: #0f172a;
}

.gold-pill svg {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
  width: clamp(16px, 1.5vw, 20px);
  height: clamp(16px, 1.5vw, 20px);
}

.gem-pill {
  background: linear-gradient(180deg, #7ddff7 0%, #4cc9f0 50%, #0ea5c9 100%);
  color: #0f172a;
  border-color: #0f172a;
}

.gem-pill svg {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
  width: clamp(16px, 1.5vw, 20px);
  height: clamp(16px, 1.5vw, 20px);
}

/* Left Sidebar - Bright 3D Cartoon Battle Cards */
.lobby-sidebar-left {
  position: absolute;
  top: clamp(80px, 12vh, 115px);
  left: clamp(16px, 3vw, 36px);
  width: clamp(250px, 24vw, 330px);
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 16px);
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 95;
}
.lobby-sidebar-left::-webkit-scrollbar {
  display: none;
}

.royalty-card {
  position: relative;
  background: linear-gradient(145deg, #ff6b35 0%, #ff9f1c 100%);
  border: 3.5px solid #0f172a;
  border-left: 6px solid #0f172a;
  border-radius: 20px;
  padding: clamp(10px, 1.5vw, 18px);
  box-shadow: 0 6px 0 #0f172a, 0 10px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  overflow: hidden;
}

.mode-royalty-card {
  background: linear-gradient(145deg, #4361ee 0%, #7209b7 100%);
  border-left: 7px solid #0f172a;
}

.royalty-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 #0f172a, 0 16px 30px rgba(0, 0, 0, 0.25);
}

.royalty-glow {
  position: absolute;
  top: -60px;
  left: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.gold-ambient {
  background: radial-gradient(circle, rgba(255, 158, 0, 0.35) 0%, transparent 70%);
}

.royalty-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.royalty-avatar-frame {
  position: relative;
  width: 50px;
  height: 50px;
}

.crown-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.avatar-icon-royalty {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1b18 0%, #3a2e10 100%);
  border: 2px solid #ffd700;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

.online-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #38b000;
  border: 2px solid #0b0f19;
  border-radius: 50%;
  box-shadow: 0 0 8px #38b000;
}

.royalty-player-info {
  display: flex;
  flex-direction: column;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.royalty-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 1px 2px 0 rgba(0,0,0,0.25);
}

.royalty-tag {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #ff0054, #ff5e7e);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 1px;
  border: 1.5px solid #0f172a;
}

.royalty-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.royalty-bp-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.royalty-bp-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
}

.bp-gold-title {
  color: #ffffff;
}

.bp-gold-badge {
  color: #ff6b35;
  background: #ffffff;
  border: 2px solid #0f172a;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
}

.royalty-bp-bar {
  width: 100%;
  height: 9px;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.3);
}

.royalty-bp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff0054 0%, #ffbe0b 100%);
  border-radius: 6px;
}

.royalty-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gold-tag {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  color: #ff0054;
  letter-spacing: 1.5px;
}

.royalty-mode-badge {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #00bbf9, #4cc9f0);
  border: 1.5px solid #0f172a;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.royalty-mode-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-shadow: 1px 2px 0 rgba(0,0,0,0.25);
}

.royalty-mode-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.35;
}

.royalty-meta-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid rgba(255,255,255,0.3);
}

.royalty-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  background: rgba(255,255,255,0.85);
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid #0f172a;
}

.mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-tag {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
}

.mode-status-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff5e7e, #ff9233);
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 1px;
}

.mode-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: #fff;
  margin: 4px 0;
  letter-spacing: 0.5px;
}

.mode-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.mode-meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
}

.mode-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Right Sidebar - Wardrobe Panel (Bright Toonistic) */
.lobby-sidebar-right {
  position: absolute;
  top: clamp(80px, 12vh, 115px);
  right: clamp(16px, 3vw, 36px);
  width: clamp(260px, 24vw, 330px);
  background: linear-gradient(145deg, #a855f7 0%, #7c3aed 100%);
  border: 4px solid #0f172a;
  border-radius: 28px;
  padding: clamp(14px, 2vw, 22px);
  box-shadow: 0 8px 0 #0f172a, 0 18px 40px rgba(0,0,0,0.25);
  animation: slideRight 0.3s ease-out;
  z-index: 95;
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
}

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #ffffff;
}

.panel-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.8rem;
  cursor: pointer;
}

.customizer-section {
  margin-bottom: 18px;
}

.customizer-section label {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: #ffffff;
  display: block;
  margin-bottom: 10px;
}

.color-options {
  display: flex;
  gap: 12px;
}

.color-btn, .pack-color-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-btn:hover, .pack-color-btn:hover {
  transform: scale(1.18);
  border-color: #fff;
}

.color-btn.active, .pack-color-btn.active {
  border-color: #ffffff;
  transform: scale(1.25);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.9);
}

/* Bottom Bar - Big Toonistic 3D MATCH START Button */
.lobby-bottom-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  z-index: 10;
}

.pubg-match-btn {
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 40%, #e6a800 100%);
  color: #0f172a;
  border: 3.5px solid #0f172a;
  border-radius: 24px;
  padding: clamp(10px, 1.5vw, 16px) clamp(20px, 2.5vw, 36px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 16px);
  cursor: pointer;
  box-shadow: 0 7px 0 #0f172a, 0 14px 28px rgba(255,190,11,0.4), var(--shine);
  transition: all 0.15s ease-in-out;
  position: relative;
  overflow: hidden;
}
.pubg-match-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 24px 24px 0 0;
  pointer-events: none;
  z-index: 1;
}
.pubg-match-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  transform: skewX(-20deg);
  animation: shimmer 2.5s infinite ease-in-out;
}
@keyframes shimmer {
  0% { left: -60%; }
  100% { left: 130%; }
}

.pubg-match-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, #ffe080 0%, #ffd000 40%, #cc9800 100%);
  box-shadow: 0 10px 0 #0f172a, 0 20px 35px rgba(255,190,11,0.6), var(--shine);
}
.pubg-match-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0f172a;
}

.match-btn-icon {
  width: clamp(38px, 4vw, 48px);
  height: clamp(38px, 4vw, 48px);
  background: #0f172a;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.match-btn-icon svg {
  width: clamp(20px, 2vw, 26px);
  height: clamp(20px, 2vw, 26px);
}

.match-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.match-label {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
  letter-spacing: 1px;
  white-space: nowrap;
}

.match-sublabel {
  font-family: var(--font-heading);
  font-size: clamp(0.65rem, 0.9vw, 0.82rem);
  font-weight: 800;
  color: rgba(15, 23, 42, 0.75);
  letter-spacing: 0.5px;
  margin-top: 2px;
  white-space: nowrap;
}

.inspect-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  color: #0f172a;
  border: 3px solid #0f172a;
  border-radius: 20px;
  padding: clamp(6px, 1vw, 10px) clamp(12px, 1.5vw, 18px);
  font-family: var(--font-heading);
  font-size: clamp(0.68rem, 0.9vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 0 #0f172a;
  white-space: nowrap;
}
.inspect-hint svg {
  stroke: #0f172a;
  width: clamp(14px, 1.2vw, 18px);
  height: clamp(14px, 1.2vw, 18px);
}

/* Bottom Right Profile Trigger Card */
.lobby-profile-trigger-card {
  position: relative;
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  border: 3.5px solid #0f172a;
  border-radius: 26px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 0 #0f172a, 0 12px 25px rgba(255,190,11,0.35), var(--shine);
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 95;
  pointer-events: auto;
}
.lobby-profile-trigger-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #0f172a, 0 16px 30px rgba(255,190,11,0.5);
  background: linear-gradient(180deg, #ffe080 0%, #ffd000 50%, #cc9800 100%);
}
.lobby-profile-trigger-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0f172a;
}

.profile-avatar-box {
  width: 42px;
  height: 42px;
  background: #0f172a;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.profile-trigger-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.trigger-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.trigger-sub {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.8);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.profile-edit-badge {
  width: 26px;
  height: 26px;
  background: #ff0054;
  border: 2px solid #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Profile Popup Modal Styling (Toonistic Candy Redesign) */
.profile-modal-card {
  max-width: 480px;
  width: 92%;
  background: linear-gradient(145deg, #ff6b35 0%, #ff9f1c 100%);
  border: 4px solid #0f172a;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 10px 0 #0f172a, 0 18px 40px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}
.profile-modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: var(--gloss);
  border-radius: 24px 24px 0 0;
  pointer-events: none;
}

.profile-modal-card .modal-header {
  border-bottom: 2px solid rgba(15, 23, 42, 0.2);
  padding-bottom: 10px;
}

.profile-modal-card .modal-title-with-icon {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 1px 2px 0 #0f172a;
}

.profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.profile-avatar-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.25);
  border: 3px solid #0f172a;
  border-radius: 20px;
  padding: 12px 18px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.profile-preview-icon {
  width: 56px;
  height: 56px;
  background: #ffbe0b;
  border: 3px solid #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #0f172a;
}

.profile-preview-text h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 2px;
  text-shadow: 1px 2px 0 #0f172a;
}

.preview-tag {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: #ffe600;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 1px 1.5px 0 #0f172a;
}

.profile-modal-card .profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-modal-card label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 1px 1.5px 0 #0f172a;
}

.profile-modal-card input, .profile-modal-card select {
  background: #ffffff;
  border: 3.5px solid #0f172a;
  border-radius: 14px;
  padding: 10px 14px;
  color: #0f172a;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  outline: none;
  box-shadow: 0 4px 0 #0f172a;
  transition: all 0.15s ease;
  width: 100%;
}

.profile-modal-card input:focus, .profile-modal-card select:focus {
  border-color: #4cc9f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0f172a;
}

.modal-footer-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.width-100 {
  width: 110px;
}

.splash-card {
  background: linear-gradient(145deg, #4361ee 0%, #7209b7 100%);
  border: 4px solid #0f172a;
  border-radius: 28px;
  padding: 40px 48px;
  max-width: 620px;
  text-align: center;
  box-shadow: 0 10px 0 #0f172a, 0 18px 40px rgba(0,0,0,0.3);
  animation: floatCard 4s ease-in-out infinite;
}

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

.splash-badge {
  display: inline-block;
  background: var(--accent-gold);
  color: var(--text-dark);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.splash-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
  margin-bottom: 12px;
  line-height: 1.1;
}

.splash-title span {
  color: var(--accent-cyan);
  background: linear-gradient(45deg, var(--accent-cyan), var(--accent-green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-subtitle {
  font-size: 1.1rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 28px;
}

.controls-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.control-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.control-badge span {
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(255, 190, 11, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 4px;
}

/* HUD Overlay */
.hud-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-container * {
  pointer-events: auto;
}

.hud-top-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: clamp(280px, 32vw, 420px);
}

.hud-top-stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.avatar-badge {
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  border: 3.5px solid #0f172a;
  border-radius: 50px;
  padding: 8px 22px 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 0 #0f172a, var(--shine);
  position: relative;
  overflow: hidden;
}
.avatar-badge::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 46px 46px 0 0;
  pointer-events: none;
}

.avatar-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #ff5e7e 0%, #ff9233 100%);
  border: 3px solid #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 0 #0f172a;
}

.avatar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.stamina-bar-container {
  width: 110px;
  height: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #0f172a;
}

.stamina-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  border-radius: 10px;
  transition: width 0.15s ease;
}

.counters-group {
  display: flex;
  gap: 12px;
}

.counter-pill {
  position: relative;
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  border: 3px solid #0f172a;
  border-radius: 24px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 5px 0 #0f172a, var(--shine);
  overflow: hidden;
}
.counter-pill::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}

.coin-pill {
  background: linear-gradient(180deg, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  color: #0f172a;
  border-color: #0f172a;
}

.gem-pill {
  background: linear-gradient(180deg, #7ddff7 0%, #4cc9f0 50%, #0ea5c9 100%);
  color: #0f172a;
  border-color: #0f172a;
}

.counter-icon { font-size: 1.3rem; }

/* Top Right UI */
.hud-top-right {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.minimap-wrapper {
  background: linear-gradient(180deg, #5ccc22 0%, #38b000 50%, #217a00 100%);
  border: 4px solid #0f172a;
  border-radius: 50%;
  width: 220px;
  height: 220px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 0 #0f172a, 0 12px 25px rgba(0,0,0,0.3), var(--shine);
  display: flex;
  justify-content: center;
  align-items: center;
}
.minimap-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: var(--gloss);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.minimap-label {
  position: absolute;
  bottom: 6px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  background: #0f172a;
  padding: 2px 8px;
  border-radius: 10px;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.hud-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-icon-btn {
  width: 46px;
  height: 46px;
  background: linear-gradient(180deg, #7890ff 0%, #4361ee 50%, #2940cc 100%);
  border: 3px solid #0f172a;
  border-radius: 16px;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 #0f172a, var(--shine);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.hud-icon-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 13px 13px 0 0;
  pointer-events: none;
}
.hud-icon-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, #bf7bf7 0%, #9d3fe8 50%, #7209b7 100%);
  box-shadow: 0 8px 0 #0f172a, var(--shine);
}

/* Interaction Prompt Toast (Interactive Button for Mobile & Desktop) */
.interaction-toast {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: max-content;
  white-space: nowrap;
  background: linear-gradient(180deg, #ff9055 0%, #ff6b35 40%, #e84e10 100%);
  border: 3px solid #0f172a;
  border-radius: 30px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 0 #0f172a, 0 10px 20px rgba(0,0,0,0.35), var(--shine);
  animation: bouncePrompt 1.5s infinite ease-in-out;
  overflow: hidden;
  z-index: 100;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  font-family: inherit;
}
.interaction-toast::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 26px 26px 0 0;
  pointer-events: none;
}

.interaction-toast:hover {
  filter: brightness(1.1);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 8px 0 #0f172a, 0 12px 25px rgba(255,107,53,0.5), var(--shine);
}

.interaction-toast:active {
  transform: translateX(-50%) translateY(3px) scale(0.96);
  box-shadow: 0 2px 0 #0f172a, 0 4px 10px rgba(0,0,0,0.3);
  filter: brightness(0.95);
}

.key-cap {
  background: linear-gradient(135deg, #ffbe0b, #ff9233);
  color: #0f172a;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 #0f172a;
  flex-shrink: 0;
}

#prompt-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #ffffff;
  pointer-events: none;
}

/* Quest Tracker Bottom Left */
.quest-tracker-card {
  background: linear-gradient(180deg, #5ccc22 0%, #38b000 40%, #217a00 100%);
  border: 3.5px solid #0f172a;
  border-left: 7px solid #0f172a;
  border-radius: 22px;
  padding: 16px 20px;
  max-width: 320px;
  box-shadow: 0 7px 0 #0f172a, var(--shine);
  position: relative;
  overflow: hidden;
}

/* Left-Side Transparent Live Stream Chat & Input */
.game-chat-card {
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: clamp(280px, 28vw, 360px);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  pointer-events: auto;
  margin-top: 4px;
}

.chat-header {
  background: transparent;
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: none;
}

.chat-title {
  display: none;
}

.chat-online-count {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(0, 245, 212, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #00f5d4;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 245, 212, 0.5);
  text-shadow: 1px 1px 0 #0f172a;
}

.chat-messages-body {
  height: 130px;
  padding: 4px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
  mask-image: linear-gradient(to bottom, transparent 0%, black 12%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%);
}

.chat-messages-body::-webkit-scrollbar {
  width: 4px;
}
.chat-messages-body::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.4);
  border-radius: 4px;
}

.chat-msg {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  word-break: break-word;
  background: transparent;
  padding: 1px 0;
  text-shadow: 1.5px 1.5px 0 #0f172a, -1.5px -1.5px 0 #0f172a, 1.5px -1.5px 0 #0f172a, -1.5px 1.5px 0 #0f172a;
}

.chat-msg.system-msg {
  color: #ffd700;
  font-style: italic;
  background: transparent;
  border-left: none;
}

.chat-msg .msg-sender {
  font-weight: 800;
  color: #00f5d4;
  margin-right: 6px;
}

.chat-input-form {
  display: flex;
  align-items: center;
  padding: 2px 0;
  background: transparent;
  border-top: none;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.chat-input-form input {
  flex: 1;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 6px 14px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.chat-input-form input:focus {
  border-color: #00f5d4;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.5);
}

.chat-input-form button {
  background: linear-gradient(180deg, #ff007f 0%, #d0006f 100%);
  border: 2px solid #0f172a;
  border-radius: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 3px 0 #0f172a;
  transition: transform 0.1s ease;
  flex-shrink: 0;
}

.chat-input-form button:hover {
  transform: translateY(-2px);
}

.chat-input-form button:hover {
  transform: translateY(-2px);
}
.quest-tracker-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: var(--gloss);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}

.quest-tag {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1.5px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.quest-tracker-header h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-top: 2px;
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}

#tracker-quest-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  margin: 6px 0 10px 0;
  line-height: 1.3;
}

.quest-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.3);
}

#tracker-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffbe0b, #ff9f1c);
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* Toast Notifications */
.toast-container {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-msg {
  background: linear-gradient(180deg, #5ccc22 0%, #38b000 50%, #217a00 100%);
  border: 3px solid #0f172a;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1rem;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 5px 0 #0f172a, var(--shine);
  animation: slideToast 0.3s ease-out forwards;
  position: relative;
  overflow: hidden;
}
.toast-msg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: var(--gloss);
  border-radius: 17px 17px 0 0;
  pointer-events: none;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Modals & Quest Journal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.dialog-card, .modal-card {
  background: linear-gradient(180deg, #6b80f5 0%, #4361ee 40%, #2940cc 100%);
  border: 4px solid #0f172a;
  border-radius: 28px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  padding: 24px;
  box-shadow: 0 10px 0 #0f172a, 0 20px 40px rgba(0,0,0,0.3), var(--shine);
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.dialog-card::-webkit-scrollbar, .modal-card::-webkit-scrollbar {
  width: 6px;
}

.dialog-card::-webkit-scrollbar-thumb, .modal-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
}
.dialog-card::before, .modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: var(--gloss);
  border-radius: 24px 24px 0 0;
  pointer-events: none;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.npc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.npc-avatar-box {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-gold), #ff9233);
  border: 3px solid #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.npc-header h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: #ffbe0b;
}

.npc-subtext {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
}

/* Hacker Mainframe Terminal Modal Card */
.hacker-card {
  background: linear-gradient(180deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%) !important;
  border-color: #00f5d4 !important;
  box-shadow: 0 10px 0 #00f5d4, 0 0 40px rgba(0, 245, 212, 0.4) !important;
}

.hacker-avatar {
  background: #090d16 !important;
  border-color: #00f5d4 !important;
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.5) !important;
}

.hacker-code-box {
  margin-top: 14px;
  background: rgba(0, 245, 212, 0.1);
  border: 2px dashed #00f5d4;
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: inset 0 0 15px rgba(0, 245, 212, 0.2);
  animation: pulseGlow 2s infinite ease-in-out;
}

.code-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffbe0b;
  letter-spacing: 1px;
}

.code-value {
  font-family: monospace;
  font-size: 1.35rem;
  font-weight: 900;
  color: #00f5d4;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(0, 245, 212, 0.8);
  user-select: text;
  -webkit-user-select: text;
}

.dialog-body {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #ffffff;
  margin-bottom: 24px;
  background: rgba(0,0,0,0.2);
  padding: 16px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.25);
}

.dialog-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid #0f172a;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: #ffbe0b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  font-size: 1rem;
  color: #ffffff;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.9);
}

.setting-row select, .setting-row input[type="checkbox"] {
  accent-color: #ffbe0b;
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 2px solid rgba(255,255,255,0.4);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
}

.quest-item {
  background: rgba(255,255,255,0.2);
  border: 2.5px solid rgba(255,255,255,0.4);
  border-left: 6px solid #ffbe0b;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.quest-item.completed {
  border-color: rgba(255,255,255,0.4);
  background: rgba(56, 176, 0, 0.3);
  border-left-color: #38b000;
}

.quest-item-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
}

.quest-item-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}

/* Utilities */
.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Touch Controls Overlay - HIDDEN by default on Desktop/Mouse Devices */
.touch-overlay {
  position: absolute;
  bottom: 25px;
  left: 0;
  width: 100%;
  padding: 0 25px;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 50;
}

.touch-overlay * {
  pointer-events: auto;
}

/* Show touch controls ONLY on touch-capable devices */
body.touch-device .touch-overlay {
  display: flex !important;
}

@media (hover: none) and (pointer: coarse) {
  .touch-overlay {
    display: flex !important;
  }

  /* Move quest tracker above joystick on touch devices to avoid overlap */
  .quest-tracker-card {
    margin-bottom: 140px;
  }
}

/* Left Virtual Joystick (Comfortable Ergonomic Size for Touch Devices) */
.joystick-base {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.75) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 3.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.3);
  touch-action: none;
}

.joystick-stick {
  width: 62px;
  height: 62px;
  background: radial-gradient(circle at 35% 35%, #00f5d4 0%, #00b4d8 60%, #0077b6 100%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  position: absolute;
  transition: transform 0.04s ease-out;
}

/* Right Touch Action Buttons (Ergonomic Big Jump Button) */
.touch-actions {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.touch-btn {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  transition: transform 0.1s ease, filter 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  pointer-events: auto;
}

.touch-btn * {
  pointer-events: none;
}

.touch-btn:active {
  transform: scale(0.92);
  filter: brightness(0.9);
}

.touch-btn-jump {
  width: 78px;
  height: 78px;
  background: radial-gradient(circle at 35% 35%, #ffd966 0%, #ffbe0b 50%, #e6a800 100%);
  border-color: #ffffff;
  box-shadow: 0 8px 22px rgba(255, 190, 11, 0.5), inset 0 3px 6px rgba(255, 255, 255, 0.9);
}

.touch-btn-jump svg {
  width: 38px;
  height: 38px;
  stroke: #1e293b;
  stroke-width: 3.2;
}

.touch-btn-dismount {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #e63946, #d62828);
}

/* Power-Up Addon Slot & Active Timer */
.power-hud-container {
  position: absolute;
  bottom: clamp(90px, 14vh, 120px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 45;
  pointer-events: auto;
  max-width: 90vw;
}

.power-slot-card {
  background: linear-gradient(135deg, rgba(9, 13, 22, 0.88) 0%, rgba(76, 201, 240, 0.25) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 2px solid rgba(76, 201, 240, 0.6);
  border-radius: 30px;
  padding: 6px 16px 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 22px rgba(76, 201, 240, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.power-slot-card.ready {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  animation: pulseGlow 1.5s infinite ease-in-out;
}

.power-slot-card.active-power {
  border-color: #00f5d4;
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.power-icon-box {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.power-info {
  display: flex;
  flex-direction: column;
}

.power-name {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.power-hint {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.btn-use-power {
  background: linear-gradient(135deg, var(--accent-gold), #ff9233);
  color: #1e293b;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 12px;
  border: 2px solid #ffffff;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(255, 190, 11, 0.4);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-use-power:hover {
  transform: scale(1.06);
}

.power-timer-container {
  width: 140px;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.power-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: 8px;
  transition: width 0.1s linear;
}

.touch-btn-sprint {
  background: linear-gradient(135deg, var(--accent-gold), #ff9233);
}

.touch-btn-interact {
  background: linear-gradient(135deg, var(--primary-color), #f72585);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (Mobile, Tablet, Foldables, Landscape)
   ========================================================================== */

/* Tablet & Smaller Desktops (Max-width 1024px) */
@media (max-width: 1024px) {
  .minimap-wrapper {
    width: 150px;
    height: 150px;
  }

  .hud-icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .lobby-sidebar-left, .lobby-sidebar-right {
    width: clamp(240px, 30vw, 290px);
  }
}

/* Mobile & Touch Layouts (Max-width 768px) */
@media (max-width: 768px) {
  .hud-container {
    padding: 10px;
  }

  /* HUD Top Left Stats Bar */
  .hud-top-left {
    gap: 8px;
    flex-wrap: wrap;
    max-width: 60vw;
  }

  .avatar-badge {
    padding: 4px 12px 4px 6px;
    gap: 8px;
    border-width: 2.5px;
  }

  .avatar-icon {
    width: 32px;
    height: 32px;
  }

  .avatar-icon svg {
    width: 18px;
    height: 18px;
  }

  .player-name {
    font-size: 0.85rem;
  }

  .stamina-bar-container {
    width: 80px;
    height: 7px;
    border-width: 1.5px;
  }

  .counters-group {
    gap: 6px;
  }

  .counter-pill {
    padding: 3px 10px;
    font-size: 0.85rem;
    border-width: 2px;
    border-radius: 18px;
    gap: 5px;
  }

  .counter-pill svg {
    width: 16px;
    height: 16px;
  }

  /* HUD Top Right: Compact Minimap & Button Column */
  .hud-top-right {
    top: 10px;
    right: 10px;
    gap: 8px;
  }

  .minimap-wrapper {
    width: 85px;
    height: 85px;
    border-width: 2.5px;
    box-shadow: 0 4px 0 #0f172a;
  }

  .minimap-label {
    font-size: 0.5rem;
    padding: 1px 5px;
    bottom: 3px;
  }

  .hud-buttons {
    gap: 6px;
  }

  .hud-icon-btn {
    width: 36px;
    height: 36px;
    border-width: 2px;
    border-radius: 12px;
  }

  .hud-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Power HUD Slot (Center Bottom) */
  .power-hud-container {
    bottom: clamp(100px, 15vh, 130px); /* Safely floats above bottom touch buttons */
    max-width: 88vw;
  }

  .power-slot-card {
    padding: 4px 10px 4px 6px;
    gap: 8px;
    border-radius: 20px;
  }

  .power-icon-box {
    width: 30px;
    height: 30px;
  }

  .power-icon-box svg {
    width: 16px;
    height: 16px;
  }

  .power-name {
    font-size: 0.76rem;
  }

  .power-hint {
    font-size: 0.58rem;
  }

  .btn-use-power {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .power-timer-container {
    width: 110px;
    height: 5px;
  }

  /* Quest Tracker card on mobile */
  .quest-tracker-card {
    max-width: 190px;
    padding: 8px 12px;
    border-width: 2px;
    border-left-width: 5px;
    border-radius: 14px;
    margin-bottom: 110px; /* Clear left joystick */
  }

  .quest-tag {
    font-size: 0.62rem;
  }

  .quest-tracker-header h4 {
    font-size: 0.88rem;
  }

  #tracker-quest-desc {
    font-size: 0.72rem;
    margin: 3px 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .quest-progress-bar {
    height: 6px;
  }

  /* Game Chat Card on mobile */
  .game-chat-card {
    width: clamp(200px, 45vw, 260px);
    margin-top: 4px;
  }

  .chat-messages-body {
    height: 90px;
  }

  .chat-msg {
    font-size: 0.75rem;
  }

  /* Touch Controls Overlay */
  .touch-overlay {
    bottom: 15px;
    padding: 0 16px;
  }

  .joystick-base {
    width: 120px;
    height: 120px;
    border-width: 3px;
  }

  .joystick-stick {
    width: 52px;
    height: 52px;
  }

  .touch-actions {
    gap: 8px;
  }

  .touch-btn-jump {
    width: 74px;
    height: 74px;
    border-width: 3px;
  }

  .touch-btn-jump svg {
    width: 36px;
    height: 36px;
  }

  .touch-btn-dismount {
    width: 52px;
    height: 52px;
  }

  /* Toast Notifications Position */
  .toast-container {
    top: 60px;
    bottom: auto;
    right: 12px;
    left: auto;
    max-width: 80vw;
  }

  .toast-msg {
    font-size: 0.82rem;
    padding: 8px 14px;
  }

  /* Interaction Prompt */
  .interaction-toast {
    bottom: 135px;
    padding: 6px 16px;
    font-size: 0.85rem;
    gap: 8px;
  }

  .key-cap {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  #prompt-text {
    font-size: 0.85rem;
  }

  /* Modals & Dialogs on mobile */
  .dialog-card, .modal-card {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 20px);
    padding: 16px;
    border-radius: 18px;
    border-width: 3px;
    margin: auto;
  }

  .modal-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .setting-row {
    padding: 8px 0;
    font-size: 0.88rem;
  }

  .setting-row select {
    padding: 4px 8px;
    font-size: 0.82rem;
  }

  .npc-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .npc-avatar {
    width: 48px;
    height: 48px;
  }

  .npc-info h3 {
    font-size: 1.2rem;
  }

  .npc-info p {
    font-size: 0.8rem;
  }

  .dialog-text {
    font-size: 0.92rem;
    padding: 12px;
  }

  /* Lobby UI Mobile Responsiveness */
  .lobby-container {
    padding: 10px;
  }

  .lobby-header {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .lobby-brand {
    display: none;
  }

  .lobby-nav {
    order: 1;
    width: 100%;
    justify-content: space-around;
    padding: 3px;
    border-radius: 25px;
  }

  .nav-tab {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .lobby-currency {
    order: 2;
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .currency-pill {
    padding: 3px 10px;
    font-size: 0.82rem;
  }

  .lobby-sidebar-left {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    max-height: 160px;
    margin-top: 4px;
  }

  .royalty-card {
    padding: 8px 12px;
    border-radius: 14px;
  }

  .mode-royalty-card {
    display: none;
  }

  .lobby-sidebar-right {
    position: absolute;
    top: 90px;
    left: 10px;
    right: 10px;
    width: auto;
    margin-top: 0;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
  }

  .lobby-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .pubg-match-btn {
    width: 100%;
    padding: 10px 18px;
    justify-content: center;
  }

  .match-label {
    font-size: 1.25rem;
  }

  .inspect-hint {
    justify-content: center;
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  .lobby-profile-trigger-card {
    justify-content: center;
    width: 100%;
    padding: 8px 14px;
  }
}

/* Mobile Landscape & Ultra-compact screens (Max-height 500px) */
@media (max-height: 500px) {
  .hud-top-left {
    gap: 6px;
  }

  .avatar-badge {
    padding: 2px 8px 2px 4px;
  }

  .avatar-icon {
    width: 26px;
    height: 26px;
  }

  .player-name {
    font-size: 0.75rem;
  }

  .stamina-bar-container {
    width: 60px;
    height: 5px;
  }

  .minimap-wrapper {
    width: 65px;
    height: 65px;
  }

  .hud-buttons {
    gap: 4px;
  }

  .hud-icon-btn {
    width: 30px;
    height: 30px;
  }

  .quest-tracker-card {
    display: none; /* Hide quest tracker in short landscape to give full field of view */
  }

  .modal-overlay {
    padding: 8px;
  }

  .dialog-card, .modal-card {
    max-height: calc(100vh - 16px);
    padding: 12px 18px;
    border-radius: 16px;
  }

  .modal-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .setting-row {
    padding: 6px 0;
  }

  .game-chat-card {
    display: flex;
    max-width: 220px;
  }

  .chat-messages-body {
    height: 65px;
  }

  .power-hud-container {
    bottom: 75px;
  }

  .touch-overlay {
    bottom: 10px;
  }

  .joystick-base {
    width: 105px;
    height: 105px;
  }

  .joystick-stick {
    width: 45px;
    height: 45px;
  }

  .touch-btn-jump {
    width: 64px;
    height: 64px;
  }

  .touch-btn-jump svg {
    width: 30px;
    height: 30px;
  }

  .lobby-container {
    padding: 6px 10px;
  }

  .lobby-sidebar-left {
    display: none;
  }

  .lobby-sidebar-right {
    top: 50px;
    max-height: calc(100vh - 70px);
  }
}


