/**
 * Generated by Muse
 * Date: 2026-10-05
 * Version: 2.0.0
 * Description: TURF client styling v2. Fullscreen Three.js street view,
 * GTA-style circular minimap, floating HUD, touch joystick, fire button.
 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #05050a; }
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #f2f2f7;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
  inset: 0;
}
.hidden { display: none !important; }

#scene { position: fixed; inset: 0; }
#scene canvas { display: block; }

/* GTA-style minimap */
#map {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 62px);
  right: 10px;
  width: 132px; height: 132px;
  border-radius: 50%;
  border: 2px solid #ffffff44;
  box-shadow: 0 4px 18px #000c;
  overflow: hidden;
  z-index: 12;
}
#map .maplibregl-ctrl-attrib { display: none; }

/* ---------- player markers (minimap) ---------- */
.pmarker { position: relative; width: 30px; height: 30px; }
.pmarker .dot {
  position: absolute; left: 50%; top: 50%;
  width: 13px; height: 13px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--c);
  border: 2px solid #fff;
  box-shadow: 0 0 8px var(--c);
}
.pmarker .nametag { display: none; }
.pmarker.wanted .dot { animation: wantedpulse 0.9s infinite; }
@keyframes wantedpulse {
  0%, 100% { box-shadow: 0 0 8px var(--c); }
  50% { box-shadow: 0 0 16px #ff2222; }
}
.pmarker.dead { opacity: .35; filter: grayscale(1); }

/* ---------- pickup markers (minimap) ---------- */
.kmarker {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 10px; color: #0a0a0f;
}
.kmarker.cash { background: #9dff6e; box-shadow: 0 0 8px #9dff6e; }
.kmarker.smg, .kmarker.rifle { background: #ffd166; box-shadow: 0 0 8px #ffd166; }
.kmarker.medkit { background: #ff5a3c; box-shadow: 0 0 8px #ff5a3c; color: #fff; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud button { pointer-events: auto; }
#topbar {
  position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 8px; right: 8px;
  display: flex; align-items: center; gap: 10px;
  background: #0a0a0fcc; border: 1px solid #ffffff22; border-radius: 12px;
  padding: 8px 12px; backdrop-filter: blur(6px);
  font-weight: 700; font-size: 14px;
}
#hpwrap { flex: 1; height: 18px; background: #22222e; border-radius: 9px; position: relative; overflow: hidden; min-width: 90px; }
#hpbar { height: 100%; width: 100%; border-radius: 9px; transition: width .2s; }
#hptext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }
#cash { color: #9dff6e; }
#wanted { letter-spacing: 2px; font-size: 13px; }
#weapon { color: #ffd166; font-size: 12px; }

#killfeed {
  position: absolute; top: calc(env(safe-area-inset-top) + 150px); left: 8px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  max-width: 62vw;
}
.feedmsg {
  background: #0a0a0fd9; border-radius: 8px; padding: 5px 10px;
  font-size: 12px; font-weight: 600;
  transition: opacity 2s;
}
.feedmsg.kill { border-left: 3px solid #ff5a3c; }
.feedmsg.info { border-left: 3px solid #7dd7ff; }
.feedmsg.fade { opacity: 0; }

#actions { position: absolute; top: calc(env(safe-area-inset-top) + 58px); left: 8px; display: flex; flex-direction: column; gap: 8px; }
.roundbtn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #ffffff33; background: #0a0a0fcc; color: #fff;
  font-size: 18px; font-weight: 800; backdrop-filter: blur(6px);
}
.roundbtn:active { transform: scale(.92); }

#btnFire {
  position: absolute; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 120px);
  width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid #ff8a7a; background: radial-gradient(circle at 35% 30%, #ff8a7a, #c22e1f);
  color: #fff; font-weight: 900; font-size: 17px; letter-spacing: .08em;
  box-shadow: 0 0 24px #ff5a3c88;
}
#btnFire:active { transform: scale(.93); }
#btnSteal, #btnExitCar {
  position: absolute; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 224px);
  width: 64px; height: 64px; border-radius: 50%; font-size: 28px;
  border: 2px solid #ffd166; background: radial-gradient(circle at 35% 30%, #3a3a4a, #1c1c26);
  box-shadow: 0 0 16px #ffd16655;
}
#btnSteal:active, #btnExitCar:active { transform: scale(.93); }

#stick {
  position: absolute; left: 18px; bottom: calc(env(safe-area-inset-bottom) + 24px);
  width: 128px; height: 128px; border-radius: 50%;
  border: 2px solid #ffffff2e; background: #ffffff0d; backdrop-filter: blur(4px);
  pointer-events: auto;
}
#nub {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px; border-radius: 50%;
  margin: -28px 0 0 -28px;
  background: radial-gradient(circle at 35% 30%, #ffffff66, #ffffff18);
  border: 2px solid #ffffff55;
}

#board {
  position: absolute; top: 20%; left: 8%; right: 8%;
  background: #0d0d16f5; border: 1px solid #ffffff2c; border-radius: 14px;
  padding: 16px; pointer-events: auto; z-index: 30;
}
#board h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: .2em; color: #ffd166; text-align: center; }
#boardList { margin: 0; padding: 0 0 0 4px; list-style: none; }
#boardList li {
  display: flex; justify-content: space-between;
  padding: 7px 4px; border-bottom: 1px solid #ffffff14; font-size: 14px; font-weight: 600;
}
#btnCloseBoard {
  display: block; margin: 12px auto 0; padding: 10px 26px; border-radius: 999px;
  border: 1px solid #ffffff33; background: #ffffff12; color: #fff; font-weight: 800;
}

/* ---------- overlays ---------- */
#entry {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(1000px 600px at 50% 20%, #2b1040cc, #0a0a0f),
              #0a0a0f;
  padding: 24px; text-align: center;
}
#entry h1 {
  font-size: 64px; margin: 0; letter-spacing: .3em; text-indent: .3em; font-weight: 900;
  background: linear-gradient(100deg, #ff5a3c, #ffd166, #7dd7ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px #ff5a3c44;
}
#entry .tag { color: #9a93b8; letter-spacing: .12em; margin: 4px 0 26px; font-size: 14px; }
#nameInput {
  width: min(78vw, 320px); padding: 14px 18px; font-size: 17px; text-align: center;
  border-radius: 12px; border: 1px solid #ffffff2e; background: #ffffff0d; color: #fff;
  margin-bottom: 14px; font-weight: 700;
}
#btnJoin {
  padding: 15px 44px; font-size: 17px; font-weight: 900; letter-spacing: .1em;
  border: none; border-radius: 999px; color: #fff; cursor: pointer;
  background: linear-gradient(100deg, #c22e1f, #ff5a3c);
  box-shadow: 0 8px 28px #ff5a3c55;
}
#btnJoin:disabled { opacity: .6; }
#entry .fine { margin-top: 26px; color: #6a6585; font-size: 12px; line-height: 1.7; }

#wasted {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #0a0a0fb8;
}
#wastedText {
  font-size: min(22vw, 110px); font-weight: 900; letter-spacing: .1em;
  color: #c22e1f; text-shadow: 0 0 40px #ff222288;
  animation: wastedin .5s ease-out;
}
@keyframes wastedin { from { transform: scale(1.6); opacity: 0; } }
#respawnIn { margin-top: 10px; color: #9a93b8; font-weight: 700; }

#toast {
  position: fixed; bottom: calc(env(safe-area-inset-bottom) + 170px); left: 50%;
  transform: translateX(-50%); z-index: 45;
  background: #0a0a0fee; border: 1px solid #ffd16688; color: #ffd166;
  padding: 10px 20px; border-radius: 999px; font-weight: 800; font-size: 15px;
  white-space: nowrap;
}

#loading {
  position: fixed; inset: 0; z-index: 48;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #05050ad9; color: #9a93b8; font-weight: 700; letter-spacing: .1em;
}
#loading .spin {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid #ffffff22; border-top-color: #ff5a3c;
  animation: spin 0.9s linear infinite; margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
