* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; font-family: system-ui, -apple-system, sans-serif; color: #fff; user-select: none; }
#game, #game canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,30,40,.55), rgba(0,0,0,.85)); z-index: 20; }
.panel { width: min(520px, 92vw); background: rgba(18,22,28,.92); border: 1px solid #ffffff22; border-radius: 14px; padding: 28px 30px; box-shadow: 0 20px 60px #000a; }
h1 { margin: 0; font-size: 34px; letter-spacing: .5px; }
.sub { margin: 4px 0 20px; color: #9fb0c0; font-size: 14px; }
label { display: block; margin: 12px 0; color: #c8d3de; font-size: 14px; }
#name { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 16px; border-radius: 8px; border: 1px solid #ffffff33; background: #0c0f13; color: #fff; }
#time-of-day { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 15px; border-radius: 8px; border: 1px solid #ffffff33; background: #0c0f13; color: #fff; }
.buttons { display: flex; gap: 10px; margin-top: 8px; }
button { flex: 1; padding: 12px 14px; font-size: 16px; font-weight: 600; border-radius: 8px; border: 1px solid #ffffff33; background: #253040; color: #fff; cursor: pointer; width: 100%; margin-top: 8px; }
button:hover { background: #2f3d52; }
button.primary { background: #d9632b; border-color: #f08a4e; }
button.primary:hover { background: #ec7238; }
.sens input { width: 100%; }
#status { min-height: 20px; color: #ffcf7a; font-size: 14px; margin-top: 6px; }
.help { margin-top: 14px; font-size: 13px; line-height: 1.6; color: #aab7c4; background: #0c0f13; border-radius: 8px; padding: 10px 12px; }
.credits { font-size: 11px; color: #6f7d8a; margin: 14px 0 0; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#crosshair i:nth-child(1) { width: 2px; height: 8px; left: -1px; top: -14px; }
#crosshair i:nth-child(2) { width: 2px; height: 8px; left: -1px; top: 6px; }
#crosshair i:nth-child(3) { width: 8px; height: 2px; left: -14px; top: -1px; }
#crosshair i:nth-child(4) { width: 8px; height: 2px; left: 6px; top: -1px; }
#crosshair.aiming { transform: scale(.65); }
#crosshair.aiming::after { content: ''; position: absolute; width: 4px; height: 4px; left: -2px; top: -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 3px 1px #000; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; opacity: 0; transition: opacity .15s;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
#hitmarker.show { opacity: 1; transition: none; }
#hitmarker.head { filter: drop-shadow(0 0 2px red) sepia(1) saturate(20) hue-rotate(-30deg); }
#scope { position: absolute; inset: 0; display: none;
  background: radial-gradient(circle at center, transparent 0, transparent 33vh, #000 33.2vh),
    linear-gradient(#000, #000) center/100% 1px no-repeat, linear-gradient(#000, #000) center/1px 100% no-repeat; }
#scope.on { display: block; }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(200,0,0,.75)); transition: opacity .4s; }
#health { position: absolute; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 700; text-shadow: 0 2px 4px #000; }
#hpbar { width: 200px; height: 12px; background: #0008; border-radius: 6px; overflow: hidden; border: 1px solid #fff4; }
#hpbar b { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3fd16b, #a6f06c); transition: width .2s; }
#ammo { position: absolute; right: 24px; bottom: 24px; font-size: 18px; text-shadow: 0 2px 4px #000; text-align: right; }
#ammo b { font-size: 40px; margin-left: 8px; }
#ammo small { display: block; color: #ffcf7a; }
#weapons { position: absolute; right: 24px; bottom: 90px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: calc(100vw - 48px); }
#weapons span { padding: 4px 8px; background: #0007; border-radius: 4px; font-size: 13px; color: #bbb; white-space: nowrap; }
#weapons span.on { background: #d9632bcc; color: #fff; }
#feed { position: absolute; right: 20px; top: 20px; text-align: right; font-size: 14px; line-height: 1.7; text-shadow: 0 1px 3px #000; max-width: 45vw; }
#feed div { background: #0006; padding: 1px 8px; border-radius: 4px; margin-bottom: 3px; display: inline-block; clear: both; float: right; }
#topinfo { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font-size: 14px; background: #0006; padding: 4px 12px; border-radius: 6px; }
#dead { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(60,0,0,.35); }
#dead h2 { font-size: 34px; margin: 0; text-shadow: 0 2px 6px #000; }
#scoreboard { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); min-width: 380px; background: rgba(12,15,19,.9); border-radius: 10px; padding: 16px 20px; }
#scoreboard h3 { margin: 0 0 10px; }
#scoreboard table { width: 100%; border-collapse: collapse; font-size: 15px; }
#scoreboard th, #scoreboard td { padding: 5px 8px; text-align: left; }
#scoreboard th:not(:first-child), #scoreboard td:not(:first-child) { text-align: right; }
#scoreboard tr.me td { background: #d9632b44; }
#minimap { position: absolute; left: 20px; top: 20px; width: 180px; height: 180px; border-radius: 8px; border: 1px solid #fff4; background: #0006; }
#chat { position: absolute; left: 20px; bottom: 80px; width: 380px; padding: 8px 10px; font-size: 15px; border-radius: 6px; border: 1px solid #fff5; background: #000b; color: #fff; pointer-events: auto; }

@media (max-width: 600px) {
  #weapons { right: 12px; bottom: 82px; max-width: 82vw; gap: 4px; }
  #weapons span { padding: 3px 6px; font-size: 11px; }
  #health { left: 12px; bottom: 14px; font-size: 22px; }
  #hpbar { width: 110px; }
  #ammo { right: 12px; bottom: 12px; font-size: 15px; }
  #ammo b { font-size: 30px; }
}
/* rooms: the link to share, on one line with its copy button */
#room { display: flex; gap: 10px; align-items: flex-end; margin: 12px 0 4px; }
#room label { flex: 1; margin: 0; }
#room input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid #ffffff33; background: #0c0f13; color: #fff; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
#room button { flex: none; width: auto; margin: 0; padding: 10px 14px; }
