:root {
  --navy: #0c3a5b;
  --orange: #ee7732;
  --teal: #2a9d8f;
  --red: #e63946;
  --amber: #f1a208;
  --green: #2a9d4a;
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #6b7a87;
  --border: #dde4ec;
  --shadow: 0 4px 18px rgba(12, 58, 91, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--navy);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--orange); }

header.bar {
  background: var(--navy);
  color: white;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.bar h1 { margin: 0; font-size: 18px; font-weight: 600; }
header.bar .meta { font-size: 13px; opacity: 0.85; }

main { padding: 22px; max-width: 1280px; margin: 0 auto; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.panel h2 { margin: 0 0 14px; font-size: 18px; }
.panel h3 { margin: 0 0 10px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, button {
  font: inherit;
  color: inherit;
}
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  margin-bottom: 12px;
}
button {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost { background: white; color: var(--navy); border: 1px solid var(--border); }
button.danger { background: var(--red); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.session-code {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--orange);
  font-family: "SF Mono", Menlo, monospace;
}

.group-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.group-card h3 { color: var(--navy); margin-bottom: 6px; }
.group-card .players { font-size: 13px; color: var(--muted); margin-bottom: 8px; min-height: 18px; }
.group-card .phase { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #eef3f8; color: var(--navy); display: inline-block; }
.group-card .progress { font-size: 12px; color: var(--muted); margin-top: 6px; }

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3f8;
  font-size: 12px;
  margin: 2px;
}
.player-chip.voted { background: #d4ecdc; color: #1e6b3a; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.unacceptable { background: var(--red); }
.dot.high { background: var(--amber); }
.dot.limited { background: var(--green); }
.dot.empty { background: #cbd3dc; }

.timer {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--orange);
}
.timer.warn { color: var(--red); }
.timer.idle { color: var(--muted); }

.card-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.card-img-wrap {
  max-width: 420px;
  width: 100%;
  background: white;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.card-img-wrap img { width: 100%; height: auto; display: block; border-radius: 8px; }

.vote-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.vote-btn {
  flex: 1 1 30%;
  min-width: 120px;
  padding: 18px 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  border: 3px solid transparent;
  color: white;
  cursor: pointer;
  transition: transform 0.1s;
}
.vote-btn:active { transform: scale(0.98); }
.vote-btn.unacceptable { background: var(--red); }
.vote-btn.high { background: var(--amber); }
.vote-btn.limited { background: var(--green); }
.vote-btn.selected { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(12,58,91,0.18); }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.reveal-cell {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.reveal-cell .name { font-weight: 600; font-size: 13px; }
.reveal-cell .badge { margin-left: auto; font-size: 11px; padding: 3px 8px; border-radius: 999px; color: white; }
.badge.unacceptable { background: var(--red); }
.badge.high { background: var(--amber); }
.badge.limited { background: var(--green); }
.badge.empty { background: #aab4bf; }

.tally { display: flex; gap: 14px; justify-content: center; font-size: 14px; margin-top: 12px; }
.tally span { display: flex; align-items: center; gap: 6px; }

.center { text-align: center; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

@media (max-width: 600px) {
  main { padding: 12px; }
  .panel { padding: 16px; }
  .session-code { font-size: 30px; letter-spacing: 4px; }
  .vote-btn { padding: 14px 8px; font-size: 14px; }
}
