/* simcity-2000-ne — UI chrome styled after SC2000's Win95-era look
   (see gdd/screenshots), plus the NE layer: player panel, chat, transfer,
   vote pips. */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #0c0c14; overflow: hidden; font-family: "Segoe UI", Tahoma, sans-serif; color: #ddd; }
#app { width: 100%; height: 100%; }
button { cursor: pointer; }

/* ── Lobby ─────────────────────────────────────────────────────────────── */
#lobby-screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; z-index: 40;
  background: radial-gradient(ellipse at 50% 30%, #23233f 0%, #0c0c14 70%);
}
#lobby-art { width: 340px; height: 8px; background: repeating-linear-gradient(90deg, #4aa3ff 0 18px, #ff9f43 18px 36px, #5cd65c 36px 54px, #e056fd 54px 72px); border-radius: 2px; }
#lobby-title { font-size: 42px; font-weight: 800; letter-spacing: 6px; color: #e8e4d0; text-shadow: 0 3px 0 #1a1a2a, 0 6px 18px #000; }
#lobby-ne { font-size: 16px; font-weight: 800; letter-spacing: 10px; color: #3fbfb0; margin-top: -10px; }
#lobby-subtitle { font-size: 13px; color: #8fa0b8; letter-spacing: 1px; }
.lobby-section { width: 480px; background: #16162a; border: 1px solid #2c2c4a; border-radius: 8px; padding: 12px; }
.lobby-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 4px 0; }
#connection-status.disconnected { color: #e05555; } #connection-status.connected { color: #5cd65c; }
#lobby-room-code { font-family: Consolas, monospace; font-size: 18px; color: #ffd35c; letter-spacing: 3px; }
#name-input { flex: 1; background: #0e0e1c; color: #eee; border: 1px solid #34345a; border-radius: 4px; padding: 7px 9px; font-size: 14px; }
#btn-copy-link { background: #26264a; color: #cfe0ff; border: 1px solid #3c3c6a; border-radius: 4px; padding: 7px 12px; }
.player-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.player-slot { border: 1px solid #2c2c4a; border-radius: 6px; padding: 8px 10px; background: #101020; min-height: 58px; }
.player-slot .slot-label { font-size: 11px; opacity: .7; }
.player-slot .slot-name { font-weight: 700; font-size: 15px; margin: 2px 0; }
.player-slot .slot-status { font-size: 11px; color: #8fa0b8; }
.player-slot.ready { border-color: #3fbf6f; box-shadow: 0 0 8px #3fbf6f33 inset; }
.player-slot.is-you { outline: 1px dashed #ffffff33; }
#btn-ready {
  width: 480px; padding: 12px; font-size: 18px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(#3fbf6f, #2c8f50); color: #fff; border: 0; border-radius: 8px;
}
#btn-ready:disabled { filter: grayscale(.8) brightness(.6); cursor: default; }
#btn-ready.on { background: linear-gradient(#e0a53f, #b57e28); }
#lobby-status-text { font-size: 12px; color: #8fa0b8; }
#lobby-hint { font-size: 11px; color: #5a6a80; max-width: 480px; text-align: center; }

/* ── Game wrapper / canvas ─────────────────────────────────────────────── */
#game-wrapper { position: absolute; inset: 0; display: none; }
#game-wrapper.active { display: block; }
#game-canvas {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #201410; image-rendering: pixelated;
}

/* ── Win95-ish chrome helpers ──────────────────────────────────────────── */
.bevel, #top-strip, #toolbar, #minimap-panel {
  background: #b8b4a8;
  border-top: 2px solid #f2efe4; border-left: 2px solid #f2efe4;
  border-right: 2px solid #55534a; border-bottom: 2px solid #55534a;
  color: #17150f;
}

/* ── Top strip ─────────────────────────────────────────────────────────── */
#top-strip {
  position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 10;
  display: flex; align-items: center; gap: 14px; padding: 0 10px;
  font-size: 13px; font-weight: 700; font-family: Tahoma, sans-serif;
  user-select: none;
}
#ts-city { color: #223; } #ts-date { min-width: 66px; }
#ts-funds { color: #1d5c1d; min-width: 76px; } #ts-funds.neg { color: #a01010; }
#ts-funds.broke { color: #a01010; text-decoration: underline wavy #a01010; }
#ts-pop { min-width: 76px; }
#ts-rci { display: flex; align-items: center; }
#ts-speed .spd {
  width: 26px; height: 20px; font-size: 9px; border: 1px solid #55534a; background: #ccc8ba; color: #333;
}
#ts-speed .spd.sel { background: #6a8fd0; color: #fff; }
#ts-speed.locked .spd { opacity: .55; cursor: default; }
#ts-tool { flex: 1; text-align: center; color: #2a2a55; }
#ts-right { margin-left: auto; display: flex; gap: 6px; }
#ts-right button { border: 1px solid #55534a; background: #ccc8ba; font-size: 10px; font-weight: 700; padding: 2px 7px; }
#ts-right button.off { color: #999; text-decoration: line-through; }

/* ── Toolbar ───────────────────────────────────────────────────────────── */
#toolbar {
  position: absolute; left: 6px; top: 40px; z-index: 10; padding: 4px;
  display: grid; grid-template-columns: 38px 38px; gap: 3px; user-select: none;
}
.tool-btn {
  width: 38px; height: 38px; padding: 0; position: relative;
  background: #ccc8ba; border-top: 2px solid #f2efe4; border-left: 2px solid #f2efe4;
  border-right: 2px solid #6a675c; border-bottom: 2px solid #6a675c;
}
.tool-btn.sel { background: #9ab0d8; border-top-color: #55534a; border-left-color: #55534a; border-right-color: #f2efe4; border-bottom-color: #f2efe4; }
.tool-btn canvas { width: 32px; height: 32px; image-rendering: pixelated; display: block; margin: 1px auto; }
.tool-sep { grid-column: 1 / span 2; height: 3px; background: #8a8578; margin: 1px 2px; }
.tool-btn .tip {
  display: none; position: absolute; left: 44px; top: 4px; white-space: nowrap; z-index: 30;
  background: #ffffe6; color: #222; border: 1px solid #666; font-size: 11px; padding: 2px 7px; pointer-events: none;
}
.tool-btn:hover .tip { display: block; }

/* ── Minimap ───────────────────────────────────────────────────────────── */
#minimap-panel { position: absolute; right: 8px; bottom: 8px; z-index: 10; padding: 4px; }
#minimap-tabs { display: flex; gap: 2px; margin-bottom: 3px; }
#minimap-tabs button { font-size: 8.5px; padding: 2px 4px; border: 1px solid #6a675c; background: #ccc8ba; color: #333; font-weight: 700; }
#minimap-tabs button.sel { background: #6a8fd0; color: #fff; }
#minimap { display: block; image-rendering: pixelated; border: 1px solid #55534a; cursor: crosshair; }

/* ── Player panel (NE) ─────────────────────────────────────────────────── */
#player-panel { position: absolute; left: 8px; bottom: 8px; z-index: 10; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.pp-chip { display: flex; align-items: center; gap: 6px; background: #000000aa; border: 1px solid #333; border-radius: 4px; padding: 3px 8px; min-width: 230px; }
.pp-chip.me { border-color: #777; background: #000000cc; }
.pp-chip.broke { border-color: #7a1010; }
.pp-dot { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.pp-name { font-weight: 700; }
.pp-bank { background: #7a1010; color: #ffb0b0; font-size: 9px; font-weight: 800; padding: 0 4px; border-radius: 2px; letter-spacing: 1px; }
.pp-share { color: #8fa0b8; font-size: 10px; }
.pp-funds { color: #9fdc9f; margin-left: auto; font-family: Consolas, monospace; font-weight: 700; }
.pp-funds.neg { color: #ff8f8f; }
.pp-chip.me .pp-funds { font-size: 13px; }
.pp-send {
  border: 1px solid #3c3c6a; background: #26264a; color: #cfe0ff;
  font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 3px;
}
.pp-send:hover { background: #34346a; }

/* ── Chat (NE) ─────────────────────────────────────────────────────────── */
#chat-box { position: absolute; left: 8px; bottom: 118px; z-index: 11; width: 300px; pointer-events: none; }
#chat-log { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.chat-line {
  background: #000000a0; border-radius: 3px; padding: 2px 7px; font-size: 12px;
  color: #e8e4d0; max-width: 300px; overflow-wrap: anywhere;
  transition: opacity 3s;
}
.chat-line.fade { opacity: 0; }
#chat-input {
  width: 220px; background: #0e0e1cd8; color: #eee; border: 1px solid #34345a;
  border-radius: 3px; padding: 3px 7px; font-size: 12px; opacity: .45;
  pointer-events: auto;
}
#chat-box.typing #chat-input, #chat-input:focus { opacity: 1; outline: none; border-color: #6a8fd0; }

/* ── Query panel ───────────────────────────────────────────────────────── */
#query-panel {
  display: none; position: absolute; z-index: 20; min-width: 190px;
  background: #f4f0e4; color: #222; border: 2px solid #333; box-shadow: 4px 4px 0 #0008;
  font-size: 12px; padding: 8px 10px;
}
#query-panel h4 { font-size: 13px; border-bottom: 1px solid #999; margin-bottom: 4px; padding-bottom: 2px; }
#query-panel .qrow { display: flex; justify-content: space-between; gap: 12px; }

/* ── Vote toast ────────────────────────────────────────────────────────── */
#vote-toast {
  display: none; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 25;
  background: #16162acc; border: 1px solid #4a4a7a; border-radius: 8px; padding: 10px 14px; min-width: 320px;
  backdrop-filter: blur(3px); color: #eee;
}
#vote-text { font-size: 14px; font-weight: 700; margin-bottom: 6px; text-align: center; }
#vote-pips { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.vote-pip {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid #888;
  background: #333; display: inline-block;
}
.vote-pip.yes { background: #3fbf6f; }
.vote-pip.no { background: #d05050; }
#vote-btns { display: flex; gap: 8px; justify-content: center; }
#vote-btns button { padding: 5px 22px; font-weight: 800; border: 0; border-radius: 5px; }
#vote-yes { background: #3fbf6f; color: #fff; } #vote-no { background: #d05050; color: #fff; }
#vote-btns button:disabled { filter: grayscale(.7) brightness(.7); }
#vote-bar { height: 4px; background: #333; border-radius: 2px; margin-top: 8px; overflow: hidden; }
#vote-bar-fill { height: 100%; width: 100%; background: #ffd35c; }

/* ── Banner ────────────────────────────────────────────────────────────── */
#banner {
  display: none; position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); z-index: 26;
  font-size: 40px; font-weight: 900; letter-spacing: 3px; text-align: center; color: #ffd35c;
  text-shadow: 0 3px 0 #000, 0 0 24px #000; pointer-events: none; white-space: pre-line;
}
#banner.bad { color: #ff6055; }
#banner .banner-contrib { margin-top: 12px; font-size: 17px; font-weight: 700; letter-spacing: 1px; line-height: 1.55; }
#banner .banner-contrib .bc-head { color: #fff; font-size: 12px; letter-spacing: 3px; opacity: .75; margin-bottom: 2px; }

/* ── Post-win scoreboard (loop-3 fix 2) ────────────────────────────────── */
#scoreboard {
  display: none; position: absolute; top: 38px; right: 8px; z-index: 12;
  background: #16162acc; border: 1px solid #4a4a7a; border-radius: 6px;
  padding: 6px 9px; min-width: 172px; font-size: 11px; color: #e8e4d0;
  backdrop-filter: blur(3px);
}
#sb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #ffd35c; }
#sb-head button { background: none; border: 0; color: #9a96b8; font-size: 12px; font-weight: 800; padding: 0 2px; cursor: pointer; line-height: 1; }
#sb-head button:hover { color: #fff; }
#sb-body { margin-top: 4px; }
.sb-line { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.sb-pop { margin-top: 3px; color: #b8d8ff; border-top: 1px solid #ffffff22; padding-top: 3px; }
.sb-goal { color: #ffd35c; font-size: 10px; margin-top: 1px; }
.sb-goal.done { color: #3fbf6f; }

/* ── Modals & Win95 windows ────────────────────────────────────────────── */
.modal { display: none; position: absolute; inset: 0; z-index: 30; background: #00000066; }
.modal.open { display: flex; align-items: center; justify-content: center; }
.win95 {
  width: 560px; background: #b8b4a8; color: #17150f;
  border-top: 2px solid #f2efe4; border-left: 2px solid #f2efe4;
  border-right: 2px solid #55534a; border-bottom: 2px solid #55534a;
  box-shadow: 6px 6px 0 #0006;
}
.win95.narrow { width: 300px; }
.win95-title {
  background: linear-gradient(90deg, #24247a, #4848b0); color: #fff; font-weight: 700; font-size: 13px;
  padding: 4px 8px; display: flex; justify-content: space-between; align-items: center;
}
.win-x { background: #ccc8ba; border: 1px solid #55534a; width: 18px; height: 16px; line-height: 12px; font-size: 12px; padding: 0; }
.win95-body { padding: 12px; font-size: 13px; font-family: Tahoma, sans-serif; }

/* budget content */
.bud-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dotted #8a8578; }
.bud-row label { flex: 1; }
.bud-row .bud-val { width: 92px; text-align: right; font-family: Consolas, monospace; }
.bud-row input[type=range] { width: 120px; }
.bud-row .pct { width: 44px; text-align: right; font-family: Consolas, monospace; }
.bud-head { font-weight: 800; margin: 8px 0 2px; border-bottom: 2px solid #55534a; }
.bud-total { font-weight: 800; }
.ord-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ord-row .bud-val { margin-left: auto; font-family: Consolas, monospace; }
.menu-item { display: block; width: 100%; text-align: left; padding: 6px 10px; background: #ccc8ba; border: 1px solid #6a675c; margin-bottom: 4px; font-size: 13px; }
.menu-item:hover { background: #9ab0d8; }
.menu-note { font-size: 10px; color: #555; margin-top: 6px; }
.bud-note { font-size: 10px; color: #555; margin-top: 8px; }

/* transfer modal */
#transfer-mine { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: #1d5c1d; }
#transfer-mine.neg { color: #a02828; }
#transfer-debt-note { display: none; font-size: 11px; font-weight: 700; color: #a02828; margin-bottom: 6px; }
#transfer-players { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tr-player {
  background: #101020; border: 2px solid #555; border-radius: 4px;
  font-weight: 800; font-size: 12px; padding: 5px 10px;
}
.tr-player.sel { background: #2a2a4a; outline: 2px solid #f2efe4; }
#transfer-amt-row { margin-bottom: 6px; }
#transfer-amount { width: 100%; padding: 6px 8px; font-size: 14px; border: 1px solid #55534a; background: #f4f0e4; }
#transfer-quick { display: flex; gap: 5px; margin-bottom: 8px; }
.tr-quick { flex: 1; padding: 4px 0; font-size: 11px; font-weight: 700; background: #ccc8ba; border: 1px solid #6a675c; }
#transfer-send {
  width: 100%; padding: 8px; font-size: 14px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(#3fbf6f, #2c8f50); color: #fff; border: 0; border-radius: 4px;
}
#transfer-send:disabled { background: #9a978c; color: #e2dfd4; cursor: not-allowed; }

/* ── Overlays ──────────────────────────────────────────────────────────── */
#countdown-overlay { display: none; position: absolute; inset: 0; z-index: 35; align-items: center; justify-content: center; background: #00000088; }
#countdown-overlay.active { display: flex; }
#countdown-number { font-size: 110px; font-weight: 900; color: #ffd35c; text-shadow: 0 4px 0 #000; }
#disconnected-overlay { display: none; position: absolute; inset: 0; z-index: 50; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #000000cc; }
#disconnected-overlay.active { display: flex; }
#btn-reconnect { padding: 10px 26px; font-size: 15px; font-weight: 700; background: #3fbf6f; border: 0; border-radius: 6px; color: #fff; }

#toast-area { position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%); z-index: 24; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #000000cc; color: #ffe9a8; border: 1px solid #444; border-radius: 5px; padding: 5px 14px; font-size: 13px; animation: toastin .2s ease-out; }
.toast.warn { border-color: #a05050; color: #ffc9b8; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── portrait rotate prompt (mobile) — pure CSS, coarse pointer only ───── */
#rotate-overlay {
  position: fixed; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  background: #0c0c14;
  z-index: 60;
  text-align: center;
}
#rotate-phone {
  width: 42px; height: 72px;
  border: 4px solid #e8e4d0;
  border-radius: 8px;
  animation: rotate-hint 1.8s ease-in-out infinite;
}
@keyframes rotate-hint {
  0%, 25%  { transform: rotate(0deg); }
  60%, 90% { transform: rotate(-90deg); }
  100%     { transform: rotate(-90deg); }
}
#rotate-text { font-size: 20px; font-weight: bold; letter-spacing: 2px; color: #e8e4d0; }
#rotate-sub  { font-size: 12px; color: #8fa0b8; }
@media (orientation: portrait) and (pointer: coarse) {
  #rotate-overlay { display: flex; }
}
