/* Mustardo Time — neon cyber-grid UI */

:root {
  --mustard: #ffd23f;
  --cyan: #00f0ff;
  --bg: #05060a;
  --panel: rgba(10, 12, 22, 0.92);
  --line: rgba(0, 240, 255, 0.25);
  --text: #d8f4ff;
  --danger: #ff3b3b;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Consolas', monospace;
  user-select: none;
}

#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.overlay { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hidden { display: none !important; }

/* ============ MENU ============ */

#menu {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(0, 240, 255, 0.06), transparent 70%),
    linear-gradient(rgba(0,240,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 100%, 40px 40px, 40px 40px, 100% 100%;
}

.menu-box {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.15), inset 0 0 30px rgba(0, 240, 255, 0.03);
  padding: 40px 48px;
  min-width: 420px;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.logo {
  font-size: 42px; letter-spacing: 6px; font-weight: 900;
  color: var(--mustard);
  text-shadow: 0 0 18px rgba(255, 210, 63, 0.6);
}
.logo-accent { color: var(--cyan); text-shadow: 0 0 18px rgba(0, 240, 255, 0.6); }
.tagline { color: rgba(216,244,255,0.55); letter-spacing: 4px; font-size: 12px; margin: 6px 0 18px; text-transform: uppercase; }
.lobby-info { font-size: 12px; color: var(--cyan); min-height: 18px; margin-bottom: 14px; letter-spacing: 1px; }

.menu-page { display: flex; flex-direction: column; gap: 10px; }

.menu-btn {
  pointer-events: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit; font-size: 16px; letter-spacing: 3px;
  padding: 12px; cursor: pointer;
  transition: all 0.15s;
}
.menu-btn:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 240, 255, 0.35); color: #fff; }
.menu-btn.primary { border-color: var(--mustard); color: var(--mustard); }
.menu-btn.primary:hover { box-shadow: 0 0 16px rgba(255, 210, 63, 0.45); }
.menu-btn.back { font-size: 12px; opacity: 0.7; }

.field-label { display: block; text-align: left; font-size: 11px; letter-spacing: 2px; color: rgba(216,244,255,0.6); margin-top: 8px; }

#name-input {
  background: rgba(0,0,0,0.5); border: 1px solid var(--line);
  color: #fff; font: inherit; font-size: 18px; padding: 10px 12px; text-align: center;
  letter-spacing: 2px; outline: none;
}
#name-input:focus { border-color: var(--mustard); }

.color-picker { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 6px 0; }
.color-swatch {
  width: 36px; height: 36px; cursor: pointer;
  border: 2px solid transparent; border-radius: 4px;
  transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 12px currentColor; }

.error-text { color: var(--danger); font-size: 13px; min-height: 16px; }

.help-content { text-align: left; font-size: 13px; line-height: 1.7; }
.help-content b { color: var(--mustard); }

.stats-content { text-align: left; font-size: 14px; line-height: 2; }
.stats-content .stat-row { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(0,240,255,0.08); }
.stats-content .stat-val { color: var(--mustard); }

input[type="range"] { width: 100%; accent-color: var(--mustard); }
select {
  background: rgba(0,0,0,0.5); border: 1px solid var(--line); color: var(--text);
  font: inherit; padding: 8px;
}
.check-label { font-size: 13px; display: block; text-align: left; margin-top: 8px; }

h2 { letter-spacing: 4px; font-size: 18px; color: var(--cyan); margin-bottom: 8px; }

/* ============ HUD ============ */

#radar-wrap { position: absolute; top: 18px; left: 18px; }
#radar { border-radius: 50%; box-shadow: 0 0 18px rgba(0, 240, 255, 0.25); }

#match-timer {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font-size: 26px; font-weight: bold; letter-spacing: 3px;
  color: var(--mustard); text-shadow: 0 0 10px rgba(255, 210, 63, 0.6);
}
#match-timer.urgent { color: var(--danger); text-shadow: 0 0 10px rgba(255,59,59,0.7); }

#killfeed {
  position: absolute; top: 18px; right: 18px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
  font-size: 13px;
}
.kf-entry {
  background: rgba(5, 6, 10, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 4px 10px;
  animation: kf-in 0.15s ease-out;
  transition: opacity 0.5s;
}
.kf-entry.fading { opacity: 0; }
@keyframes kf-in { from { transform: translateX(20px); opacity: 0; } }

#announcements {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  text-align: center;
}
.announce {
  font-size: 30px; font-weight: 900; letter-spacing: 6px;
  color: var(--mustard); text-shadow: 0 0 20px rgba(255, 210, 63, 0.8);
  animation: ann-in 0.2s ease-out;
}
.announce.kind-streak, .announce.kind-multikill { color: var(--danger); text-shadow: 0 0 20px rgba(255,59,59,0.8); }
.announce.kind-time { color: var(--cyan); font-size: 22px; text-shadow: 0 0 16px rgba(0,240,255,0.8); }
@keyframes ann-in { from { transform: scale(1.6); opacity: 0; } }

#crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.ch-dot {
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--mustard); box-shadow: 0 0 6px var(--mustard), 0 0 2px #000;
}
.ch-ring {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--mustard);
  box-shadow: 0 0 5px rgba(255, 210, 63, 0.6), inset 0 0 4px rgba(0,0,0,0.5);
  transition: transform 0.12s ease-out;
}
#crosshair.kick .ch-ring { transform: scale(1.55); transition: transform 0.03s; }

#hitmarker {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 26px; color: #fff; opacity: 0;
  text-shadow: 0 0 8px var(--mustard);
}
#hitmarker.show { animation: hm 0.25s ease-out; }
@keyframes hm { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1.4); } 100% { opacity: 0; } }

#damage-vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 30, 30, 0.45) 100%);
  transition: opacity 0.4s;
}

#hud-bottom {
  position: absolute; bottom: 20px; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 30px;
}

#hp-block { display: flex; align-items: center; gap: 12px; }
#hp-bar-wrap {
  width: 220px; height: 14px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.5);
}
#hp-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--mustard));
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  transition: width 0.15s;
}
#hp-num { font-size: 26px; font-weight: bold; color: var(--cyan); text-shadow: 0 0 8px rgba(0,240,255,0.6); }

#weapon-block { text-align: right; }
#weapon-name { font-size: 14px; letter-spacing: 3px; color: rgba(216,244,255,0.7); }
#ammo { font-size: 32px; font-weight: bold; color: var(--mustard); text-shadow: 0 0 10px rgba(255,210,63,0.5); }
#ammo.low { color: var(--danger); }
.ammo-sep { opacity: 0.4; margin: 0 4px; font-size: 22px; }
#ammo-reserve { font-size: 20px; opacity: 0.8; }
#grenade-count { font-size: 14px; color: var(--cyan); }
#weapon-slots { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.wslot {
  font-size: 11px; padding: 3px 8px;
  border: 1px solid rgba(0,240,255,0.2); color: rgba(216,244,255,0.5);
}
.wslot.active { border-color: var(--mustard); color: var(--mustard); box-shadow: 0 0 8px rgba(255,210,63,0.3); }

#pickup-prompt {
  position: absolute; bottom: 32%; left: 50%; transform: translateX(-50%);
  font-size: 16px; letter-spacing: 2px;
  background: rgba(5,6,10,0.8); border: 1px solid var(--mustard);
  color: var(--mustard); padding: 8px 18px;
  box-shadow: 0 0 14px rgba(255,210,63,0.3);
}

#reload-hint {
  position: absolute; bottom: 27%; left: 50%; transform: translateX(-50%);
  font-size: 14px; letter-spacing: 3px; color: var(--cyan);
  animation: blink 0.6s infinite alternate;
}
@keyframes blink { to { opacity: 0.4; } }

#respawn-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(5, 6, 10, 0.55);
}
#death-text {
  font-size: 52px; font-weight: 900; letter-spacing: 10px;
  color: var(--danger); text-shadow: 0 0 30px rgba(255,59,59,0.8);
}
#respawn-timer { font-size: 20px; color: var(--text); margin-top: 12px; letter-spacing: 2px; }

#spectator-overlay {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
#spectating-name {
  font-size: 20px; letter-spacing: 3px; color: var(--cyan);
  text-shadow: 0 0 12px rgba(0,240,255,0.6);
}
.spec-hint { font-size: 12px; color: rgba(216,244,255,0.55); margin-top: 4px; }

#scoreboard, #match-results {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(0,240,255,0.2);
  padding: 24px 34px; min-width: 480px;
}
#scoreboard h3 { letter-spacing: 3px; color: var(--mustard); margin-bottom: 12px; }
#scoreboard table, #match-results table { width: 100%; border-collapse: collapse; font-size: 14px; }
#scoreboard th, #match-results th {
  text-align: left; font-size: 11px; letter-spacing: 2px;
  color: rgba(216,244,255,0.5); padding: 4px 10px;
  border-bottom: 1px solid var(--line);
}
#scoreboard td, #match-results td { padding: 6px 10px; border-bottom: 1px solid rgba(0,240,255,0.07); }

#match-results { text-align: center; pointer-events: auto; }
#results-winner { font-size: 20px; color: var(--mustard); margin: 8px 0 14px; letter-spacing: 2px; }
#results-countdown { margin-top: 14px; font-size: 13px; color: rgba(216,244,255,0.6); }

/* ============ HAT SHOP ============ */

.toggle-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; letter-spacing: 2px; color: rgba(216,244,255,0.7);
  padding: 2px 0 6px; cursor: pointer;
}
.toggle-row input { accent-color: var(--mustard); width: 16px; height: 16px; }

.coin-chip { color: var(--mustard); font-size: 12px; }
.shop-balance { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.shop-balance span { color: var(--mustard); font-weight: bold; }
.shop-hint { opacity: 0.5; font-size: 11px; }

.hat-list { display: flex; flex-direction: column; gap: 8px; }
.hat-row {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); padding: 10px 14px; gap: 10px;
}
.hat-row.owned { border-color: rgba(125, 255, 74, 0.4); }
.hat-row.equipped { border-color: var(--mustard); box-shadow: 0 0 10px rgba(255,210,63,0.25); }
.hat-name { font-size: 14px; letter-spacing: 1px; text-align: left; }
.hat-cost { font-size: 12px; color: var(--mustard); white-space: nowrap; }
.hat-btn {
  pointer-events: auto; background: transparent; border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 11px; letter-spacing: 2px;
  padding: 6px 12px; cursor: pointer;
}
.hat-btn:hover { border-color: var(--cyan); }
.hat-btn:disabled { opacity: 0.35; cursor: default; }

#coin-count { font-size: 14px; color: var(--mustard); }

/* ============ MOBILE TOUCH CONTROLS ============ */

#touch-controls {
  position: fixed; inset: 0; z-index: 15; pointer-events: none;
  user-select: none; -webkit-user-select: none;
}
#look-zone {
  position: absolute; top: 0; right: 0; width: 55%; height: 100%;
  pointer-events: auto; touch-action: none;
}
#joy-zone {
  position: absolute; left: 0; bottom: 0; width: 45%; height: 55%;
  pointer-events: auto; touch-action: none;
}
#joy-base {
  position: absolute; left: 34px; bottom: 44px;
  width: 116px; height: 116px; border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.4);
  background: rgba(5, 6, 10, 0.35);
}
#joy-knob {
  position: absolute; left: 50%; top: 50%; margin: -26px 0 0 -26px;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0, 240, 255, 0.35);
  border: 2px solid var(--cyan);
}
.tc-btn {
  position: absolute; pointer-events: auto; touch-action: none;
  border-radius: 50%; border: 2px solid rgba(255, 210, 63, 0.55);
  background: rgba(5, 6, 10, 0.45); color: var(--mustard);
  font: inherit; font-size: 13px; letter-spacing: 1px;
}
.tc-btn:active, .tc-btn.active { background: rgba(255, 210, 63, 0.3); }
#tc-fire { right: 26px; bottom: 60px; width: 92px; height: 92px; font-size: 16px; }
#tc-aim { right: 130px; bottom: 40px; width: 64px; height: 64px; border-color: rgba(0,240,255,0.55); color: var(--cyan); }
#tc-jump { right: 40px; bottom: 168px; width: 64px; height: 64px; }
#tc-reload { right: 200px; bottom: 120px; width: 48px; height: 48px; }
#tc-grenade { right: 152px; bottom: 172px; width: 48px; height: 48px; }
#tc-pickup { right: 220px; bottom: 44px; width: 48px; height: 48px; border-color: rgba(125,255,74,0.55); color: #7dff4a; }
#tc-swap { right: 96px; bottom: 236px; width: 48px; height: 48px; }
#tc-menu { left: 16px; top: 210px; width: 42px; height: 42px; }

#connection-status {
  position: fixed; bottom: 12px; left: 12px; z-index: 20;
  font-size: 12px; color: var(--danger); letter-spacing: 2px;
}

/* ================================================================
   Y2K SKIN — chrome, gloss, bubbles. Overrides the base theme.
   ================================================================ */

:root {
  --y2k-pink: #ff4fd8;
  --y2k-aqua: #00d5ff;
  --y2k-lime: #aaff00;
  --y2k-chrome-hi: #f4f9ff;
  --y2k-chrome-lo: #8fa3bd;
}

html, body {
  font-family: 'Trebuchet MS', Verdana, 'Segoe UI', sans-serif;
}

/* --- menu: chrome bubble panel over a starburst sky --- */
#menu {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 79, 216, 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0, 213, 255, 0.16), transparent 45%),
    repeating-conic-gradient(from 0deg at 50% 40%, rgba(255,255,255,0.045) 0deg 4deg, transparent 4deg 14deg),
    linear-gradient(180deg, #101a33 0%, #0a0f22 55%, #131033 100%);
}

.menu-box {
  border: 2px solid var(--y2k-chrome-hi);
  border-radius: 26px;
  background: linear-gradient(180deg, #45577a 0%, #1b2440 18%, #0c1226 100%);
  box-shadow:
    0 0 34px rgba(255, 79, 216, 0.35),
    0 0 60px rgba(0, 213, 255, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 18px 30px rgba(255, 255, 255, 0.08);
  position: relative;
}
.menu-box::before {
  content: '✦';
  position: absolute; top: 10px; left: 18px;
  color: var(--y2k-pink); font-size: 18px;
  text-shadow: 0 0 8px var(--y2k-pink);
}
.menu-box::after {
  content: '✦';
  position: absolute; bottom: 12px; right: 20px;
  color: var(--y2k-aqua); font-size: 14px;
  text-shadow: 0 0 8px var(--y2k-aqua);
}

.logo {
  font-style: italic;
  background: linear-gradient(180deg, #ffffff 8%, #d9e6f5 38%, #7f93ad 50%, #eaf4ff 62%, #9fb4cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 rgba(20, 30, 55, 0.9)) drop-shadow(0 0 14px rgba(0, 213, 255, 0.55));
}
.logo-accent {
  background: linear-gradient(180deg, #ffe9a8 5%, var(--mustard) 45%, #ff8a3d 55%, #ffd97a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.tagline { color: var(--y2k-pink); text-shadow: 0 0 8px rgba(255, 79, 216, 0.6); }
.tagline::before { content: '★ '; }
.tagline::after { content: ' ★'; }

.menu-btn {
  border-radius: 999px;
  border: 2px solid rgba(216, 226, 238, 0.8);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.08) 42%,
                    rgba(0,0,0,0.28) 58%, rgba(255,255,255,0.06) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 6px rgba(0,0,0,0.45);
}
.menu-btn:hover {
  border-color: var(--y2k-pink);
  box-shadow: 0 0 16px rgba(255, 79, 216, 0.55), inset 0 1px 0 rgba(255,255,255,0.7);
  color: #fff;
}
.menu-btn.primary { border-color: var(--mustard); }
.menu-btn.back { border-radius: 999px; }

#name-input { border-radius: 999px; }
select { border-radius: 10px; }
.color-swatch { border-radius: 50%; }
.hat-row { border-radius: 16px; }
.hat-btn { border-radius: 999px; }

/* --- HUD: glossy rounded plates --- */
#match-timer {
  background: linear-gradient(180deg, rgba(69, 87, 122, 0.85), rgba(12, 18, 38, 0.85));
  border: 2px solid rgba(216, 226, 238, 0.75);
  border-radius: 999px;
  padding: 4px 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 0 14px rgba(0, 213, 255, 0.3);
}

.kf-entry {
  border-radius: 999px;
  border: 1px solid rgba(216, 226, 238, 0.5);
  background: linear-gradient(180deg, rgba(58, 72, 100, 0.85), rgba(10, 14, 28, 0.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

#hp-bar-wrap {
  border-radius: 999px;
  border: 2px solid rgba(216, 226, 238, 0.7);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}
#hp-bar { background: linear-gradient(90deg, var(--y2k-aqua), var(--y2k-pink)); }

#scoreboard, #match-results {
  border-radius: 22px;
  border: 2px solid var(--y2k-chrome-hi);
  background: linear-gradient(180deg, #45577a 0%, #1b2440 20%, #0c1226 100%);
  box-shadow: 0 0 34px rgba(255, 79, 216, 0.3), inset 0 2px 0 rgba(255,255,255,0.5);
}

.announce {
  background: linear-gradient(180deg, #ffffff 10%, #cfe0f2 45%, #8fa3bd 52%, #eaf4ff 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(255, 79, 216, 0.8)) drop-shadow(0 2px 0 rgba(10, 15, 30, 0.9));
}
.announce.kind-time { filter: drop-shadow(0 0 12px rgba(0, 213, 255, 0.9)) drop-shadow(0 2px 0 rgba(10, 15, 30, 0.9)); font-size: 22px; }

#pickup-prompt { border-radius: 999px; }
#reload-hint { color: var(--y2k-aqua); }
.wslot { border-radius: 999px; }
#grenade-count, #coin-count { text-shadow: 0 0 6px rgba(0, 213, 255, 0.5); }

/* --- restart vote panel --- */
#vote-panel {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%);
  pointer-events: auto;
  text-align: center;
  padding: 12px 26px;
  border-radius: 20px;
  border: 2px solid var(--y2k-chrome-hi);
  background: linear-gradient(180deg, #45577a 0%, #1b2440 22%, #0c1226 100%);
  box-shadow: 0 0 24px rgba(255, 79, 216, 0.4), inset 0 2px 0 rgba(255,255,255,0.5);
}
#vote-question { font-size: 15px; letter-spacing: 1px; color: #fff; }
#vote-counts { font-size: 13px; color: var(--y2k-aqua); margin: 4px 0; }
#vote-buttons { display: flex; gap: 10px; justify-content: center; margin: 6px 0; }
#vote-buttons button {
  pointer-events: auto; cursor: pointer;
  font: inherit; font-size: 13px; letter-spacing: 2px;
  padding: 6px 20px; border-radius: 999px;
  border: 2px solid rgba(216, 226, 238, 0.8); color: #0c1226; font-weight: bold;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 5px rgba(0,0,0,0.4);
}
#vote-yes { background: linear-gradient(180deg, #d6ff8a, var(--y2k-lime) 55%, #7dc400); }
#vote-no { background: linear-gradient(180deg, #ffb3ec, var(--y2k-pink) 55%, #d426ae); }
#vote-hint { font-size: 11px; color: rgba(216, 244, 255, 0.6); }
