/* GeoBingo Web — team Street-View word hunt */
:root {
  --bg: #14161c; --panel: #1d212b; --panel2: #252a36; --line: #333a48;
  --ink: #e8ecf3; --muted: #97a0b3; --accent: #4f8cff; --accent2: #2faf50;
  --danger: #e23b3b; --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); height: 100vh; overflow: hidden;
}
button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel2);
  color: var(--ink); padding: 8px 14px; border-radius: 8px; transition: .12s;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
input, select {
  font: inherit; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
label { display: block; color: var(--muted); font-size: .85rem; margin: 6px 0; }
label input, label select { display: block; width: 100%; margin-top: 4px; color: var(--ink); }
h1, h2, h3, h4 { margin: 0 0 .4em; }
.hint { color: var(--muted); font-size: .85rem; }
.hidden { display: none !important; }

/* screens */
.screen { display: none; height: 100vh; }
.screen.active { display: block; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.key-warning { position: fixed; top: 0; left: 0; right: 0; background: #5a3a12;
  color: #ffd9a0; text-align: center; font-size: .82rem; padding: 4px; z-index: 50; }
.key-warning:empty { display: none; }

/* menu */
#screen-menu { display: none; place-items: center; }
#screen-menu.active { display: grid; }
.menu-card { width: 360px; text-align: center; }
.menu-card h1 { font-size: 2.4rem; letter-spacing: -1px; }
.tagline { color: var(--muted); margin-top: -.4em; }
.menu-card .primary { width: 100%; margin-top: 14px; }
.or { color: var(--muted); margin: 16px 0 8px; font-size: .8rem; }
.join-row { display: flex; gap: 8px; }
.code-in { flex: 1; text-transform: uppercase; letter-spacing: 3px; text-align: center; }
.error { color: #ff8a8a; min-height: 1.2em; margin-top: 10px; font-size: .85rem; }

/* lobby */
.lobby-wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px; height: 100vh;
  overflow-y: auto; }
.lobby-head { margin-bottom: 16px; }
.code-pill { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 2px 10px; font-size: 1rem; letter-spacing: 2px; }
.lobby-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; }
.team-list { display: grid; gap: 10px; }
.team-card { border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--panel2); }
.team-card-head { display: flex; align-items: center; gap: 8px; }
.team-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.team-name { font-weight: 600; }
.team-members { color: var(--muted); font-size: .82rem; margin: 6px 0; min-height: 1em; }
.team-join { width: 100%; }
.word-add { display: flex; gap: 8px; }
.word-add input { flex: 1; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { font-size: .78rem; padding: 4px 10px; border-radius: 20px; background: var(--panel2);
  color: var(--muted); }
.chip:hover { color: var(--ink); }
.word-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.word-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px;
  border-bottom: 1px solid var(--line); }
.word-text { flex: 1; }
.word-by { color: var(--muted); font-size: .72rem; }
.word-del { padding: 2px 8px; line-height: 1; }
.msg { font-size: .8rem; min-height: 1.1em; }
.msg.ok { color: var(--accent2); } .msg.bad { color: #ff8a8a; }
.host-config { margin-top: 16px; }
.cfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.host-config .primary { width: 100%; }

/* exploring */
#screen-game { display: none; }
#screen-game.active { display: grid; grid-template-columns: 320px 1fr; }
.explore-side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px;
  display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }
.explore-head { display: flex; align-items: center; justify-content: space-between; }
.team-badge { font-weight: 700; padding: 4px 10px; border-radius: 8px; background: #555; color: #fff;
  font-size: .85rem; }
.team-badge.ok { background: var(--accent2) !important; } .team-badge.bad { background: var(--danger) !important; }
.timer { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--danger); }
.explore-words { list-style: none; margin: 12px 0; padding: 0; flex: 1; }
.explore-word { display: flex; align-items: center; gap: 8px; padding: 8px 6px;
  border-bottom: 1px solid var(--line); }
.explore-word.done { opacity: .7; }
.explore-word.done .ew-text { text-decoration: line-through; color: var(--muted); }
.ew-text { flex: 1; }
.ew-capture { white-space: nowrap; }
.ew-uncap { padding: 6px 9px; }
.streetview { height: 100vh; background: #0c0d11; }
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--muted);
  text-align: center; padding: 30px; }

/* voting */
.vote-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px; height: 100vh;
  display: flex; flex-direction: column; }
.vote-head { display: flex; flex-direction: column; gap: 6px; }
.vote-head .primary { align-self: flex-start; }
.vote-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: 0; }
.vote-list { overflow-y: auto; padding-right: 6px; }
.vote-group { margin-bottom: 14px; }
.vote-word { color: var(--accent); }
.vote-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px;
  border-bottom: 1px solid var(--line); }
.vote-team { flex: 1; }
.vote-tally { color: var(--muted); font-size: .8rem; }
.vote-yes { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.vote-no { background: var(--danger); border-color: var(--danger); color: #fff; }
.vote-own { color: var(--muted); font-size: .78rem; }
.vote-view { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.vote-streetview { flex: 1; background: #0c0d11; border-radius: 10px; min-height: 220px; }
.vote-claims-map { height: 180px; background: #0c0d11; border-radius: 10px; }

/* results */
#screen-results { display: none; place-items: center; }
#screen-results.active { display: grid; }
.results-card { width: 420px; text-align: center; }
.winner-banner { font-size: 1.7rem; font-weight: 800; margin: 10px 0 18px; }
.team-scores { display: grid; gap: 8px; margin-bottom: 18px; }
.score-row { display: flex; align-items: center; gap: 10px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.score-team { flex: 1; text-align: left; font-weight: 600; }
.score-pts { font-variant-numeric: tabular-nums; font-weight: 700; }
.results-card .primary { width: 100%; }

@media (max-width: 760px) {
  .lobby-cols, .vote-cols, .cfg-grid { grid-template-columns: 1fr; }
  #screen-game.active { grid-template-columns: 1fr; }
  .explore-side { height: auto; max-height: 45vh; }
  .streetview { height: 55vh; }
}
