/* Connect Four — board, discs, lobby. Shell styles live in common.css. */

.c4-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  gap: 18px;
}

/* ── Lobby ───────────────────────────────────────────────── */

.lobby { text-align: center; width: 100%; }
.lobby-title { margin: 0 0 8px; font-size: 1.5rem; color: var(--color-primary); }
.lobby-sub { margin: 0 auto 22px; max-width: 42ch; color: var(--color-text-muted); font-size: 0.92rem; line-height: 1.55; }
.lobby-form { max-width: 320px; margin: 0 auto; text-align: left; }
.lobby-form .btn { margin-top: 6px; }

/* ── Game ────────────────────────────────────────────────── */

.game { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.status {
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  min-height: 1.6em;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 460px;
}
.status.is-yours { border-color: var(--color-primary); color: var(--color-primary); }
.status.is-won { border-color: var(--color-accent); color: var(--color-accent); }
.status.is-lost { border-color: var(--color-border); color: var(--color-text-muted); }

.board-wrap { width: 100%; max-width: 460px; }

.c4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2.2%;
  padding: 2.6%;
  background: var(--color-primary);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.cell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-bg);
  border: none;
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s;
}
.cell:disabled { cursor: default; }
.cell:focus-visible { outline: 3px solid var(--color-on-primary); outline-offset: 2px; }

/* The disc itself, so an empty slot keeps the board's hole look. */
.cell.p1::after, .cell.p2::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: drop 0.26s cubic-bezier(0.34, 1.26, 0.64, 1);
}
.cell.p1::after { background: var(--color-accent); }
.cell.p2::after { background: var(--color-secondary); }

.cell.is-win::after { box-shadow: 0 0 0 3px var(--color-on-primary), 0 0 14px var(--color-on-primary); }

/* Hover preview of where the disc would land. */
.cell.is-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.32;
}
.cell.is-preview.prev-1::after { background: var(--color-accent); }
.cell.is-preview.prev-2::after { background: var(--color-secondary); }

@keyframes drop {
  from { transform: translateY(-340%); }
  to { transform: translateY(0); }
}

/* ── Seats ───────────────────────────────────────────────── */

.seat-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 0.85rem; }
.seat { display: inline-flex; align-items: center; gap: 7px; color: var(--color-text-muted); }
.seat .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.seat-1 .dot { background: var(--color-accent); }
.seat-2 .dot { background: var(--color-secondary); }
.seat.is-you { color: var(--color-text); font-weight: 600; }
.seat.is-turn .dot { box-shadow: 0 0 0 3px var(--color-primary-20); }
.seat.is-waiting { opacity: 0.5; font-style: italic; }

.conn { font-size: 0.72rem; color: var(--color-text-muted); }
.conn.is-down { color: var(--color-error); }

/* ── Invite ──────────────────────────────────────────────── */

.invite { width: 100%; max-width: 460px; }
.invite label { display: block; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 6px; }
.invite-row { display: flex; gap: 8px; }
.invite-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-family: var(--font-code);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.invite-row input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

@media (max-width: 620px) {
  .topbar { gap: 10px; padding: 10px 12px; }
  .stats { margin-left: auto; gap: 12px; }
  .c4-main { padding: 16px 12px 30px; }
}
