* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #090d16;
  color: #f8fafc;
}

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

/* CROSSHAIR */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

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

.hud-cinematic {
  opacity: 0 !important;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}

.hud-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.progress-bar-container {
  width: 180px;
  height: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #10b981;
  border-radius: 5px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* OBJECTIVE DIRECTION ARROW WIDGET */
#objective-arrow {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 8px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.arrow-icon {
  font-size: 18px;
  display: inline-block;
  transform-origin: center;
  transition: transform 0.1s linear;
}

#objective-distance {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* MINIMAP RADAR */
#minimap-container {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #0f172a;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

#minimap-container:hover {
  transform: scale(1.05);
  border-color: #38bdf8;
}

#minimap-canvas {
  width: 160px;
  height: 160px;
  display: block;
}

.minimap-hint {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 10px;
}

/* CENTER INTERACTION HINT */
#interaction-hint {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(16, 185, 129, 0.92);
  color: #064e3b;
  font-size: 15px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
  pointer-events: none;
}

/* HUD BOTTOM (STEALTH METERS) */
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.meter-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#hud-nav-shortcuts {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #cbd5e1;
}

#hud-nav-shortcuts b {
  color: #38bdf8;
}

/* DIALOGUE BOX */
#dialogue-box {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 680px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  padding: 22px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  z-index: 60;
  cursor: pointer;
}

#dialogue-speaker {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

#dialogue-text {
  font-size: 16px;
  line-height: 1.5;
  color: #f1f5f9;
  min-height: 48px;
}

#dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.dialogue-choice-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dialogue-choice-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: white;
  transform: translateX(4px);
}

#dialogue-continue {
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
  margin-top: 10px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1.0; }
}

/* FULL MAP MODAL */
.map-card {
  width: 560px !important;
  max-width: 95vw;
}

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

.map-header h2 {
  font-size: 20px;
  color: #38bdf8;
}

.btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 18px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.6);
}

#fullmap-canvas {
  width: 500px;
  height: 500px;
  max-width: 85vw;
  max-height: 55vh;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: crosshair;
}

.map-legend {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  margin-top: 14px;
  color: #cbd5e1;
}

/* JOURNAL MODAL */
.journal-card {
  width: 520px !important;
  text-align: left !important;
}

.journal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.6);
  padding: 18px;
  border-radius: 10px;
}

/* TOAST BANNER */
#toast {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(2, 132, 199, 0.95);
  color: white;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 50;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast-hidden {
  opacity: 0;
  transform: translate(-50%, -20px) !important;
}

/* LETTERBOX CINEMATIC BARS */
#letterbox {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bar-top, .bar-bottom {
  width: 100%;
  height: 14vh;
  background: #000;
}

.bar-bottom {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 10px 40px;
}

#cinematic-text {
  color: #fef08a;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  max-width: 800px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  line-height: 1.4;
  white-space: pre-line;
}

#skip-cinematic-btn {
  position: absolute;
  right: 28px;
  bottom: 20px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #e2e8f0;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

#skip-cinematic-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* MENUS & MODALS */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}

.menu-card {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 36px 44px;
  width: 480px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.game-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.game-subtitle {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 28px;
}

/* MODERN MENU STYLING */
.modern-menu {
  width: 540px !important;
  max-width: 95vw;
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 20px !important;
  padding: 32px 36px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 32px rgba(16, 185, 129, 0.12) !important;
}

.menu-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.setting-group {
  margin: 18px 0;
  text-align: left;
}

.setting-title {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.radio-card:hover .card-inner {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}

.radio-card input:checked + .card-inner {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.card-hard input:checked + .card-inner {
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.card-icon {
  font-size: 24px;
  line-height: 1;
}

.card-text {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}

.card-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.3;
}

.btn-play {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  margin-top: 14px;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-play:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(16, 185, 129, 0.6);
}

.menu-footer {
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
}

.footer-title {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.controls-hint {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.modal-caught {
  border-color: rgba(239, 68, 68, 0.5) !important;
}

.title-busted {
  color: #ef4444;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
}

.title-victory {
  color: #10b981;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
}

.modal-desc {
  font-size: 15px;
  color: #cbd5e1;
  margin-bottom: 24px;
  line-height: 1.5;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
  border-color: rgba(56, 189, 248, 0.4);
}

/* AUDIO SETTINGS MODAL */
.settings-card {
  width: 520px !important;
  max-width: 95vw;
  text-align: left !important;
  padding: 28px 32px !important;
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.15) !important;
}

.audio-settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.toggle-card:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(56, 189, 248, 0.35);
}

.toggle-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-icon {
  font-size: 26px;
  line-height: 1;
}

.toggle-name {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}

.toggle-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.toggle-card input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: #334155;
  border-radius: 13px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.toggle-card input[type="checkbox"]:checked + .toggle-switch {
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.toggle-card input[type="checkbox"]:checked + .toggle-switch::after {
  transform: translateX(22px);
}

.hidden {
  display: none !important;
}
