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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #021024;
  font-family: 'Segoe UI', 'Arial Black', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   AUTH / LOGIN MODAL & PAUSE DRAWER
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(6, 40, 82, 0.72) 0%, rgba(2, 12, 27, 0.92) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  pointer-events: auto;
}

.auth-card, .pause-card {
  width: 100%;
  max-width: 620px;
  max-height: 94vh;
  overflow-y: auto;
  background: rgba(9, 28, 52, 0.94);
  border: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(14, 165, 233, 0.25);
}

.form-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.species-card {
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

.species-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.55);
}

.species-card.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: #fde047;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
}

.species-thumb {
  width: 100%;
  height: 54px;
  border-radius: 8px;
  background-color: #ffffff;
  background-size: 200% 200%;
  background-position: 0% 0%;
  background-repeat: no-repeat;
  margin-bottom: 5px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.15);
}

.species-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.species-sub {
  font-size: 10px;
  color: #bae6fd;
  margin-top: 2px;
  line-height: 1.2;
}

.hs-eco-pill {
  margin-top: 4px;
  background: rgba(6, 78, 59, 0.82);
  border: 1.5px solid #34d399;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.pause-card {
  max-width: 640px;
}

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

.brand-logo {
  font-size: 46px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.brand-header h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.brand-header h1 span {
  color: #38bdf8;
}

.subtitle {
  color: #94a3b8;
  font-size: 13.5px;
  margin-top: 2px;
}

.account-banner {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.account-banner.neutral {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

.account-banner.returning {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.account-banner.new-user {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 15px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.form-group input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s;
}

.color-swatch.active {
  border-color: #ffffff;
  transform: scale(1.16);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
}

.auth-error {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.play-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.45);
  margin-top: 6px;
}

/* ============================================================================
   AUTHENTIC HUNGRY SHARK ARCADE HUD (1:1 MATCH TO SCREENSHOT)
   ============================================================================ */
.hs-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

/* 1. TOP-LEFT: STAR SCORE & STOPWATCH */
.hs-top-left {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.hs-star-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}

.hs-score-num {
  font-size: 30px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7), 0 0 2px #000;
  letter-spacing: 0.5px;
}

.hs-timer-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 3px;
}

.hs-clock-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.hs-timer-num {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* 2. TOP-CENTER: FLOATING ARCADE COMBO (X2 / X3) */
.hs-combo {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: 46px;
  font-weight: 900;
  color: #f59e0b;
  background: linear-gradient(180deg, #fde047 0%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #78350f) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
  letter-spacing: -1px;
}

/* 3. TOP-RIGHT: GREEN HP BAR, RED FIN BOOST BAR, PAUSE HEXAGON & COINS/GEMS */
.hs-top-right {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hs-bars-and-pause {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hs-bars-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.hs-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(6, 54, 77, 0.72);
  border: 2px solid rgba(14, 116, 144, 0.65);
  border-radius: 14px 6px 6px 14px;
  padding: 4px 14px 4px 8px;
  transform: skewX(-18deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.hp-wrapper {
  width: 245px;
  height: 24px;
}

.boost-wrapper {
  width: 118px;
  height: 22px;
}

.hs-bar-track {
  width: 100%;
  height: 100%;
  background: rgba(3, 28, 44, 0.85);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.hs-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.16s ease;
}

.green-fill {
  background: linear-gradient(180deg, #a3e635 0%, #65a30d 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.45);
}

.red-fill {
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.4);
}

.hs-lvl-label {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%) skewX(18deg);
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.5px;
}

.hs-bar-end-icon {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%) skewX(18deg);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.hs-bar-end-icon svg {
  width: 24px;
  height: 24px;
}

/* Hexagonal Cyan Pause Button (||) */
.hs-pause-hex {
  pointer-events: auto;
  width: 46px;
  height: 46px;
  background: linear-gradient(180deg, #67e8f9 0%, #0284c7 100%);
  border: 3px solid #bae6fd;
  border-radius: 13px;
  color: #082f49;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 #0369a1, 0 8px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s;
}

.hs-pause-hex:hover {
  transform: scale(1.06);
}

.hs-pause-hex:active {
  transform: translateY(3px);
}

/* Currency Rows (Coins & Gems below bars) */
.hs-currency-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}

.hs-currency-num {
  font-size: 21px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.75);
}

.hs-coin-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef08a, #f59e0b 65%, #b45309);
  border: 2px solid #fde047;
  color: #78350f;
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.hs-gem-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #86efac 0%, #16a34a 60%, #065f46 100%);
  border: 2px solid #bbf7d0;
  color: #ffffff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

/* 4. BOTTOM-LEFT: NAUTICAL COMPASS & VIRTUAL JOYSTICK RING */
.hs-bottom-left {
  position: absolute;
  bottom: 22px;
  left: 26px;
  display: flex;
  align-items: flex-end;
  gap: 28px;
}

.hs-compass {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #f8fafc 0%, #e2e8f0 70%, #94a3b8 100%);
  border: 5px solid #0c4a6e;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-compass::before {
  content: '';
  position: absolute;
  top: -9px;
  width: 12px;
  height: 6px;
  border-radius: 4px;
  background: #0c4a6e;
}

.hs-compass-needle {
  width: 8px;
  height: 32px;
  background: linear-gradient(180deg, #0284c7 0%, #0284c7 50%, #64748b 50%, #64748b 100%);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  transition: transform 0.15s ease;
}

.hs-joystick-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.16) 0%, rgba(14, 165, 233, 0.08) 70%, transparent 100%);
  border: 1.5px solid rgba(186, 230, 253, 0.22);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-joy-arrow {
  position: absolute;
  font-size: 11px;
  color: rgba(224, 242, 254, 0.55);
}
.hs-joy-arrow.up { top: 6px; }
.hs-joy-arrow.down { bottom: 6px; }
.hs-joy-arrow.left { left: 7px; }
.hs-joy-arrow.right { right: 7px; }

.hs-joy-arc {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px #f59e0b);
}

/* 5. BOTTOM-CENTER: SLANTED GOLD RUSH BAR */
.hs-bottom-center {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.hs-goldrush-wrapper {
  position: relative;
  width: 340px;
  max-width: 65vw;
  height: 26px;
  background: rgba(6, 54, 77, 0.78);
  border: 2px solid rgba(14, 116, 144, 0.65);
  border-radius: 8px 14px 14px 8px;
  padding: 4px 8px 4px 18px;
  transform: skewX(-18deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.hs-gold-medallion {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%) skewX(18deg);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef08a, #f59e0b 68%, #b45309);
  border: 2.5px solid #fde047;
  color: #78350f;
  font-size: 17px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.hs-gold-track {
  width: 100%;
  height: 100%;
  background: rgba(3, 28, 44, 0.9);
  border-radius: 8px;
  overflow: hidden;
}

.hs-gold-fill {
  height: 100%;
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 55%, #d97706 100%);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.85);
  transition: width 0.2s ease;
}

/* 6. COMPACT SONAR MINIMAP (BOTTOM-RIGHT) */
.hs-minimap-panel {
  position: absolute;
  bottom: 18px;
  right: 20px;
  background: rgba(6, 40, 65, 0.65);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 6px 8px;
  pointer-events: auto;
}

.minimap-header {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #bae6fd;
  font-weight: 700;
  margin-bottom: 4px;
}

#minimapCanvas {
  display: block;
  border-radius: 8px;
  background: linear-gradient(180deg, #06b6d4 0%, #0284c7 35%, #0c4a6e 80%, #041326 100%);
}

/* 7. PAUSE / MULTIPLAYER DRAWER MODAL */
.pause-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.resume-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.pause-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.action-pill {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.safe-pill {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}

.pause-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pause-col {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 12px;
  padding: 10px;
}

.lb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.lb-tab {
  flex: 1;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}

.lb-tab.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: rgba(56, 189, 248, 0.55);
  color: #fff;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.lb-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
}

.chat-messages {
  height: 145px;
  overflow-y: auto;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  font-size: 12.5px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.chat-form button {
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Kill Feed & Center Banner */
.kill-feed-container {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.kill-item {
  background: rgba(6, 40, 65, 0.72);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  color: #e0f2fe;
}

.center-banner {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(6, 40, 65, 0.9);
  border: 2px solid #fde047;
  padding: 14px 24px;
  border-radius: 16px;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

@media (max-width: 768px) {
  .pause-grid { grid-template-columns: 1fr; }
  .hs-minimap-panel { display: none; }
}
