:root {
  color-scheme: dark;
  --bg: #070d14;
  --surface: #0c1520;
  --surface-2: #111d2c;
  --surface-card: #0e1925;
  --surface-card-hover: #142334;
  --line: #1c2c3d;
  --line-light: #293f56;
  --text: #f3f7fa;
  --text-bright: #ffffff;
  --muted: #839bb0;
  --muted-dark: #587187;

  --accent: #2de2b6;
  --accent-soft: rgba(45, 226, 182, 0.12);
  --accent-team-a: #00d2ff;
  --accent-team-a-soft: rgba(0, 210, 255, 0.12);
  --accent-team-b: #ff5277;
  --accent-team-b-soft: rgba(255, 82, 119, 0.12);

  --warning: #f5b041;
  --warning-soft: rgba(245, 176, 65, 0.12);
  --danger: #ff4757;
  --danger-soft: rgba(255, 71, 87, 0.12);
  --success: #2ed573;
  --success-soft: rgba(46, 213, 115, 0.12);
  --violet: #a29bfe;
  --violet-soft: rgba(162, 155, 254, 0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--line-light);
}

/* Base Typography */
h1, h2, h3, h4, p {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8rem;
}

/* Buttons */
button, .button {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms ease;
  white-space: nowrap;
}

button:hover, .button:hover {
  filter: brightness(1.08);
  border-color: var(--line-light);
}

button:active, .button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.8);
}

button.primary, .button.primary {
  background: var(--accent);
  color: #032018;
  font-weight: 750;
  border-color: transparent;
}
button.primary:hover {
  box-shadow: 0 0 16px rgba(45, 226, 182, 0.35);
}

button.secondary {
  background: var(--surface-card);
  border-color: var(--line);
  color: var(--text);
}
button.secondary:hover {
  background: var(--surface-2);
  border-color: var(--line-light);
}

button.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 71, 87, 0.4);
  color: #ffb8bf;
}
button.danger:hover {
  background: rgba(255, 71, 87, 0.25);
  border-color: var(--danger);
}

button.warning {
  background: var(--warning-soft);
  border-color: rgba(245, 176, 65, 0.4);
  color: #ffe8b8;
}

.small-btn {
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.w-full {
  width: 100%;
}

/* Inputs & Form Controls */
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

input, select {
  font: inherit;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  background: #08111a;
  color: var(--text-bright);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.55rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.accent, .badge.active, .badge.open, .badge.waiting {
  border-color: rgba(45, 226, 182, 0.4);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.warning, .badge.preparing, .badge.countdown, .badge.finishing {
  border-color: rgba(245, 176, 65, 0.45);
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.results, .badge.finished {
  border-color: rgba(162, 155, 254, 0.45);
  background: var(--violet-soft);
  color: var(--violet);
}

.badge.danger, .badge.eliminated {
  border-color: rgba(255, 71, 87, 0.45);
  background: var(--danger-soft);
  color: var(--danger);
}

.muted-badge {
  color: var(--muted-dark);
  border-color: var(--line);
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.role-pill {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: rgba(162, 155, 254, 0.1);
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.role-pill.role-participant {
  background: rgba(45, 226, 182, 0.12);
  color: var(--accent);
  border: 1px solid rgba(45, 226, 182, 0.25);
}
.role-pill.role-spectator {
  background: rgba(162, 155, 254, 0.12);
  color: var(--violet);
  border: 1px solid rgba(162, 155, 254, 0.25);
}
.role-pill.role-admin {
  background: rgba(254, 202, 87, 0.15);
  color: #feca57;
  border: 1px solid rgba(254, 202, 87, 0.3);
}

.badge.winner {
  background: rgba(254, 202, 87, 0.2);
  color: #feca57;
  border: 1px solid rgba(254, 202, 87, 0.5);
  box-shadow: 0 0 10px rgba(254, 202, 87, 0.2);
}
.badge.runner_up,
.badge.runner-up,
.badge.subganador {
  background: rgba(116, 185, 255, 0.2);
  color: #74b9ff;
  border: 1px solid rgba(116, 185, 255, 0.5);
  box-shadow: 0 0 10px rgba(116, 185, 255, 0.15);
}
.badge.active {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.35);
}
.badge.eliminated {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.35);
}
.badge.disqualified {
  background: rgba(235, 47, 6, 0.2);
  color: #eb2f06;
  border: 1px solid rgba(235, 47, 6, 0.4);
}
.badge.pending {
  background: rgba(255, 165, 2, 0.15);
  color: #ffa502;
  border: 1px solid rgba(255, 165, 2, 0.35);
}

.edit-participant-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.readonly-input {
  background: #050a0f !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  border-color: var(--line) !important;
}

/* Connection indicator dots */
.connection-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connection-indicator.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(46, 213, 115, 0.8);
}
.connection-indicator.offline {
  background: var(--muted-dark);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ========================================================================= */
/* App Layout & Navigation Bar                                              */
/* ========================================================================= */

.admin-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  flex-shrink: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: #09121c;
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

.topbar-brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--text-bright);
  text-decoration: none;
}
.brand strong {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.brand span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Topbar Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.nav-tabs button {
  min-height: 32px;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-tabs button:hover {
  color: var(--text-bright);
  background: var(--surface-2);
}

.nav-tabs button.active {
  background: var(--accent);
  color: #032018;
  font-weight: 750;
}

.tab-icon {
  flex-shrink: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Main Workspace */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-workspace,
.app-content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.login-wrapper {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.login-card {
  width: min(440px, 100%);
  padding: 2rem;
}

/* Shared Card */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  padding: 1.1rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 750;
}

/* Google Forms setup */
.forms-card { padding: 1.15rem; margin-bottom: 1.1rem; }
.forms-card .card-header { margin-bottom: 0.65rem; }
.forms-card .card-header h2 { margin: 0.16rem 0; }
.forms-setup { margin-top: 1rem; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 72%, transparent); overflow: hidden; }
.forms-setup summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; }
.forms-setup summary::-webkit-details-marker { display: none; }
.forms-setup-title { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 750; color: var(--text-bright); }
.setup-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 15%, transparent); }
.setup-dot.ready { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.setup-dot.waiting { background: #f0b54c; }
.forms-setup-body { border-top: 1px solid var(--line); padding: 1rem; display: grid; gap: 0.9rem; }
.setup-intro { display: grid; gap: 0.3rem; padding: 0.75rem 0.85rem; border-radius: 9px; background: rgba(45, 226, 182, 0.06); color: var(--muted); font-size: 0.84rem; }
.setup-intro strong { color: var(--text); }
.forms-setup-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.forms-setup-actions .small-btn { text-decoration: none; }
.setup-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.76rem; }
@media (max-width: 720px) { .forms-setup summary { align-items: flex-start; flex-direction: column; gap: 0.25rem; } }

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th, .data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted-dark);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tr:hover td {
  background: var(--surface-card-hover);
}

/* ========================================================================= */
/* Pestaña: Resumen (Overview)                                              */
/* ========================================================================= */

.overview-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.75rem;
  gap: 1.1rem;
  overflow: hidden;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.view-title {
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  flex-shrink: 0;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  background: var(--surface-card);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}

.stat-live .stat-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-waiting .stat-icon {
  background: var(--warning-soft);
  color: var(--warning);
}
.stat-participants .stat-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.stat-body strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.1;
}

.stat-body span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.lobbies-card-overview {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.25rem;
}

.overview-lobbies-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ========================================================================= */
/* Pestaña: Lobbies (3-Column Workspace)                                    */
/* ========================================================================= */

.lobbies-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

/* Sidebar */
.lobbies-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.icon-btn-add {
  min-height: 32px;
  width: 32px;
  padding: 0;
  border-radius: 8px;
}

.lobbies-list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lobby-sidebar-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--line);
  text-align: left;
}

.lobby-sidebar-item:hover {
  background: var(--surface-card-hover);
  border-color: var(--line-light);
  filter: none;
}

.lobby-sidebar-item.active {
  background: #102131;
  border-color: var(--accent);
  box-shadow: inset 3px 0 var(--accent);
}

.lobby-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.lobby-item-title {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Arena Container */
.lobby-arena-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.lobby-arena-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  height: 100%;
  overflow: hidden;
}

.arena-main-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.1rem 1.4rem;
  gap: 0.85rem;
  overflow-y: auto;
}

.arena-side-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.1rem 1.25rem 1.1rem 0;
  gap: 0.75rem;
  overflow-y: auto;
}

/* Arena Header */
.arena-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.arena-tag-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.lobby-id-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.meta-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.arena-title {
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

/* Match Clock */
.match-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #0d1a27, #132739);
  flex-shrink: 0;
}

.clock-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.clock-detail {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.clock-value {
  font-size: 2.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-bright);
}

.match-clock.live {
  border-color: rgba(45, 226, 182, 0.45);
  box-shadow: inset 4px 0 var(--accent);
}
.match-clock.countdown {
  border-color: rgba(245, 176, 65, 0.55);
  box-shadow: inset 4px 0 var(--warning);
}
.match-clock.countdown .clock-label,
.match-clock.countdown .clock-value {
  color: var(--warning);
}
.match-clock.danger {
  border-color: rgba(255, 71, 87, 0.55);
  box-shadow: inset 4px 0 var(--danger);
}
.match-clock.danger .clock-label,
.match-clock.danger .clock-value {
  color: var(--danger);
}
.match-clock.finished .clock-label,
.match-clock.finished .clock-value {
  color: var(--violet);
}

/* Side-by-Side Teams Grid */
.teams-versus-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0.75rem;
  flex: 1;
  min-height: 180px;
}

.team-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-card);
  padding: 0.85rem;
  gap: 0.65rem;
  overflow: hidden;
}

.team-card-a {
  border-top: 3px solid var(--accent-team-a);
}
.team-card-b {
  border-top: 3px solid var(--accent-team-b);
}

.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.team-name-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-badge-pill {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
}
.team-badge-a {
  background: var(--accent-team-a);
  color: #022533;
}
.team-badge-b {
  background: var(--accent-team-b);
  color: #3b0310;
}

.team-count-badge {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.team-player-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #09121b;
  border: 1px solid var(--line);
}

.player-main-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.player-name-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-name {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-subinfo {
  font-size: 0.72rem;
  color: var(--muted);
}

.player-score-action {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.score-display {
  font-size: 1.15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright);
}

.icon-button-move {
  min-height: 28px;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}
.icon-button-move:hover {
  color: var(--text-bright);
  border-color: var(--accent);
}

.empty-team-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 90px;
  color: var(--muted-dark);
  font-size: 0.8rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.teams-vs-divider {
  display: grid;
  place-items: center;
  padding: 0 0.15rem;
}
.teams-vs-divider span {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--muted-dark);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-pill);
}

/* 1v1 Fighter Duel Layout */
.fighter-duel-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0.85rem;
  flex: 1;
  min-height: 220px;
}

.fighter-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-card);
  padding: 1rem 1.1rem;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
}

.fighter-card-a {
  border-top: 4px solid var(--accent-team-a);
  background: linear-gradient(180deg, rgba(0, 210, 255, 0.05) 0%, var(--surface-card) 45%);
}

.fighter-card-b {
  border-top: 4px solid var(--accent-team-b);
  background: linear-gradient(180deg, rgba(255, 82, 119, 0.05) 0%, var(--surface-card) 45%);
}

.fighter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.fighter-tag-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fighter-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 900;
}
.fighter-badge-a {
  background: var(--accent-team-a);
  color: #022533;
}
.fighter-badge-b {
  background: var(--accent-team-b);
  color: #3b0310;
}

.fighter-role-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fighter-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
  justify-content: space-between;
}

.fighter-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.fighter-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
  border: 1px solid var(--line-light);
}

.fighter-avatar-a {
  background: rgba(0, 210, 255, 0.14);
  color: var(--accent-team-a);
  border-color: rgba(0, 210, 255, 0.35);
}

.fighter-avatar-b {
  background: rgba(255, 82, 119, 0.14);
  color: var(--accent-team-b);
  border-color: rgba(255, 82, 119, 0.35);
}

.fighter-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fighter-name {
  font-size: 1.15rem;
  font-weight: 850;
  color: var(--text-bright);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fighter-handle {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.fighter-score-box {
  background: #081119;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.fighter-score-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

.fighter-score-val {
  font-size: 2.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright);
  line-height: 1;
}

.fighter-attempts-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: var(--muted);
}
.fighter-attempts-row strong {
  color: var(--text-bright);
}

.fighter-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
  min-height: 150px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted-dark);
  text-align: center;
  padding: 1rem;
}

.fighter-empty-state svg {
  color: var(--muted-dark);
  opacity: 0.7;
}

.fighter-vs-badge {
  display: grid;
  place-items: center;
  padding: 0 0.15rem;
}

.fighter-vs-badge span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--text-bright);
  background: #09131d;
  border: 1px solid var(--line-light);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.5);
}

.dialog-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Match Action Bar (Stepped Controls) */
.match-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface-card);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.action-bar-hint {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.action-bar-hint p {
  color: var(--muted);
}

.action-bar-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.countdown-btn {
  background: var(--warning);
  color: #2b1d03;
  font-weight: 800;
}
.countdown-btn:hover {
  box-shadow: 0 0 16px rgba(245, 176, 65, 0.4);
}

/* Side Column Panels */
.side-panel-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-card);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-header-compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.step-indicator {
  display: flex;
  flex-direction: column;
}
.step-num {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.step-indicator h3 {
  font-size: 0.96rem;
  font-weight: 750;
  color: var(--text-bright);
}

.difficulty-pill {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(245, 176, 65, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 176, 65, 0.4);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.level-meta-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #09121a;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
}

.level-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-id-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.fighter-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.fighter-remove-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  line-height: 1;
  transition: all 120ms ease;
}
.fighter-remove-btn:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: var(--danger);
  color: #ff8a97;
}

.level-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.random-btn-group {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 0.35rem;
}

.random-main-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 750;
}

.filter-gear-btn {
  padding: 0;
  display: grid;
  place-items: center;
  min-height: 32px;
  font-size: 0.95rem;
  transition: all 140ms ease;
}
.filter-gear-btn.has-filter {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(45, 226, 182, 0.1);
  box-shadow: 0 0 8px rgba(45, 226, 182, 0.2);
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: #08121a;
  border: 1px solid var(--line);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 120ms ease;
}
.active-filter-tag:hover {
  border-color: var(--accent);
  color: var(--text-bright);
}
.filter-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.filter-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.45rem;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #08121a;
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 120ms ease;
}

.filter-chip:hover {
  border-color: var(--line-light);
  background: #0d1a24;
}

.filter-chip:has(input:checked) {
  border-color: var(--accent);
  background: rgba(45, 226, 182, 0.08);
  box-shadow: 0 0 10px rgba(45, 226, 182, 0.12);
}

.filter-chip input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}

.chip-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-bright);
}

.manual-level-form-compact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}
.manual-level-form-compact input {
  min-height: 32px;
  font-size: 0.82rem;
}

.quick-assign-form-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-label {
  font-size: 0.72rem;
  font-weight: 700;
}

.input-stacked {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.input-stacked input, .input-stacked select {
  min-height: 32px;
  font-size: 0.82rem;
}

.form-row-duo {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.45rem;
}
.assign-submit-btn {
  min-height: 32px;
  padding-inline: 0.85rem;
}

.exceptional-actions-panel {
  cursor: pointer;
}
.exceptional-summary {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  outline: none;
  user-select: none;
}
.exceptional-summary:hover {
  color: var(--text-bright);
}
.exceptional-body {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* ========================================================================= */
/* Pestaña: Participantes                                                   */
/* ========================================================================= */

.participants-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.75rem;
  gap: 1.1rem;
  overflow: hidden;
}

.participants-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.participant-form-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: fit-content;
}

.participant-vertical-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.participant-table-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.table-scroll-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ========================================================================= */
/* Pestaña: Revisiones                                                      */
/* ========================================================================= */

.reviews-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.75rem;
  gap: 1.1rem;
  overflow: hidden;
}

.reviews-content-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.review-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.review-value-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.review-percentage {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--warning);
}

.review-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-clean {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 60%;
  color: var(--muted);
}

/* Modern Dialog */
dialog.modern-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(640px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  border: 1px solid var(--line-light);
  border-radius: 16px;
  padding: 0;
  background: #0b141f;
  color: var(--text-bright);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 1px rgba(45, 226, 182, 0.25);
  overflow: hidden;
  box-sizing: border-box;
}

dialog.modern-dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog::backdrop {
  background: rgba(3, 8, 14, 0.85);
  backdrop-filter: blur(6px);
}

.modern-dialog form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 4rem);
  height: 100%;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: #0e1926;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  z-index: 2;
}

.dialog-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dialog-badge {
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.dialog-header h2 {
  font-size: 1.25rem;
  font-weight: 850;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.dialog-close-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 120ms ease;
}
.dialog-close-btn:hover {
  background: var(--surface-2);
  color: var(--text-bright);
  border-color: var(--line-light);
}

.dialog-body-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.dialog-section {
  background: #081119;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dialog-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.dialog-section-header svg {
  color: var(--accent);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  background: #0e1926;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  gap: 1rem;
}

.dialog-footer-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.danger-outline-btn {
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: #ff8a97;
  font-weight: 700;
  font-size: 0.82rem;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 140ms ease;
}
.danger-outline-btn:hover {
  background: rgba(255, 71, 87, 0.22);
  border-color: var(--danger);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.35);
}

.save-lobby-btn {
  box-shadow: 0 0 14px rgba(45, 226, 182, 0.25);
}
.save-lobby-btn:hover {
  box-shadow: 0 0 20px rgba(45, 226, 182, 0.45);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 100;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: min(420px, calc(100% - 2rem));
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.1rem;
  background: #112030;
  color: var(--text-bright);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.toast.error {
  border-color: var(--danger);
  background: #281014;
  color: #ffd8dc;
}

.hidden {
  display: none !important;
}

/* Media Queries */
@media (max-width: 960px) {
  .lobbies-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .lobby-arena-layout {
    grid-template-columns: 1fr;
  }
  .arena-side-column {
    padding: 0 1.4rem 1.4rem;
  }
  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .participants-layout {
    grid-template-columns: 1fr;
  }
}

/* Public Spectator Page */
.public-page {
  height: 100vh;
  overflow-y: auto;
  background: #070d14;
}

.public-container {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.public-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.public-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-bright);
}

.public-lobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.25rem;
}

.public-lobby-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 140ms ease;
}

.public-lobby-card.is-live {
  border-color: rgba(45, 226, 182, 0.45);
  box-shadow: 0 0 24px rgba(45, 226, 182, 0.08);
}

.public-lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.public-lobby-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.public-match-title {
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.public-level-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #09121a;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  gap: 0.75rem;
}

.public-level-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.public-level-tag {
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.public-level-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-bright);
}

/* Public 1v1 Duel */
.public-duel-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.public-player-box {
  background: #081119;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.public-player-a {
  border-left: 3px solid var(--accent-team-a);
}
.public-player-b {
  border-right: 3px solid var(--accent-team-b);
}

.public-player-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.public-player-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.public-player-display {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-player-user {
  font-size: 0.7rem;
  color: var(--muted);
}

.public-score-val {
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright);
  line-height: 1.1;
  text-align: center;
  margin: 0.2rem 0;
}

.public-attempts-sub {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.public-empty-slot {
  display: grid;
  place-items: center;
  min-height: 70px;
  color: var(--muted-dark);
  font-size: 0.78rem;
  font-style: italic;
}

.public-vs-divider {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--muted-dark);
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

/* Public Teams */
.public-teams-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.public-team-col {
  background: #081119;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.public-team-title {
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.public-team-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
}

.public-result-banner {
  background: rgba(162, 155, 254, 0.1);
  border: 1px solid rgba(162, 155, 254, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  text-align: center;
}

.public-winner-badge {
  font-size: 0.88rem;
  font-weight: 850;
  color: var(--violet);
}

/* ========================================================================= */
/* Portal de Jugador (Player Portal V2)                                     */
/* ========================================================================= */

.player-portal-body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #0d1e2d 0%, #060c13 60%, #04080c 100%);
  color: var(--text);
  font-family: "Plus Jakarta Sans", sans-serif;
  display: flex;
  flex-direction: column;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  background: rgba(6, 12, 19, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo-icon {
  font-size: 1.4rem;
}

.topbar-user-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.player-status-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #09131d;
  border: 1px solid var(--line);
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  border-radius: var(--radius-pill);
}

.player-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #0984e3 100%);
  color: #04080c;
  font-size: 0.82rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.player-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.player-name-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-bright);
}

.player-role-label {
  font-size: 0.68rem;
  color: var(--muted);
}
.player-role-label.active {
  color: var(--accent);
}
.player-role-label.eliminated {
  color: var(--danger);
}

.icon-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Player Main Container */
.player-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem 2.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Login Card */
.player-login-container {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 70vh;
}

.player-login-card {
  background: #08121a;
  border: 1px solid var(--line-light);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(45, 226, 182, 0.08);
  border-radius: var(--radius-md);
  padding: 2.2rem 2.5rem;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: center;
}

.login-badge {
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(45, 226, 182, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin: 0 auto;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1.2;
}

.login-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.player-login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.login-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-group .input-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 1.1rem;
  pointer-events: none;
}

.login-input-group input {
  padding-left: 2.5rem;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
}

.quick-user-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-label {
  font-size: 0.74rem;
  color: var(--muted);
}

.user-chip {
  background: #0d1c28;
  border: 1px solid var(--line);
  color: var(--text-bright);
  font-size: 0.74rem;
  font-weight: 750;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 120ms ease;
}

.user-chip:hover {
  border-color: var(--accent);
  background: rgba(45, 226, 182, 0.12);
  color: var(--accent);
}

.player-submit-btn {
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Dashboard Banner */
.player-welcome-banner {
  margin-bottom: 1.5rem;
}

.welcome-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-bright);
}

.welcome-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Lobbies Grid */
.player-lobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}

.player-lobby-card {
  background: #08121a;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 160ms ease;
}

.player-lobby-card:hover {
  border-color: var(--line-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.player-lobby-card.assigned-hero {
  border-color: var(--accent);
  background: linear-gradient(180deg, #0a1926 0%, #08121a 100%);
  box-shadow: 0 0 24px rgba(45, 226, 182, 0.12);
}

.player-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-card-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lobby-id-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(45, 226, 182, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.player-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.player-card-title {
  font-size: 1.15rem;
  font-weight: 850;
  color: var(--text-bright);
}

.player-card-time {
  font-size: 0.74rem;
  color: var(--muted);
}

.player-level-banner {
  background: #050b10;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.player-level-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.level-name-strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-bright);
}

.level-creator-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.player-duel-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  background: #050b10;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}

.duel-player-side {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.side-tag {
  font-size: 0.64rem;
  font-weight: 850;
  width: fit-content;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
.side-tag-a { background: rgba(45, 226, 182, 0.15); color: var(--accent); }
.side-tag-b { background: rgba(255, 71, 87, 0.15); color: var(--danger); }

.player-score-small {
  font-size: 0.88rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright);
}

.duel-vs-divider {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--muted-dark);
}

.enter-lobby-btn {
  width: 100%;
  min-height: 38px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

/* Arena View Inside Lobby */
.player-arena-view {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.player-arena-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.player-arena-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-bright);
}

.player-arena-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
}

.player-duel-column {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.player-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.you-badge {
  font-size: 0.64rem;
  font-weight: 900;
  background: var(--accent);
  color: #04080c;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.35rem;
}

.fighter-card.is-you {
  box-shadow: 0 0 16px rgba(45, 226, 182, 0.15);
}

/* Simulator Panel */
.player-simulator-panel {
  background: #08121a;
  border: 1.5px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player-simulator-panel.in-progress {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(45, 226, 182, 0.1);
}

.sim-badge {
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(45, 226, 182, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.25rem;
}
.sim-badge.live { color: #ff6b81; background: rgba(255, 107, 129, 0.15); }
.sim-badge.practice { color: #a29bfe; background: rgba(162, 155, 254, 0.15); }

.simulator-start-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.sim-start-btn {
  min-height: 42px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.simulator-slider-box {
  background: #050b10;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.slider-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-percentage {
  font-size: 1.35rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.simulator-range {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
  cursor: pointer;
}

.simulator-finish-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.sim-action-btn {
  min-height: 44px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.victory-btn {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: #04080c;
  box-shadow: 0 0 16px rgba(0, 184, 148, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.forms-simple{padding:20px;display:grid;gap:15px}.forms-simple p{line-height:1.6}.forms-simple form,.forms-setup form{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));align-items:end;gap:14px}.forms-simple label,.forms-setup label{display:grid;gap:7px}.forms-simple select,.forms-simple input,.forms-setup select{width:100%;min-width:0;padding:10px}.forms-preview{display:grid;gap:12px;padding:16px;border:1px solid var(--line-light);border-radius:12px;background:var(--surface-2)}
