:root {
  --bg: #08090d;
  --panel: rgba(14, 16, 22, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #e8eaf0;
  --dim: #8a919c;
  --gold: #c9a84c;
  --gold2: #f0d080;
  --red: #e05555;
  --ta: #ff9a3c;
  --td: #40c8ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: 'Space Grotesk', system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: rgba(255,255,255,.06); font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .9em; text-align: center; }

/* ---------- meniu ---------- */
.menu { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 56px 16px 16px; overflow-y: auto; }
.menu-card { margin-top: auto; }
.foot { margin-bottom: auto; }
.menu-bg { position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(201,168,76,.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(255,120,40,.12), transparent 60%),
    linear-gradient(180deg, #0b0d12, #07080b); }
.back { position: fixed; top: 16px; left: 16px; color: var(--dim); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--gold2); }
.menu-card { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.logo { font-family: 'Rajdhani', sans-serif; font-size: 64px; line-height: .9; letter-spacing: 2px; text-align: center; }
.logo span { color: var(--text); font-weight: 600; margin-right: 10px; }
.logo b { color: var(--gold); text-shadow: 0 0 30px rgba(201,168,76,.35); }
.tag { text-align: center; color: var(--dim); margin: 6px 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dim); margin-bottom: 14px; }
.field input, .field select, .join-row input { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 15px; outline: none; }
.field input:focus, .join-row input:focus { border-color: var(--gold); }
.actions { display: flex; flex-direction: column; gap: 10px; }
.join-row { display: flex; gap: 10px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 3px; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px; text-align: center; }
.btn { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.btn:active { transform: translateY(1px); }
.btn.big { padding: 13px 16px; font-size: 16px; }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1406; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: rgba(224,85,85,.4); color: #ffb0b0; }
.more { margin-top: 16px; color: var(--dim); }
.more summary { cursor: pointer; margin-bottom: 10px; }
.err { color: #ff9090; min-height: 1.2em; margin-top: 10px; font-size: 14px; }
.howto { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.howto h3 { color: var(--text); font-size: 14px; margin-bottom: 8px; }
.howto ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.howto b { color: var(--text); }
.foot { color: var(--dim); font-size: 12px; margin-top: 14px; text-align: center; }

.loading { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px; background: rgba(5,6,8,.85); z-index: 50; }
.loading.show { display: flex; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- joc ---------- */
#game-root { position: fixed; inset: 0; display: none; }
.game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hud-root { position: absolute; inset: 0; pointer-events: none; font-family: 'Rajdhani', sans-serif; user-select: none; }
.hud { position: absolute; inset: 0; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.radar { position: absolute; top: 12px; left: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); }
.top { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 0; background: rgba(8,10,14,.6); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; }
.top .sc { display: flex; align-items: center; gap: 10px; padding: 4px 14px; font-size: 26px; }
.top .sc .lbl { font-size: 12px; letter-spacing: 1.5px; color: rgba(255,255,255,.7); }
.top .sc-a { border-bottom: 3px solid var(--ta); }
.top .sc-d { border-bottom: 3px solid var(--td); }
.top .sc-a b { color: var(--ta); } .top .sc-d b { color: var(--td); }
.clock { padding: 2px 18px; text-align: center; border-left: 1px solid rgba(255,255,255,.08); border-right: 1px solid rgba(255,255,255,.08); }
#clock { font-size: 28px; font-weight: 700; line-height: 1.1; }
#clock.planted { color: #ff4a3a; animation: pulse 1s infinite; }
.clock .sub { font-size: 12px; color: rgba(255,255,255,.65); }
@keyframes pulse { 50% { opacity: .55; } }
.bomb-ind { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); color: #ff6a50; font-weight: 700; letter-spacing: 1px; font-size: 16px; }
.killfeed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf { background: rgba(8,10,14,.65); padding: 3px 10px; border-radius: 6px; font-size: 16px; font-weight: 600; transition: opacity .8s; border: 1px solid transparent; }
.kf.mine { border-color: rgba(255,80,60,.7); }
.kf.old { opacity: 0; }
.kf .w { color: #ddd; font-weight: 500; font-size: 14px; margin: 0 4px; }
.tA { color: var(--ta); } .tD { color: var(--td); } .tS { color: #aaa; }
.center-msg { position: absolute; top: 24%; left: 0; right: 0; text-align: center; font-size: 42px; font-weight: 700; letter-spacing: 1px; opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
.center-msg.show { opacity: 1; transform: none; }
.center-msg.ta { color: var(--ta); } .center-msg.td { color: var(--td); } .center-msg.warn { color: #ff6a50; }
.sub-msg { position: absolute; top: calc(24% + 52px); left: 0; right: 0; text-align: center; font-size: 20px; color: #eee; opacity: 0; transition: opacity .25s; }
.sub-msg.show { opacity: 1; }
.crosshair { --gap: 4px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.crosshair i { position: absolute; background: var(--ch, #7dff8a); box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.crosshair .t, .crosshair .b { width: 2px; height: var(--chl, 9px); left: -1px; }
.crosshair .l, .crosshair .r { height: 2px; width: var(--chl, 9px); top: -1px; }
.crosshair .t { bottom: var(--gap); } .crosshair .b { top: var(--gap); }
.crosshair .l { right: var(--gap); } .crosshair .r { left: var(--gap); }
.crosshair .dot { width: 2px; height: 2px; left: -1px; top: -1px; }
.hitmark { position: absolute; left: 50%; top: 50%; opacity: 0; }
.hitmark.show { opacity: 1; }
.hitmark i { position: absolute; width: 10px; height: 2px; background: #fff; }
.hitmark.head i { background: #ff4040; }
.hitmark i:nth-child(1) { transform: translate(-16px,-10px) rotate(45deg); }
.hitmark i:nth-child(2) { transform: translate(6px,-10px) rotate(-45deg); }
.hitmark i:nth-child(3) { transform: translate(-16px,8px) rotate(-45deg); }
.hitmark i:nth-child(4) { transform: translate(6px,8px) rotate(45deg); }
.dmg-ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmg-ring i { position: absolute; left: -40px; top: -150px; width: 80px; height: 22px; transform-origin: 40px 150px; background: radial-gradient(ellipse at center, rgba(255,40,30,.85), rgba(255,40,30,0) 70%); animation: fade .9s forwards; }
@keyframes fade { to { opacity: 0; } }
.red-flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(200,0,0,.9)); opacity: 0; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scope { position: absolute; inset: 0; display: none; }
.scope-hole { position: absolute; left: 50%; top: 50%; width: 96vh; height: 96vh; transform: translate(-50%,-50%); border-radius: 50%; box-shadow: 0 0 0 200vmax #000, inset 0 0 60px 20px rgba(0,0,0,.85); }
.scope .sh { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }
.scope .sv { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #000; }
.scope-dot { display: none; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #ff2d2d; box-shadow: 0 0 6px 1px rgba(255,45,45,.8); }
.scope.optic .scope-hole { width: 74vh; height: 74vh; box-shadow: 0 0 0 200vmax rgba(6,7,9,.96), 0 0 0 4px #15171b, inset 0 0 36px 8px rgba(0,0,0,.65); }
.scope.optic .sh, .scope.optic .sv { display: none; }
.scope.optic .scope-dot { display: block; }
.progress { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); width: 300px; display: none; text-align: center; }
.progress .pl { font-size: 18px; margin-bottom: 6px; font-weight: 600; }
.progress .pb { height: 8px; background: rgba(0,0,0,.6); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
.progress .pb i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.bottom-left { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 16px; align-items: flex-end; }
.stat { display: flex; align-items: center; gap: 6px; background: rgba(8,10,14,.55); padding: 4px 14px; border-radius: 8px; font-size: 34px; font-weight: 700; }
.stat .ic { font-size: 20px; color: var(--gold); }
.stat.low b { color: #ff4a3a; }
.money { font-size: 26px; font-weight: 700; color: #8dff9a; background: rgba(8,10,14,.55); padding: 4px 12px; border-radius: 8px; }
.bottom-right { position: absolute; right: 16px; bottom: 14px; text-align: right; }
.ammo { font-size: 44px; font-weight: 700; line-height: 1; }
.ammo span { font-size: 22px; color: rgba(255,255,255,.7); margin-left: 4px; }
.wname { font-size: 15px; color: rgba(255,255,255,.75); letter-spacing: .5px; }
.slots { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; margin-bottom: 8px; }
.slot { font-size: 14px; color: rgba(255,255,255,.55); }
.slot kbd { margin-right: 6px; font-size: 11px; }
.slot.on { color: var(--gold2); font-weight: 700; font-size: 16px; }
.bombtag { color: #ff4040; }
.chat { position: absolute; left: 16px; bottom: 90px; width: min(460px, 50vw); }
.chat .lines div { font-family: 'Space Grotesk', sans-serif; font-size: 14px; padding: 2px 0; transition: opacity 1s; }
.chat .lines div.old { opacity: 0; }
.chat.typing .lines div.old { opacity: 1; }
.chat .sys { color: #c9c3a8; font-style: italic; }
.chat input { display: none; width: 100%; margin-top: 6px; background: rgba(8,10,14,.85); border: 1px solid var(--gold); border-radius: 8px; padding: 8px 10px; outline: none; pointer-events: auto; font-family: 'Space Grotesk', sans-serif; }
.chat.typing input { display: block; }
.spec { position: absolute; bottom: 140px; left: 0; right: 0; text-align: center; font-size: 20px; }
.hint { position: absolute; top: 66%; left: 0; right: 0; text-align: center; font-size: 18px; color: rgba(255,255,255,.85); }

.modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.45); pointer-events: auto; font-family: 'Space Grotesk', sans-serif; }
.modal.open { display: flex; }
.modal .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal .panel.wide { width: min(820px, calc(100vw - 32px)); }
.modal h2 { font-family: 'Rajdhani', sans-serif; font-size: 30px; display: flex; justify-content: space-between; align-items: baseline; }
.modal h2 span { color: #8dff9a; }
.modal h3 { font-size: 15px; color: var(--gold2); margin-top: 6px; }
.modal label { display: flex; align-items: center; gap: 10px; font-size: 14px; justify-content: space-between; }
.modal label input[type=range] { flex: 1; accent-color: var(--gold); }
.modal label span { width: 48px; text-align: right; color: var(--dim); }
.modal select { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.modal select option { background: #14171e; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 0; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.room-code b { font-family: 'Rajdhani', sans-serif; font-size: 28px; letter-spacing: 4px; color: var(--gold2); }
.mut { color: var(--dim); font-size: 13px; }
.buy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.buy-col h4 { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.buy-item { display: flex; width: 100%; align-items: center; gap: 8px; text-align: left; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; cursor: pointer; }
.buy-item:hover { border-color: var(--gold); background: rgba(201,168,76,.12); }
.buy-item span { flex: 1; }
.buy-item b { color: #8dff9a; }
.buy-item.poor { opacity: .45; }
.buy-item.poor b { color: #ff9090; }
.bcols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bcols h3 { font-family: 'Rajdhani', sans-serif; font-size: 22px; margin-bottom: 6px; }
.bcols h3.tA { color: var(--ta); } .bcols h3.tD { color: var(--td); }
.board table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board th { text-align: left; color: var(--dim); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.board td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.04); }
.board th:not(:first-child), .board td:not(:first-child) { text-align: right; width: 70px; }
.board tr.me td { color: var(--gold2); font-weight: 600; }
.board small { color: var(--dim); }
.lockhint { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; background: rgba(0,0,0,.35); pointer-events: auto; cursor: pointer; text-align: center; padding: 16px; }
.lockhint div { font-size: 34px; font-weight: 700; }
.lockhint b { color: var(--gold2); }
.lockhint small { font-size: 15px; color: rgba(255,255,255,.8); max-width: 720px; font-family: 'Space Grotesk', sans-serif; }
@media (max-width: 700px) {
  .radar { width: 120px; height: 104px; }
  .center-msg { font-size: 28px; }
  .bcols { grid-template-columns: 1fr; }
  .logo { font-size: 48px; }
}
.pub-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); cursor: pointer; }
.rooms-box { margin-top: 16px; }
.rooms-box h3 { font-size: 14px; margin-bottom: 8px; }
#rooms { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dim); max-height: 190px; overflow-y: auto; }
.room-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text); cursor: pointer; text-align: left; }
.room-row:hover { border-color: var(--gold); }
.room-row b { color: var(--gold); }
#top { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.top-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 2px; color: var(--text); border-bottom: 1px solid var(--line); }
.top-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row b { flex-shrink: 0; font-weight: 500; color: var(--dim); font-size: 12px; }
.me-stats { font-size: 13px; color: var(--gold); margin-bottom: 8px; }
.top-note { font-size: 11px; color: var(--dim); margin-top: 8px; }
.medal { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font: 700 34px/1 'Rajdhani', sans-serif; letter-spacing: 2px; color: #ffd84d; text-shadow: 0 2px 10px rgba(0,0,0,.8); opacity: 0; }
.medal.small { font-size: 22px; color: #fff; }
.medal.big { font-size: 52px; color: #ff5c4d; }
.medal.show { animation: medal-pop 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes medal-pop { 0% { opacity: 0; transform: scale(1.5); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.radio-menu { display: none; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); padding: 12px 16px; border-radius: 10px; background: rgba(8,10,14,.78); font-size: 15px; line-height: 1.7; }
.radio-menu b { display: block; color: var(--gold); margin-bottom: 4px; }
.radio-menu kbd { display: inline-block; min-width: 18px; text-align: center; margin-right: 6px; border-radius: 4px; background: rgba(255,255,255,.14); font: inherit; font-weight: 700; }
