/* ZERO SIEVERT co-op — exclusion-zone lobby + game chrome
   Evidence: title-screen.png (yellow wordmark on magenta sky over black
   silhouette), loading-deploy.png (black bg, white pixel text, green accent) */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --yellow: #e8d44d;
  --green: #52c46a;
  --red: #d84848;
  --sky: #c86a9c;
  --bg-deep: #0a0d08;
  --bg-panel: rgba(14, 18, 12, 0.92);
  --line: #2c3626;
  --line-hi: #4c5c3e;
  --dim: #8a967c;
  --p1: #4aa3ff;
  --p2: #ff9f43;
  --p3: #5cd65c;
  --p4: #e056fd;
}

html, body {
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, #131a10 0%, var(--bg-deep) 75%);
  color: #dde4d2;
  font-family: "Courier New", monospace;
  overflow: hidden;
}

#app { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Lobby ─────────────────────────────────────────────────────────────── */
#lobby-screen {
  width: min(560px, 94vw);
  max-height: 96vh;
  overflow-y: auto;
  padding: 0 30px 26px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(82, 196, 106, 0.12), inset 0 0 60px rgba(0,0,0,0.5);
}

/* magenta-sky hero strip with black treeline silhouette (title evidence) */
#lobby-hero {
  height: 64px;
  margin: 0 -30px 14px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 55%, #0a0d08 100%),
    repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 22px),
    linear-gradient(180deg, #7c3860 0%, #c86a9c 55%, #e0879c 100%);
  background-blend-mode: normal, normal, normal;
  border-bottom: 2px solid #000;
  position: relative;
}
#lobby-hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: repeating-linear-gradient(90deg,
    #050705 0 26px, transparent 26px 34px, #050705 34px 52px, transparent 52px 60px);
}

#lobby-title {
  font-size: 46px;
  font-weight: bold;
  letter-spacing: 6px;
  color: var(--yellow);
  text-shadow: 3px 3px 0 #000, 0 0 22px rgba(232, 212, 77, 0.35);
}
#lobby-title span { color: #f0e88a; }

#lobby-subtitle { margin: 6px 0 16px; font-size: 12px; color: var(--dim); letter-spacing: 1px; }

#connection-status { font-size: 12px; margin-bottom: 12px; }
#connection-status.connected { color: var(--green); }
#connection-status.disconnected { color: var(--red); }

.lobby-section { margin-bottom: 16px; }
.lobby-section-title {
  font-size: 11px; letter-spacing: 3px; color: var(--green);
  text-transform: uppercase; margin-bottom: 7px;
}

.btn-row { display: flex; gap: 8px; }

input#room-code-input {
  flex: 0 0 110px;
  background: #10150c; border: 1px solid var(--line-hi); color: var(--yellow);
  font-family: inherit; font-size: 18px; font-weight: bold; letter-spacing: 3px;
  padding: 8px 10px; text-transform: uppercase; text-align: center;
}

button {
  background: #1a2214; border: 1px solid var(--line-hi); color: #dde4d2;
  font-family: inherit; font-size: 13px; padding: 9px 14px; cursor: pointer;
  letter-spacing: 1px;
}
button:hover:not(:disabled) { background: #26321c; border-color: var(--green); }
button:disabled { opacity: 0.45; cursor: default; }

.player-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.player-slot {
  padding: 9px 12px; background: #10150c; border: 1px solid var(--line);
  min-height: 52px;
}
.player-slot.occupied { border-color: var(--line-hi); }
.player-slot.ready { border-color: var(--green); box-shadow: 0 0 10px rgba(82,196,106,.3); }
.slot-label { font-size: 12px; font-weight: bold; letter-spacing: 1px; }
.slot-label.p1 { color: var(--p1); }
.slot-label.p2 { color: var(--p2); }
.slot-label.p3 { color: var(--p3); }
.slot-label.p4 { color: var(--p4); }
.slot-status { font-size: 11px; color: var(--dim); margin-top: 4px; }

.btn-ready {
  width: 100%; font-size: 20px; font-weight: bold;
  letter-spacing: 5px; padding: 13px;
  background: linear-gradient(180deg, #24401e, #122411);
  border: 1px solid var(--green);
  text-shadow: 0 0 8px var(--green);
}
.btn-ready.is-ready { background: linear-gradient(180deg, #4a4416, #2a260c); border-color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }

#lobby-status-text { font-size: 12px; color: var(--dim); min-height: 16px; }
#lobby-help { font-size: 11px; color: #66735a; line-height: 1.7; border-top: 1px solid var(--line); padding-top: 10px; }

/* ── Game ──────────────────────────────────────────────────────────────── */
#game-wrapper { display: none; position: relative; width: 100%; height: 100%; align-items: center; justify-content: center; }
#game-wrapper.active { display: flex; }
#lobby-screen.hidden { display: none; }

canvas#game-canvas {
  max-width: 100vw; max-height: 100vh;
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: contain;
  background: #000;
  cursor: crosshair;
  image-rendering: pixelated;
}

#countdown-overlay {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
#countdown-overlay.active { display: flex; }
#countdown-number {
  font-size: 120px; font-weight: bold; color: var(--green);
  text-shadow: 5px 5px 0 #000, 0 0 40px var(--green);
}

#disconnected-overlay {
  position: absolute; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(4, 8, 4, 0.9); z-index: 30;
}
#disconnected-overlay.active { display: flex; }
#dc-title { color: var(--red); letter-spacing: 4px; }
#dc-message { color: var(--dim); font-size: 13px; }

#mute-btn, #fullscreen-btn {
  position: absolute; bottom: 10px; z-index: 20;
  width: 40px; height: 40px; padding: 0; font-size: 18px;
  background: rgba(14, 18, 12, 0.6); border: 1px solid var(--line-hi);
}
#mute-btn { right: 10px; }
#fullscreen-btn { right: 58px; }

/* ── Rotate hint (portrait phones) ─────────────────────────────────────── */
#rotate-hint {
  display: none; position: absolute; inset: 0; z-index: 40;
  align-items: center; justify-content: center;
  background: rgba(4, 8, 4, 0.92); color: var(--yellow);
  font-size: 20px; letter-spacing: 2px; text-align: center; padding: 20px;
}
@media (orientation: portrait) {
  body.touch #rotate-hint { display: flex; }
}

/* ── Touch UI ──────────────────────────────────────────────────────────── */
#touch-ui { display: none; }
body.touch #touch-ui { display: block; }
#joy-left, #joy-right {
  position: absolute; bottom: 0; width: 42%; height: 55%; z-index: 15;
}
#joy-left { left: 0; }
#joy-right { right: 0; }
#touch-buttons {
  position: absolute; right: 12px; top: 12%;
  display: flex; flex-direction: column; gap: 10px; z-index: 16;
}
.tbtn {
  width: 64px; height: 44px; font-size: 11px; font-weight: bold;
  background: rgba(14, 18, 12, 0.55); border: 1px solid var(--green);
  color: var(--green); border-radius: 6px;
}
.tbtn:active { background: rgba(82, 196, 106, 0.35); }
