/* HuntZoon Tactical Cyber-Theme Styling */
:root {
  --black: #060911;
  --bg-app: #080D18;
  --ink: #0E1626;
  --ink-2: #141F36;
  --ink-3: #1B2947;
  
  /* HuntZoon Brand Colors: Neon Cyber Emerald & Electric Cyan */
  --hz-emerald: #00E5A3;
  --hz-emerald-glow: rgba(0, 229, 163, 0.35);
  --hz-cyan: #00E5FF;
  --hz-cyan-glow: rgba(0, 229, 255, 0.3);
  --p-500: #00E5A3;      /* Primary button & brand color */
  --p-600: #00C88E;
  --p-700: #009B6E;
  --p-300: #5CFFD0;
  --p-100: #E6FFF7;

  --white: #FFFFFF;
  --text: #F0F6FF;
  --muted: #8E9FB8;
  --dim: #5C6E87;
  --line: rgba(0, 229, 163, 0.2);

  --danger: #FF2A6D;
  --danger-bg: rgba(255, 42, 109, 0.18);
  --success: #00E5A3;
  --warning: #FFB800;

  --head: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cut {
  --c: 12px;
  clip-path: polygon(
    var(--c) 0,
    100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%,
    0 var(--c)
  );
}

.cut-sm {
  --c: 6px;
  clip-path: polygon(
    var(--c) 0,
    100% 0,
    100% calc(100% - var(--c)),
    calc(100% - var(--c)) 100%,
    0 100%,
    0 var(--c)
  );
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-app);
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  user-select: none;
}

/* Splash Loader for HuntZoon */
#sh-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #8E9FB8;
  font: 12px/1.4 var(--mono);
  letter-spacing: .25em;
  transition: opacity .35s ease, visibility .35s ease;
}
#sh-splash img {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 12px 36px var(--hz-emerald-glow);
}
#sh-splash .bar {
  width: 130px;
  height: 2px;
  background: #1B2947;
  overflow: hidden;
  border-radius: 2px;
}
#sh-splash .bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--hz-emerald);
  box-shadow: 0 0 10px var(--hz-emerald);
  animation: sh 1.1s ease-in-out infinite;
}
@keyframes sh {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* Application Header */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  background: rgba(8, 13, 24, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--head);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand-link span {
  background: linear-gradient(90deg, #FFFFFF, var(--hz-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-link img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-pill {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--hz-emerald);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.profile-pill:hover {
  background: var(--ink-3);
  border-color: var(--hz-cyan);
}
.room-badge {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--hz-cyan);
  letter-spacing: 0.1em;
}

/* App View Containers */
.app-view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.app-view.active {
  display: flex;
}

.view-content {
  max-width: 540px;
  margin: 76px auto 30px;
  padding: 0 16px;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Buttons */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  font: 700 15px/1 var(--sans);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.4) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.btn:hover::after {
  transform: translateX(120%);
  transition: transform 0.6s var(--ease);
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--hz-emerald);
  color: #04100B;
  box-shadow: 0 4px 18px var(--hz-emerald-glow);
}
.btn-primary:hover {
  background: #26FFBF;
}
.btn-secondary {
  background: var(--ink-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: var(--ink-3);
  border-color: var(--hz-emerald);
}
.btn-white {
  background: var(--white);
  color: #080D18;
  font-weight: 700;
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
  font-weight: 700;
}
.btn-google {
  background: #FFFFFF;
  color: #1F1F1F;
  font-weight: 600;
  border: 1px solid #DADCE0;
  gap: 12px;
}
.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}

/* Cards & Inputs */
.card {
  background: var(--ink);
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.card-title {
  font-family: var(--head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  height: 48px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--hz-emerald);
  box-shadow: 0 0 10px var(--hz-emerald-glow);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 229, 163, 0.1);
}
.toggle-input {
  width: 22px;
  height: 22px;
  accent-color: var(--hz-emerald);
  cursor: pointer;
}

/* Connected Roster */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--ink-2);
  border: 1px solid rgba(0, 229, 163, 0.12);
}
.player-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  text-transform: uppercase;
}
.role-hunter {
  background: rgba(255, 42, 109, 0.22);
  color: #FF5A8D;
  border: 1px solid rgba(255, 42, 109, 0.5);
}
.role-shadow {
  background: rgba(0, 229, 163, 0.2);
  color: var(--hz-emerald);
  border: 1px solid rgba(0, 229, 163, 0.45);
}
.role-unassigned {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

/* MATCH HUD SCREEN */
#view-match {
  position: relative;
  width: 100%;
  height: 100%;
}
#map-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Tactical Top HUD */
.hud-top {
  position: absolute;
  top: 70px;
  left: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.hud-pill {
  pointer-events: auto;
  background: rgba(8, 13, 24, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  min-width: 80px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.hud-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.hud-val {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

/* Tactical Sector Scanner / Radar Banner */
.sector-scanner-bar {
  position: absolute;
  top: 136px;
  left: 14px;
  right: 14px;
  z-index: 500;
  background: rgba(14, 22, 38, 0.94);
  border: 1px solid var(--hz-emerald);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px var(--hz-emerald-glow);
}
.scanner-text {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}
.radar-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hz-cyan);
  animation: radarDot 1.2s infinite;
}
@keyframes radarDot {
  0% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 10px var(--hz-cyan); }
  100% { transform: scale(0.8); opacity: 0.4; }
}

/* Floating Kill Feed Notifications */
.kill-feed {
  position: absolute;
  top: 180px;
  left: 14px;
  right: 14px;
  z-index: 550;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.kill-item {
  background: rgba(255, 42, 109, 0.92);
  color: var(--white);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 42, 109, 0.45);
  animation: slideInDown 0.3s ease-out;
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tactical Compass Widget */
.compass-widget {
  position: absolute;
  bottom: 160px;
  right: 16px;
  z-index: 500;
  background: rgba(8, 13, 24, 0.94);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.compass-dial {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--hz-emerald);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0, 229, 163, 0.15) 0%, transparent 70%);
}
.compass-dial::before {
  content: "N";
  position: absolute;
  top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--hz-cyan);
}
.compass-needle {
  position: absolute;
  width: 4px;
  height: 32px;
  transform-origin: 50% 100%;
  top: 6px;
  transition: transform 0.3s var(--ease);
}
.compass-needle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 14px solid var(--danger);
}
.compass-dist {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--hz-cyan);
}

/* Bottom Action Bar */
.hud-bottom {
  position: absolute;
  bottom: 20px;
  left: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* "I GOT TAGGED" Button */
.btn-tagged-action {
  width: 100%;
  min-height: 58px;
  font-family: var(--head);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 8px 32px rgba(255, 42, 109, 0.5);
  animation: taggedGlow 2s infinite alternate;
}
@keyframes taggedGlow {
  0% { box-shadow: 0 4px 16px rgba(255, 42, 109, 0.3); }
  100% { box-shadow: 0 8px 36px rgba(255, 42, 109, 0.75); }
}

/* Warnings */
.oob-banner {
  position: absolute;
  top: 135px;
  left: 14px;
  right: 14px;
  z-index: 600;
  background: rgba(255, 42, 109, 0.95);
  color: var(--white);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 42, 109, 0.6);
  animation: flash 0.6s infinite alternate;
}
@keyframes flash {
  0% { opacity: 0.85; }
  100% { opacity: 1; transform: scale(1.01); }
}

/* Simulator D-Pad */
.sim-controls {
  position: absolute;
  left: 16px;
  bottom: 90px;
  z-index: 500;
  background: rgba(8, 13, 24, 0.88);
  border: 1px solid var(--line);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(3, 32px);
  gap: 4px;
}
.dpad button {
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dpad button:active {
  background: var(--hz-emerald);
  color: #000;
}

/* Comms Drawer */
.chat-drawer {
  position: absolute;
  bottom: 84px;
  left: 16px;
  right: 16px;
  max-height: 200px;
  background: rgba(14, 22, 38, 0.95);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 550;
  display: none;
  flex-direction: column;
}
.chat-messages {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  max-height: 140px;
}
.chat-msg {
  line-height: 1.3;
}
.chat-msg b {
  font-family: var(--mono);
  color: var(--hz-cyan);
  font-size: 11px;
}
.chat-msg.system {
  color: var(--warning);
  font-style: italic;
}
.chat-input-bar {
  display: flex;
  border-top: 1px solid var(--line);
}
.chat-input-bar input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 8px 12px;
  outline: none;
  font-size: 13px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 9, 17, 0.92);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active {
  display: flex;
}
.snapshot-card {
  width: 100%;
  max-width: 440px;
  background: var(--ink);
  border: 1px solid var(--line);
  padding: 30px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  position: relative;
}
.snapshot-header {
  text-align: center;
  margin-bottom: 20px;
}
.snapshot-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--hz-emerald);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.snapshot-title {
  font-family: var(--head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.stat-box {
  background: var(--ink-2);
  border: 1px solid rgba(0, 229, 163, 0.12);
  padding: 12px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.stat-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* Leaflet Dark Theme Overrides */
.leaflet-container {
  background: #080D18 !important;
}
.leaflet-control-zoom {
  border: 1px solid var(--line) !important;
  background: rgba(8, 13, 24, 0.85) !important;
}
.leaflet-control-zoom a {
  background: var(--ink-2) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--line) !important;
}
.leaflet-control-attribution {
  background: rgba(8, 13, 24, 0.75) !important;
  color: var(--muted) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a {
  color: var(--hz-cyan) !important;
}

/* Custom Leaflet Markers */
.pulse-beacon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #FFF;
  position: relative;
  box-shadow: 0 0 14px var(--danger);
}
.pulse-beacon::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid var(--danger);
  animation: pingRipple 1.6s ease-out infinite;
}
@keyframes pingRipple {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.player-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--hz-emerald);
  border: 2px solid #FFF;
  box-shadow: 0 0 14px var(--hz-emerald);
}

.death-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1B2947;
  border: 1.5px solid var(--danger);
  color: var(--danger);
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Additional Auth, Avatar & Zone Code Styles for HuntZoon */
.auth-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--ink-2);
  border: 2px solid var(--hz-emerald);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 28px var(--hz-emerald-glow);
}
.auth-hero-icon img {
  width: 48px;
  height: 48px;
}

.google-auth-box {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 24px 16px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.btn-google-auth {
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  background: #FFFFFF;
  color: #1F1F1F;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  border: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: all 0.2s var(--ease);
}
.btn-google-auth:hover {
  background: #F1F3F4;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 229, 255, 0.3);
}

.nav-user-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--hz-emerald);
  object-fit: cover;
}
.nav-signout-btn {
  background: transparent;
  border: 1px solid rgba(255, 42, 109, 0.4);
  color: #FF5A8D;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-signout-btn:hover {
  background: rgba(255, 42, 109, 0.2);
  border-color: var(--danger);
}

/* Zone Code Share Banner */
.zone-code-box {
  background: var(--ink-2);
  border: 2px solid var(--hz-emerald);
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 30px var(--hz-emerald-glow);
  margin-bottom: 16px;
}
.zone-code-val {
  font-family: var(--mono);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--hz-cyan);
  text-shadow: 0 0 16px var(--hz-cyan-glow);
  margin: 8px 0;
}
.zone-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--hz-emerald);
  color: #04100B;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s var(--ease);
  pointer-events: none;
}
.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}
