/* Raffcraft - Modern Minecraft Glassmorphism & Cyber-Pastel Aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&family=VT323&display=swap');

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0c0817;
  font-family: 'Outfit', sans-serif;
  color: #f8fafc;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

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

/* Top Bar: Immortality Badge & Coordinates */
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.immortality-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(24, 18, 42, 0.75);
  backdrop-filter: blur(12px);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(244, 114, 182, 0.4);
  box-shadow: 0 8px 32px rgba(236, 72, 153, 0.2);
}

.rainbow-hearts {
  font-size: 20px;
  animation: heartPulse 1.8s infinite ease-in-out;
  filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.6));
}

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

.immortal-text {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f472b6, #c084fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hud-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.stat-tag {
  background: rgba(18, 14, 30, 0.75);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.flight-active-tag {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #bae6fd;
  animation: glowPulse 2s infinite;
}

.hud-reset-btn {
  background: rgba(239, 68, 68, 0.25);
  border: 1.5px solid rgba(248, 113, 113, 0.6);
  color: #fecaca;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.hud-reset-btn:hover {
  background: rgba(239, 68, 68, 0.55);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
}

.hud-reset-btn:active {
  transform: scale(0.95);
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }
  50% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.6); }
}

/* Boss Health Bar Container */
#boss-bar-container {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 90%;
  max-width: 560px;
  z-index: 1000;
  pointer-events: none;
  background: rgba(15, 10, 25, 0.85);
  backdrop-filter: blur(12px);
  padding: 10px 18px;
  border-radius: 18px;
  border: 1.5px solid rgba(244, 63, 94, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.boss-title-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

#boss-name {
  color: #f87171;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

#boss-hp-text {
  color: #fef08a;
}

.boss-bar-track {
  width: 100%;
  height: 18px;
  background: rgba(20, 10, 15, 0.85);
  border: 2px solid #ef4444;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

#boss-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #dc2626 0%, #f97316 50%, #facc15 100%);
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.8);
  transition: width 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Center Crosshair & Hit Markers */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: transform 0.08s ease;
}

.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  transition: all 0.08s ease;
}

.crosshair::before {
  top: 8px;
  left: 0;
  width: 18px;
  height: 2px;
}

.crosshair::after {
  top: 0;
  left: 8px;
  width: 2px;
  height: 18px;
}

.crosshair.hit {
  transform: translate(-50%, -50%) scale(1.6);
}

.crosshair.hit::before, .crosshair.hit::after {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}

/* Bottom Bar: Hotbar & Quick Tips */
.hud-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.hud-hotbar {
  display: flex;
  gap: 8px;
  background: rgba(20, 15, 35, 0.8);
  backdrop-filter: blur(14px);
  padding: 8px 12px;
  border-radius: 18px;
  border: 2px solid rgba(192, 132, 252, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.hotbar-slot {
  position: relative;
  width: 52px;
  height: 52px;
  background: rgba(30, 24, 52, 0.6);
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hotbar-slot.active {
  transform: scale(1.18);
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.2);
  box-shadow: 0 0 18px rgba(244, 114, 182, 0.7);
  z-index: 2;
}

.slot-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slot-number {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  text-shadow: 0 1px 2px #000;
}

.quick-tips {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
  background: rgba(15, 10, 25, 0.6);
  padding: 4px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.quick-tips span b {
  color: #f472b6;
}

/* Toast Notifications */
#notification-toast {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(30, 20, 50, 0.9);
  backdrop-filter: blur(16px);
  border: 1.5px solid #d946ef;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  color: #fdf4ff;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 30px rgba(217, 70, 239, 0.35);
  z-index: 100;
}

#notification-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- MENUS & MODALS --- */
.screen-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 7, 20, 0.85);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.3s ease;
}

.screen-modal.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

#start-screen {
  background: radial-gradient(circle at center, rgba(16, 10, 30, 0.75) 0%, rgba(10, 6, 20, 0.92) 100%),
              url('../assets/raffcraft_cover.jpg') center/cover no-repeat;
}

.menu-card {
  background: linear-gradient(145deg, rgba(28, 20, 48, 0.9), rgba(18, 12, 32, 0.95));
  border: 2px solid rgba(192, 132, 252, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(192, 132, 252, 0.2);
  border-radius: 28px;
  padding: 42px;
  max-width: 580px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo-title {
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #f472b6 0%, #c084fc 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(192, 132, 252, 0.6));
  line-height: 1.1;
}

.logo-sub {
  font-size: 15px;
  color: #cbd5e1;
  max-width: 440px;
  line-height: 1.5;
}

.lore-box {
  background: rgba(15, 10, 25, 0.6);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #e2e8f0;
}

.lore-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #ffffff;
  border: none;
  padding: 16px 36px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.7);
}

.btn-reset-bosses {
  background: linear-gradient(135deg, #dc2626, #ea580c) !important;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.5) !important;
}

.btn-reset-bosses:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(220, 38, 38, 0.8) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

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

/* --- CREATIVE INVENTORY MODAL --- */
.inv-dialog {
  background: linear-gradient(145deg, rgba(26, 18, 44, 0.95), rgba(16, 10, 28, 0.98));
  border: 2px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
  border-radius: 24px;
  padding: 32px;
  max-width: 740px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.inv-title {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.inv-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
}

.inv-close-btn:hover {
  color: #f472b6;
}

.inv-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  overflow-x: auto;
}

.inv-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.inv-tab.active {
  background: #a855f7;
  border-color: #c084fc;
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.inv-search {
  width: 100%;
  background: rgba(10, 6, 18, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 10px 16px;
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.inv-search:focus {
  border-color: #f472b6;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.3);
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: 420px;
  padding-right: 6px;
}

.inv-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inv-card:hover {
  background: rgba(192, 132, 252, 0.15);
  border-color: #c084fc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(192, 132, 252, 0.25);
}

.inv-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.inv-card-title {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #e2e8f0;
}

/* --- BOSS SPEECH BANNER & DIALOGUE --- */
.boss-speech-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.95);
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.95), rgba(3, 105, 161, 0.95));
  border: 2.5px solid #00f0ff;
  border-radius: 20px;
  padding: 16px 32px;
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.5), 0 0 50px rgba(2, 132, 199, 0.6);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  max-width: 850px;
  width: 90%;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.boss-speech-banner.theme-red {
  background: linear-gradient(135deg, rgba(88, 14, 14, 0.95), rgba(153, 27, 27, 0.95));
  border-color: #ef4444;
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.6), 0 0 50px rgba(185, 28, 28, 0.7);
}

.boss-speech-banner.theme-red .boss-speech-title {
  color: #f87171;
  text-shadow: 0 0 14px rgba(248, 113, 113, 0.9);
}

.boss-speech-banner.theme-yellow {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.95), rgba(180, 83, 9, 0.95));
  border-color: #facc15;
  box-shadow: 0 12px 40px rgba(250, 204, 21, 0.6), 0 0 50px rgba(217, 119, 6, 0.7);
}

.boss-speech-banner.theme-yellow .boss-speech-title {
  color: #fef08a;
  text-shadow: 0 0 14px rgba(254, 240, 138, 0.9);
}

.boss-speech-banner.theme-blue {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.95), rgba(3, 105, 161, 0.95));
  border-color: #00f0ff;
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.6), 0 0 50px rgba(2, 132, 199, 0.7);
}

.boss-speech-banner.theme-blue .boss-speech-title {
  color: #38bdf8;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

.boss-speech-banner.theme-black {
  background: linear-gradient(135deg, rgba(15, 7, 25, 0.98), rgba(46, 16, 101, 0.95));
  border-color: #d946ef;
  box-shadow: 0 12px 40px rgba(217, 70, 239, 0.7), 0 0 50px rgba(147, 51, 234, 0.8);
}

.boss-speech-banner.theme-black .boss-speech-title {
  color: #f472b6;
  text-shadow: 0 0 16px rgba(244, 114, 182, 0.95);
}

.boss-speech-banner.active {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) scale(1.05) !important;
  pointer-events: auto;
}

.boss-speech-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.boss-speech-quote {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  font-style: italic;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  animation: speechGlow 2s infinite ease-in-out;
}

@keyframes speechGlow {
  0%, 100% { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 255, 255, 0.6); }
  50% { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 32px rgba(255, 255, 255, 1.0); }
}

/* --- PRISMATIC RAINBOW SNIPER SCOPE OVERLAY --- */
.sniper-scope-overlay {
  position: fixed;
  inset: 0;
  z-index: 80000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, transparent 28%, rgba(15, 23, 42, 0.75) 45%, rgba(2, 6, 23, 0.98) 72%);
  backdrop-filter: blur(2px);
  animation: scopePulse 3s infinite ease-in-out;
}

.scope-reticle-circle {
  position: relative;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 2.5px solid rgba(236, 72, 153, 0.85);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.6), inset 0 0 45px rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scope-reticle-inner {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1.5px dashed rgba(56, 189, 248, 0.7);
  animation: scopeRotate 18s infinite linear;
}

.scope-crosshair-h {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ec4899 25%, #38bdf8 50%, #ec4899 75%, transparent);
}

.scope-crosshair-v {
  position: absolute;
  height: 100%;
  width: 2px;
  background: linear-gradient(180deg, transparent, #ec4899 25%, #38bdf8 50%, #ec4899 75%, transparent);
}

.scope-range-text {
  position: absolute;
  bottom: 24px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.9);
}

@keyframes scopeRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scopePulse {
  0%, 100% { filter: brightness(1.0); }
  50% { filter: brightness(1.12); }
}

/* --- SNIPER AMMO BADGE --- */
.sniper-ammo-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9), rgba(88, 28, 135, 0.9));
  border: 2px solid #ec4899;
  border-radius: 12px;
  padding: 6px 16px;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5);
  margin-bottom: 4px;
  animation: ammoGlow 2.5s infinite ease-in-out;
}

.pump-hint {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(236, 72, 153, 0.3);
  border: 1px solid #ec4899;
  border-radius: 6px;
  color: #fbcfe8;
  letter-spacing: 1px;
}

@keyframes ammoGlow {
  0%, 100% { box-shadow: 0 4px 18px rgba(236, 72, 153, 0.5); }
  50% { box-shadow: 0 4px 28px rgba(56, 189, 248, 0.7); }
}

/* =========================================================
   CINEMATIC INTRO CUTSCENE STYLING
   ========================================================= */
.cutscene-container {
  position: fixed;
  inset: 0;
  z-index: 95000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.5s ease-out;
}

.cutscene-container.hidden {
  display: none !important;
}

/* Widescreen Cinema Letterbox Bars */
.cutscene-bar {
  width: 100%;
  height: 11vh;
  background: #000000;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
}

.cutscene-bar-top {
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.cutscene-bar-bottom {
  border-top: 2px solid rgba(255, 255, 255, 0.08);
}

.cutscene-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 13vh;
  pointer-events: none;
}

/* Narrative Subtitles */
.cutscene-subtitles {
  max-width: 800px;
  margin: 0 20px 24px 20px;
  padding: 14px 28px;
  background: rgba(10, 6, 22, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(168, 85, 247, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  pointer-events: auto;
}

/* Big Title Card */
.cutscene-title-card {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: titleCardPop 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cutscene-title-card.hidden {
  display: none !important;
}

.cutscene-logo {
  font-size: 68px;
  font-weight: 900;
  letter-spacing: 8px;
  margin: 0;
  background: linear-gradient(135deg, #fbcfe8, #f472b6, #c084fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 35px rgba(244, 114, 182, 0.8));
}

.cutscene-logo-sub {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #e0e7ff;
  margin-top: 6px;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.8);
}

@keyframes titleCardPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.85); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
}

/* Skip Button */
.cutscene-skip-btn {
  position: absolute;
  bottom: 12vh;
  right: 28px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  color: #cbd5e1;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.cutscene-skip-btn:hover {
  background: rgba(244, 114, 182, 0.35);
  border-color: #f472b6;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.4);
}

/* ==========================================================================
   MOBILE TOUCH CONTROLS & RESPONSIVE OVERLAYS
   ========================================================================== */
.mobile-touch-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
  touch-action: none;
}

/* Virtual Joystick Zone (Bottom-Left) */
.touch-joystick-zone {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 150px;
  height: 150px;
  pointer-events: auto;
  touch-action: none;
}

.joystick-base {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  position: absolute;
  top: 15px;
  left: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.joystick-stick {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, #f472b6, #c084fc);
  box-shadow: 0 0 15px rgba(244, 114, 182, 0.8);
  pointer-events: none;
  transition: transform 0.05s ease-out;
}

/* Touch Camera Look Zone (Right half of screen) */
.touch-look-zone {
  position: absolute;
  top: 0;
  right: 0;
  width: 55vw;
  height: 80vh;
  pointer-events: auto;
  touch-action: none;
}

/* Touch Action Buttons Container */
.touch-action-buttons {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 12px;
  pointer-events: auto;
}

.tbtn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(24, 18, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  touch-action: manipulation;
  transition: transform 0.1s, background 0.1s;
}

.tbtn:active {
  transform: scale(0.9);
  background: rgba(244, 114, 182, 0.5);
  border-color: #f472b6;
}

.tbtn-jump { background: rgba(56, 189, 248, 0.35); border-color: #38bdf8; }
.tbtn-attack { background: rgba(239, 68, 68, 0.4); border-color: #ef4444; }
.tbtn-build { background: rgba(234, 179, 8, 0.4); border-color: #eab308; }

/* ==========================================================================
   FLOATING HUD CHAT STREAM & CHAT MODAL
   ========================================================================== */
.hud-chat-stream {
  position: absolute;
  bottom: 110px;
  left: 24px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 15;
}

.hud-chat-item {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 8px;
  border-left: 4px solid #38bdf8;
  color: #f1f5f9;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: opacity 0.5s ease;
}

.chat-dialog {
  background: rgba(18, 14, 32, 0.95);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(244, 114, 182, 0.4);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  height: 420px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  padding: 20px;
}

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

.chat-messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 6px;
}

.chat-msg-row.self {
  background: rgba(244, 114, 182, 0.15);
  border-left: 3px solid #f472b6;
}

.chat-time { color: #94a3b8; font-size: 11px; }
.chat-author { font-weight: bold; color: #38bdf8; }
.chat-text { color: #f8fafc; word-break: break-word; }

.chat-form {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.chat-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  color: white;
  outline: none;
}

/* ==========================================================================
   FRIENDS & ROOM PLAYERS MODAL
   ========================================================================== */
.friends-dialog {
  background: rgba(18, 14, 32, 0.95);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  padding: 24px;
}

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

.room-info-card {
  display: flex;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.friends-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.friends-list-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar { font-size: 22px; }
.player-name { font-weight: 700; color: #f8fafc; }
.player-dim { font-size: 11px; color: #94a3b8; }

.btn-friend {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-friend.is-friend {
  background: rgba(234, 179, 8, 0.25);
  border-color: #eab308;
  color: #fef08a;
}

.player-badge-self {
  font-size: 11px;
  background: rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #a855f7;
}

.empty-list {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin: 20px 0;
}

/* Responsive Scaling for Small Mobile Screens */
@media (max-width: 640px) {
  .hud-top { flex-direction: column; gap: 8px; align-items: stretch; }
  .hud-stats { align-items: flex-start; }
  .quick-tips { display: none; }
  .touch-action-buttons { grid-template-columns: repeat(3, 48px); gap: 8px; }
  .tbtn { width: 48px; height: 48px; font-size: 18px; }
  .hud-hotbar { gap: 4px; padding: 4px 8px; }
  .hotbar-slot { width: 40px; height: 40px; }
}




