:root {
  --hud: #ffc23a;
  --hud-dim: rgba(255, 194, 58, 0.75);
  --blue: #5d8dff;
  --red: #ff5a45;
  --bg: #15110c;
  --panel: #1c160f;
  --line: #5a4a2e;
  --text: #f3e6c8;
  --font: 'VT323', ui-monospace, monospace;
  --title: 'Russo One', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 20px; }
body { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

.btn {
  font-family: var(--title); font-size: 15px; letter-spacing: .02em; text-transform: uppercase;
  background: linear-gradient(#5c4a2c, #3e3220); color: var(--text); border: 2px solid #8a7246; border-radius: 3px;
  padding: 9px 14px; cursor: pointer; box-shadow: 0 2px 0 #1a140c;
}
.btn:hover { background: linear-gradient(#6e5934, #4a3b24); border-color: #c09a55; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.hot { background: linear-gradient(#c4651c, #8c4210); border-color: #ffb050; }
.btn.ghost { background: transparent; }
.btn.danger { background: linear-gradient(#7a2a20, #4e1a14); border-color: #b44a3a; }
.btn.big { font-size: 18px; padding: 12px 20px; }
.btn.small { font-size: 12px; padding: 6px 10px; }
.btn.active { border-color: var(--hud); color: var(--hud); }
:not(.overlay).dim { opacity: .7; }
.warn { color: var(--red); }
.t0 { color: var(--blue); }
.t1 { color: var(--red); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 16px; touch-action: pan-y; }
.overlay.dim { background: rgba(10, 8, 5, .72); }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 18px 22px; max-width: 760px; width: 100%; max-height: 100%; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.panel.small { max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.panel.wide { max-width: 900px; }
.panel h2 { font-family: var(--title); font-weight: 400; margin: 0 0 10px; color: var(--hud); letter-spacing: .03em; }
.panel h3 { font-family: var(--title); font-weight: 400; font-size: 16px; margin: 14px 0 6px; }
.panel table { width: 100%; border-collapse: collapse; }
.panel th, .panel td { text-align: left; padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,.07); }
.panel tr.me td { color: var(--hud); }
.panel tr.off td { opacity: .5; }

/* ---------- main menu ---------- */
#menu { align-items: flex-start; background: linear-gradient(rgba(12,9,6,.55), rgba(12,9,6,.85)); }
.menu-inner { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 0 40px; }
.logo { display: block; width: min(640px, 92%); margin: 10px auto 4px; border: 3px solid #000; box-shadow: 0 8px 30px rgba(0,0,0,.6); image-rendering: auto; }
.tagline { text-align: center; color: var(--hud); margin: 8px 0 18px; font-size: 22px; text-shadow: 0 2px 0 #000; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mode-card { background: var(--panel); border: 2px solid var(--line); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; }
.mode-card h3 { font-family: var(--title); font-weight: 400; margin: 0 0 6px; color: var(--hud); font-size: 20px; }
.mode-card p { margin: 0 0 12px; flex: 1; line-height: 1.05; }
.mode-card .btns { display: flex; flex-direction: column; gap: 6px; }
.join-row { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; flex-wrap: wrap; }
.join-row input { font-family: var(--title); font-size: 16px; text-transform: uppercase; letter-spacing: .2em; width: 150px; padding: 8px 10px; background: #0e0b07; color: var(--hud); border: 2px solid var(--line); border-radius: 3px; text-align: center; }
#online-count { text-align: center; color: #7fdc6a; min-height: 22px; }
.info-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; margin-top: 10px; }
.panel-lite { background: rgba(28,22,15,.86); border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; }
.panel-lite h3 { font-family: var(--title); font-weight: 400; font-size: 15px; margin: 0 0 8px; color: var(--hud); }
.panel-lite p { margin: 4px 0; line-height: 1.05; }
#stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#stats-grid div { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.25); padding: 4px; border-radius: 3px; }
#stats-grid b { font-size: 24px; color: var(--hud); }
#stats-grid span { font-size: 15px; opacity: .8; text-align: center; }
#leaderboard { margin: 0; padding: 0; list-style: none; }
#leaderboard li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
#leaderboard li small { grid-column: 1 / -1; opacity: .6; font-size: 15px; }
#leaderboard b { color: var(--hud); }
.controls-help p { font-size: 17px; }
.home-btn { position: fixed; top: 10px; left: 12px; z-index: 25; color: var(--text); text-decoration: none; font-family: var(--title); font-size: 13px; background: rgba(0,0,0,.5); padding: 6px 10px; border-radius: 3px; }
#account-wrap { position: fixed; top: 8px; right: 10px; z-index: 30; }
#hud:not([hidden]) ~ #account-wrap { display: none; }

/* lobby */
.code-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.code-row b { font-family: var(--title); font-size: 26px; letter-spacing: .2em; color: var(--hud); }
#lobby-players { display: flex; gap: 12px; flex-wrap: wrap; }
.lobby-team { flex: 1; min-width: 200px; background: rgba(0,0,0,.3); padding: 8px 12px; border-radius: 3px; border-left: 4px solid var(--line); }
.lobby-team.t0 { border-color: var(--blue); }
.lobby-team.t1 { border-color: var(--red); }
.lobby-team h3 { margin: 0 0 6px; }
.lobby-team div { color: var(--text); }
.lobby-team .btn { margin-top: 8px; }
#lobby .panel > .btn { margin-top: 10px; margin-right: 8px; }
.big-text { font-size: 28px; color: var(--hud); }
.spinner { width: 34px; height: 34px; margin: 6px auto; border: 4px solid var(--line); border-top-color: var(--hud); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* end screen */
#end-title { font-size: 34px; text-align: center; }
#end-title.win { color: #7fdc6a; }
#end-title.loss { color: var(--red); }
#end-sub { text-align: center; font-size: 22px; }
#endscreen .btns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* settings */
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; }
.settings-grid label { display: flex; flex-direction: column; gap: 2px; }
.settings-grid label span { color: var(--hud); }
.settings-grid label.check { flex-direction: row; align-items: center; gap: 8px; }
.settings-grid select { font-family: var(--font); font-size: 18px; background: #0e0b07; color: var(--text); border: 1px solid var(--line); }
.settings-grid .num-row { display: flex; align-items: center; gap: 8px; }
.settings-grid .num-row input[type=range] { flex: 1; min-width: 0; }
.settings-grid input[type=number] { width: 80px; font-family: var(--font); font-size: 18px; background: #0e0b07; color: var(--text); border: 1px solid var(--line); padding: 2px 4px; }
.settings-grid .num-row .dim { color: var(--text); opacity: .7; font-size: 15px; }
input[type=range] { width: 100%; accent-color: #c4651c; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bind-wrap { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.bind { font-family: var(--font); font-size: 18px; width: 100%; min-width: 110px; background: #0e0b07; color: var(--text); border: 1px solid var(--line); border-radius: 2px; padding: 2px 6px; cursor: pointer; }
.bind.wait { color: var(--hud); border-color: var(--hud); }

/* ---------- HUD (CS-1.6-like amber) ---------- */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; color: var(--hud); text-shadow: 0 0 2px #000, 0 2px 0 #000; }
#top { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); text-align: center; }
#score-teams, #score-dm { display: flex; align-items: center; gap: 14px; background: rgba(0,0,0,.4); padding: 2px 14px; border-radius: 3px; font-size: 30px; }
#score-dm { font-size: 22px; }
#timer, #timer-dm { font-size: 34px; color: #fff3d4; min-width: 70px; }
#timer.bomb { color: var(--red); animation: blink .6s steps(2) infinite; }
.sc { font-size: 34px; min-width: 30px; }
#phase { font-size: 18px; color: var(--hud-dim); }
#team-label { font-size: 17px; }
#team-label.t0 { color: var(--blue); } #team-label.t1 { color: var(--red); }
#killfeed { position: absolute; top: 8px; right: 10px; max-width: 34vw; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.feed { background: rgba(0,0,0,.55); padding: 1px 8px; font-size: 18px; color: #eee; border-radius: 2px; }
.feed.mine { border: 1px solid #c33; }
.feed .w { color: #ddd; }
#center-msg { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); font-family: var(--title); font-size: 30px; white-space: nowrap; color: #fff3d4; }
#center-msg.red { color: var(--red); font-size: 22px; }
#center-msg.blue { color: var(--blue); } #center-msg.redteam { color: var(--red); }
#sub-msg { position: absolute; top: calc(24% + 44px); left: 50%; transform: translateX(-50%); font-size: 22px; white-space: nowrap; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%,-50%) rotate(45deg); opacity: 0; }
#hitmarker::before, #hitmarker::after { content: ''; position: absolute; background: #fff; }
#hitmarker::before { left: 10px; top: 0; width: 2px; height: 22px; }
#hitmarker::after { top: 10px; left: 0; width: 22px; height: 2px; }
#hitmarker.show { opacity: 1; }
#hitmarker.hs::before, #hitmarker.hs::after { background: #ff3b30; }
#hitmarker.shield::before, #hitmarker.shield::after { background: #8fd8ff; }
#scope { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0 min(40vh, 40vw), #000 calc(min(40vh, 40vw) + 1px)); }
#scope::before, #scope::after { content: ''; position: absolute; background: #000; }
#scope::before { left: 0; right: 0; top: 50%; height: 1px; }
#scope::after { top: 0; bottom: 0; left: 50%; width: 1px; }
#hurt { position: absolute; inset: 0; background: radial-gradient(circle, transparent 45%, rgba(200,0,0,.55)); opacity: 0; }
#dmgdir { position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; opacity: 0; }
#dmgdir::before { content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 22px solid rgba(255,40,30,.85); border-top: 0; }
#dmgdir.show { animation: fadeout 1.2s forwards; }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes blink { 50% { opacity: .35; } }
#progress { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); width: 260px; height: 16px; background: rgba(0,0,0,.6); border: 1px solid var(--hud); }
#progress-bar { height: 100%; width: 0; background: var(--hud); }
#progress-label { position: absolute; top: 18px; left: 0; right: 0; text-align: center; }
#hint { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); font-size: 22px; white-space: nowrap; }
#bottom-left { position: absolute; left: 14px; bottom: 10px; display: flex; gap: 16px; align-items: baseline; font-size: 40px; }
#bottom-left .ico { font-size: 30px; }
#hp.low { color: var(--red); animation: blink .5s steps(2) infinite; }
#money { color: #7fdc6a; font-size: 32px; }
#bottom-right { position: absolute; right: 14px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; }
#wname { font-size: 20px; color: var(--hud-dim); }
#ammo { font-size: 40px; }
#weapons-list { position: absolute; right: 14px; bottom: 84px; display: flex; flex-direction: column; align-items: flex-end; font-size: 18px; color: var(--hud-dim); }
#weapons-list .cur { color: #fff3d4; }
#ping { position: absolute; left: 14px; top: 8px; font-size: 16px; color: var(--hud-dim); }
#menu-btn { position: absolute; left: 12px; top: 26px; z-index: 2; font-family: var(--title); font-size: 14px; background: rgba(0,0,0,.45); color: var(--hud); border: 1px solid var(--hud-dim); border-radius: 3px; padding: 4px 8px; display: none; }
body.touch #menu-btn { display: block; }

#scoreboard { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#scoreboard .panel { max-width: 640px; background: rgba(20,16,10,.88); }

#buymenu .row { display: flex; justify-content: space-between; margin-bottom: 8px; color: #7fdc6a; font-size: 22px; }
#buy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.buy-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font-family: var(--font); font-size: 18px; color: var(--text); background: rgba(0,0,0,.35); border: 2px solid var(--line); border-radius: 3px; padding: 8px 10px; cursor: pointer; }
.buy-item:hover:not(:disabled) { border-color: var(--hud); }
.buy-item:disabled { opacity: .4; cursor: default; }
.buy-item.owned { border-color: #7fdc6a; }
.buy-item b { font-family: var(--title); font-weight: 400; font-size: 15px; color: var(--hud); }
.buy-item .price { color: #7fdc6a; }
.buy-item small { opacity: .7; font-size: 15px; }
.buy-item .k { position: absolute; right: 8px; top: 4px; opacity: .5; }

#toast { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); z-index: 40; background: rgba(0,0,0,.8); color: var(--hud); padding: 8px 16px; border: 1px solid var(--hud-dim); border-radius: 3px; font-size: 20px; max-width: 90vw; text-align: center; pointer-events: none; }
#rotate { position: fixed; inset: 0; z-index: 50; background: #000; color: var(--hud); display: flex; align-items: center; justify-content: center; font-size: 28px; text-align: center; padding: 20px; }

/* ---------- touch ---------- */
#touch { position: fixed; inset: 0; z-index: 6; }
#touch .joy-zone { position: absolute; left: 0; top: 25%; bottom: 0; width: 42%; }
#touch .look-zone { position: absolute; right: 0; top: 0; bottom: 0; width: 58%; }
#touch .joy-base { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255,194,58,.5); background: rgba(0,0,0,.2); pointer-events: none; }
#touch .joy-knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,194,58,.55); }
.tbtn { position: absolute; font-family: var(--title); font-size: 12px; color: #fff3d4; background: rgba(0,0,0,.38); border: 2px solid rgba(255,194,58,.55); border-radius: 50%; width: 58px; height: 58px; padding: 0; touch-action: none; }
.tbtn.on { background: rgba(255,194,58,.45); }
.tbtn.fire { right: 4%; bottom: 22%; width: 88px; height: 88px; font-size: 14px; background: rgba(160,30,20,.45); }
.tbtn.fire2 { left: 172px; top: 112px; width: 56px; height: 56px; background: rgba(160,30,20,.4); }
.tbtn.jump { right: calc(4% + 100px); bottom: 10%; }
.tbtn.crouch { right: calc(4% + 30px); bottom: 4%; }
.tbtn.reload { right: calc(4% + 108px); bottom: calc(10% + 70px); }
.tbtn.cycle { right: 4%; bottom: calc(22% + 100px); }
.tbtn.scopeb { right: calc(4% + 70px); bottom: calc(22% + 110px); display: none; }
#touch.has-scope .tbtn.scopeb { display: block; }
.tbtn.use { left: 50%; bottom: 26%; transform: translateX(-50%); width: 120px; height: 44px; border-radius: 6px; display: none; }
#touch.can-use .tbtn.use { display: block; }
.tbtn.buyb { left: 8px; top: 64px; width: 74px; height: 32px; border-radius: 4px; font-size: 11px; }
.tbtn.scores { left: 88px; top: 64px; width: 54px; height: 32px; border-radius: 4px; font-size: 11px; }
body.touch #hint { bottom: 40%; font-size: 18px; }
body.touch #bottom-left { font-size: 28px; bottom: 6px; left: 50%; transform: translateX(-120%); }
body.touch #money { font-size: 22px; }
body.touch #bottom-right { top: 50px; bottom: auto; right: 10px; }
body.touch #ammo { font-size: 28px; }
body.touch #weapons-list { display: none; }
body.touch #killfeed { top: 120px; }

@media (max-width: 1100px) {
  #killfeed { top: 96px; max-width: none; }
}
@media (max-width: 900px) {
  .modes { grid-template-columns: 1fr; }
  .info-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  #center-msg { font-size: 22px; }
}
@media (max-height: 500px) {
  html, body { font-size: 17px; }
  #score-teams { font-size: 22px; }
  .sc, #timer { font-size: 26px; }
  .menu-inner { padding-top: 40px; }
  .logo { width: min(420px, 70%); }
}
#score-dm span { white-space: nowrap; }
body.touch #score-dm { font-size: 17px; }
body.touch #dm-lead { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
body.touch .feed { font-size: 15px; }
body.touch #killfeed { top: 60px; right: 90px; }

/* minimap */
#minimap { position: absolute; left: 10px; top: 30px; width: 230px; aspect-ratio: 72 / 52; border: 2px solid rgba(255,194,58,.55); border-radius: 3px; image-rendering: auto; }
body.touch #minimap { width: 150px; top: 102px; left: 8px; opacity: .9; }
@media (max-height: 500px) { #minimap { width: 170px; } }

/* ---------- arsenal / cases ---------- */
.coins { color: #ffd54a; font-family: var(--title); white-space: nowrap; }
.coins.big { font-size: 22px; margin-left: auto; }
.arsenal-btn { display: flex; align-items: center; gap: 14px; width: min(560px, 100%); margin: 10px auto 4px; padding: 10px 16px; cursor: pointer; color: var(--text);
  background: linear-gradient(110deg, #3b2a12, #6b4a12 40%, #3b2a12); border: 2px solid #ffd54a; border-radius: 4px; box-shadow: 0 0 18px rgba(255,213,74,.35); animation: glow 2.2s ease-in-out infinite; text-align: left; }
.arsenal-btn b { font-family: var(--title); font-weight: 400; font-size: 18px; color: #ffd54a; display: block; }
.arsenal-btn small { opacity: .8; }
.arsenal-btn .coins { margin-left: auto; font-size: 20px; }
.crate-mini { width: 38px; height: 30px; background: linear-gradient(#b0802c, #7a5214); border: 2px solid #ffd54a; border-radius: 3px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.3); }
@keyframes glow { 50% { box-shadow: 0 0 30px rgba(255,213,74,.7); } }
.arm-panel { max-width: 1000px; }
.arm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.arm-head h2 { margin: 0; }
.chip { font-family: var(--title); font-size: 13px; padding: 6px 10px; background: rgba(0,0,0,.35); color: var(--text); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.chip.active { border-color: #ffd54a; color: #ffd54a; }
.chips, .arm-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
#case-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 0; }
.crate { position: relative; width: 220px; height: 140px; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 0 22px rgba(255,213,74,.5)); }
.crate-lid { position: absolute; left: -8px; right: -8px; top: 0; height: 34px; background: linear-gradient(#d4a63c, #9a6a1c); border: 3px solid #ffd54a; border-radius: 4px; transition: transform .5s; transform-origin: left bottom; }
.crate-body { position: absolute; left: 0; right: 0; top: 30px; bottom: 0; background: repeating-linear-gradient(90deg, #8a5a18 0 26px, #7a4e14 26px 28px); border: 3px solid #ffd54a; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.crate-body span { font-family: var(--title); color: #fff3d4; font-size: 20px; text-shadow: 0 2px 0 #000; background: #c0392b; padding: 2px 10px; transform: rotate(-4deg); border: 2px solid #fff3d4; }
#case-stage.opening .crate { animation: rattle .12s linear infinite; }
#case-stage.opening .crate-lid { transform: rotate(-35deg); }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes rattle { 25% { transform: translate(-3px, 1px) rotate(-1deg); } 75% { transform: translate(3px, -1px) rotate(1deg); } }
.teaser { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; opacity: .9; }
.teaser .skin-card { width: 120px; }
.case-actions { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.case-actions .check { display: flex; gap: 6px; align-items: center; }
#reel-wrap { position: relative; overflow: hidden; height: 128px; margin: 6px 0 10px; background: #0b0905; border: 2px solid var(--line); border-radius: 4px; cursor: pointer; }
#reel-strip { display: flex; gap: 6px; padding: 8px 0; will-change: transform; }
#reel-strip .skin-card { flex: 0 0 130px; }
.reel-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #ffd54a; box-shadow: 0 0 12px #ffd54a; z-index: 2; }
.skin-card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 4px 4px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.35)); border-bottom: 4px solid var(--rc); border-radius: 3px; text-align: center; line-height: 1; min-height: 108px; box-shadow: inset 0 -30px 30px -24px var(--rc); }
.skin-card img { width: 120px; height: 48px; image-rendering: pixelated; }
.skin-card b { font-family: var(--title); font-weight: 400; font-size: 11px; opacity: .8; margin-top: 4px; }
.skin-card span { font-size: 16px; color: #fff3d4; }
.skin-card small { font-size: 14px; color: #7fdc6a; margin-top: 2px; }
.skin-card.r-gold { background: linear-gradient(180deg, rgba(255,215,0,.15), rgba(0,0,0,.35)); }
.skin-card .eq { position: absolute; top: 3px; left: 3px; font-style: normal; font-size: 12px; background: #7fdc6a; color: #000; padding: 0 4px; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.inv-item { cursor: pointer; }
.inv-item:hover .skin-card { outline: 1px solid var(--rc); }
#odds-list h3 { margin: 14px 0 6px; }
.small { font-size: 16px; }
.small a, .reveal-card a { color: #5dade2; }
/* reveal */
.reveal-overlay { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(0,0,0,.55), rgba(0,0,0,.92)); padding: 16px; overflow: hidden; }
.reveal-overlay .rays { position: absolute; left: 50%; top: 50%; width: 1600px; height: 1600px; margin: -800px; background: repeating-conic-gradient(from 0deg, var(--rc) 0 6deg, transparent 6deg 20deg); opacity: .18; animation: spinrays 14s linear infinite; mask-image: radial-gradient(circle, #000 10%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 60%); }
.reveal-overlay.lv0 .rays, .reveal-overlay.lv1 .rays { opacity: .08; }
.reveal-overlay.lv4 .rays { opacity: .45; animation-duration: 5s; }
@keyframes spinrays { to { transform: rotate(360deg); } }
.reveal-card { position: relative; text-align: center; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.reveal-card h2 { font-family: var(--title); font-weight: 400; color: #fff3d4; margin: 6px 0; font-size: 26px; }
.reveal-card .rar { font-family: var(--title); color: var(--rc); letter-spacing: .1em; font-size: 18px; text-shadow: 0 0 12px var(--rc); }
.lv4 .reveal-card .rar { font-size: 24px; animation: blink .4s steps(2) 6; }
.big-skin { display: inline-block; padding: 14px 24px; border-radius: 6px; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 45%, transparent), transparent 70%); }
.big-skin img { width: min(360px, 80vw); image-rendering: pixelated; filter: drop-shadow(0 0 14px var(--rc)); }
.reveal-card .value { font-family: var(--title); font-size: 30px; color: #7fdc6a; margin: 4px 0; text-shadow: 0 0 10px rgba(127,220,106,.5); }
.reveal-card .btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
#detail .panel { text-align: center; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
#confetti { position: fixed; inset: 0; z-index: 36; pointer-events: none; }
#flash { position: fixed; inset: 0; z-index: 37; background: #fff6c8; opacity: 0; pointer-events: none; }
#flash.go { animation: flashgo 1.1s ease-out; }
@keyframes flashgo { 0% { opacity: .95; } 100% { opacity: 0; } }
body.shake .reveal-card { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1), shake .5s .1s; }
@keyframes shake { 20% { transform: translate(-8px, 4px); } 40% { transform: translate(8px, -4px); } 60% { transform: translate(-6px, 2px); } 80% { transform: translate(4px, -2px); } }
#coin-pops { position: fixed; left: 50%; top: 58%; z-index: 41; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.coin-pop { font-family: var(--title); color: #ffd54a; font-size: 20px; text-shadow: 0 2px 0 #000, 0 0 10px rgba(255,213,74,.6); animation: coinup 1.8s ease-out forwards; }
@keyframes coinup { 0% { transform: scale(.4); opacity: 0; } 15% { transform: scale(1.25); opacity: 1; } 30% { transform: scale(1); } 100% { transform: translateY(-60px); opacity: 0; } }
.end-coins { text-align: center; font-family: var(--title); color: #ffd54a; font-size: 24px; }
@media (max-height: 500px) {
  .crate { width: 160px; height: 96px; }
  .crate-lid { height: 24px; }
  .crate-body { top: 20px; }
  .crate-body span { font-size: 15px; }
  #case-stage .teaser { display: none; }
  .reveal-overlay { align-items: safe center; overflow-y: auto; }
  .big-skin { padding: 4px 12px; }
  .big-skin img { width: auto; height: 22vh; }
  .reveal-card h2 { font-size: 20px; margin: 2px 0; }
  .reveal-card .value { font-size: 22px; }
  .reveal-card p { margin: 2px 0; }
}

/* ---------- loadout ---------- */
.menu-loadout-wrap { margin: 10px 0 4px; }
.menu-loadout-wrap h3 { font-family: var(--title); font-weight: 400; font-size: 16px; color: var(--hud); margin: 0 0 6px; text-align: center; }
.menu-loadout-wrap h3 small { font-family: var(--font); color: var(--text); opacity: .7; font-size: 16px; }
.loadout-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.lo-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; cursor: pointer; color: var(--text); font-family: var(--font); line-height: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.4)); border: 1px solid var(--line); border-bottom: 4px solid var(--rc); border-radius: 3px; box-shadow: inset 0 -26px 26px -22px var(--rc); }
.lo-slot:hover, .lo-slot.active { border-color: #ffd54a; border-bottom-color: var(--rc); }
.lo-slot img { width: 100%; max-width: 120px; aspect-ratio: 120 / 48; image-rendering: pixelated; }
.lo-slot b { font-family: var(--title); font-weight: 400; font-size: 11px; opacity: .8; margin-top: 2px; }
.lo-slot span { font-size: 16px; color: #fff3d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lo-slot small { font-size: 13px; opacity: .6; }
#lo-title { margin: 14px 0 6px; }
@media (max-width: 900px) { .loadout-row { grid-template-columns: repeat(4, 1fr); } }

/* ---------- opt-in ads (1 coin per second) ---------- */
.ad-toggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(560px, 100%); margin: 6px auto; padding: 7px 12px; cursor: pointer;
  background: rgba(0,0,0,.45); color: var(--text); border: 1px dashed #7fdc6a; border-radius: 4px; font-family: var(--font); font-size: 18px; }
.ad-toggle b { font-family: var(--title); font-weight: 400; font-size: 14px; color: #7fdc6a; }
.ad-toggle small { width: 100%; text-align: center; opacity: .75; font-size: 15px; }
.ad-toggle .sw { width: 38px; height: 20px; border-radius: 10px; background: #3a2f22; position: relative; border: 1px solid var(--line); }
.ad-toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #a89a86; transition: left .2s; }
.ad-toggle.on { border-style: solid; box-shadow: 0 0 12px rgba(127,220,106,.4); }
.ad-toggle.on .sw { background: #2f6b25; }
.ad-toggle.on .sw::after { left: 20px; background: #7fdc6a; }
#adslot { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 32; flex-direction: column; align-items: center; gap: 1px; padding: 2px 0 4px; background: #120e09; border-top: 2px solid #ffd54a; }
#adslot.on { display: flex; }
body.ingame #adslot { display: none !important; }
.adlabel { font: 13px/14px var(--font); letter-spacing: .05em; color: #c9b88f; }
#adbox { max-width: 100%; overflow: hidden; background: rgba(255,255,255,.04); }
#adbox iframe { display: block; border: 0; }
body.ad-on:not(.ingame) .overlay { padding-bottom: calc(var(--ad-h, 72px) + 12px); }
.coin-balance.bump { display: inline-block; animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.25); color: #fff3a0; } }
.skin-grid > p { grid-column: 1 / -1; }

#smoke-screen { position: absolute; inset: 0; background: radial-gradient(circle, rgba(245,245,255,.92), rgba(225,230,245,.98)); opacity: 0; pointer-events: none; }

.map-pick { display: flex; align-items: center; gap: 6px; font-family: var(--title); font-size: 13px; color: var(--hud); }
.map-pick select { font-family: var(--font); font-size: 18px; background: #0e0b07; color: var(--text); border: 2px solid var(--line); border-radius: 3px; padding: 4px 6px; }

/* crosshair: sizes come from the settings as CSS variables (whole pixels, so the lines stay sharp);
   #crosshair is placed on a whole pixel at the screen centre by main.js */
#crosshair, .xc { --gap: 4px; --len: 8px; --th: 2px; --off: -1px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
#crosshair i, .xc i { position: absolute; background: var(--xc, #6f6); }
#crosshair.xo i, .xc.xo i { box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
#crosshair .l, #crosshair .r, .xc .l, .xc .r { width: var(--len); height: var(--th); top: var(--off); }
#crosshair .u, #crosshair .d, .xc .u, .xc .d { width: var(--th); height: var(--len); left: var(--off); }
#crosshair .l, .xc .l { right: var(--gap); } #crosshair .r, .xc .r { left: var(--gap); }
#crosshair .u, .xc .u { bottom: var(--gap); } #crosshair .d, .xc .d { top: var(--gap); }
#crosshair .c, .xc .c { width: var(--th); height: var(--th); left: var(--off); top: var(--off); display: none; }
#crosshair.dot .c, .xc.dot .c { display: block; }
.xhair-preview { position: relative; display: inline-block; width: 72px; height: 72px; flex: none; background: #6b5a3a; border: 1px solid var(--line); border-radius: 3px; }
.xhair-color .row { display: flex; align-items: center; gap: 10px; }
.xhair-color input[type=color] { width: 48px; height: 32px; border: 1px solid var(--line); background: none; padding: 0; }

/* bunny hop feedback */
#speedfx { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 240, 200, .16) 72%, rgba(255, 220, 150, .32) 100%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.07) 0 2deg, transparent 2deg 9deg);
  mask-image: radial-gradient(circle, transparent 38%, #000 75%); -webkit-mask-image: radial-gradient(circle, transparent 38%, #000 75%); }
#hop-meter { --hop: 0; position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); font-family: var(--title); font-size: 18px; opacity: 0; pointer-events: none;
  color: hsl(calc(50 - var(--hop) * 50), 100%, 60%); text-shadow: 0 2px 0 #000, 0 0 12px currentColor; white-space: nowrap; }
#hop-meter.pop { animation: hoppop 1.1s ease-out; }
@keyframes hoppop { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 12% { opacity: 1; transform: translateX(-50%) scale(calc(1.15 + var(--hop) * .25)); } 30% { transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-18px); } }
body.touch #hop-meter { bottom: 46%; }

/* red dot sight: blocky retro housing, tinted lens, glowing red dot */
#reddot { position: absolute; inset: 0; pointer-events: none; }
#reddot .sight { position: absolute; left: 50%; top: 50%; width: min(34vh, 34vw); height: min(28vh, 28vw); transform: translate(-50%, -50%);
  border: min(2.4vh, 2.4vw) solid #1d1d1d; border-bottom-width: min(5vh, 5vw); border-radius: 6px; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #3a3a3a; }
#reddot .lens { position: absolute; inset: 0; background: radial-gradient(circle, rgba(120,200,255,.06), rgba(80,140,200,.16)); }
#reddot .dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ff2a1a;
  box-shadow: 0 0 6px 2px rgba(255,40,20,.85), 0 0 14px 4px rgba(255,40,20,.35); }

/* ======================================================================
   Main menu, game style: full screen, no page scrolling
   ====================================================================== */
#menu.game-menu { display: grid; grid-template-columns: clamp(210px, 25vw, 330px) 1fr; align-items: stretch; padding: 0; overflow: hidden; touch-action: none;
  background: linear-gradient(90deg, rgba(8,6,4,.94) 0, rgba(8,6,4,.8) 22%, rgba(8,6,4,.35) 55%, rgba(8,6,4,.6) 100%); }
body.ad-on:not(.ingame) #menu.game-menu { padding-bottom: 0; bottom: var(--ad-h, 72px); }
.gm-side { display: flex; flex-direction: column; gap: 1.4vh; padding: 1.6vh 1.4vw 1.6vh; min-height: 0; background: rgba(12,9,6,.6); border-right: 2px solid rgba(255,194,58,.22); box-shadow: 8px 0 30px rgba(0,0,0,.35); }
.gm-home { align-self: flex-start; color: var(--text); opacity: .7; text-decoration: none; font-family: var(--title); font-size: 12px; letter-spacing: .05em; }
.gm-home:hover { opacity: 1; color: var(--hud); }
.gm-logo { width: 100%; max-height: 22vh; object-fit: cover; border: 2px solid #000; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.gm-nav { display: flex; flex-direction: column; gap: .7vh; }
.gm-btn { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 1.25vh 12px; border: none; border-left: 4px solid transparent; cursor: pointer; text-align: left;
  font-family: var(--title); font-size: clamp(12px, 2.05vh, 18px); letter-spacing: .06em; text-transform: uppercase; color: var(--text);
  background: linear-gradient(90deg, rgba(255,194,58,.07), rgba(255,194,58,0) 80%); transition: background .15s, padding .15s, color .15s; }
.gm-btn .ico { width: 1.5em; text-align: center; filter: drop-shadow(0 1px 0 #000); }
.gm-btn:hover, .gm-btn.active { color: #fff3d4; padding-left: 18px; border-left-color: var(--hud); background: linear-gradient(90deg, rgba(255,194,58,.32), rgba(255,194,58,0) 90%); }
.gm-btn.gold { color: #ffd54a; }
.gm-btn.gold .coins { margin-left: auto; font-style: normal; font-size: .9em; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,213,74,.5); }
.gm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.gm-side-foot .ad-toggle { width: 100%; margin: 0; padding: 6px 8px; font-size: 15px; }
.gm-side-foot .ad-toggle small { font-size: 13px; }
.gm-side-foot #online-count { text-align: left; font-size: 16px; min-height: 0; }

.gm-main { position: relative; display: flex; flex-direction: column; min-height: 0; padding: 7vh 3.2vw 3vh; overflow: hidden; }
.gm-page { display: flex; flex-direction: column; gap: 2.2vh; max-width: 1000px; min-height: 0; animation: gmin .25s ease-out; }
@keyframes gmin { from { opacity: 0; transform: translateX(14px); } }
.gm-title { margin: 0; font-family: var(--title); font-weight: 400; font-size: clamp(16px, 3.3vh, 30px); color: var(--hud); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 2px 0 #000; }
.gm-title small { font-family: var(--font); text-transform: none; letter-spacing: 0; color: var(--text); opacity: .7; font-size: .6em; }

.game-menu .mode-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2vw; }
.game-menu .mode-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6vh; height: clamp(84px, 21vh, 190px); padding: 8px; cursor: pointer; color: var(--text);
  background: linear-gradient(170deg, rgba(60,46,26,.9), rgba(14,11,7,.95)); border: 2px solid var(--line); border-radius: 0;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); transition: transform .12s, border-color .12s, box-shadow .12s; }
.game-menu .mode-card:hover { transform: translateY(-3px); border-color: #c09a55; }
.game-menu .mode-card.active { border-color: var(--hud); background: linear-gradient(170deg, rgba(150,92,24,.85), rgba(40,24,8,.95)); box-shadow: inset 0 0 30px rgba(255,194,58,.25); }
.game-menu .mode-card .mt-icon { font-size: clamp(24px, 6vh, 54px); filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); }
.game-menu .mode-card b { font-family: var(--title); font-weight: 400; font-size: clamp(13px, 2.6vh, 22px); color: #fff3d4; letter-spacing: .04em; text-transform: uppercase; }
.game-menu .mode-card small { font-size: clamp(13px, 2.1vh, 18px); opacity: .75; }
.game-menu .mode-card.active b { color: #ffe39a; }
.mode-desc { margin: 0; min-height: 2.2em; font-size: clamp(15px, 2.4vh, 21px); line-height: 1.1; color: #e9dcc0; text-shadow: 0 1px 0 #000; }
.play-actions { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 1.2vw; }
.big-act { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; height: clamp(54px, 12vh, 104px); padding: 0 16px; cursor: pointer; color: var(--text);
  background: linear-gradient(180deg, rgba(70,56,34,.95), rgba(34,27,17,.95)); border: 2px solid #8a7246;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: transform .1s, filter .1s; }
.big-act .ico { grid-row: 1 / 3; font-size: clamp(20px, 4.6vh, 38px); }
.big-act b { font-family: var(--title); font-weight: 400; font-size: clamp(13px, 2.6vh, 22px); text-transform: uppercase; letter-spacing: .05em; color: #fff3d4; align-self: end; }
.big-act small { font-size: clamp(12px, 1.9vh, 16px); opacity: .75; align-self: start; }
.big-act:hover { filter: brightness(1.18); transform: translateY(-2px); }
.big-act:active { transform: translateY(1px); }
.big-act.hot { background: linear-gradient(180deg, #d4731f, #8c4210); border-color: #ffb050; box-shadow: 0 0 22px rgba(255,140,40,.35); animation: hotpulse 2.4s ease-in-out infinite; }
@keyframes hotpulse { 50% { box-shadow: 0 0 34px rgba(255,140,40,.6); } }
.play-extra { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.join-box { display: flex; gap: 6px; }
.join-box input { font-family: var(--title); font-size: 15px; text-transform: uppercase; letter-spacing: .2em; width: 140px; padding: 7px 10px; background: #0e0b07; color: var(--hud); border: 2px solid var(--line); border-radius: 3px; text-align: center; }

.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4vw; min-height: 0; }
.stats-cols .panel-lite { min-height: 0; overflow: auto; max-height: 72vh; }
.help-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4vw; }
.help-cols p { font-size: clamp(15px, 2.3vh, 19px); line-height: 1.15; }
.game-menu .loadout-row { grid-template-columns: repeat(4, 1fr); }

/* phones in landscape and small laptop screens */
@media (max-height: 520px) {
  #menu.game-menu { grid-template-columns: 200px 1fr; }
  .gm-side { gap: 4px; padding: 6px 8px; }
  .gm-logo { max-height: 15vh; }
  .gm-btn { padding: 5px 8px; font-size: 12px; }
  .gm-main { padding: 46px 14px 8px; }
  .gm-page { gap: 8px; }
  .gm-side-foot .ad-toggle small { display: none; }
  .game-menu .loadout-row { grid-template-columns: repeat(8, 1fr); }
  .lo-slot small { display: none; }
}
/* portrait phones: nav on top, content below (only here the content may scroll) */
@media (max-width: 640px) and (orientation: portrait) {
  #menu.game-menu { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; touch-action: pan-y; }
  .gm-side { border-right: none; border-bottom: 2px solid rgba(255,194,58,.22); padding-top: 44px; }
  .gm-nav { flex-direction: row; flex-wrap: wrap; }
  .gm-btn { width: auto; flex: 1 1 45%; }
  .gm-main { padding: 12px; overflow: visible; }
  .game-menu .mode-tiles, .play-actions, .stats-cols, .help-cols { grid-template-columns: 1fr; }
  .game-menu .mode-card { height: 70px; flex-direction: row; gap: 12px; }
}
@media (max-height: 520px) {
  .big-act small, .gm-side-foot #online-count { display: none; }
  .big-act { height: 50px; padding: 0 10px; }
  .big-act b { align-self: center; font-size: 13px; }
  .big-act .ico { grid-row: auto; font-size: 20px; }
  .game-menu .mode-card { height: 76px; gap: 2px; }
  .game-menu .mode-card .mt-icon { font-size: 22px; }
  .mode-desc { font-size: 14px; min-height: 0; }
  .gm-side-foot .ad-toggle { flex-wrap: nowrap; font-size: 13px; padding: 4px 6px; }
  .gm-title { font-size: 15px; }
  .gm-btn.gold .coins { padding: 1px 6px; }
}
