/* =============================================================================
   lobby.css — GomokuVN Lobby Page
   Style: Modern Premium — soft depth, two-column layout with sidebar
   ============================================================================= */

/* ── Two-column layout wrapper ────────────────────────────────────────────── */
.lobby-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto;
  gap: 0;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  align-items: start;
}

/* Pages that reuse .lobby-layout for its centered/max-width column but never
   render a .lobby-sidebar (tournament.html — TODO.md #56 item 2) — without
   this, the reserved 260px column just sits empty as dead space. */
.lobby-layout--single {
  grid-template-columns: 1fr;
}

/* ── Main lobby column ────────────────────────────────────────────────────── */
.lobby {
  width: 100%;
  box-sizing: border-box;
  padding: 32px 24px 48px 32px;
  min-width: 0; /* prevent grid overflow */
}

/* ── Sidebar column ───────────────────────────────────────────────────────── */
.lobby-sidebar {
  padding: 32px 24px 48px 0;
  position: sticky;
  top: 56px; /* match topnav height */
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
}

/* ── Section header + action bar ──────────────────────────────────────────── */
.lobby__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .lobby__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

.lobby__title {
  font-size: calc(24px * var(--fs-scale, 1));
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.02em;
}

.lobby__count {
  font-size: calc(14px * var(--fs-scale, 1));
  color: var(--c-ink-3);
  margin-left: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--c-surface-2);
  border-radius: 9999px;
  vertical-align: middle;
}

/* Primary "Create room" button - Button-in-Button architecture */
.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  font-family: var(--font);
  color: var(--c-on-brand);
  background: var(--c-brand);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--duration-normal) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.btn-create:hover {
  background: var(--c-brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--c-brand-light);
}
.btn-create:active { transform: translateY(0) scale(0.96) !important; }
.btn-create i { 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; 
  height: 32px; 
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  flex-shrink: 0; 
  transition: transform var(--duration-fast) var(--ease-spring);
}
.btn-create:hover i {
  transform: scale(1.1) rotate(90deg);
}

/* Secondary "History" button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  font-family: var(--font);
  color: var(--c-ink-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--duration-normal) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--c-surface-2);
  color: var(--c-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn-secondary:active { transform: translateY(0) scale(0.96) !important; }
/* ui-audit R1: room.html (start modal, QR) uses .btn-primary but never loaded login.css where it lived. Same pill as .btn-secondary, brand fill. */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-size: calc(14px * var(--fs-scale, 1)); font-weight: 700; font-family: var(--font);
  color: var(--c-on-brand); background: var(--c-brand); border: 1px solid transparent; border-radius: 9999px;
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: var(--duration-normal) var(--ease-spring); transition-property: background-color, color, box-shadow, transform, opacity;
}
.btn-primary:hover:not(:disabled) { background: var(--c-brand-dark); }
.btn-primary:disabled { background: var(--c-ink-3); cursor: not-allowed; }
.btn-secondary i { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Generic brand-filled pill button (TODO.md #73) ──────────────────────────
   .btn/.btn-confirm previously had no base rule outside .modal__actions
   (see below), so every use elsewhere (tournament cards, pairing rows,
   match-result overlays) fell back to the browser's default button chrome.
   This is the shared look; scoped rules (.pairing-card__actions .btn,
   .tournament-card__actions .btn, .modal__actions .btn, ...) still override
   sizing/width on top of it. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--duration-normal) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  text-decoration: none;
}
.btn-confirm {
  background: var(--c-brand);
  color: var(--c-on-brand);
  box-shadow: var(--shadow-sm);
}
.btn-confirm:hover {
  background: var(--c-brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--c-brand-light);
}
.btn-confirm:active { transform: translateY(0) scale(0.96) !important; }

/* ── Room List ────────────────────────────────────────────────────────────── */
.room-list {
  /* Handled by .ui-shell > .ui-core */
}

/* Premium empty state */
.room-list__empty {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.room-list__empty-icon {
  margin-bottom: 20px;
  opacity: 0.75;
}

.room-list__empty-text {
  display: block;
  font-size: calc(16px * var(--fs-scale, 1));
  font-weight: 600;
  color: var(--c-ink-2);
  margin-bottom: 6px;
}

.room-list__empty-sub {
  display: block;
  font-size: calc(14px * var(--fs-scale, 1));
  color: var(--c-ink-3);
  font-weight: 400;
}

/* Card list (replaces the old 6-column .room-table at every viewport) */
.room-cards {
  display: flex;
  flex-direction: column;
}

.room-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: var(--card-pad);
  border-bottom: 1px solid var(--c-border-light);
  transition: background var(--duration-fast) var(--ease-out);
}
.room-card:last-child { border-bottom: none; }
.room-card:hover { background: var(--c-surface-2); }

.room-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.room-card__title {
  font-size: calc(15px * var(--fs-scale, 1));
  font-weight: 600;
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: calc(14px * var(--fs-scale, 1));
  color: var(--c-ink-3);
  min-width: 0;
}

.room-card__host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
}

.room-card__dot { color: var(--c-border); }

.room-card__id {
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.room-card__chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Room ID column */
.room-id {
  font-weight: 800;
  font-family: var(--font);
  color: var(--c-ink-2);
  font-size: calc(14px * var(--fs-scale, 1));
  letter-spacing: 0.04em;
}

/* State badge */
.state-badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}
.state-badge--idle {
  background: var(--c-surface-2);
  color: var(--c-state-idle);
  border: 1px solid var(--c-border);
}
.state-badge--playing {
  background: var(--c-success-bg);
  color: var(--c-state-playing);
}
.state-badge--waiting {
  background: var(--c-warning-bg);
  color: var(--c-warning);   /* ui-audit F2: state-waiting is a dot colour (4.2:1), text uses --c-warning */
}

/* Single plain-language rule summary chip */
.rule-chip {
  display: inline-block;
  padding: 5px 10px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
  background: var(--c-surface-2);
  color: var(--c-ink-3);
  border: 1px solid var(--c-border);
}
.rule-chip--custom {
  background: var(--c-brand-light);
  color: var(--c-brand-text);
  border-color: transparent;
}

/* Rule tags */
.rule-tags { display: flex; gap: 6px; }
.rule-tag {
  padding: 4px 10px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  white-space: nowrap;
  border-radius: 6px;
  background: var(--c-surface-2);
  color: var(--c-ink-2);
  border: 1px solid var(--c-border);
}
.rule-tag--wall {
  color: var(--c-error);
  background: var(--c-error-bg);
  border-color: transparent;
}
.rule-tag--portal {
  color: var(--c-brand-text);
  background: var(--c-brand-light);
  border-color: transparent;
}
.rule-tag--swap2 {
  color: var(--c-success);
  background: var(--c-success-bg);
  border-color: transparent;
}
.rule-tag--win {
  color: var(--c-accent);
  background: var(--c-accent-light);
  border-color: transparent;
}
.rule-tag--size {
  color: var(--c-ink-3);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Player count */
.player-count { font-weight: 700; font-size: calc(15px * var(--fs-scale, 1)); }
.player-count--full { color: var(--c-state-playing); }
.player-count--open { color: var(--c-ink-2); }

/* Join button */
.btn-join {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 20px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  font-family: var(--font);
  color: var(--c-brand-text);
  background: var(--c-brand-light);
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--duration-fast) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
}
.btn-join:hover {
  background: var(--c-brand);
  color: var(--c-on-brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--c-brand-light);
}
.btn-join:active { transform: translateY(0) scale(0.96) !important; }

/* Modal shell (.modal-overlay/.modal/__header/__close/__body/__actions): components.css §10 (#543). */

/* Setting row */
.setting-row { margin-bottom: 20px; }
.setting-row:last-child { margin-bottom: 0; }

.setting-label {
  display: block;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 600;
  color: var(--c-ink-3);
  margin-bottom: 8px;
}

/* Radio-pill group */
.pill-group {
  display: flex;
  gap: 6px;
  background: var(--c-surface-2);
  padding: 6px;
  border-radius: 9999px;
  border: 1px solid var(--c-border);
}
.pill-group input[type="radio"] { display: none; }
.pill-group label {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  color: var(--c-ink-2);
  background: var(--c-surface-2);
  cursor: pointer;
  transition: var(--duration-fast) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  border-radius: 9999px;
  user-select: none;
}
.pill-group input:not(:checked) + label:hover {
  background: var(--c-hover);
  color: var(--c-ink);
}
.pill-group label:active {
  transform: scale(0.96);
}
.pill-group input:checked + label {
  background: var(--c-surface);
  color: var(--c-ink);
  box-shadow: var(--shadow-sm);
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.toggle-row + .toggle-row { margin-top: 8px; }

.toggle-name { flex: 1; min-width: 0; font-size: calc(14px * var(--fs-scale, 1)); color: var(--c-ink); font-weight: 500; }

.toggle-switch { position: relative; flex: none; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--c-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--duration-fast) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
}
.toggle-switch:active .toggle-slider {
  transform: scale(0.92);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 20px; height: 20px;
  background: var(--c-knob);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-spring);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.toggle-switch input:checked + .toggle-slider { background: var(--c-brand); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Timer input */
.timer-input { display: flex; align-items: center; gap: 12px; }
.timer-input input[type="number"],
.timer-input input[type="text"],
.timer-input input[type="date"],
.timer-input input[type="datetime-local"] {
  width: 100px;
  padding: 12px 16px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  outline: none;
  transition: var(--duration-fast) var(--ease-spring);
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
}
.timer-input input[type="text"], .timer-input input[type="date"], .timer-input input[type="datetime-local"] { width: 100%; }
.timer-input input:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 4px var(--c-brand-light);
}
.timer-input .unit { font-size: calc(14px * var(--fs-scale, 1)); color: var(--c-ink-3); font-weight: 600; }

/* ── Online Users Sidebar Panel ──────────────────────────────────────────── */
.online-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.online-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-in-out);
}
.online-panel__header:hover { background: var(--c-surface-2); }

.online-panel__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 6px var(--c-success);
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out 2;   /* stops after 5s (DEP-AUTO-MOTION) */
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px var(--c-success); }
  50%       { box-shadow: 0 0 12px var(--c-success); }
}

@media (prefers-reduced-motion: reduce) {
  .online-panel__dot { animation: none; }
}

.online-panel__title {
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 600;
  color: var(--c-ink);
  flex: 1;
}

.online-panel__count {
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  color: var(--c-brand-text);
  background: var(--c-brand-light);
  border-radius: 10px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.online-panel__arrow {
  color: var(--c-ink-3);
  transition: transform var(--duration-normal) var(--ease-spring);
  display: flex;
  align-items: center;
}
.online-panel__header.open .online-panel__arrow { transform: rotate(180deg); }

/* Sidebar: always show user list (no collapse needed at desktop) */
.online-panel__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}
.online-panel__body.open {
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
}

/* On desktop sidebar, open by default via JS — graceful fallback */
.lobby-sidebar .online-panel__body {
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
  overflow-y: auto;
}

.online-panel__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid var(--c-border-light);
}

.online-panel__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 500;
  color: var(--c-ink);
  transition: background var(--duration-fast) var(--ease-in-out);
  cursor: default;
}
.online-panel__list li:hover { background: var(--c-surface-2); }

.online-panel__list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-success);
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .lobby-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .lobby-sidebar {
    padding: 0 24px 32px;
    position: static;
    max-height: none;
  }

  /* Collapse sidebar panel on mobile (original behavior) */
  .lobby-sidebar .online-panel__body {
    max-height: 0;
  }
  .lobby-sidebar .online-panel__body.open {
    max-height: 400px;
  }

  .lobby { padding: 24px 20px 24px; }
}

@media (max-width: 640px) {
  .lobby { padding: 16px 12px 20px; }
  .lobby-sidebar { padding: 0 12px 32px; }

  /* Card list keeps every field (incl. status) at phone widths — only tighten it */
  .room-card { padding: 12px; gap: 10px; }
  .room-card__title { font-size: calc(14px * var(--fs-scale, 1)); }
  .btn-join { padding: 8px 16px; }

}

/* ─────────────────────────────────────────────────────────────────────────
 * Tables & Tournaments — section tabs, tournament cards, filter row.
 * Moved here verbatim from the approved static mockup
 * (client/tables-tournaments-mockup.html, feature/tables-tournaments-mockup)
 * once Phase 5 wired it into the real lobby — see TODO.md #48 / instruction.md B48.
 * ────────────────────────────────────────────────────────────────────────── */

.section-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}
.section-tabs__btn {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: calc(15px * var(--fs-scale, 1));
  font-weight: 600;
  color: var(--c-ink-2);
  /* min-height 44px keeps this a valid touch target on mobile, per
     touch-target-size guideline, without changing desktop density. */
  min-height: 44px;
  padding: 0 4px;
  margin-right: 24px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.section-tabs__btn:hover { color: var(--c-ink); }
.section-tabs__btn:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.section-tabs__btn.is-active {
  color: var(--c-brand-text);
  border-bottom-color: var(--c-brand);
}
.section-tabs__btn .icon { margin-right: 6px; font-size: calc(16px * var(--fs-scale, 1)); vertical-align: -2px; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  /* .filter-row and .tournament-grid are siblings directly inside .ui-core,
     which (main.css's Double-Bezel Architecture) carries no padding of its
     own — .tournament-grid supplies its own 16px, but .filter-row had none,
     so the pills sat flush against the card's top/left border. */
  padding: 16px 16px 0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .filter-row { padding: 12px 8px 0; }
}
.filter-pill { appearance: none; }   /* #511: chip look (tonal, ✓ + ring when active) from components.css */
.filter-spacer { flex: 1; }
/* Status filter reads as tabs (underline on the active one), like the lobby rule tabs; the format select stays a tonal pill. */
.filter-tabs { display: flex; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--c-border); }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs .filter-pill { position: relative; flex: none; min-height: 44px; padding: 0 14px; border-radius: 0; background: none; box-shadow: none; color: var(--c-ink-2); white-space: nowrap; }
.filter-tabs .filter-pill:hover { background: none; color: var(--c-ink); }
.filter-tabs .filter-pill.is-active { background: none; box-shadow: none; color: var(--c-brand-text); }
.filter-tabs .filter-pill.is-active::before { content: none; }
.filter-tabs .filter-pill::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.filter-tabs .filter-pill:hover::after { background: var(--c-border-strong, var(--c-ink-3)); }
.filter-tabs .filter-pill.is-active::after { background: var(--c-brand-text); }
.filter-select {   /* B518: tonal pill like the .filter-pill chips beside it (#511), not a boxed field */
  min-height: var(--ctl-h-md);
  padding: 0 36px 0 var(--ctl-px-md);
  border: 0;
  border-radius: var(--ctl-r-pill);
  background-color: color-mix(in srgb, var(--c-ink) var(--ctl-fill-pct), var(--c-surface));   /* not the shorthand: it would erase the components.css chevron */
  color: var(--c-ink);
  font-size: var(--text-sm);
  font-weight: 700;
}
.filter-select:hover { background-color: color-mix(in srgb, var(--c-ink) var(--ctl-fill-hover-pct), var(--c-surface)); }
.filter-select:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}

.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px;
}
.tournament-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--card-radius);
  padding: var(--card-pad-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s ease, transform .15s ease;
  cursor: pointer;
}
.tournament-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.tournament-card:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .tournament-card,
  .section-tabs__btn,
  .filter-pill {
    transition: none;
  }
  .tournament-card:hover { transform: none; }
}
@media (max-width: 480px) {
  /* Filter pills and select need the full 44px touch target on small
     screens even though 36px reads fine at desktop pointer precision. */
  .filter-pill, .filter-select { min-height: 44px; }
}
.tournament-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tournament-card__name {
  font-size: calc(15px * var(--fs-scale, 1));
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.3;
}
.badge {
  display: inline-block;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--format {
  background: var(--c-surface-2);
  color: var(--c-ink-2);
}
.badge--live {
  background: var(--c-success-bg);
  color: var(--c-success);
}
.badge--upcoming {
  background: var(--c-warning-bg);
  color: var(--c-warning);
}
.badge--done {
  background: var(--c-surface-2);
  color: var(--c-ink-3);
}
.tournament-card__meta {
  font-size: calc(14px * var(--fs-scale, 1));
  color: var(--c-ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tournament-card__meta .icon { font-size: calc(16px * var(--fs-scale, 1)); }
.tournament-card__status {
  margin-top: 2px;
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border-light);
}
.tournament-card__status--your-turn { color: var(--c-brand-text); }
.tournament-card__status--waiting { color: var(--c-ink-3); font-weight: 600; }
.tournament-card__status--registered { color: var(--c-success); }
.tournament-card__actions { display: flex; gap: 8px; margin-top: 2px; }
.tournament-card__actions .btn, .tournament-card__actions .btn-secondary { flex: 1; }

.empty-tournaments {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}
.empty-tournaments .room-list__empty-text { margin-top: 14px; }

@media (max-width: 640px) {
  .tournament-grid { padding: 8px; gap: 12px; }
  .tournament-card { padding: var(--card-pad); }
}

/* ── Live matches browser (TODO.md #60) ─────────────────────────────────── */
.live-matches-panel {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 16px; width: 100%; box-sizing: border-box;
}
.live-matches-panel__header {
  display: flex; align-items: center; gap: 8px; font-size: calc(14px * var(--fs-scale, 1)); font-weight: 700;
  color: var(--c-ink-3);margin-bottom: 10px;
}
.live-matches-panel__header .icon { color: var(--c-error); font-size: calc(16px * var(--fs-scale, 1)); }
.live-matches-panel__list { display: flex; flex-direction: column; gap: 8px; }
.live-match-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--c-border-light); border-radius: 10px;
  background: var(--c-surface-2); cursor: pointer; transition: border-color var(--duration-fast);
  flex-wrap: wrap;
}
.live-match-row:hover { border-color: var(--c-brand); }
.live-match-row__players { font-size: calc(14px * var(--fs-scale, 1)); font-weight: 700; color: var(--c-ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.live-match-row__vs { font-size: calc(14px * var(--fs-scale, 1)); font-weight: 600; color: var(--c-ink-3); }
.live-match-row__meta { font-size: calc(14px * var(--fs-scale, 1)); color: var(--c-ink-3); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.live-match-row__meta .icon { font-size: calc(16px * var(--fs-scale, 1)); }
.live-match-row__tournament { font-size: calc(14px * var(--fs-scale, 1)); color: var(--c-ink-2); width: 100%; }


