:root {
  --red: #b3242a;
  --bone: #e8e4d8;
  --dim: #8a8a86;
  --panel: rgba(12, 13, 16, 0.92);
  --line: rgba(232, 228, 216, 0.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070c; }
body {
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  color: var(--bone);
  user-select: none;
  -webkit-user-select: none;
}
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }

/* ============ overlays ============ */
#dmg-vignette, #health-pulse, #screen-flash {
  position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 40;
}
#dmg-vignette { background: radial-gradient(ellipse at center, transparent 42%, rgba(160, 10, 5, 0.55) 100%); transition: opacity 0.35s; }
#health-pulse { background: radial-gradient(ellipse at center, transparent 48%, rgba(140, 5, 0, 0.6) 100%); transition: opacity 0.5s; }
#screen-flash { background: #fff; transition: opacity 0.45s; z-index: 41; }

/* ============ HUD ============ */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 30; font-family: 'Staatliches', 'Arial Narrow', sans-serif; }

#crosshair {
  --gap: 10px;
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity 0.15s;
}
#crosshair span { position: absolute; background: rgba(240, 240, 230, 0.9); box-shadow: 0 0 2px #000; }
.ch-l { width: 8px; height: 2px; left: calc(-8px - var(--gap)); top: -1px; }
.ch-r { width: 8px; height: 2px; left: var(--gap); top: -1px; }
.ch-t { width: 2px; height: 8px; left: -1px; top: calc(-8px - var(--gap)); }
.ch-b { width: 2px; height: 8px; left: -1px; top: var(--gap); }
.ch-dot { width: 2px; height: 2px; left: -1px; top: -1px; }

#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitmarker span { position: absolute; width: 10px; height: 2px; background: #fff; box-shadow: 0 0 3px #000; }
#hitmarker span:nth-child(1) { transform: rotate(45deg); left: -12px; top: -8px; }
#hitmarker span:nth-child(2) { transform: rotate(-45deg); left: 2px; top: -8px; }
#hitmarker span:nth-child(3) { transform: rotate(-45deg); left: -12px; top: 6px; }
#hitmarker span:nth-child(4) { transform: rotate(45deg); left: 2px; top: 6px; }
#hitmarker.hm-show { opacity: 1; }
#hitmarker.hm-kill span { background: #ff4a3a; width: 12px; }
#hitmarker.hm-head span { background: #ffd24a; }

#bottom-left { position: absolute; left: 28px; bottom: 22px; }
#round {
  font-size: 58px; font-weight: 400; color: var(--red); line-height: 0.9; letter-spacing: 4px;
  text-shadow: 0 0 18px rgba(179, 36, 42, 0.7), 0 2px 4px #000;
  min-height: 52px;
}
#round.round-anim { animation: roundIn 1.4s ease-out; }
@keyframes roundIn {
  0% { transform: scale(2.4); opacity: 0; filter: blur(6px); }
  35% { transform: scale(1); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}
#points { font-size: 30px; font-weight: 400; letter-spacing: 2px; color: var(--bone); text-shadow: 0 2px 4px #000; margin-top: 2px; }
#points.flash { animation: ptsFlash 0.25s; }
@keyframes ptsFlash { 0% { color: #ffd24a; transform: scale(1.12); } 100% { color: var(--bone); transform: scale(1); } }
#perk-icons { display: flex; gap: 6px; margin-top: 8px; }
.perk-icon {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; border-radius: 4px; font-weight: 900; font-size: 13px;
  background: rgba(0, 0, 0, 0.5); text-shadow: 0 1px 2px #000;
}

#bottom-right { position: absolute; right: 28px; bottom: 22px; text-align: right; }
#weapon-name { font-size: 17px; letter-spacing: 3px; color: var(--dim); text-transform: uppercase; }
#ammo { font-size: 40px; font-weight: 400; letter-spacing: 2px; text-shadow: 0 2px 4px #000; }
#ammo .sep { color: var(--dim); margin: 0 6px; font-size: 24px; }
#ammo .reserve { color: var(--dim); font-size: 24px; }
#nade-row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 6px; }
#nade-count { font-family: 'Special Elite', 'Courier New', monospace; font-size: 14px; color: #cfc6ae; letter-spacing: 1px; }
#grenades { display: flex; gap: 5px; justify-content: flex-end; }
.nade { width: 12px; height: 16px; background: #6f7f5a; border-radius: 3px 3px 5px 5px; border: 1px solid #2c331f; box-shadow: 0 1px 3px #000; }
.nade.monkey { background: #b3894d; }
#monkey-count {
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 13px; letter-spacing: 1.5px;
  color: #e8c87a; text-shadow: 0 1px 3px #000; margin-bottom: 2px;
}
#monkey-count em { font-style: normal; color: rgba(220, 200, 150, 0.6); font-size: 11px; }

#drop-timers { position: absolute; top: 18px; right: 28px; text-align: right; }
.drop-timer { font-size: 18px; font-weight: 800; letter-spacing: 2px; text-shadow: 0 0 12px currentColor, 0 2px 3px #000; animation: pulse 0.8s infinite alternate; }
@keyframes pulse { from { opacity: 0.75; } to { opacity: 1; } }

#wave-progress { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: var(--dim); letter-spacing: 2px; font-size: 15px; }
#pap-notice { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); color: #c9a2ff; letter-spacing: 2px; font-size: 16px; text-shadow: 0 0 14px #8a5cff; }

#prompt-wrap { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); text-align: center; }
#prompt {
  font-size: 19px; color: var(--bone); text-shadow: 0 2px 4px #000; letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.45); padding: 8px 18px; border-radius: 4px; border: 1px solid var(--line);
}
#prompt b { color: #ffd24a; }
#prompt .pts { color: #8dff8d; font-weight: 700; }
#prompt .dim { color: var(--dim); }
#prompt-bar { width: 180px; height: 5px; background: rgba(255, 255, 255, 0.15); margin: 8px auto 0; border-radius: 3px; overflow: hidden; }
#prompt-bar-fill { height: 100%; background: #ffd24a; width: 0; }

#banner {
  position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
  font-size: 54px; font-weight: 900; letter-spacing: 10px; color: var(--red);
  opacity: 0; white-space: nowrap;
}
#banner.banner-anim { animation: bannerIn 3.4s ease-out forwards; }
@keyframes bannerIn {
  0% { opacity: 0; transform: translateX(-50%) scale(1.6); filter: blur(8px); }
  12% { opacity: 1; transform: translateX(-50%) scale(1); filter: blur(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
#banner-sub {
  position: absolute; left: 50%; top: 26%; margin-top: 66px; transform: translateX(-50%);
  font-size: 17px; letter-spacing: 4px; color: var(--dim); opacity: 0; white-space: nowrap;
}
#banner-sub.banner-sub-anim { animation: bannerIn 3.4s ease-out forwards; }

#revive-wrap { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); text-align: center; }
#revive-text { font-size: 17px; letter-spacing: 3px; color: #7ec8e3; text-shadow: 0 0 12px #3a7a9a; margin-bottom: 6px; }
.bar { width: 240px; height: 7px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; overflow: hidden; }
#revive-fill { height: 100%; background: #7ec8e3; width: 0; }

#down-overlay { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(60, 0, 0, 0.25), rgba(30, 0, 0, 0.65)); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#down-text { font-size: 42px; font-weight: 900; letter-spacing: 8px; color: #ff5545; text-shadow: 0 0 24px #a00; margin-bottom: 14px; }
.bar.bleed { width: 320px; }
#bleed-fill { height: 100%; background: #ff5545; width: 100%; transition: width 0.3s linear; }

#scoreboard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px 30px; min-width: 480px;
}
#scoreboard h3 { letter-spacing: 6px; color: var(--dim); font-size: 15px; margin-bottom: 12px; text-align: center; }
#scoreboard table { width: 100%; border-collapse: collapse; font-size: 17px; }
#scoreboard th { color: var(--dim); font-size: 12px; letter-spacing: 2px; text-align: left; padding: 4px 10px; border-bottom: 1px solid var(--line); }
#scoreboard td { padding: 6px 10px; font-weight: 700; text-shadow: 0 1px 3px #000; }

/* ============ screens ============ */
.screen { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
#menu {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(120, 20, 12, 0.22), transparent 60%),
    linear-gradient(180deg, #030407 0%, #07090e 55%, #0d0b09 100%);
  overflow: hidden;
  animation: projFlicker 7s infinite steps(1);
}
@keyframes projFlicker {
  0%, 100% { filter: brightness(1); }
  31% { filter: brightness(1); } 32% { filter: brightness(0.94); } 33% { filter: brightness(1); }
  68% { filter: brightness(1); } 69% { filter: brightness(0.96); } 70% { filter: brightness(1); }
}
#skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40vh; opacity: 0.9; pointer-events: none; }
#skyline .win { animation: winFlicker 3.7s infinite steps(1); }
#skyline .win.d2 { animation-delay: 1.3s; }
#skyline .win.d3 { animation-delay: 2.4s; }
@keyframes winFlicker { 0%, 88% { opacity: 0.9; } 90%, 94% { opacity: 0.15; } 96%, 100% { opacity: 0.9; } }
.fog-layer {
  position: absolute; left: -20%; right: -20%; height: 40vh; bottom: -6vh; pointer-events: none;
  background: radial-gradient(ellipse at 30% 100%, rgba(90, 100, 120, 0.12), transparent 60%),
              radial-gradient(ellipse at 70% 100%, rgba(90, 100, 120, 0.09), transparent 60%);
  animation: fogDrift 26s linear infinite alternate;
}
.fog-layer.f2 { animation-duration: 37s; animation-direction: alternate-reverse; opacity: 0.6; }
@keyframes fogDrift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
/* animated film grain (SVG turbulence tile, jittered with steps) */
#film-grain {
  position: absolute; inset: -120px; pointer-events: none; opacity: 0.09; z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainJit 0.55s infinite steps(1);
}
@keyframes grainJit {
  0% { transform: translate(0, 0); } 20% { transform: translate(-38px, 22px); }
  40% { transform: translate(24px, -41px); } 60% { transform: translate(-19px, -28px); }
  80% { transform: translate(41px, 14px); } 100% { transform: translate(0, 0); }
}
/* projector scratches: thin vertical lines that appear and drift */
#film-scratch {
  position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0.5;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(22% - 1px), rgba(220, 215, 200, 0.13) 22%, transparent calc(22% + 1px)),
    linear-gradient(90deg, transparent 0, transparent calc(71% - 1px), rgba(220, 215, 200, 0.09) 71%, transparent calc(71% + 1px));
  animation: scratchMove 9s infinite steps(1);
}
@keyframes scratchMove {
  0%, 100% { background-position: 0 0, 0 0; opacity: 0.5; }
  20% { background-position: 14px 0, -8px 0; opacity: 0.2; }
  38% { background-position: -10px 0, 12px 0; opacity: 0.55; }
  55% { background-position: 6px 0, -14px 0; opacity: 0.15; }
  76% { background-position: -16px 0, 6px 0; opacity: 0.5; }
}
#menu-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 50% 46%, transparent 42%, rgba(0, 0, 0, 0.55) 78%, rgba(0, 0, 0, 0.88) 100%);
}
.menu-corner {
  position: absolute; z-index: 4; font-family: 'Special Elite', 'Courier New', monospace;
  color: rgba(170, 163, 146, 0.4); font-size: 12px; letter-spacing: 3px; pointer-events: none;
}
.menu-corner.tl { top: 22px; left: 26px; }
.menu-corner.tr { top: 22px; right: 26px; }
.menu-corner.br { bottom: 20px; right: 26px; }
.menu-inner { text-align: center; animation: fadeUp 0.7s ease-out; position: relative; z-index: 5; margin-bottom: 9vh; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; } }
.title-block { position: relative; display: inline-block; padding: 0 40px; }
.title-top { letter-spacing: 6px; color: #7d786a; font-size: 13px; margin-bottom: 14px; font-family: 'Special Elite', 'Courier New', monospace; }
#menu h1 {
  font-family: 'Staatliches', 'Arial Narrow', sans-serif;
  font-size: 124px; font-weight: 400; letter-spacing: 26px; color: #d9d2bd; text-indent: 26px; /* optically recenter tracked caps */
  text-shadow: 0 0 42px rgba(179, 36, 42, 0.55), 0 2px 0 #000, 0 5px 14px #000;
  line-height: 0.95;
}
.title-rule { display: flex; align-items: center; gap: 14px; margin: 16px 6px 10px; }
.title-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(190, 182, 158, 0.5), transparent); }
.title-rule em { color: #8c262b; font-style: normal; font-size: 11px; }
.title-sub { letter-spacing: 9px; color: #a82a30; font-size: 16px; font-family: 'Special Elite', 'Courier New', monospace; text-shadow: 0 0 16px rgba(179, 36, 42, 0.8); }
/* rubber stamp, rotated and half-faded like old ink */
.stamp {
  position: absolute; top: 8px; right: -56px; transform: rotate(11deg);
  font-family: 'Staatliches', 'Arial Narrow', sans-serif; font-size: 26px; letter-spacing: 5px;
  color: rgba(168, 42, 48, 0.55); border: 3px double rgba(168, 42, 48, 0.55); border-radius: 4px;
  padding: 4px 12px 2px; pointer-events: none;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='w'%3E%3CfeTurbulence baseFrequency='0.25' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.85 0.15'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23w)'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='w'%3E%3CfeTurbulence baseFrequency='0.25' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.85 0.15'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23w)'/%3E%3C/svg%3E");
}
/* typewritten document-style menu items */
.menu-buttons { display: flex; flex-direction: column; gap: 4px; margin: 40px auto 0; width: 340px; }
.menu-link { display: block; text-decoration: none; }
.mbtn {
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 19px; font-weight: 400; letter-spacing: 4px;
  padding: 10px 16px 10px 40px; background: transparent; color: #b3ac99; text-align: left;
  border: none; border-left: 2px solid transparent; border-radius: 0; cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s; text-transform: uppercase; position: relative;
}
.mbtn::before {
  content: '►'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: #a82a30; opacity: 0; transition: opacity 0.12s;
}
.mbtn:hover:not(:disabled) {
  color: #ece5cf; border-left-color: #a82a30;
  background: linear-gradient(90deg, rgba(150, 30, 34, 0.16), transparent 75%);
}
.mbtn:hover:not(:disabled)::before { opacity: 1; }
.mbtn.primary { color: #ddd5bf; }
.mbtn.danger:hover { background: linear-gradient(90deg, rgba(120, 15, 10, 0.3), transparent 75%); }
.mbtn.small { font-size: 14px; padding: 8px 12px 8px 30px; letter-spacing: 2px; }
.mbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.mbtn.ready { color: #6fbf7f; }
/* panel buttons (lobby/options/pause) stay centered chrome */
.panel .mbtn { text-align: center; padding: 12px 26px; border: 1px solid rgba(232, 228, 216, 0.14); border-left-width: 2px; border-radius: 2px; background: rgba(16, 17, 20, 0.7); }
.panel .mbtn::before { display: none; }
.panel .mbtn:hover:not(:disabled) { background: rgba(150, 30, 34, 0.3); }
.panel .mbtn.primary { border-left-color: #a82a30; }
/* ---------- cheat codes ---------- */
.cheats {
  margin-top: 22px; padding: 12px 18px 10px;
  border: 1px solid rgba(200, 185, 140, 0.18); background: rgba(8, 9, 12, 0.55);
  display: flex; flex-direction: column; gap: 5px; text-align: left;
}
.cheats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; margin: 14px 0 6px; text-align: left; }
@media (max-width: 720px) { .cheats-grid { grid-template-columns: 1fr; } }
.cheats-title {
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 11px; letter-spacing: 4px;
  color: rgba(200, 185, 140, 0.5); text-align: center; margin-bottom: 4px;
}
.cheat {
  display: flex; align-items: baseline; gap: 10px; cursor: pointer; user-select: none;
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 13px; letter-spacing: 1.5px;
  color: #cfc6ae;
}
.cheat:hover { color: #f0e6c8; }
.cheat input { display: none; }
.cheat .box {
  position: relative; top: 2px; width: 13px; height: 13px; flex: 0 0 13px;
  border: 1px solid rgba(207, 198, 174, 0.55); display: inline-block;
}
.cheat input:checked + .box { background: rgba(200, 60, 40, 0.25); border-color: #c8402f; }
.cheat input:checked + .box::after {
  content: '✕'; position: absolute; inset: 0; color: #e04a38; font-size: 11px; line-height: 12px; text-align: center;
}
.cheat input:checked ~ .txt { color: #f0dfc0; }
.cheat .txt em { font-style: normal; color: rgba(180, 170, 145, 0.55); font-size: 11px; margin-left: 6px; letter-spacing: 0.5px; }
.cheat-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mbtn.titan {
  display: block; width: 100%; margin: 10px 0 4px; text-align: center;
  border-left-color: #d4af37; color: #ffd24a;
  background: linear-gradient(90deg, rgba(212,175,55,0.14), rgba(212,175,55,0.04));
}
.mbtn.titan:hover { background: linear-gradient(90deg, rgba(212,175,55,0.28), rgba(212,175,55,0.1)); }
.loadout-row { margin-top: 14px; text-align: left; }
.loadout-title { display: block; margin-bottom: 8px; }
.loadout-title em { font-style: normal; color: rgba(180,170,145,0.5); letter-spacing: 0.5px; }
.wpn-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .wpn-picks { grid-template-columns: 1fr; } }
.wpn-pick label { font-family: 'Special Elite', 'Courier New', monospace; font-size: 11px; letter-spacing: 2px; color: rgba(200,185,140,0.6); }
.wpn-search {
  width: 100%; margin: 6px 0; background: rgba(10,11,14,0.85); color: #cfc6ae;
  border: 1px solid rgba(200,185,140,0.3); font-family: 'Special Elite','Courier New',monospace;
  font-size: 13px; padding: 4px 8px; letter-spacing: 1px;
}
.wpn-list { max-height: 170px; overflow-y: auto; border: 1px solid rgba(200,185,140,0.16); background: rgba(6,7,9,0.6); }
.wpn-group { font-family: 'Special Elite','Courier New',monospace; font-size: 10px; letter-spacing: 2px; color: rgba(200,185,140,0.45); padding: 6px 8px 2px; }
.wpn-item {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: 'Special Elite','Courier New',monospace; font-size: 12.5px; letter-spacing: 1px;
  color: #cfc6ae; padding: 4px 10px;
}
.wpn-item:hover { background: rgba(200,60,40,0.12); color: #f0e6c8; }
.wpn-item.sel { background: rgba(200,60,40,0.22); color: #ffd9c8; border-left: 3px solid #c8402f; }
.wpn-item .cls { color: rgba(180,170,145,0.45); font-size: 10.5px; margin-left: 6px; }
.cheat-lbl { font-family: 'Special Elite', 'Courier New', monospace; font-size: 11px; letter-spacing: 2px; color: rgba(200, 185, 140, 0.6); }
#cheat-round, #cheat-area {
  background: rgba(10, 11, 14, 0.85); color: #cfc6ae; border: 1px solid rgba(200, 185, 140, 0.3);
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 13px; padding: 3px 7px; letter-spacing: 1px;
}
#cheat-round { width: 58px; }

.menu-help { margin-top: 34px; color: #5c584c; font-size: 12px; line-height: 1.9; letter-spacing: 1px; font-family: 'Special Elite', 'Courier New', monospace; }
.menu-help b { color: #9d9684; }
.menu-foot { margin-top: 22px; color: #413e36; font-size: 11px; letter-spacing: 1px; font-family: 'Special Elite', 'Courier New', monospace; }

/* loading */
.load-inner { text-align: center; width: min(460px, 84vw); }
.load-title { font-family: 'Staatliches', 'Arial Narrow', sans-serif; font-size: 52px; letter-spacing: 14px; color: #ddd6c4; text-shadow: 0 0 30px rgba(179, 36, 42, 0.6); margin-bottom: 26px; }
.load-bar-wrap { height: 5px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
#load-bar { height: 100%; width: 0; background: linear-gradient(90deg, #6b1418, #d43a40); transition: width 0.2s; }
.load-hint { margin-top: 16px; color: #6f6b60; font-family: 'Special Elite', 'Courier New', monospace; font-size: 13px; letter-spacing: 2px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 34px 40px; min-width: 380px; max-width: 92vw; text-align: center;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7); animation: fadeUp 0.4s ease-out;
}
.panel.wide { min-width: 560px; }
.panel h2 { letter-spacing: 8px; font-size: 30px; margin-bottom: 18px; }
.panel .dim { color: var(--dim); }
.panel .small-note { font-size: 13px; margin-top: 14px; }

.row-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.row-buttons.col { flex-direction: column; align-items: stretch; }

/* lobby */
.lobby-code-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.lobby-code-row .lbl { font-size: 11px; letter-spacing: 3px; color: var(--dim); text-align: left; }
#lobby-code { font-size: 44px; font-weight: 900; letter-spacing: 10px; color: #ffd24a; text-shadow: 0 0 18px rgba(255, 210, 74, 0.4); text-align: left; }
.link-row { display: flex; gap: 8px; flex: 1; min-width: 260px; }
#lobby-link {
  flex: 1; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--dim);
  padding: 9px 12px; border-radius: 4px; font-family: inherit; font-size: 13px;
}
#lobby-players { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.lobby-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 4px; padding: 12px 18px;
}
.lobby-name { font-size: 18px; font-weight: 800; letter-spacing: 1px; flex: 1; }
.lobby-ready { font-size: 13px; letter-spacing: 3px; color: var(--dim); }
.lobby-ready.yes { color: #3fae5a; text-shadow: 0 0 10px rgba(63, 174, 90, 0.5); }
/* voice: speaker dots light up while someone talks */
.lobby-spk { color: #3a3f46; font-size: 13px; width: 18px; transition: color 0.12s, text-shadow 0.12s; }
.lobby-spk.on { color: #4ae08a; text-shadow: 0 0 8px rgba(74, 224, 138, 0.8); }
.lobby-mute {
  background: none; border: none; cursor: pointer; font-size: 15px; padding: 0 8px;
  opacity: 0.75; filter: grayscale(0.4);
}
.lobby-mute:hover { opacity: 1; }
.lobby-mute.muted { opacity: 1; filter: none; }
.lobby-voice-note { color: var(--dim); font-size: 12px; letter-spacing: 1px; }
#lobby-hint { color: var(--dim); font-size: 14px; letter-spacing: 1px; min-height: 20px; }
.lobby-note { margin-top: 16px; color: #555; font-size: 12px; letter-spacing: 1px; }

#join-code {
  width: 220px; font-size: 34px; font-weight: 900; letter-spacing: 12px; text-align: center;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: #ffd24a;
  padding: 10px; border-radius: 4px; margin: 18px auto 0; display: block; text-transform: uppercase;
  font-family: inherit; outline: none;
}
#join-code:focus { border-color: #ffd24a; }

/* options */
.opt-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px 22px; text-align: left; align-items: center; margin-top: 8px; }
.opt-grid label { letter-spacing: 1px; font-size: 15px; }
.opt-grid .val { color: #ffd24a; margin-left: 6px; }
.opt-grid input[type='range'] { width: 100%; accent-color: var(--red); }
.opt-grid select, .opt-grid input[type='text'], #opt-name {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--bone);
  padding: 8px 10px; border-radius: 4px; font-family: inherit; font-size: 15px; width: 100%;
}
.opt-grid input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--red); justify-self: start; }

.overlay-dark { background: rgba(3, 4, 6, 0.75); backdrop-filter: blur(3px); }

.pause-controls {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(200,185,140,0.15);
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 11.5px; letter-spacing: 1px;
  color: rgba(207,198,174,0.65); line-height: 1.9;
}
.pause-controls b { color: #cfc6ae; }
#lobby-name {
  background: rgba(10,11,14,0.85); color: #f0e6c8; border: 1px solid rgba(200,185,140,0.3);
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 14px; padding: 4px 10px; letter-spacing: 1px;
  width: 180px;
}
#toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  padding: 12px 26px; font-size: 15px; letter-spacing: 1px; z-index: 90;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); animation: fadeUp 0.25s ease-out;
}

/* HUD corner buttons (pause / fullscreen) */
#hud-btns { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 40; }

#vox-sub {
  position: fixed; left: 26px; bottom: 118px; max-width: 46ch;
  font-family: 'Special Elite', 'Courier New', monospace; font-size: 15px; letter-spacing: 0.5px;
  color: #e8dfc8; text-shadow: 0 2px 6px #000; pointer-events: none; z-index: 34;
  opacity: 0.96;
}
#vox-sub::before { content: '📻 '; opacity: 0.7; }
.vox-anim { animation: voxIn 0.25s ease-out; }
@keyframes voxIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 0.96; transform: none; } }

#lock-hint {
  position: fixed; left: 50%; top: 58%; transform: translateX(-50%);
  font-family: 'Staatliches', 'Arial Narrow', sans-serif; font-size: 22px; letter-spacing: 4px;
  color: #ece5cf; text-shadow: 0 2px 8px #000; pointer-events: none; z-index: 35;
  animation: lockHintPulse 1.4s ease-in-out infinite;
}
@keyframes lockHintPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }#hud-btns button {
  width: 40px; height: 40px; border-radius: 6px; cursor: pointer;
  background: rgba(10, 11, 14, 0.55); border: 1px solid rgba(232, 228, 216, 0.22);
  color: #b8b2a2; font-size: 17px; line-height: 1; backdrop-filter: blur(2px);
  transition: all 0.12s; font-family: inherit;
}
#hud-btns button:hover { color: #ece5cf; border-color: rgba(232, 228, 216, 0.5); background: rgba(20, 21, 26, 0.75); }
#hud-btns button.on { color: #ffd24a; border-color: rgba(255, 210, 74, 0.5); }

@media (max-width: 700px) {
  #menu h1 { font-size: 54px; letter-spacing: 8px; }
  .panel.wide { min-width: 0; width: 94vw; }
  #banner { font-size: 30px; }
}
@media (max-height: 820px) and (min-width: 701px) {
  .menu-inner { margin-bottom: 1vh; }
  #menu h1 { font-size: 86px; }
  .title-top { margin-bottom: 8px; }
  .title-rule { margin-top: 9px; }
  .menu-buttons { margin-top: 20px; }
  .mbtn { padding-top: 7px; padding-bottom: 7px; font-size: 16px; }
  .menu-help { margin-top: 18px; line-height: 1.55; }
  .menu-foot { margin-top: 10px; }
}

/* ---------- touch-device gate ---------- */
body.touch-device-gated > :not(#device-gate) { visibility: hidden; }
body.touch-device-gated #device-gate,
body.touch-device-gated #device-gate * { visibility: visible; }
#device-gate {
  z-index: 200; overflow: hidden; padding: 24px;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(125, 26, 18, 0.26), transparent 58%),
    linear-gradient(180deg, #030407 0%, #080a0e 58%, #0e0b09 100%);
}
#device-gate .fog-layer { z-index: 0; }
.gate-grain {
  position: absolute; inset: -100px; pointer-events: none; opacity: 0.08; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grainJit 0.7s infinite steps(1);
}
.gate-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,.82) 100%); }
.gate-dossier, .gate-foot {
  position: absolute; z-index: 4; font: 11px/1.4 'Special Elite', 'Courier New', monospace;
  letter-spacing: 2.5px; color: rgba(194, 184, 158, 0.38); text-align: center;
}
.gate-dossier { top: 22px; left: 20px; right: 20px; }
.gate-foot { bottom: 18px; left: 20px; right: 20px; }
.device-gate-card {
  position: relative; z-index: 5; width: min(560px, 100%); padding: clamp(28px, 7vw, 58px);
  border: 1px solid rgba(210, 197, 164, 0.2); background: rgba(8, 9, 12, 0.78);
  box-shadow: 0 30px 100px rgba(0,0,0,.75), inset 0 0 70px rgba(140,32,28,.05);
  text-align: center; animation: fadeUp .55s ease-out;
}
.device-gate-card::before, .device-gate-card::after { content: ''; position: absolute; width: 28px; height: 28px; border-color: rgba(179,36,42,.8); }
.device-gate-card::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.device-gate-card::after { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.gate-kicker { color: #9b302f; font: 12px/1 'Special Elite', monospace; letter-spacing: 5px; }
.gate-mark { width: 58px; height: 58px; margin: 26px auto 22px; border: 2px solid rgba(179,36,42,.65); border-radius: 50%; color: #c43a3d; font: 46px/52px 'Staatliches', sans-serif; transform: rotate(8deg); }
.device-gate-card h2 { font: 400 clamp(38px, 10vw, 64px)/.95 'Staatliches', sans-serif; letter-spacing: clamp(5px, 1.6vw, 11px); color: #ddd5bf; text-shadow: 0 0 28px rgba(179,36,42,.38); }
.gate-lead { max-width: 26ch; margin: 20px auto 0; color: #cfc6ae; font: 16px/1.55 'Special Elite', monospace; }
.gate-copy { max-width: 48ch; margin: 16px auto 0; color: #736e61; font: 12px/1.7 'Special Elite', monospace; }
.gate-actions { display: grid; gap: 9px; margin-top: 28px; }
.gate-action, .gate-audio {
  min-height: 46px; display: flex; align-items: center; justify-content: center; padding: 11px 16px;
  border: 1px solid rgba(210,197,164,.2); background: rgba(16,17,20,.68); color: #bdb49f;
  font: 12px/1.25 'Special Elite', monospace; letter-spacing: 2px; text-decoration: none; cursor: pointer;
}
.gate-action.primary { color: #eee5ce; border-left: 3px solid #b3242a; background: linear-gradient(90deg, rgba(150,30,34,.2), rgba(16,17,20,.68)); }
.gate-audio { width: 100%; margin-top: 9px; border: 0; background: transparent; color: #6e6a60; font-size: 10px; }
.gate-audio[aria-pressed='true'] { color: #a99f89; }
@media (max-width: 420px) {
  #device-gate { padding: 14px; }
  .device-gate-card { padding: 26px 20px; }
  .gate-copy { font-size: 11px; }
  .gate-dossier { font-size: 9px; letter-spacing: 1.8px; }
}

/* ---------- sniper scope (full ADS) ---------- */
#scope-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 36; }
#scope-overlay.hidden { display: none; }
.scope-ring {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 33vmin, rgba(0,0,0,0.55) 33.8vmin, rgba(0,0,0,0.99) 34.4vmin);
}
.scope-h {
  position: absolute; top: 50%; left: 50%; width: 64vmin; height: 2px;
  transform: translate(-50%, -1px);
  background: rgba(20, 20, 20, 0.85);
  box-shadow: 0 0 2px rgba(230, 230, 220, 0.7);
}
.scope-v {
  position: absolute; top: 50%; left: 50%; width: 2px; height: 64vmin;
  transform: translate(-1px, -50%);
  background: rgba(20, 20, 20, 0.85);
  box-shadow: 0 0 2px rgba(230, 230, 220, 0.7);
}
.scope-tick {
  position: absolute; left: 50%; width: 2px; height: 2vmin;
  transform: translateX(-1px);
  background: rgba(20, 20, 20, 0.85);
  box-shadow: 0 0 2px rgba(230, 230, 220, 0.7);
}
.scope-tick.t1 { top: calc(50% + 6vmin); }
.scope-tick.t2 { top: calc(50% + 12vmin); }
.scope-tick.t3 { top: calc(50% + 18vmin); }
.scope-tick.t4 { top: calc(50% + 24vmin); }

#reddot-overlay { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 36; }
#reddot-overlay.hidden { display: none; }
.rd-glass {
  width: 11vmin; height: 8.5vmin; border-radius: 12%;
  border: 2px solid rgba(30, 32, 36, 0.9);
  background: linear-gradient(135deg, rgba(160, 190, 210, 0.10), rgba(120, 150, 175, 0.05));
  box-shadow: inset 0 0 8px rgba(180, 200, 220, 0.15), 0 1px 3px rgba(0,0,0,0.6);
}
.rd-dot {
  position: absolute; left: 50%; top: 50%; width: 0.55vmin; height: 0.55vmin;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #ff2a1a; box-shadow: 0 0 6px 2px rgba(255, 40, 25, 0.75);
}

/* ---------- character select ---------- */
.chars-panel { max-width: 860px; }
#char-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.char-card {
  border: 1px solid rgba(200, 185, 140, 0.22); background: rgba(10, 11, 14, 0.6);
  padding: 14px 10px; text-align: center; cursor: pointer; transition: all 0.15s;
}
.char-card:hover { border-color: rgba(232, 210, 150, 0.65); background: rgba(20, 20, 26, 0.8); transform: translateY(-2px); }
.char-card.taken { opacity: 0.35; pointer-events: none; }
.char-card canvas { width: 64px; height: 64px; image-rendering: pixelated; margin-bottom: 8px; }
.char-card .cc-name { font-family: 'Staatliches', sans-serif; font-size: 17px; letter-spacing: 1.5px; color: #e8dfc8; }
.char-card .cc-role { font-family: 'Special Elite', monospace; font-size: 10px; letter-spacing: 1px; color: rgba(200,185,140,0.55); margin-top: 3px; }
.char-page { display: flex; gap: 26px; max-width: 780px; text-align: left; }
.char-page-left { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#char-portrait { width: 192px; height: 192px; image-rendering: pixelated; border: 1px solid rgba(200,185,140,0.3); background: #0a0b0e; }
#char-voice-lines { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.vline-btn {
  font-family: 'Special Elite', monospace; font-size: 12px; letter-spacing: 1px;
  background: rgba(20, 21, 26, 0.7); color: #cfc6ae; border: 1px solid rgba(200,185,140,0.25);
  padding: 6px 10px; cursor: pointer; text-align: left;
}
.vline-btn:hover { color: #f0e6c8; border-color: rgba(232,210,150,0.6); }
.char-role { font-family: 'Special Elite', monospace; font-size: 13px; letter-spacing: 2px; color: #c8402f; margin: 4px 0 14px; }
.char-bio { font-family: 'Special Elite', monospace; font-size: 14px; line-height: 1.7; color: #cfc6ae; }
.char-traits { margin: 12px 0; padding-left: 18px; font-family: 'Special Elite', monospace; font-size: 13px; color: rgba(200,185,140,0.85); }
.char-traits li { margin: 3px 0; }
.char-quotes { margin: 14px 0 20px; font-family: 'Special Elite', monospace; font-size: 13px; font-style: italic; color: rgba(160, 200, 230, 0.75); }
.char-quotes div { margin: 4px 0; }
.lobby-char-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lobby-char-name { font-family: 'Staatliches', sans-serif; letter-spacing: 2px; color: #e8dfc8; font-size: 16px; }

#mic-indicator {
  position: fixed; top: 16px; left: 18px; transform: none;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  pointer-events: none; z-index: 34;
}
#mic-indicator .spk {
  font-family: 'Staatliches', sans-serif; font-size: 14px; letter-spacing: 2px;
  color: #7ee38a; text-shadow: 0 2px 6px #000;
  background: rgba(8, 10, 12, 0.55); border: 1px solid rgba(126, 227, 138, 0.35);
  padding: 2px 10px; border-radius: 3px;
  animation: spkIn 0.15s ease-out;
}
@keyframes spkIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
