:root {
  --bg: #1a1a2e; --panel: #16213e; --accent: #e2b04a;
  --desert: #d4a843; --pool: #5dade2; --oasis: #2e8b57;
  --mountain: #4a3728; --text: #eee; --muted: #8899aa;
  --camel-white: #fff; --camel-blue: #3498db; --camel-red: #e74c3c;
  --camel-green: #2ecc71; --camel-yellow: #f1c40f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; }
.screen { min-height: 100vh; }

/* LOBBY */
#lobby { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
#lobby h1 { font-size: 2.5em; color: var(--accent); }
#lobby-panel, #room-waiting { background: var(--panel); padding: 30px; border-radius: 12px; text-align: center; }
input[type="text"] { padding: 10px 14px; font-size: 1em; border: 1px solid #334; border-radius: 6px; background: #0f3460; color: var(--text); margin: 6px; }
button { padding: 10px 20px; font-size: 1em; border: none; border-radius: 6px; background: var(--accent); color: #1a1a2e; font-weight: bold; cursor: pointer; margin: 6px; }
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.4; cursor: default; }
#join-row { display: flex; align-items: center; justify-content: center; margin-top: 10px; }
#player-list { margin: 15px 0; }
.player-chip { display: inline-block; background: #0f3460; padding: 6px 14px; border-radius: 20px; margin: 4px; font-size: 0.95em; }

/* GAME LAYOUT */
#game { display: flex; flex-direction: column; height: 100vh; }
#top-bar { display: flex; justify-content: space-between; padding: 10px 20px; background: var(--panel); font-size: 0.9em; }
#top-bar span { margin-right: 20px; }
#game-layout { display: flex; flex: 1; overflow: hidden; }

/* BOARD */
#board-container { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: #0d1b2a; }
#board-svg { flex-shrink: 0; }

.hex-poly { stroke: rgba(0,0,0,0.3); stroke-width: 1; cursor: pointer; transition: filter 0.15s; }
.hex-poly:hover { filter: brightness(1.2); stroke: var(--accent); stroke-width: 2; }
.hex-poly.valid-placement { stroke: var(--camel-green); stroke-width: 2.5; filter: brightness(1.1); }
.hex-poly.blocked { cursor: not-allowed; opacity: 0.5; }
.hex-poly.elevation-dim { filter: brightness(0.6); }
.hex-label { font-size: 10px; fill: var(--text); pointer-events: none; text-anchor: middle; dominant-baseline: middle; }
.hex-feature { pointer-events: none; }

/* SIDE PANEL */
#side-panel { width: 260px; background: var(--panel); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
#side-panel h3 { color: var(--accent); font-size: 0.85em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; border-bottom: 1px solid #334; padding-bottom: 4px; }
#supply-list { display: flex; flex-direction: column; gap: 4px; }
.supply-row { display: flex; justify-content: space-between; font-size: 0.9em; }
.supply-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
#players-list { display: flex; flex-direction: column; gap: 6px; }
.player-row { background: #0f3460; padding: 8px; border-radius: 6px; }
.player-row.active { border: 1px solid var(--accent); }
.player-row .pname { font-weight: bold; }
.player-row .pscore { float: right; color: var(--accent); }
.player-row .pwh { float: right; margin-left: 8px; font-size: 11px; color: var(--pool); }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
#game-log { max-height: 200px; overflow-y: auto; font-size: 0.8em; color: var(--muted); }
#game-log div { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
#color-select { background: #0f3460; color: var(--text); border: 1px solid #334; padding: 6px; border-radius: 4px; }
#placement-hint { font-size: 0.8em; color: var(--muted); margin-left: 8px; }

/* OVERLAY */
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
#overlay-content { background: var(--panel); padding: 40px; border-radius: 12px; text-align: center; max-width: 500px; }
#overlay-content h2 { color: var(--accent); margin-bottom: 16px; }
.score-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.score-table th, .score-table td { padding: 8px; text-align: left; border-bottom: 1px solid #334; }
.score-table th { color: var(--accent); font-size: 0.85em; }
