:root {
  --gold: #ffcc4d; --gold2: #b8781a; --red: #ff2a1a; --ink: #0b0806; --hud: rgba(10, 8, 6, .55); --txt: #f6efe2;
  --font: 'Oswald', system-ui, sans-serif; --display: 'Bangers', 'Impact', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; color: var(--txt); font-family: var(--font); user-select: none; -webkit-user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; }
.hidden { display: none !important; }

/* ---------- titles ---------- */
.gold { background: linear-gradient(180deg, #fff4b8 0%, #ffd34d 30%, #c47a12 62%, #ffde72 78%, #8a4b05 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #4a1e02; filter: drop-shadow(0 4px 0 #7a1a05) drop-shadow(0 8px 14px rgba(0,0,0,.7)); }
.red { color: #ff2a1a; font-family: 'Permanent Marker', cursive; transform: rotate(-4deg); filter: drop-shadow(0 3px 0 #3a0000) drop-shadow(0 0 18px rgba(255,40,10,.6)); }
.ltitle, .mtitle { display: flex; flex-direction: column; align-items: center; font-family: var(--display); line-height: .86; letter-spacing: 2px; }
.ltitle .gold, .mtitle .gold { font-size: clamp(54px, 10vw, 150px); }
.ltitle .red, .mtitle .red { font-size: clamp(40px, 7vw, 104px); margin-top: -6px; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; z-index: 50;
  background: radial-gradient(ellipse at 50% 120%, #ff7a1a 0%, #7a1d08 35%, #1a0805 70%, #000 100%); }
.lbar { width: min(520px, 80vw); height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.lbar div { height: 100%; width: 0; background: linear-gradient(90deg, #ffcc4d, #ff5a1a); transition: width .3s; box-shadow: 0 0 12px #ff8a2a; }
.lmsg { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; opacity: .8; }
.ltip { max-width: 600px; text-align: center; font-size: 15px; opacity: .65; padding: 0 20px; min-height: 40px; }

/* ---------- menu ---------- */
#menu { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 40;
  background: linear-gradient(90deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%); align-items: flex-start; padding-left: 7vw; }
#menu .mtitle { align-items: flex-start; }
.mtag { margin: 18px 0 26px 6px; font-size: 18px; letter-spacing: 1px; opacity: .9; text-shadow: 0 2px 6px #000; }
.mbtns { display: flex; flex-direction: column; gap: 6px; }
.mbtns button, .panel button { font-family: var(--font); font-weight: 600; font-size: 24px; letter-spacing: 3px; text-transform: uppercase; color: var(--txt);
  background: none; border: none; text-align: left; padding: 6px 18px 6px 14px; cursor: pointer; border-left: 4px solid transparent; transition: all .12s; text-shadow: 0 2px 8px #000; }
.mbtns button:hover, .mbtns button.sel, .panel button:hover { color: var(--gold); border-left-color: var(--red); background: linear-gradient(90deg, rgba(255,60,20,.25), transparent); padding-left: 22px; }
.mfoot { position: absolute; bottom: 24px; left: 7vw; font-size: 13px; opacity: .6; letter-spacing: 1px; }
#pause { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: flex; flex-direction: column; justify-content: center; padding-left: 8vw; }
.ptitle { font-family: var(--display); font-size: 90px; color: var(--gold); margin-bottom: 20px; letter-spacing: 4px; text-shadow: 0 4px 0 #7a1a05; }
.panel { position: fixed; z-index: 48; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 92vw); max-height: 88vh; overflow: auto;
  background: rgba(14,10,8,.92); border: 1px solid rgba(255,204,77,.25); padding: 30px 34px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.panel h2 { font-family: var(--display); font-size: 46px; color: var(--gold); letter-spacing: 3px; margin-bottom: 18px; }
.panel p { margin-bottom: 14px; line-height: 1.5; opacity: .9; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-bottom: 20px; font-size: 16px; }
.cgrid b { display: inline-block; min-width: 92px; color: var(--gold); }
.panel label { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 17px; }
.panel select, .panel input[type=range] { width: 240px; accent-color: #ff6a1a; }
.panel select { background: #222; color: #fff; border: 1px solid #555; padding: 4px; font-family: var(--font); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#minimapWrap { position: absolute; left: 28px; bottom: 74px; width: 220px; height: 220px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(0,0,0,.7), 0 0 0 5px rgba(255,204,77,.55), 0 10px 30px rgba(0,0,0,.6); background: #1a1714; }
#minimap { width: 100%; height: 100%; }
#mmNorth { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); font-weight: 700; font-size: 13px; color: var(--gold); text-shadow: 0 1px 3px #000; }
#mmArea { position: absolute; bottom: 14px; width: 100%; text-align: center; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 1px 3px #000; opacity: .9; }
#vitals { position: absolute; left: 28px; bottom: 26px; width: 300px; display: flex; flex-direction: column; gap: 5px; }
.bar { position: relative; height: 13px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.18); transform: skewX(-18deg); overflow: hidden; }
.bar .fill { position: absolute; inset: 0; width: 100%; background: linear-gradient(180deg, #7dff6a, #2fa52a); transition: width .12s; z-index: 2; }
.bar .ghost { position: absolute; inset: 0; width: 100%; background: #ffd9a0; transition: width .6s .25s; z-index: 1; }
.bar.low .fill { background: linear-gradient(180deg, #ff6a5a, #c01a0a); animation: pulse .6s infinite alternate; }
.bar.small { height: 8px; width: 220px; }
.bar.small .fill { background: linear-gradient(90deg, #ff9a1a, #ffd34d); }
.bar.small.full .fill { background: linear-gradient(90deg, #ffd34d, #fff6c0); box-shadow: 0 0 10px #ffcc4d; animation: pulse .4s infinite alternate; }
.bar span, #highBar span { position: absolute; right: 8px; top: -2px; font-size: 9px; letter-spacing: 2px; transform: skewX(18deg); z-index: 3; opacity: .85; }
#highBar { position: relative; height: 6px; width: 220px; background: rgba(0,0,0,.5); transform: skewX(-18deg); }
#highBar .fill { position: absolute; inset: 0; background: linear-gradient(90deg, #1aa52a, #ffd700, #e01a0a); }
#highBar span { top: -14px; color: #7dff6a; }
@keyframes pulse { from { opacity: .65 } to { opacity: 1 } }
#heat { position: absolute; right: 30px; top: 24px; display: flex; gap: 6px; font-size: 30px; filter: drop-shadow(0 2px 4px #000); }
#heat i { font-style: normal; opacity: .18; filter: grayscale(1); transition: all .3s; }
#heat i.on { opacity: 1; filter: none; animation: heatpulse 1s infinite; }
#heat.search i.on { animation: blink .5s infinite; }
@keyframes heatpulse { 50% { transform: scale(1.12) } }
@keyframes blink { 50% { opacity: .25 } }
#objective { position: absolute; left: 30px; top: 26px; max-width: 420px; text-shadow: 0 2px 6px rgba(0,0,0,.9); }
#objective .otitle { font-size: 13px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; }
#objective .otext { font-size: 19px; font-weight: 600; margin-top: 2px; }
#objective .odist { font-size: 13px; opacity: .7; }
#weapon { position: absolute; right: 30px; bottom: 28px; text-align: right; text-shadow: 0 2px 6px #000; }
#weapon .wname { font-size: 14px; letter-spacing: 3px; opacity: .8; }
#weapon .ammo { font-size: 36px; font-weight: 700; line-height: 1; }
#weapon .ammo small { font-size: 18px; opacity: .6; }
#weapon .joints { font-size: 14px; color: #7dff6a; letter-spacing: 1px; margin-top: 4px; }
#collect { position: absolute; right: 30px; top: 70px; text-align: right; font-size: 14px; letter-spacing: 1px; text-shadow: 0 2px 4px #000; opacity: .9; line-height: 1.5; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 3px #000; }
#crosshair i:nth-child(1) { left: 14px; top: 0; width: 2px; height: 9px; } #crosshair i:nth-child(2) { left: 14px; bottom: 0; width: 2px; height: 9px; }
#crosshair i:nth-child(3) { top: 14px; left: 0; height: 2px; width: 9px; } #crosshair i:nth-child(4) { top: 14px; right: 0; height: 2px; width: 9px; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; transition: opacity .15s; }
#hitmarker.on { opacity: 1; transition: none; }
#hitmarker::before, #hitmarker::after { content: ''; position: absolute; background: #ff3a2a; left: 12px; top: 0; width: 3px; height: 26px; }
#hitmarker::after { transform: rotate(90deg); }
#combo { position: absolute; right: 12%; top: 38%; font-family: var(--display); font-size: 64px; color: var(--gold); text-shadow: 0 4px 0 #7a1a05, 0 0 20px rgba(255,120,20,.6); transform: rotate(-6deg); opacity: 0; transition: opacity .3s; }
#combo.on { opacity: 1; transition: none; }
#combo small { display: block; font-size: 22px; color: #fff; letter-spacing: 3px; }
#prompt { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); background: rgba(0,0,0,.65); padding: 8px 18px; font-size: 18px; border-left: 3px solid var(--gold); white-space: nowrap; }
#prompt b { display: inline-block; background: var(--gold); color: #000; padding: 0 8px; margin-right: 10px; border-radius: 3px; }
#subtitles { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); width: min(900px, 90vw); text-align: center; font-size: 22px; line-height: 1.35; text-shadow: 0 2px 4px #000, 0 0 12px #000; }
#subtitles .who { color: var(--gold); font-weight: 700; margin-right: 8px; text-transform: uppercase; letter-spacing: 1px; }
#toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); text-align: center; font-size: 20px; text-shadow: 0 2px 6px #000; transition: opacity .4s; opacity: 0; }
#toast.on { opacity: 1; }
#banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; animation: bannerIn .6s ease-out; }
#banner .b1 { font-size: 16px; letter-spacing: 8px; color: var(--gold); text-shadow: 0 2px 6px #000; }
#banner .b2 { font-family: var(--display); font-size: clamp(48px, 7vw, 96px); letter-spacing: 3px; text-shadow: 0 5px 0 #7a1a05, 0 0 30px rgba(0,0,0,.8); color: #fff; }
#banner.win .b2 { color: var(--gold); }
@keyframes bannerIn { from { transform: scale(1.3); opacity: 0; letter-spacing: 30px } }
#bossbar { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); width: min(640px, 70vw); text-align: center; }
#bossbar .bname { font-family: var(--display); font-size: 30px; letter-spacing: 3px; color: #fff; text-shadow: 0 3px 0 #7a1a05; }
#bossbar .bfill { height: 12px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.3); }
#bossbar .bfill div { height: 100%; width: 100%; background: linear-gradient(180deg, #ff5a3a, #9a0a00); transition: width .2s; }
#labels { position: absolute; inset: 0; }
.lbl { position: absolute; transform: translate(-50%, -100%); font-size: 13px; text-shadow: 0 1px 3px #000; white-space: nowrap; text-align: center; }
.lbl .hp { width: 54px; height: 4px; background: rgba(0,0,0,.6); margin: 2px auto 0; } .lbl .hp div { height: 100%; background: #ff3a2a; }
.lbl.warn { font-size: 30px; color: #ff2a1a; font-weight: 700; animation: warn .15s infinite alternate; }
.lbl.warn.blue { color: #3ab0ff; }
@keyframes warn { to { transform: translate(-50%, -100%) scale(1.25) } }
.lbl.name { color: var(--gold); font-weight: 600; letter-spacing: 1px; }
.lbl.dmg { font-family: var(--display); font-size: 26px; color: #ffd34d; animation: dmg .8s forwards; }
.lbl.dmg.crit { color: #ff3a2a; font-size: 34px; }
@keyframes dmg { to { transform: translate(-50%, -220%); opacity: 0 } }
#marker { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: none; text-align: center; }
#marker .mdot { width: 18px; height: 18px; margin: auto; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 10px var(--gold), 0 0 0 3px rgba(0,0,0,.5); }
#marker .mdist { font-size: 12px; margin-top: 6px; text-shadow: 0 1px 3px #000; }
#hint { position: absolute; right: 30px; top: 46%; max-width: 300px; background: rgba(0,0,0,.6); border-right: 3px solid var(--gold); padding: 10px 14px; font-size: 15px; line-height: 1.4; opacity: 0; transition: opacity .4s; text-align: right; }
#hint.on { opacity: 1; }
#hint b { color: var(--gold); }
#fortune { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-2deg); }
#fortune .paper { background: #f6f1e4; color: #2a1a0a; padding: 18px 32px; min-width: 380px; text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.6); animation: bannerIn .4s; }
#fortune .ftitle { font-size: 11px; letter-spacing: 4px; color: #b02a10; }
#fortune .ftext { font-family: Georgia, serif; font-style: italic; font-size: 21px; margin: 8px 0; }
#fortune .fnum { font-size: 12px; opacity: .6; letter-spacing: 2px; }
#bigmap { position: fixed; inset: 0; z-index: 30; background: rgba(8,8,8,.92); }
#bigmapCanvas { width: 100%; height: 100%; cursor: grab; }
.maplegend { position: absolute; left: 24px; top: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; background: rgba(0,0,0,.6); padding: 14px 18px; }
.maplegend b { color: var(--gold); letter-spacing: 2px; margin-bottom: 4px; }
.maplegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.maplegend em { opacity: .6; font-size: 12px; margin-top: 6px; }
#letterbox div { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 20; transition: height .6s; }
#letterbox div:first-child { top: 0; } #letterbox div:last-child { bottom: 0; }
#letterbox.on div { height: 11vh; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 25; transition: opacity .8s; }
#death { position: fixed; inset: 0; z-index: 26; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse, rgba(80,0,0,.2), rgba(0,0,0,.7)); }
#death .d1 { font-family: var(--display); font-size: clamp(70px, 12vw, 170px); color: #c8140a; letter-spacing: 6px; text-shadow: 0 6px 0 #300, 0 0 40px #000; animation: bannerIn 1.2s; }
#death .d2 { font-size: 18px; letter-spacing: 4px; opacity: .7; }
#fps { position: fixed; right: 8px; bottom: 4px; z-index: 60; font: 12px monospace; color: #9f9; text-shadow: 0 1px 2px #000; }
#clickToPlay { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 35; background: rgba(0,0,0,.7); padding: 16px 30px; font-size: 22px; letter-spacing: 3px; border: 1px solid var(--gold); cursor: pointer; }
#err { position: fixed; inset: 20px; z-index: 99; background: #300; color: #fff; padding: 20px; font: 14px monospace; white-space: pre-wrap; overflow: auto; }
@media (max-width: 760px) { #minimapWrap { width: 150px; height: 150px; } #vitals { width: 200px; } .cgrid { grid-template-columns: 1fr; } }
#hud.cine > *:not(#subtitles):not(#banner):not(#toast):not(#labels) { display: none !important; }
#hud.cine #labels { display: none; }
