:root {
  --sand: #ecd29b; --sand2: #d4a85c; --brown: #24150b; --brown2: #3a2312; --gold: #e0b04a; --teal: #1f9a96;
  --red: #c4472f; --blue: #2f7ec4; --panel: rgba(30, 18, 9, 0.88);
}
* { box-sizing: border-box; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1008; font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; color: var(--sand); }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; background: radial-gradient(ellipse at 50% 120%, rgba(240,160,70,.25), transparent 60%), rgba(12, 7, 3, 0.55); }
#menu { background-image: url(/assets/keyart.jpg), radial-gradient(ellipse at 50% 120%, rgba(240,160,70,.35), transparent 60%); background-size: cover; background-position: center; }
.menu-card { position: relative; width: min(520px, 92vw); max-height: 94vh; overflow: auto; padding: 26px 30px; background: var(--panel); border: 2px solid var(--gold); border-radius: 6px; box-shadow: 0 0 0 5px rgba(224,176,74,.15), 0 20px 60px rgba(0,0,0,.6); text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 4 L36 24 L56 30 L36 36 L30 56 L24 36 L4 30 L24 24 Z' fill='none' stroke='%23e0b04a' stroke-opacity='.07' stroke-width='1.5'/%3E%3C/svg%3E"); }
.menu-card.wide { width: min(860px, 94vw); }
.ornament { height: 10px; margin: 0 auto 10px; width: 60%; background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 16px); opacity: .5; clip-path: polygon(0 50%, 5% 0, 10% 50%, 5% 100%); }
.ornament.bottom { margin: 14px auto 0; }
h1.title { margin: 4px 0; font-size: 54px; font-weight: 900; color: var(--sand); letter-spacing: 1px; text-shadow: 0 3px 0 #7a4c18, 0 0 24px rgba(224,176,74,.4); }
h1.title span { color: var(--gold); }
.tagline { margin: 0 0 16px; color: var(--sand2); font-size: 15px; }
h2 { margin: 0 0 8px; color: var(--gold); }
h3 { margin: 6px 0; color: var(--sand2); }
.muted { color: #a58a5c; font-size: 14px; }
input[type=text], input:not([type]) { width: 100%; padding: 11px 14px; margin: 0 0 12px; font: inherit; font-size: 17px; color: var(--sand); background: #120a04; border: 1px solid #7a5a28; border-radius: 4px; text-align: center; user-select: text; -webkit-user-select: text; }
button { font: inherit; font-weight: 700; font-size: 17px; padding: 11px 16px; color: var(--sand); background: var(--brown2); border: 1px solid #8a6830; border-radius: 4px; cursor: pointer; transition: .12s; }
button:hover { background: #4d2f17; border-color: var(--gold); transform: translateY(-1px); }
button.primary { background: linear-gradient(#d8a43c, #a86f1a); color: #1d1105; border-color: #f2cd78; }
button.primary:hover { background: linear-gradient(#e8b64c, #b87d22); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btns { display: flex; flex-direction: column; gap: 10px; }
.joinrow { display: flex; gap: 8px; } .joinrow input { margin: 0; flex: 1; text-transform: uppercase; letter-spacing: 4px; }
.diffrow { margin-top: 14px; font-size: 14px; color: var(--sand2); } .diffrow label { margin: 0 6px; cursor: pointer; }
details { margin-top: 12px; text-align: right; font-size: 14px; } summary { cursor: pointer; color: var(--gold); }
details label { display: block; margin: 8px 0; } details input[type=range] { width: 55%; vertical-align: middle; }
details ul { padding: 0 18px; line-height: 1.9; color: var(--sand2); } details b { color: var(--gold); }
.err { margin-top: 10px; color: #ff8a6a; min-height: 22px; font-weight: 700; }
.code { font-size: 46px; font-weight: 900; letter-spacing: 10px; color: var(--gold); margin: 4px 0; direction: ltr; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 12px 0 16px; text-align: right; }
.teams ul { list-style: none; padding: 0; margin: 0; } .teams li { padding: 5px 10px; margin: 3px 0; background: rgba(255,255,255,.05); border-radius: 3px; }
.teams li.me { background: rgba(224,176,74,.22); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#topbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 0; text-align: center; }
#topbar .score { width: 78px; padding: 4px 0; background: rgba(20,12,6,.8); border: 1px solid #6a4a20; }
#topbar .score span { display: block; font-size: 32px; font-weight: 900; line-height: 1.1; }
#topbar .score small { color: var(--sand2); font-size: 11px; }
#topbar .us span { color: #6cc2ff; } #topbar .them span { color: #ff7e5f; }
#topbar .center { min-width: 130px; padding: 4px 10px; background: rgba(20,12,6,.85); border-top: 1px solid #6a4a20; border-bottom: 1px solid #6a4a20; }
#timer { font-size: 28px; font-weight: 900; line-height: 1.1; direction: ltr; } #timer.red { color: #ff5a3a; animation: blink .5s infinite alternate; }
#roundInfo, #sideInfo { font-size: 11px; color: var(--sand2); }
#aliveRow { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); font-size: 14px; background: rgba(20,12,6,.6); padding: 1px 14px; border-radius: 10px; }
#aliveRow i { font-style: normal; opacity: .6; margin: 0 8px; } #aliveUs { color: #6cc2ff; font-weight: 700; } #aliveThem { color: #ff7e5f; font-weight: 700; }
#minimap { position: absolute; top: 10px; right: 10px; border: 2px solid #7a5a28; background: rgba(20,12,6,.55); border-radius: 4px; }
#killfeed { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; direction: rtl; }
#killfeed div { background: rgba(20,12,6,.75); padding: 3px 10px; border-radius: 3px; font-size: 14px; border: 1px solid transparent; animation: fadeout 6s forwards; }
#killfeed div.mine { border-color: var(--gold); } #killfeed .us { color: #6cc2ff; } #killfeed .them { color: #ff7e5f; } #killfeed .w { color: var(--sand2); margin: 0 6px; font-size: 12px; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --g: 6px; }
#crosshair i { position: absolute; background: #d8ffe8; box-shadow: 0 0 2px #000; }
#crosshair i:nth-child(1) { width: 2px; height: 8px; left: -1px; top: calc(-8px - var(--g)); }
#crosshair i:nth-child(2) { width: 2px; height: 8px; left: -1px; top: var(--g); }
#crosshair i:nth-child(3) { width: 8px; height: 2px; top: -1px; left: calc(-8px - var(--g)); }
#crosshair i:nth-child(4) { width: 8px; height: 2px; top: -1px; left: var(--g); }
#crosshair.hide { display: none; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: 0; transition: opacity .25s; background:
  linear-gradient(45deg, transparent 46%, #fff 46% 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, #fff 46% 54%, transparent 54%); }
#hitmarker.on { opacity: 1; transition: none; } #hitmarker.head { filter: drop-shadow(0 0 3px #ff3a2a) sepia(1) saturate(8) hue-rotate(-30deg); }
#dmgind { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transition: opacity .6s; }
#dmgind.on { opacity: 1; transition: none; }
#dmgind div { position: absolute; left: -60px; top: -150px; width: 120px; height: 40px; background: radial-gradient(ellipse at 50% 100%, rgba(255,40,20,.85), transparent 70%); transform-origin: 60px 150px; }
#scope { position: fixed; inset: 0; display: none; background: radial-gradient(circle at 50% 50%, transparent 0 28vh, #000 28.4vh); }
#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; }
#scope.on { display: block; }
#msg { position: absolute; top: 24%; left: 0; right: 0; text-align: center; font-size: 44px; font-weight: 900; text-shadow: 0 3px 12px #000; opacity: 0; transition: opacity .3s; }
#msg.on { opacity: 1; } #submsg { position: absolute; top: calc(24% + 62px); left: 0; right: 0; text-align: center; font-size: 20px; text-shadow: 0 2px 8px #000; color: var(--sand); }
#progress { position: absolute; left: 50%; bottom: 26%; width: 260px; margin-left: -130px; height: 18px; background: rgba(0,0,0,.65); border: 1px solid var(--gold); }
#progress div { height: 100%; width: 0; background: var(--gold); } #progress span { position: absolute; top: -26px; width: 100%; text-align: center; font-weight: 700; text-shadow: 0 1px 4px #000; }
#spectate { position: absolute; bottom: 90px; left: 0; right: 0; text-align: center; font-size: 20px; text-shadow: 0 2px 8px #000; }
#vitals { position: absolute; bottom: 14px; left: 16px; display: flex; gap: 10px; direction: ltr; }
.vit { min-width: 84px; padding: 4px 12px; background: rgba(20,12,6,.8); border: 1px solid #6a4a20; text-align: center; }
.vit b { display: block; font-size: 34px; font-weight: 900; line-height: 1.1; } .vit small { color: var(--sand2); font-size: 11px; }
.vit.hp b { color: #7be07b; } .vit.hp.low b { color: #ff5a3a; } .vit.armor b { color: #6cc2ff; } .vit.cash b { color: var(--gold); font-size: 26px; }
#ammoBox { position: absolute; bottom: 14px; right: 16px; padding: 6px 18px; background: rgba(20,12,6,.8); border: 1px solid #6a4a20; text-align: center; direction: ltr; }
#wepName { font-size: 14px; color: var(--sand2); } #ammoVal { font-size: 20px; color: var(--sand2); } #ammoVal b { font-size: 40px; color: #fff; font-weight: 900; }
#bombIcon { color: #ff8a5a; font-size: 13px; font-weight: 700; margin-top: 2px; }
#buyHint { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(20,12,6,.75); padding: 4px 16px; border: 1px solid var(--gold); }
.items { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.item { padding: 14px 10px; background: #2a1a0d; border: 1px solid #7a5a28; border-radius: 4px; cursor: pointer; transition: .12s; }
.item:hover { border-color: var(--gold); background: #3a2412; } .item.off { opacity: .4; cursor: not-allowed; } .item.own { border-color: #7be07b; }
.item .k { color: var(--gold); font-size: 13px; } .item .n { font-size: 22px; font-weight: 900; } .item .p { color: var(--gold); font-size: 18px; } .item .d { color: var(--sand2); font-size: 12px; margin-top: 4px; }
#buyCash { color: var(--gold); margin-right: 14px; }
#pause, #loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 15; padding: 14px 30px; background: var(--panel); border: 1px solid var(--gold); font-size: 22px; }
table { width: 100%; border-collapse: collapse; } td, th { padding: 4px 8px; text-align: right; font-size: 15px; } th { color: var(--sand2); font-size: 12px; } tr.me td { background: rgba(224,176,74,.2); } tr.dead td { opacity: .5; }
@keyframes blink { to { opacity: .5; } } @keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
