/* ISP Arcade — shared multiplayer UI (room lists, lobbies, scoreboards). */

.view {
  flex: 1 1 auto;
  min-height: 0;
}

.room-chip {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 5px 14px;
}

/* ---------- Setup / lobby ---------- */
.setup-view,
.lobby-view {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.setup-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 680px;
  width: 100%;
  margin-top: 12px;
  padding-bottom: 16px;
}

.setup-stack .setup-card {
  margin-top: 0;
  max-width: none;
}

.setup-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 30px;
  max-width: 680px;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.setup-sub {
  color: var(--ink-soft);
  font-weight: 600;
  margin: 8px 0 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  margin-bottom: 12px;
}

.field span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.text-input {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 14px;
  -webkit-user-select: text;
  user-select: text;
}

.text-input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.setup-columns {
  display: flex;
  gap: 18px;
  align-items: stretch;
  margin-top: 8px;
}

.setup-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.setup-col h3 {
  font-size: 1rem;
}

.mini-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.setup-divider {
  align-self: center;
  color: var(--ink-soft);
  font-weight: 700;
}

.code-input {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  width: 160px;
}

.setup-error {
  color: #c92a2a;
  font-weight: 700;
  min-height: 1.4em;
  margin-top: 12px;
}

.big-code {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin: 6px 0;
}

.lobby-players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 14px 0;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 16px;
}

.player-chip.offline {
  opacity: 0.45;
}

.player-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.dot-0 { background: var(--found-1); }
.dot-1 { background: var(--found-2); }
.dot-2 { background: var(--found-3); }
.dot-3 { background: var(--found-4); }
.dot-4 { background: var(--found-5); }
.dot-5 { background: var(--found-6); }
.dot-6 { background: var(--found-7); }
.dot-7 { background: var(--found-8); }

.lobby-hint {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Scoreboard rows ---------- */
.race-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.score-row.offline {
  opacity: 0.45;
}

.score-row .player-dot {
  flex-shrink: 0;
}

.score-row .score-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row .score-count {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 22px;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- Final scoreboard ---------- */
.final-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 4px;
  text-align: left;
}

.final-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  background: var(--bg);
  border-radius: 10px;
  padding: 9px 14px;
}

.final-row .score-count {
  margin-left: auto;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.final-row.winner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

@media (max-width: 760px) {
  .setup-columns {
    flex-direction: column;
  }
}

/* ---------- Live room list (inside each game's setup screen) ---------- */
.rooms-card h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #40c057;
  animation: live-pulse 1.6s ease infinite;
  display: none;
}

.live-dot.on {
  display: inline-block;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.room-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  text-align: left;
}

.room-row .room-info {
  flex: 1;
  min-width: 0;
}

.room-row .room-title {
  font-weight: 800;
  letter-spacing: 0.08em;
}

.room-row .room-players {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row .room-status {
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 9px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.room-row .room-status.lobby {
  background: #d3f9d8;
  color: #2b8a3e;
}

.room-row .room-status.playing {
  background: var(--accent-soft);
  color: var(--accent);
}

.rooms-empty {
  color: var(--ink-soft);
  font-weight: 600;
  text-align: center;
  padding: 10px 0 4px;
}
