/* ==========================================================================
   CUELUNA · hoja principal de estilos
   Sistema «sport» inspirado en el lenguaje de las apps de billar de referencia:
   azul eléctrico, superficies con profundidad, fondos con brillos y textura,
   botones compactos y menús ordenados. Tokens en theme.css (claro/oscuro).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: transparent;
}

/* Lienzo continuo: una sola capa fija al viewport. Las luces ya no viajan con
   el documento, así que no se cortan ni forman bandas al desplazarse. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    /* Tramado de fibra de carbono, muy tenue */
    repeating-linear-gradient(45deg, var(--carbon-a) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, var(--carbon-b) 0 2px, transparent 2px 6px),
    /* Luz lateral izquierda */
    radial-gradient(900px 1200px at -18% 42%, var(--side-light), transparent 62%),
    /* Brillos de marca */
    radial-gradient(1100px 620px at 8% -12%, var(--glow-a), transparent 62%),
    radial-gradient(920px 540px at 104% -6%, var(--glow-b), transparent 58%),
    radial-gradient(840px 560px at 48% 118%, var(--glow-c), transparent 64%);
}

h1, h2, h3, h4, h5 {
  color: var(--text);
  line-height: 1.22;
  letter-spacing: -.02em;
  font-weight: 800;
}

p { margin: 10px 0; }

a { color: var(--accent-text); }

strong { font-weight: 800; }

::selection { background: var(--accent); color: #fff; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-text);
  font-size: 11px;
  letter-spacing: .22em;
  font-weight: 800;
  text-transform: uppercase;
}

.muted { color: var(--muted); line-height: 1.65; }

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   2. Barra superior + menú de usuario
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 5%;
  border-bottom: 1px solid var(--border-header);
  background: var(--topbar-bg);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: .55;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* Emblema de la marca (nuevo icono) + wordmark en oro sobre el fondo noche. */
.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(227, 174, 78, .35), 0 4px 12px rgba(0, 0, 0, .35);
}

.brand-wordmark {
  display: block;
  height: 19px;
  width: auto;
}

.brand-wordmark-on-light { display: none; }

/* Wordmark dentro de un titular: misma serigrafía que el logo, a la altura del texto. */
.inline-brand {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.06em;
}

.inline-brand img {
  display: block;
  height: .82em;
  width: auto;
}

.inline-brand img.inline-brand-on-light { display: none; }

:root[data-theme="light"] .inline-brand img.inline-brand-on-dark { display: none; }
:root[data-theme="light"] .inline-brand img.inline-brand-on-light { display: block; }

:root[data-theme="light"] .brand-wordmark-on-dark { display: none; }
:root[data-theme="light"] .brand-wordmark-on-light { display: block; }

:root[data-theme="light"] .brand-mark {
  box-shadow: 0 0 0 1px rgba(125, 87, 22, .3), 0 4px 12px rgba(74, 58, 24, .18);
}

.beta {
  color: var(--accent-text);
  font-size: 10px;
  letter-spacing: .22em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0;
  border: 0;
  background: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.theme-toggle {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--shadow);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Menú de usuario (solo con sesión iniciada) */
.user-menu { position: relative; }

body:has(#authenticated-panel[hidden]) .user-menu { display: none; }

.user-menu-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background:
    linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.user-menu-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 4px;
  min-width: 216px;
  padding: 8px;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 22px 60px var(--shadow), inset 0 1px 0 var(--sheen);
  animation: menuDrop .14s ease;
}

@keyframes menuDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu-name {
  margin: 2px 2px 6px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.menu-item {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover { background: var(--nav-hover-bg); }

.menu-item-danger { color: var(--warn); }

.menu-item-danger:hover { background: rgba(220, 90, 70, .12); }

.user-menu-group { display: contents; }

/* Acciones de la cabecera: bandeja y secciones */
.topbar-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.topbar-icon:hover { background: var(--nav-hover-bg); }

.topbar-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar-icon[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* --------------------------------------------------------------------------
   3. Estructura principal
   -------------------------------------------------------------------------- */
main {
  width: min(1180px, 92%);
  margin: 40px auto;
}

main:has(#authenticated-panel:not([hidden])) > .hero { display: none; }

section.app-view {
  display: block;
  min-width: 0;
  margin: 0;
}

.app-view[hidden] { display: none !important; }

footer {
  padding: 22px 6%;
  border-top: 1px solid var(--border-header);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Hero (portada de visitante) */
.hero { margin: 0 0 34px; }

.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.06;
  letter-spacing: -.03em;
}

.hero h1 em {
  color: var(--accent-text);
  font-style: normal;
}

.hero .intro {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 520px;
}

/* --------------------------------------------------------------------------
   4. Tarjeta de autenticación / lienzo general de la app
   -------------------------------------------------------------------------- */
.auth-card {
  display: block;
  width: min(100%, 520px);
  margin: 0 auto 70px;
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--border-card);
  border-radius: 22px;
  background:
    linear-gradient(150deg, var(--sheen), transparent 42%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
  box-shadow: 0 26px 80px var(--shadow-strong);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: clamp(23px, 3.6vw, 30px);
}

#authenticated-panel { width: 100%; }

/* --------------------------------------------------------------------------
   5. Botones (compactos, con degradado y sin estridencias)
   -------------------------------------------------------------------------- */
.auth-card button {
  width: auto;
  min-height: 34px;
  margin-top: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: none;
  transition: filter .15s ease, transform .1s ease;
}
.auth-card #login-form #login-button { width: 100%; min-height: 38px; }

.auth-card button:hover {
  background: var(--btn-bg-hover);
  box-shadow: 0 12px 26px -10px var(--halo);
}

.auth-card button:active { transform: translateY(1px); }

.auth-card button:disabled { opacity: .6; cursor: wait; box-shadow: none; }

.auth-card button.secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--accent-text);
  box-shadow: none;
}

.auth-card button.secondary:hover {
  background: var(--nav-hover-bg);
  border-color: var(--accent);
}

.auth-card button.small {
  min-height: 36px;
  padding: 6px 13px;
  font-size: 13px;
  border-radius: 10px;
}

.auth-card button.approve-button {
  background: linear-gradient(135deg, #2fbf71, #1d8f52);
  color: #06210f;
}

.auth-card button.reject-button {
  background: transparent;
  border: 1px solid rgba(220, 100, 90, .55);
  color: #f0b5b5;
}

.auth-card button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.auth-card a { color: var(--accent-text); text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   6. Formularios
   -------------------------------------------------------------------------- */
.auth-card form { display: grid; gap: 10px; margin-top: 22px; }

.auth-card label {
  margin-top: 4px;
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-card textarea { resize: vertical; min-height: 110px; }

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-card input::placeholder,
.auth-card textarea::placeholder { color: var(--muted); opacity: .75; }

/* Interruptor (switch) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  margin-top: 4px;
}

.auth-card .marker-form .switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .15s ease;
  pointer-events: none;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}

.switch input:checked + .switch-slider { background: var(--accent); }

.switch input:checked + .switch-slider::before { transform: translateX(20px); }

.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   7. Mensajes, avisos y «pills» de estado
   -------------------------------------------------------------------------- */
.message {
  min-height: 1.3em;
  margin: 4px 0;
  color: var(--warn);
  font-size: 14px;
}

.message.success { color: var(--success); }

.notice {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.feature-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   8. Navegación principal
   -------------------------------------------------------------------------- */
.primary-nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  gap: 4px;
  margin: 18px 0 24px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 36px -22px var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar { display: none; }

.auth-card .primary-nav .nav-item {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 750;
  overflow-wrap: anywhere;
  box-shadow: none;
  white-space: nowrap;
}

.auth-card .primary-nav .nav-item:hover {
  background-color: var(--nav-hover-bg);
  color: var(--text);
  filter: none;
}

.auth-card .primary-nav .nav-item[aria-current="page"] {
  border-color: var(--nav-active-border);
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  box-shadow: inset 0 0 0 1px var(--accent-soft), 0 6px 18px -12px var(--halo);
}

/* --------------------------------------------------------------------------
   9. Secciones de trabajo, rejillas y tarjetas
   -------------------------------------------------------------------------- */
.workspace-heading { margin: 26px 0 14px; }

.workspace-heading-compact { margin-top: 2px; }

.workspace-heading h3,
.workspace-section h3 {
  margin: 0 0 6px;
  font-size: 21px;
}

.workspace-section {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: none;
}

.workspace-section > p { line-height: 1.6; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 26px;
}

#authenticated-panel .feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(150deg, var(--sheen), transparent 48%),
    var(--card-bg);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 44px -26px var(--shadow);
}

.feature-card h3 { margin: 12px 0 7px; font-size: 18px; }

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Tarjetas-acción de la portada (botones con apariencia de tarjeta) */
.auth-card button.feature-card {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(150deg, var(--sheen), transparent 48%),
    var(--card-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.auth-card button.feature-card:hover {
  background:
    linear-gradient(150deg, var(--accent-soft), transparent 55%),
    var(--card-bg);
  border-color: var(--border-strong);
  filter: none;
}

.auth-card button.feature-card h3 { color: var(--text); }

.auth-card button.feature-card:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* Módulos en desarrollo (historial) */
.module-placeholder { margin: 22px 0; }

.module-panel {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(150deg, var(--sheen), transparent 46%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

.module-panel h3 {
  margin: 10px 0;
  font-size: clamp(23px, 3vw, 32px);
}

.module-panel p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   10. Solicitudes (beta / admin)
   -------------------------------------------------------------------------- */
.request-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

#admin-beta-requests-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.request-card {
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--card-bg);
}

.request-card h4 { margin: 0 0 8px; font-size: 16px; }

.request-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.request-card .request-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.request-card .request-actions button { margin-top: 4px; }

/* --------------------------------------------------------------------------
   11. Torneos
   -------------------------------------------------------------------------- */
.tournament-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tournament-toolbar .message {
  flex: 1 1 220px;
  overflow-wrap: anywhere;
}

.auth-card #refresh-tournaments,
.auth-card .tournament-detail-heading button {
  width: auto;
  min-width: 130px;
  margin-top: 0;
  padding: 0 16px;
}

#tournament-create-form {
  margin: 20px 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
}

#tournament-create-form h4,
.tournament-detail-heading h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tournament-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 16px;
}

.tournament-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.tournament-field-wide { grid-column: 1 / -1; }

.tournament-field label {
  margin-top: 0;
  color: var(--label);
  font-size: 13.5px;
  font-weight: 700;
}

.auth-card .tournament-field input,
.auth-card .tournament-field select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 0;
}

.tournament-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.tournament-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(150deg, var(--sheen), transparent 48%),
    var(--card-bg);
  overflow: hidden;
}

.tournament-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -35%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.tournament-card-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.tournament-card h4 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.4;
}

.tournament-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.tournament-card .feature-state { letter-spacing: .06em; }

.auth-card .tournament-card .tournament-view-button {
  width: 100%;
  min-height: 38px;
  margin-top: auto;
  padding: 8px 14px;
}

.tournament-detail {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.tournament-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tournament-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 18px;
}

.tournament-detail-summary p,
#tournament-detail-content > p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.tournament-detail-summary strong,
#tournament-detail-content > p strong { color: var(--text); }

.tournament-detail-section { margin-top: 20px; }

.tournament-detail-section h5 { margin: 0 0 8px; font-size: 15px; }

.tournament-detail-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

/* Plazas e invitaciones */
.tournament-entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.tournament-entry-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 650;
}

.tournament-entry-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.tournament-entry-note {
  margin: 8px 0;
  font-size: .92rem;
  color: var(--muted);
}

.tournament-detail-section.tournament-entries-section { margin-top: 22px; }

.tournament-detail-list.tournament-entry-list { padding-left: 24px; }

.tournament-detail-section.tournament-entry-manager { margin-top: 22px; }

.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invitation-notice {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--accent-soft);
}

.invitation-notice p { margin: 0 0 10px; }

.invitation-notice p:last-child { margin-bottom: 0; }

.invitation-notice-success { border-color: rgba(90, 200, 140, .5); }

.tournament-entry-row {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.tournament-entry-info strong { display: block; overflow-wrap: anywhere; }

.tournament-entry-status { margin: 5px 0 0; }

.tournament-entry-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.tournament-invitation-link {
  display: grid;
  width: 100%;
  gap: 8px;
}

.tournament-invitation-link input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 9px;
  font: inherit;
}

.tournament-invitation-link p { overflow-wrap: anywhere; margin: 0; }

.tournament-card-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.tournament-role {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tournament-role-organizer {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: var(--border-accent);
}

.tournament-role-participant {
  color: var(--accent-2);
  background: rgba(142, 195, 232, .12);
  border-color: rgba(142, 195, 232, .4);
}

.bracket-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.score-input {
  width: 54px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.team-chip-checkin {
  border-color: rgba(120, 190, 140, .55);
  color: #b6e0c2;
}

.organizer-panel {
  display: grid;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.organizer-panel[hidden] { display: none; }

.organizer-panel h4 {
  margin: 0;
  font-size: 15px;
}

.organizer-panel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.organizer-panel-row:first-of-type { border-top: 0; padding-top: 0; }

.organizer-panel-name {
  font-weight: 600;
  margin-right: auto;
}

.organizer-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.organizer-chip-alerta {
  border-color: rgba(225, 160, 112, .55);
  color: #f1c7a4;
}

.organizer-chip-nuevo {
  border-color: rgba(120, 190, 140, .55);
  color: #b6e0c2;
}

.tournament-filters {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.tournament-filters[hidden] { display: none; }

.tournament-management-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tournament-delete-button {
  border: 1px solid rgba(225, 112, 112, .5);
  border-radius: 10px;
  padding: 9px 13px;
  color: #f1b4b4;
  background: rgba(145, 42, 52, .16);
  cursor: pointer;
}

.tournament-delete-button:hover { background: rgba(145, 42, 52, .28); }

.tournament-delete-button:disabled { opacity: .6; cursor: wait; }

.tournament-duplicate-button {
  border: 1px solid var(--border-strong, rgba(255,255,255,.22));
  border-radius: 10px;
  padding: 9px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.tournament-duplicate-button:hover { background: rgba(255, 255, 255, .12); }
.tournament-duplicate-button:disabled { opacity: .6; cursor: wait; }

.tournament-management-actions .message { margin: 0; }

/* Asistente de creación (wizard) */
.tournament-wizard-progress {
  display: grid;
  gap: 9px;
  margin: 18px 0;
  color: var(--accent-text);
  font-size: .9rem;
  font-weight: 700;
}

.tournament-wizard-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

#tournament-wizard-progress-fill {
  display: block;
  width: 33.333%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 160ms ease;
}

.tournament-wizard-field[hidden],
.tournament-form-grid[hidden],
#tournament-create-review[hidden],
.tournament-wizard-actions [hidden] { display: none !important; }

.tournament-wizard-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tournament-review-list {
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--accent-soft);
}

.tournament-review-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.tournament-review-row:last-child { border-bottom: 0; }

.tournament-review-row span {
  text-align: right;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   12. Jugadores (buscador)
   -------------------------------------------------------------------------- */
.player-search {
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin-top: 6px;
}

.player-search label {
  color: var(--label);
  font-size: 13.5px;
  font-weight: 700;
}

.player-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.player-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.player-results {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.player-result {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
  transition: background .15s ease;
}

.player-result:hover { background: rgba(255, 255, 255, .04); }

.player-result-photo {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 64px;
  height: 64px;
  line-height: 0;
}

.player-result-photo > img {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

/* La banderita, pegada a la esquina de la foto. */
.player-result .player-result-flag {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  object-fit: cover;
  position: absolute;
  right: -2px;
  bottom: -2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.player-result-info {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.player-result-info strong { overflow-wrap: anywhere; font-size: 14.5px; color: var(--text); font-weight: 600; }

.player-result-info span { color: var(--muted); font-size: 11.5px; }

/* --------------------------------------------------------------------------
   13. Perfil, foto y recorte
   -------------------------------------------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 60%),
    var(--card-bg);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  border-radius: 22px;
  border: 2px solid var(--border-strong);
  background: var(--card-bg);
  object-fit: cover;
  box-shadow: 0 10px 26px -14px var(--halo);
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-identity strong { font-size: 22px; overflow-wrap: anywhere; }

.profile-identity .muted { font-size: 13px; overflow-wrap: anywhere; }

.profile-form { display: grid; gap: 10px; max-width: 560px; }

.profile-form label {
  margin-top: 4px;
  color: var(--label);
  font-size: 13.5px;
  font-weight: 700;
}

.profile-form input {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.profile-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Identidad: país, ciudad, sexo, nacimiento y privacidad */
.identity-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.identity-field { display: grid; gap: 6px; min-width: 0; }

.identity-field label {
  margin: 0;
  color: var(--label);
  font-size: 13.5px;
  font-weight: 700;
}

.profile-form select,
.profile-form textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.profile-form select { min-height: 42px; }
.profile-form textarea { resize: vertical; min-height: 82px; }

.profile-form select:focus,
.profile-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-required,
.field-optional {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.field-required { background: var(--accent-soft); color: var(--accent-text); }
.field-optional { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.privacy-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.privacy-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.privacy-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.privacy-option input { width: 16px; height: 16px; accent-color: var(--accent); }

.profile-flag {
  font-size: 24px;
  line-height: 1;
}

.profile-flag[hidden] { display: none; }

/* Ficha pública de un jugador */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(140deg, var(--glow-a), transparent 62%),
    linear-gradient(150deg, var(--surface-2), var(--surface));
}

.profile-avatar-large {
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  border-radius: 26px;
  border: 2px solid var(--border-strong);
  background: var(--card-bg);
  object-fit: cover;
  box-shadow: 0 14px 34px -16px var(--halo);
}

.profile-bio {
  max-width: 650px;
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.player-result-button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 10px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.auth-card .player-result-button:hover { filter: none; }

.player-result:hover { background: var(--nav-hover-bg); }

/* Ficha tipo red social (perfil propio y ajeno) */
.profile-card {
  position: relative;
  overflow: hidden;
  margin: 14px 0 8px;
  border: 1px solid var(--border-card);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: 0 18px 44px -30px var(--shadow);
}

.profile-cover {
  height: 116px;
  background:
    radial-gradient(circle at 22% 30%, var(--glow-a), transparent 60%),
    radial-gradient(circle at 78% 10%, var(--glow-b), transparent 55%),
    linear-gradient(120deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
}

.profile-card-main {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 0 18px 16px;
  margin-top: -54px;
  flex-wrap: wrap;
}

.profile-card-main .profile-avatar-large { margin-bottom: 2px; }

.profile-card-main .profile-identity { flex: 1 1 220px; gap: 5px; }

.profile-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.profile-photo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.auth-card .profile-photo-actions button {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 14px;
  min-height: 38px;
}

.profile-card .profile-bio {
  margin: 0 18px 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 14px;
  background: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: none;
  border-right: 1px solid var(--border);
  text-align: left;
}
.stat-tile:last-child { border-right: 0; }

.stat-tile strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.stat-tile span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Paneles discretos: plegados por defecto, visibles si se buscan */
.reserved-panel {
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.reserved-panel[hidden] { display: none; }

.reserved-panel > summary {
  padding: 13px 16px;
  color: var(--label);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.reserved-panel > summary::-webkit-details-marker { display: none; }

.reserved-panel > summary::before {
  content: "▸ ";
  color: var(--accent-text);
}

.reserved-panel[open] > summary::before { content: "▾ "; }

.reserved-panel > summary:hover { color: var(--text); }

.reserved-panel > p,
.reserved-panel > form {
  margin: 0 16px 16px;
}

/* Códigos de invitación */
.invitation-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.invitation-form .identity-field { flex: 1 1 180px; }

.auth-card .invitation-form button {
  width: auto;
  min-width: 140px;
  margin: 0;
}

.invitation-result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px dashed var(--border-accent);
  border-radius: 14px;
  background: var(--accent-soft);
}

.invitation-result[hidden] { display: none; }

.invitation-result .muted { flex: 1 1 100%; margin: 0; }

.invitation-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.invitation-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.invitation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.invitation-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 200px;
  min-width: 0;
}

.invitation-item .muted { flex: 1 1 100%; margin: 0; font-size: 12.5px; }

.auth-card .invitation-item button {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  min-height: 34px;
}

@media (max-width: 620px) {
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-card-main { margin-top: -40px; }
  .profile-photo-actions { margin-left: 0; }
}

/* Bandeja de avisos */
.inbox-toggle {
  position: relative;
}

.inbox-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.inbox-badge[hidden] { display: none; }

.notification-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.notification-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}

.notification-item.unread {
  border-color: var(--border-accent);
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 62%),
    var(--card-bg);
}

.notification-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notification-head strong { font-size: 15px; }

.notification-head .muted { font-size: 12.5px; }

.notification-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.notification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.auth-card .notification-actions button {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  min-height: 34px;
}

/* Pestañas de la bandeja y conversaciones */
.inbox-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.auth-card .inbox-tab {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.auth-card .inbox-tab:hover { background: var(--nav-hover-bg); color: var(--text); filter: none; }

.auth-card .inbox-tab[aria-current="page"] {
  border-color: var(--nav-active-border);
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
}

.tab-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.tab-count[hidden] { display: none; }

.message-threads { display: grid; gap: 8px; margin-top: 14px; }

.auth-card .thread-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.auth-card .thread-item:hover { border-color: var(--border-strong); filter: none; }

.thread-item.unread {
  border-color: var(--border-accent);
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 62%),
    var(--card-bg);
}

.thread-item img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  object-fit: cover;
}

.thread-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }

.thread-info strong { overflow-wrap: anywhere; }

.thread-info .muted {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.thread-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.thread-side .muted { font-size: 11.5px; }

.thread-unread {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}

.message-thread { margin-top: 14px; }

.message-thread-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  margin: 10px 0 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.bubble {
  align-self: flex-start;
  max-width: min(78%, 520px);
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  background: var(--card-bg);
}

.bubble.mine {
  align-self: flex-end;
  border-color: var(--border-accent);
  border-radius: 14px 14px 4px 14px;
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 70%),
    var(--card-bg);
}

.bubble p {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble-time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.message-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.message-form textarea {
  flex: 1 1 240px;
  min-height: 52px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.message-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-card .message-form button {
  width: auto;
  min-width: 120px;
  margin: 0;
  flex: 0 0 auto;
}

.photo-picker {
  margin: 16px 0 4px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.photo-preview {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.photo-picker-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.auth-card .photo-picker button,
.auth-card .profile-form button {
  width: auto;
  min-width: 140px;
  margin-top: 0;
}

.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 8, 18, .78);
  backdrop-filter: blur(6px);
}

.crop-dialog {
  width: min(420px, 100%);
  max-height: 94vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 26px 70px var(--shadow);
}

.crop-dialog h4 { margin: 0 0 6px; font-size: 18px; }

.crop-stage {
  margin: 16px auto;
  width: min(320px, 78vw);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  touch-action: none;
  cursor: grab;
}

.crop-stage:active { cursor: grabbing; }

.crop-stage canvas { width: 100%; height: 100%; display: block; }

.crop-zoom-label {
  display: grid;
  gap: 6px;
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.crop-zoom-label input { width: 100%; }

.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.auth-card .crop-actions button {
  width: auto;
  min-width: 120px;
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   14. Opciones
   -------------------------------------------------------------------------- */
.option-group { margin-top: 8px; }

.option-group h4 { margin: 0 0 4px; font-size: 16px; }

.option-segmented {
  display: inline-flex;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.option-choice {
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 750;
  cursor: pointer;
}

.option-choice[aria-pressed="true"] {
  border-color: var(--nav-active-border);
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
}

.option-choice:hover { background: var(--nav-hover-bg); }

.option-note { margin-top: 18px; font-size: 13px; }

/* --------------------------------------------------------------------------
   15. Marcador — formulario y listas
   -------------------------------------------------------------------------- */
.marker-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.marker-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.marker-field-wide { grid-column: 1 / -1; }

.marker-field > label,
.marker-field-label {
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.auth-card .marker-form input,
.auth-card .marker-form select {
  width: 100%;
  min-height: 38px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.marker-checks {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }

.check input { width: 18px; height: 18px; }

.inline-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.inline-row select { flex: 1 1 140px; }

.auth-card .marker-field .secondary.small {
  width: auto;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  flex-wrap: wrap;
}

.auth-card .segmented button {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.auth-card .segmented button[aria-pressed="true"] {
  border-color: var(--nav-active-border);
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
}

.marker-opp { margin-top: 10px; display: grid; gap: 8px; }

.auth-card .marker-create {
  grid-column: 1 / -1;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-card .marker-create:disabled { opacity: .6; cursor: wait; }

.auth-card .unlimited-btn {
  min-width: 38px;
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.auth-card .unlimited-btn[aria-pressed="true"] {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: transparent;
}

.marker-form input.is-dim { opacity: .35; }

.marker-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
}
.marker-player > .marker-player-tag { grid-column: 1 / -1; }

.marker-player-tag {
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.marker-player-name { display: flex; align-items: center; gap: 10px; }

.marker-player-name strong { font-size: 15px; overflow-wrap: anywhere; }

.marker-mini-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.marker-player-color { display: flex; align-items: center; gap: 10px; }

.marker-player-color-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.marker-game {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.marker-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-card .marker-form-actions .secondary {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 18px;
}

.auth-card .marker-form .secondary {
  width: auto;
  min-width: 0;
  margin: 0;
}

.auth-card .marker-form .inline-row .secondary,
.auth-card .marker-form .marker-player .secondary { padding: 0 16px; }

.auth-card .marker-form-actions .marker-create { flex: 1 1 auto; width: auto; }

.marker-switch-field { align-items: start; }

/* El interruptor necesita su caja: sin ella se estiraba a toda la pantalla. */
.auth-card .marker-switch-field .check {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  margin: 0;
  gap: 0;
}
.auth-card .marker-switch-field .check input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.auth-card .marker-switch-field .switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .15s ease;
  pointer-events: none;
}
.auth-card .marker-switch-field .switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}
.auth-card .marker-switch-field .check input:checked + .switch-slider { background: var(--accent); }
.auth-card .marker-switch-field .check input:checked + .switch-slider::before { transform: translateX(18px); }

/* Selector de color compacto (desplegable) */
.color-select { position: relative; }

.auth-card .color-select-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 5px 13px 5px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.color-select-button .swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18);
}

.color-select-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 40px var(--shadow);
}

.color-select-panel[hidden] { display: none; }

.auth-card .color-swatch-btn {
  width: 34px;
  height: 34px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.auth-card .color-swatch-btn[aria-pressed="true"] { border-color: var(--text); }

/* Lista de marcadores (creados + historial) */
.marker-active-wrap {
  margin: 10px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}

.marker-active-wrap h4 { margin: 0 0 10px; font-size: 16px; }

.marker-active-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.marker-active-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.marker-active-item .grow { flex: 1 1 160px; min-width: 0; }

.marker-active-item .muted { display: block; font-size: 13px; }

.auth-card .marker-active-item .secondary.small {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 14px;
}

.marker-created {
  margin: 6px 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}

.marker-created > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 750;
  list-style: none;
}

.marker-created > summary::-webkit-details-marker { display: none; }

.marker-created > summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.marker-created[open] > summary::after { content: "▴"; }

.marker-created-count { color: var(--muted); font-weight: 600; }

.marker-created > ul,
.marker-created > p { padding: 0 16px 14px; }

.marker-created .marker-active-list { padding: 0 16px 14px; }

.auth-card .marker-new {
  width: auto;
  min-height: 34px;
  margin: 0 0 14px;
  padding: 0 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-card .marker-new:hover { background: var(--nav-hover-bg); }

.marker-list-vs { display: flex; flex: 0 0 auto; }

.marker-list-vs .marker-mini-avatar { width: 30px; height: 30px; border-radius: 9px; }

.marker-list-vs .marker-mini-avatar + .marker-mini-avatar {
  margin-left: -10px;
  box-shadow: 0 0 0 2px var(--card-bg);
}

.marker-list-actions { display: flex; flex: 0 0 auto; gap: 8px; }

.marker-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.marker-history-line {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   16. Marcador — tablero a pantalla completa
   -------------------------------------------------------------------------- */
.marker-board {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.marker-board[hidden] { display: none; }

.marker-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
}

.marker-topbar .marker-status { justify-self: start; }

.marker-topbar .marker-icons { justify-self: end; }

.marker-status {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .34);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
  white-space: nowrap;
}

.marker-clock {
  justify-self: center;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: clamp(24px, 6vw, 44px);
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
}

.marker-icons { display: flex; gap: 8px; }

.auth-card .icon-btn {
  width: 44px;
  height: 44px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 13px;
  background: rgba(10, 16, 32, .45);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.auth-card .icon-btn:hover { background: rgba(10, 16, 32, .68); }

.auth-card .icon-btn:active { transform: translateY(1px); }

.auth-card .icon-btn.finish {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: transparent;
}

.auth-card .icon-btn.finish:hover { background: var(--btn-bg-hover); }

.marker-halves { flex: 1; display: flex; flex-direction: row; }

.auth-card .marker-half {
  flex: 1 1 50%;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(160deg, var(--half-from), var(--half-to));
  color: var(--half-fg);
}

.auth-card .marker-half:active { filter: brightness(1.06); }

.auth-card .marker-half.is-off { cursor: default; }

.marker-half-name {
  font-size: clamp(15px, 4vw, 24px);
  font-weight: 800;
  opacity: .92;
  text-align: center;
  padding: 0 8px;
  overflow-wrap: anywhere;
}

.marker-half-score {
  font-size: clamp(64px, 24vw, 220px);
  line-height: .9;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.auth-card .half-minus {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.auth-card .half-minus:hover { background: rgba(0, 0, 0, .45); }

.auth-card .marker-half.is-off .half-minus { opacity: .3; pointer-events: none; }

.auth-card .marker-menu {
  position: absolute;
  top: calc(66px + env(safe-area-inset-top));
  right: 14px;
  z-index: 6;
  display: grid;
  gap: 6px;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px var(--shadow);
}

.marker-menu[hidden] { display: none; }

.auth-card .marker-menu .menu-item {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.auth-card .marker-menu .menu-item:hover { background: var(--nav-hover-bg); }

.marker-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 10, 22, .55);
}

.marker-overlay[hidden] { display: none; }

.marker-overlay-card { display: grid; justify-items: center; gap: 16px; }

.marker-wait {
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-weight: 750;
  text-align: center;
  animation: markerpulse 1.6s ease-in-out infinite;
}

@keyframes markerpulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

.auth-card .marker-start {
  width: 148px;
  height: 148px;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 0 10px var(--accent-soft);
}

.marker-save {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  text-align: center;
}

.marker-save .row { display: flex; gap: 10px; }

.auth-card .marker-save .secondary {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 16px;
}

.marker-board-msg {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  z-index: 6;
  padding: 0 16px;
  text-align: center;
  color: #fff;
  font-weight: 650;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.auth-card .marker-half-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, .75);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

.marker-save .result-title { margin: 0; font-size: 24px; font-weight: 850; }

.marker-save .result-time {
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.marker-save .result-note { margin: 0; color: var(--muted); font-size: 13px; }

.marker-save .result-win {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  animation: winpop .5s ease;
}

@keyframes winpop {
  0% { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.marker-save .decision { display: grid; gap: 10px; width: min(300px, 82vw); }

.auth-card .marker-save .decision .secondary {
  width: 100%;
  min-width: 0;
  margin: 0;
}

/* Pausa que bloquea */
.marker-board.is-paused .marker-half { filter: brightness(.5) saturate(.7); }

.marker-board.is-paused { box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .16); }

.marker-board.is-paused .marker-status {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.marker-board.is-paused .marker-clock { animation: markerpulse 1.8s ease-in-out infinite; }

/* --------------------------------------------------------------------------
   17. Armazón de la app (sesión iniciada): barra lateral + contenido
   -------------------------------------------------------------------------- */
main:has(#authenticated-panel:not([hidden])) .auth-card {
  width: 100%;
  max-width: none;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

#authenticated-panel {
  display: grid;
  align-items: start;
}

#authenticated-panel .primary-nav {
  position: sticky;
  flex-direction: column;
  margin: 0;
}

.auth-card #authenticated-panel .primary-nav .nav-item {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}



.app-main {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: start;
}

.app-toast { margin: 0; }

#tournament-message { color: var(--muted); }

#tournament-message.success { color: var(--success); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 2px 0 8px;
}

.page-head-text { min-width: 0; }

.page-head-text h2,
.page-head-text h3 {
  margin: 0 0 3px;
  font-size: clamp(21px, 2.4vw, 26px);
}

.page-head-text .eyebrow { margin-bottom: 3px; }

.page-head-text .muted { margin: 0 0 4px; }

.page-head-text .field-help { margin-top: 2px; }

.page-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-card .page-head-actions button {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 16px;
}

@media (max-width: 900px) {
  #authenticated-panel {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #authenticated-panel .primary-nav {
    position: sticky;
    top: 72px;
    flex-direction: row;
    overflow-x: auto;
  }

  .auth-card #authenticated-panel .primary-nav .nav-item {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 9px 10px;
  }

  .auth-card #authenticated-panel .primary-nav .nav-item[aria-current="page"] {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 760px) {
  #authenticated-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  #authenticated-panel .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  main { margin: 40px auto; }

  main:has(#authenticated-panel:not([hidden])) {
    width: 94%;
    margin-top: 20px;
    padding-bottom: 96px;
  }

  #authenticated-panel .feature-grid,
  #admin-beta-requests-list,
  .tournament-list,
  .tournament-form-grid,
  .tournament-detail-summary {
    grid-template-columns: 1fr;
  }

  .tournament-field-wide { grid-column: auto; }

  .tournament-detail-heading { flex-direction: column; }

  .auth-card .tournament-detail-heading button { width: 100%; }

  .beta { display: none; }

  .topbar { padding: 10px 4%; }

}

@media (max-width: 620px) {
  .identity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .marker-form { grid-template-columns: 1fr; }
  .marker-field-wide { grid-column: auto; }
  .section, section { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .marker-game { grid-template-columns: 1fr 1fr; }
  .tournament-review-row { flex-direction: column; gap: 3px; }
  .tournament-review-row span { text-align: left; }
  .request-card .request-actions { grid-template-columns: 1fr; }
  .workspace-section { padding: 16px; }
  header { padding: 18px 6%; }
  .hero h1 { letter-spacing: -.02em; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-wordmark { height: 16px; }
  .tournament-entry-form { grid-template-columns: minmax(0, 1fr); }
}

/* --- Panel de administración: cuentas y registro --- */
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
}
.admin-filters input[type="search"] { flex: 1 1 220px; min-width: 180px; }
.admin-filters select { flex: 0 1 auto; }

.admin-accounts { display: flex; flex-direction: column; gap: 8px; }
.admin-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}
.admin-account-info { flex: 1 1 auto; min-width: 0; }
.admin-account-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.admin-account-meta { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.admin-account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-account-actions button { font-size: 13px; padding: 6px 10px; }

.admin-badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 10.5px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.admin-badge[data-tipo="beta"] { color: #2E7BFF; border-color: #2E7BFF; }
.admin-badge[data-tipo="admin"] { color: #f5a623; border-color: #f5a623; }
.admin-badge[data-estado="suspended"] { color: #e5484d; border-color: #e5484d; }
.admin-badge[data-estado="oculta"] { color: #6b7280; border-color: #6b7280; }

.admin-audit { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.admin-audit-item { padding: 8px 10px; border-left: 2px solid var(--border-strong); }
.admin-audit-item time { color: var(--muted); margin-right: 8px; }

.admin-stats { display: flex; flex-direction: column; gap: 16px; }
.admin-stats-group h5 { margin: 0 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.admin-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-bg);
}
.admin-stat strong { font-size: 22px; line-height: 1.1; }
.admin-stat span { color: var(--muted); font-size: 12.5px; }

/* --- Opciones · tus datos --- */
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.data-actions a.secondary,
.data-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.data-actions a.secondary:hover,
.data-actions button:hover {
  border-color: var(--accent);
}

button.danger {
  border-color: color-mix(in srgb, #e05555 60%, var(--border-strong));
  background: color-mix(in srgb, #e05555 16%, var(--surface-2));
  color: #ffd9d9;
}

button.danger:hover {
  border-color: #e05555;
  background: color-mix(in srgb, #e05555 26%, var(--surface-2));
}

button.danger:disabled {
  opacity: .6;
  cursor: progress;
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--accent-text);
}

/* --- Aviso de medición (portada) --- */
.medicion-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, calc(100% - 24px));
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  font-size: 13px;
  line-height: 1.5;
}

.medicion-banner[hidden] { display: none !important; }

.medicion-banner p { margin: 0 0 12px; color: var(--muted); }
.medicion-banner strong { color: var(--text); }
.medicion-banner a { color: var(--accent-text); }

.medicion-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.medicion-actions button {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #10151d;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.medicion-actions button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  font-weight: 600;
}

/* --- Panel: serie de barras --- */
.admin-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
  padding: 6px 0 0;
}

.admin-spark-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
}

.admin-spark-foot {
  margin: 6px 0 0;
  font-size: 11px;
}

a.secondary.small {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}

a.secondary.small:hover { border-color: var(--accent); }

/* Moderación discreta: aviso rápido, borrar mensaje y bloqueos */
.quick-report {
  position: fixed;
  left: 14px;
  bottom: 76px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 22, 30, 0.72);
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  z-index: 40;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.quick-report:hover,
.quick-report:focus-visible {
  opacity: 1;
  color: #fff;
}
.quick-report-dialog {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #11161f;
  color: inherit;
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 20px;
}
.quick-report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.quick-report-dialog h3 {
  margin: 0 0 6px;
}
.quick-report-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.9rem;
}
.quick-report-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.quick-report-file {
  display: block;
  margin: 12px 0 0;
  font-size: 0.85rem;
  opacity: 0.8;
}
.quick-report-file input {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
}
.quick-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.bubble-delete {
  background: none;
  border: 0;
  padding: 0;
  margin-top: 4px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  text-decoration: underline;
}
.bubble-delete:hover {
  color: rgba(255, 255, 255, 0.8);
}
.bubble-deleted .bubble-delete {
  display: none;
}
.bubble-deleted p {
  font-style: italic;
  opacity: 0.6;
}

/* Gestión: pestañas, filas clicables y ficha en ventana */
.admin-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 0 0;
  margin: 0 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  scrollbar-width: thin;
}
.auth-card .admin-tab {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.62;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
}
.auth-card .admin-tab:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.05);
  filter: none;
}
.auth-card .admin-tab[aria-current="page"] {
  opacity: 1;
  border-bottom-color: currentColor;
  font-weight: 600;
}
.admin-tab-count {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.72rem;
  line-height: 1.5;
}
.admin-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.admin-row:hover,
.admin-row:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}
.admin-row-open {
  font-size: 0.78rem;
  opacity: 0.55;
  white-space: nowrap;
  align-self: center;
}
.detail-dialog {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: #11161f;
  color: inherit;
  width: min(560px, calc(100% - 28px));
  max-height: calc(100% - 60px);
  padding: 22px;
  overflow-y: auto;
}
.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.detail-dialog h3 {
  margin: 2px 0 4px;
  font-size: 1.15rem;
}
.detail-dialog-body {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-note {
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.detail-row {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}
.detail-key {
  flex: 0 0 140px;
  opacity: 0.62;
}
.detail-value {
  flex: 1;
  word-break: break-word;
}
.detail-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.detail-dialog-foot {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}
@media (max-width: 520px) {
  .detail-row {
    flex-direction: column;
    gap: 2px;
  }
  .detail-key {
    flex: none;
    font-size: 0.78rem;
  }
}

/* Paginadores de las listas de gestión */
.admin-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
}
.admin-pager-info {
  font-size: 0.82rem;
  opacity: 0.66;
  margin-right: auto;
}
.auth-card .admin-pager button {
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 6px 14px;
  font-size: 0.85rem;
}
.auth-card .admin-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Filtros con etiqueta visible y filas de cuentas en columnas */
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.admin-field > span {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}
.admin-filters .admin-field input,
.admin-filters .admin-field select {
  margin: 0;
  /* Dentro de una columna, flex-basis se mide en vertical: sin esto, el buscador
     heredaba `flex: 1 1 220px` y salía un recuadro de 220 px de alto. La regla lleva
     `.admin-filters` delante para ganar en especificidad a la del buscador. */
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}
.admin-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 118px 88px 46px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
}
.admin-accounts-head {
  padding-top: 0;
  padding-bottom: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}
.admin-accounts-head span {
  min-width: 0;
}
.admin-account-grid .admin-cell {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-account-grid .admin-cell-name {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}
.admin-cell-name .admin-account-name {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-cell-name .admin-badge { flex: 0 0 auto; }
.admin-cell-name .admin-cell-sub {
  flex: 0 1 auto;
  min-width: 0;
}
.admin-account-grid .admin-cell-name .admin-account-name {
  font-size: 0.95rem;
  line-height: 1.25;
}
.admin-cell-sub {
  font-size: 0.74rem;
  line-height: 1.2;
  opacity: 0.6;
  overflow-wrap: anywhere;
}
/* El correo va debajo del nombre: una fila de dos líneas como mucho. */
.admin-cell-name .admin-cell-sub {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-cell-date {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 0.82rem;
}
@media (max-width: 760px) {
  .admin-accounts-head { display: none; }
  .admin-account-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
  }
  .admin-cell-name {
    grid-column: 1 / -1;
  }
  .admin-cell-date {
    grid-column: 1 / 2;
  }
}

/* VS&VS: lista de desafíos y cierre del marcador */
.vsvs-list { display: flex; flex-direction: column; gap: 8px; }
.auth-card .vsvs-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "quien lado" "meta lado";
  gap: 2px 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: inherit;
  text-align: left;
  box-shadow: none;
}
.auth-card .vsvs-item:hover { border-color: var(--border-strong); filter: none; }
.auth-card .vsvs-item.te-toca { border-color: var(--accent); }
.vsvs-item strong { grid-area: quien; font-size: 0.95rem; }
.vsvs-item-meta { grid-area: meta; font-size: 0.8rem; color: var(--muted); }
.vsvs-item-lado {
  grid-area: lado;
  align-self: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.vsvs-history { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.vsvs-history-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.vsvs-create, .vsvs-score {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.vsvs-score { grid-template-columns: 1fr 1fr; }
.vsvs-create { grid-template-columns: 1fr 90px 1fr; }
.vsvs-score button, .vsvs-create button { grid-column: 1 / -1; }
@media (max-width: 520px) {
  .vsvs-create, .vsvs-score { grid-template-columns: 1fr; }
}

.auth-card .topbar-icon {
  width: 38px;
  height: 38px;
  min-height: 38px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}
.auth-card .topbar-icon:hover { filter: none; background: var(--nav-hover-bg); }

/* Ficha de jugador en ventana */
.player-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100% - 40px);
  padding: 22px;
  overflow-y: auto;
}
.player-dialog .workspace-section { margin: 0; }
.player-dialog .page-head { margin-bottom: 12px; }
@media (max-width: 520px) {
  .player-dialog { padding: 16px; border-radius: 14px; }
}

/* Ficha de torneo en ventana */
.tournament-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100% - 40px);
  padding: 22px;
  overflow-y: auto;
}
.tournament-dialog .tournament-detail-heading { margin-bottom: 10px; }

/* Menú de acciones de la ficha de jugador (⋯) */
.action-menu { position: relative; display: inline-flex; }
.action-menu-toggle { min-width: 44px; font-size: 18px; line-height: 1; letter-spacing: 1px; }
.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 178px;
  padding: 6px;
  display: grid;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
}
.action-menu-panel .menu-item { text-align: left; }

/* Navegación móvil (bloque 2) */
.bottom-nav { display: none; }
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; background: rgba(0,0,0,.5); }
.sheet-panel { width: 100%; max-height: 80%; overflow-y: auto; background: var(--card-bg); border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 6px; border-top: 1px solid var(--border-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h3 { margin: 0; }
.sheet .menu-item { text-align: left; }
@media (max-width: 760px) {
  body { padding-bottom: 78px; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--card-bg); border-top: 1px solid var(--border-strong); box-shadow: 0 -8px 24px rgba(0,0,0,.28); }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; background: none; border: 0; border-radius: 10px; color: var(--text); font: inherit; font-size: 10.5px; letter-spacing: .2px; }
  .bottom-nav button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .bn-icon svg { width: 22px; height: 22px; display: block; }
}

/* Creador de torneos (bloque 3A) — panel con barra lateral y campos subrayados */
.creator-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 68vh; }
.creator-side { background: rgba(6, 11, 18, .55); border-right: 1px solid var(--border); padding: 14px 0 0; display: grid; align-content: start; }
.creator-side-title { margin: 0 0 8px; padding: 0 16px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.creator-tab { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; color: var(--label); font: inherit; font-size: 13.5px; padding: 9px 16px; cursor: pointer; }
.creator-tab:hover { background: rgba(255, 255, 255, .04); }
.creator-tab.is-active { background: rgba(255, 255, 255, .07); border-left-color: var(--accent); color: #fff; }
.creator-side-foot { margin-top: 18px; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.creator-side-foot p { margin: 0; }
.creator-side-foot #preview-estimate { color: var(--accent-text); font-weight: 600; }
.creator-panel { min-width: 0; display: flex; flex-direction: column; }
.creator-head { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(216, 182, 107, .07), transparent); }
.creator-head-text { min-width: 0; display: grid; gap: 2px; }
.creator-head h3 { margin: 0; font-size: 20px; }
.creator-head-meta { margin: 0; font-size: 12px; color: var(--muted); }
.creator-meta-line { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--muted); }
.creator-meta-line span { white-space: nowrap; }
.creator-cover { width: 96px; height: 54px; flex: none; border-radius: 6px; background: var(--accent-soft) center / cover no-repeat; display: grid; place-items: center; font-size: 10px; color: var(--muted); overflow: hidden; }
.creator-body { padding: 20px; display: grid; gap: 16px; max-width: 760px; }
.creator-body[hidden] { display: none; }
.field { display: grid; gap: 3px; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.field input, .field select, .field textarea { background: transparent; border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; padding: 7px 0; font: inherit; font-size: 14px; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }
.field-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.field-line > input { flex: 1 1 auto; min-width: 0; }
.field-line .field-help { white-space: nowrap; font-size: 11px; letter-spacing: 0; text-transform: none; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-note { font-size: 11.5px; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--label); }
.switch input { width: 15px; height: 15px; accent-color: var(--accent); }
.creator-subblock { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }
.creator-actions { position: sticky; bottom: 0; margin-top: auto; display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--panel); }
.creator-actions .message { flex: 1; margin: 0; font-size: 12.5px; }
.btn-primary, .btn-secondary { font: inherit; font-size: 13px; height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); border: 0; font-weight: 600; }
.btn-secondary { background: transparent; color: var(--label); border: 1px solid var(--border-strong); }
.help { display: inline-grid; place-items: center; width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--muted); font-size: 9.5px; line-height: 1; cursor: help; }
.help:hover, .help:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.help-tip { position: fixed; z-index: 90; max-width: 240px; background: #121c28; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.4; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
@media (max-width: 860px) {
  .creator-shell { grid-template-columns: 1fr; }
  .creator-side { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0; }
  .creator-side-title, .creator-side-foot { display: none; }
  .creator-tab { width: auto; border-left: 0; border-bottom: 2px solid transparent; padding: 10px 12px; white-space: nowrap; }
  .creator-tab.is-active { border-left: 0; border-bottom-color: var(--accent); }
  .creator-head { align-items: flex-start; }
  .creator-head .creator-cover { width: 72px; height: 40px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

/* Editor de cartel (bloque 3A) */
.cover-editor { width: min(640px, 94vw); border: 1px solid var(--border-strong); border-radius: 16px; background: var(--card-bg); color: var(--text); padding: 16px; }
.cover-editor::backdrop { background: rgba(0,0,0,.65); }
.cover-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cover-editor-head h3 { margin: 0; font-size: 16px; }
.cover-viewport { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #000; touch-action: none; cursor: grab; }
.cover-viewport:active { cursor: grabbing; }
.cover-viewport img { position: absolute; max-width: none; user-select: none; pointer-events: none; }
.cover-zoom { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.cover-zoom input { flex: 1; }
.cover-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.cover-editor-actions .secondary { margin-right: auto; }

/* Corrección de especificidad: el botón global de .auth-card (ancho 100%, 42 px,
   degradado) se comía las pestañas del creador y el icono de ayuda. */
.auth-card .creator-tab {
  width: auto; min-height: 0; margin: 0; padding: 9px 16px;
  border: 0; border-left: 3px solid transparent; border-radius: 0;
  background: none; box-shadow: none; color: var(--label);
  font: inherit; font-size: 13.5px; font-weight: 500; letter-spacing: 0;
  text-align: left; width: 100%;
}
.auth-card .creator-tab:hover { background: rgba(255, 255, 255, .04); box-shadow: none; }
.auth-card .creator-tab.is-active {
  background: rgba(255, 255, 255, .07);
  border-left-color: var(--accent); color: #fff;
}
.auth-card .help {
  width: 14px; height: 14px; min-height: 0; margin: 0; padding: 0;
  border-radius: 50%; border: 1px solid var(--border-strong);
  background: none; box-shadow: none; color: var(--muted);
  font-size: 9.5px; font-weight: 600;
}
.auth-card .btn-primary, .auth-card .btn-secondary {
  width: auto; min-height: 34px; margin: 0; font-size: 13px; font-weight: 600;
}
.auth-card .btn-secondary {
  background: transparent; border: 1px solid var(--border-strong); color: var(--label);
}
@media (max-width: 860px) {
  .auth-card .creator-tab {
    width: auto; padding: 10px 12px; border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .auth-card .creator-tab.is-active {
    border-left: 0; border-bottom-color: var(--accent);
  }
}

/* Campos del creador: anulan la caja global de .auth-card (44 px, radio 11, borde completo) */
.auth-card .field input,
.auth-card .field select,
.auth-card .field textarea {
  width: 100%; min-height: 34px; padding: 6px 0;
  border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0;
  background: transparent; box-shadow: none; font-size: 14px;
}
.auth-card .field textarea { min-height: 76px; }
.auth-card .field input:focus,
.auth-card .field select:focus,
.auth-card .field textarea:focus {
  border-bottom: 2px solid var(--accent); box-shadow: none; padding-bottom: 5px;
}
.auth-card select { color-scheme: dark; }
.auth-card option { background: #0d1420; color: var(--text); }
.auth-card .check {
  display: flex; align-items: center; gap: 9px;
  width: auto; margin: 2px 0; font-size: 13px; font-weight: 500; color: var(--label);
}
.auth-card .check input { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--accent); }
.auth-card .check span { line-height: 1.35; }
.auth-card .marker-switch-field .check span { line-height: 0; }
.creator-body .field { max-width: 100%; }

/* ===== Capa de diseño de aplicación (2026-10-20) ===== */
/* Barra lateral: filas densas, no tarjetas */

/* Lista de torneos: fila densa con divisor, sin tarjeta */
.auth-card .tournament-card {
  display: block; margin: 0; padding: 10px 12px;
  border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: none; box-shadow: none;
}
.auth-card .tournament-card::before { display: none; }
.auth-card .tournament-card:hover { background: rgba(255, 255, 255, .03); }
.auth-card .tournament-card-heading { display: flex; align-items: center; gap: 8px; }
.auth-card .tournament-card h4 { margin: 0; font-size: 14.5px; font-weight: 600; }
.auth-card .tournament-card .feature-state {
  font-size: 10px; letter-spacing: .05em; padding: 2px 7px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
}
.auth-card .tournament-card > p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.auth-card .tournament-card-roles { display: flex; gap: 6px; margin-top: 4px; }
.auth-card .tournament-role { font-size: 10.5px; color: var(--muted); }
.auth-card .tournament-card .tournament-view-button {
  margin-top: 6px; min-height: 28px; padding: 0 10px; font-size: 12px;
  border-radius: 6px; width: auto;
}

/* ===== Capa global de diseño (2026-10-20) ===== */
.auth-card h2 { font-size: 22px; }
.auth-card .page-head h3 { font-size: 19px; letter-spacing: 0; }
.auth-card .page-head .muted { font-size: 12.5px; }

/* Botones: compactos y de ancho natural; los envíos de formulario siguen a lo ancho */
.auth-card button {
  width: auto; min-height: 34px; margin-top: 0; padding: 0 14px;
  border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: none;
}
.auth-card button:hover { box-shadow: none; }
.auth-card form > button[type="submit"] { width: 100%; }

/* Campos: 38 px, radio 8, etiqueta pequeña en acento */
.auth-card input, .auth-card select, .auth-card textarea {
  min-height: 38px; padding: 8px 10px; border-radius: 8px; font-size: 14px;
}
.auth-card textarea { min-height: 88px; }
.auth-card label {
  margin-top: 4px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text);
}

/* Inicio: módulos como filas, no tarjetas */
.feature-grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.auth-card button.feature-card {
  display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "title state" "desc desc";
  align-items: center; gap: 2px 10px;
  width: 100%; margin: 0; padding: 12px 14px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; box-shadow: none;
}
.auth-card button.feature-card:last-child { border-bottom: 0; }
.auth-card button.feature-card:hover { background: rgba(255, 255, 255, .04); }
.auth-card button.feature-card h3 { grid-area: title; margin: 0; font-size: 14.5px; }
.auth-card button.feature-card .feature-state {
  grid-area: state; justify-self: end; font-size: 10px; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
}
.auth-card button.feature-card p { grid-area: desc; margin: 0; font-size: 12.5px; color: var(--muted); }

/* Avisos: filas */
.auth-card .notification-item {
  padding: 10px 2px; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: none;
}
.auth-card .notification-item.unread { background: rgba(216, 182, 107, .05); }
.auth-card .notification-item p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* Ficha del torneo: datos en dos columnas */
.auth-card .tournament-detail-summary {
  display: grid; grid-template-columns: 132px 1fr; gap: 2px 12px; font-size: 13px;
}
.auth-card .tournament-detail-summary p { display: contents; margin: 0; }
.auth-card .tournament-detail-summary strong {
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}

/* Superficies y listas del resto de pantallas */
.auth-card .workspace-section {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.auth-card .player-result-button { background: none; }
.auth-card .player-result-button:hover { background: rgba(255, 255, 255, .04); }
.auth-card .detail-dialog {
  border: 1px solid var(--border); border-radius: 12px; padding: 0;
  background: var(--panel); width: min(720px, 94vw); max-height: 88vh; overflow: auto;
}
.auth-card .detail-dialog > * { padding-left: 16px; padding-right: 16px; }
.auth-card .tournament-detail-heading,
.auth-card .detail-dialog > header { padding-top: 12px; padding-bottom: 12px; }
.auth-card .tournament-teams h5,
.auth-card .tournament-invite h5 { font-size: 11px; letter-spacing: .06em; }

/* Login: sin cartel gigante y con acciones discretas */
.hero h1 { font-size: 34px; line-height: 1.12; letter-spacing: -0.01em; }
.hero .intro { font-size: 14px; max-width: 560px; }
.hero .eyebrow, .auth-card .eyebrow { font-size: 11px; letter-spacing: .14em; }
.auth-card #show-register,
.auth-card #show-reset {
  width: auto; min-height: 0; margin: 10px 0 0; padding: 0;
  background: none; border: 0; box-shadow: none;
  color: var(--accent-text); font-size: 12.5px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px;
}
.auth-card #show-register:disabled { color: var(--muted); text-decoration: none; }

/* Iconos de la barra superior */
.auth-card .topbar-icon {
  width: 32px; height: 32px; min-height: 32px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border);
  background: none; box-shadow: none;
}

/* Ficha: el rol es un chip, no una barra */
#profile-role, #public-profile-role {
  display: inline-flex; width: auto; min-height: 0; margin: 0;
  padding: 2px 10px; border: 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 10px; letter-spacing: .05em;
}

/* Marcador: botón normal, no barra de ancho completo */
.auth-card .marker-create, .auth-card #marker-create {
  width: auto; min-height: 34px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600;
}

/* ===== Rediseño del armazón: lo que de verdad se ve ===== */

/* Botones: se acaban las barras doradas de lado a lado (salvo el login) */
.auth-card form > button[type="submit"] { width: auto; min-width: 150px; }
.auth-card #login-form #login-button { width: 100%; }

/* Navegación: lista plana, sin tarjeta redondeada */

/* Superficies: paneles planos, sin tarjetas dentro de tarjetas */
.auth-card .workspace-section {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  padding: 0;
}
.auth-card .workspace-section + .workspace-section {
  border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px;
}
.auth-card .page-head h3 { font-size: 22px; }
.auth-card .page-head .muted { font-size: 13px; }

/* Ficha: bloques separados por línea, no por tarjeta */
.auth-card .profile-hero { background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.auth-card .profile-stats { border: 0; border-bottom: 1px solid var(--border); }

/* ===== Estructura de pantalla, igual que el creador ===== */
.auth-card .workspace-section {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
}
.auth-card .page-head {
  padding: 0 0 12px; margin: 0 0 14px;
  border-bottom: 1px solid var(--border);
}
.auth-card .page-head h3 { font-size: 20px; }

/* Ficha: cabecera, cifras en fila y formulario subrayado */
.auth-card .profile-card-main { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; }
.auth-card .profile-avatar-large { width: 64px; height: 64px; border-radius: 12px; }
.auth-card .profile-identity strong { font-size: 19px; }
.auth-card .profile-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 0 0 14px;
}
.auth-card .profile-stats > * {
  padding: 10px 14px; border-right: 1px solid var(--border);
  text-align: left; background: none;
}
.auth-card .profile-stats > *:last-child { border-right: 0; }
.auth-card .profile-stats strong { display: block; font-size: 18px; line-height: 1.2; }
.auth-card .profile-stats span { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.auth-card .profile-form label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.auth-card .profile-form input,
.auth-card .profile-form select,
.auth-card .profile-form textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--border-strong);
  border-radius: 0; padding: 6px 0;
}
.auth-card .profile-form button[type="submit"] { width: auto; min-width: 160px; margin-top: 14px; justify-self: start; }
.auth-card #profile-edit { border: 0; border-top: 1px solid var(--border); padding-top: 4px; }
.auth-card #profile-edit > summary { font-size: 13px; font-weight: 600; color: var(--accent-text); }

/* Días del torneo: una fila por día con su hora de inicio */
.day-list { display: grid; gap: 2px; margin: 2px 0 12px; }
.day-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.day-row > span { font-size: 13px; color: var(--muted); text-transform: capitalize; }
@media (max-width: 640px) {
  .day-row { grid-template-columns: minmax(0, 1fr) 92px; }
}

/* Clasificación final */
.clasificacion-final { margin-top: 14px; }
.tabla-final { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla-final th {
  text-align: left; font-weight: 600; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted, #6b7a89); padding: 6px 8px;
  border-bottom: 1px solid var(--line, #d5dde5);
}
.tabla-final td { padding: 7px 8px; border-bottom: 1px solid var(--line, #e6ecf2); }
.tabla-final td.puesto { font-weight: 700; width: 2.5rem; }
.tabla-final td.jugador { font-weight: 600; }
.tabla-final .premio { font-weight: 500; color: var(--muted, #6b7a89); }
.tabla-final td.porcentaje { white-space: nowrap; }
.tabla-final .barra {
  display: inline-block; width: 64px; height: 8px; border-radius: 4px;
  background: var(--line, #e6ecf2); overflow: hidden; vertical-align: middle;
  margin-right: 8px;
}
.tabla-final .barra > span { display: block; height: 100%; background: var(--accent, #3d7ea6); }
.tabla-final tr.oculto { display: none; }

/* Historial del organizador */
.historial-torneo { margin-top: 14px; }
.historial-torneo ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: .88rem; }
.historial-torneo li {
  padding: 5px 0; border-bottom: 1px solid var(--line, #e6ecf2);
  color: var(--muted, #55636f);
}

/* Aviso intrusivo del organizador */
.aviso-organizador {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(5, 8, 12, .86); backdrop-filter: blur(3px);
}
.aviso-caja {
  background: var(--surface, #111a26); border: 2px solid #d8b66b; border-radius: 20px;
  padding: 30px 34px; text-align: center; max-width: 560px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.aviso-caja h3 { margin: 0 0 10px; font-size: 26px; color: #d8b66b; }
.aviso-caja p { margin: 0 0 22px; font-size: 18px; }
.aviso-caja button {
  font: inherit; font-size: 17px; padding: 13px 26px; border-radius: 12px;
  border: 1px solid #d8b66b; background: #d8b66b; color: #14100a; cursor: pointer;
}

/* Tablets */
.tablets-torneo { margin-top: 14px; }
.tablets-lista { display: grid; gap: 8px; margin-top: 6px; }
.tablets-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .92rem; }
.tablets-salida { color: var(--muted, #6b7a89); font-size: .85rem; }

.aviso-acciones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.aviso-acciones button {
  font: inherit; font-size: 16px; padding: 12px 18px; border-radius: 12px;
  border: 1px solid #d8b66b; background: transparent; color: #f4efe6; cursor: pointer;
}
.aviso-acciones button.primary { background: #d8b66b; color: #14100a; }
.qr-mesa { width: 132px; height: 132px; border-radius: 8px; background: #fff; padding: 4px; }

.ficha-pais { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.bandera { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.siglas { font-size: 11px; letter-spacing: .06em; color: var(--muted, #6b7a89); }

/* ==========================================================================
   19. Sistema visual 2.0 — armazón, jerarquía y controles
   Una sola rejilla de espacios, un solo radio por familia, un solo oro.
   ========================================================================== */
:root {
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --h-control: 42px;
  --ui: 13.5px;
  --elev-1: 0 1px 2px rgba(0, 0, 0, .28);
  --elev-2: 0 10px 28px -18px rgba(0, 0, 0, .8);
}

/* --- Lienzo --- */
main:has(#authenticated-panel:not([hidden])) {
  width: min(1320px, 100% - 48px);
  margin: 0 auto var(--sp-6);
}

#authenticated-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.app-main { gap: var(--sp-4); }

/* --- Barra lateral --- */
/* Navegación horizontal pegada a la cabecera: escritorio y tablet. */
#authenticated-panel .primary-nav {
  position: sticky;
  top: 64px;
  z-index: 30;
  display: flex;
  flex-direction: row;
  gap: var(--sp-1);
  margin: 0 0 var(--sp-4);
  padding: var(--sp-2) 2px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--nav-bg);
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.auth-card #authenticated-panel .primary-nav .nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  box-shadow: none;
  font-size: var(--ui);
  font-weight: 600;
  color: var(--label);
  letter-spacing: .005em;
  white-space: nowrap;
}

.auth-card #authenticated-panel .primary-nav .nav-item:hover {
  background: var(--nav-hover-bg);
  color: var(--text);
}

.auth-card #authenticated-panel .primary-nav .nav-item[aria-current="page"] {
  border-left: 0;
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px var(--nav-active-border);
  color: var(--nav-active-text);
}

/* --- Cabecera de página --- */
.page-head {
  align-items: center;
  gap: var(--sp-4);
  margin: 0 0 var(--sp-3);
  padding: 0 2px;
}

.page-head-text h2,
.page-head-text h3 {
  margin: 0 0 4px;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -.025em;
}

.page-head-text .muted {
  margin: 0;
  font-size: var(--ui);
  line-height: 1.5;
  max-width: 62ch;
}

.page-head-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* --- Superficies --- */
.module-panel,
.workspace-section {
  padding: var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.module-panel h3,
.workspace-heading h3 {
  margin: 0 0 var(--sp-1);
  font-size: 16px;
  letter-spacing: -.015em;
}

.module-panel p:not(.eyebrow) { font-size: var(--ui); }

/* --- Botones --- */
.btn-primary,
.btn-secondary,
.btn-ghost {
  font: inherit;
  font-size: var(--ui);
  font-weight: 600;
  height: var(--h-control);
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: background-color .15s ease, border-color .15s ease, transform .06s ease;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 0;
  box-shadow: 0 6px 18px -10px var(--halo);
}

.btn-primary:hover { background: var(--btn-bg-hover); }

.btn-secondary,
.btn-ghost {
  background: transparent;
  color: var(--label);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover,
.btn-ghost:hover { border-color: var(--border-accent); color: var(--text); }

.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active { transform: translateY(1px); }

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; }

/* Los botones antiguos heredan el mismo alto y radio. */
button.secondary {
  height: var(--h-control);
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--ui);
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--label);
}

button.secondary:hover { border-color: var(--border-accent); color: var(--text); }

/* --- Controles --- */
.field input,
.field select,
.field textarea,
.admin-field input,
.admin-field select {
  min-height: var(--h-control);
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--input-bg);
  color: var(--text);
  font-size: var(--ui);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea { padding: var(--sp-3); min-height: 96px; line-height: 1.55; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-field input:focus,
.admin-field select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-row { gap: var(--sp-3); }
.field { gap: 6px; }

.check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--ui);
}

/* --- Pestañas de sección: estilos consolidados --- */
.section-tabs {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
  scrollbar-width: none;
}

.auth-card .section-tabs {
  gap: 18px;
}

.section-tabs::-webkit-scrollbar { display: none; }

.auth-card .section-tabs button {
  flex: 0 0 auto;
  width: auto;
  height: 34px;
  min-height: 32px;
  margin: 0;
  padding: 6px 2px 8px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  opacity: .6;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

.auth-card .section-tabs button:hover {
  opacity: .9;
  background: rgba(255, 255, 255, .05);
  filter: none;
}

.auth-card .section-tabs button[aria-current="page"] {
  opacity: 1;
  border-bottom-color: var(--accent);
}

/* --- Página del torneo --- */
.tpage { display: grid; gap: var(--sp-4); }

.tpage-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.tpage-id { min-width: 0; }
.tpage-id .eyebrow { margin: 0 0 2px; }
.tpage-id h2 { margin: 0; font-size: clamp(20px, 2vw, 26px); letter-spacing: -.025em; }
.tpage-meta { margin: 4px 0 0; color: var(--muted); font-size: var(--ui); }
.tpage-body { display: grid; gap: var(--sp-4); }

/* --- Móvil --- */
@media (max-width: 900px) {
  main:has(#authenticated-panel:not([hidden])) {
    width: 100%;
    margin: 0;
  }

  #authenticated-panel {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #authenticated-panel .primary-nav {
    position: sticky;
    top: 56px;
    z-index: 30;
    flex-direction: row;
    gap: 4px;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
  }

  .auth-card #authenticated-panel .primary-nav .nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 9px 13px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .app-main { padding: var(--sp-4); gap: var(--sp-3); }

  .module-panel,
  .workspace-section { padding: var(--sp-4); border-radius: var(--r-md); }

  .page-head { align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .page-head-actions > * { flex: 1 1 auto; justify-content: center; }

  .tpage-head {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--r-md);
  }

  .tpage-head .btn-ghost { justify-self: start; }

  .field-row,
  .field-row-3 { grid-template-columns: 1fr !important; }
}

/* El botón de vuelta es secundario, aunque otra regla antigua lo pinte como primario. */
.tpage-head .btn-ghost,
#tpage-back {
  background: transparent;
  background-image: none;
  color: var(--label);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.tpage-head .btn-ghost:hover,
#tpage-back:hover {
  color: var(--text);
  border-color: var(--border-accent);
}

/* --- Contenido del torneo: ficha, secciones, inscritos y cuadro --- */
.tournament-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--sp-6);
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.dt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.dt-row:nth-last-child(-n+2) { border-bottom: 0; }

.dt-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.dt-value {
  font-size: var(--ui);
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.tournament-detail-section {
  padding: var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.tournament-detail-section > h3,
.tournament-detail-section > h4 {
  margin: 0 0 var(--sp-1);
  font-size: 16px;
}

.tournament-detail-section > p:first-of-type { margin-top: 0; }

.tournament-management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--input-bg);
}

.tournament-management-actions button {
  height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--label);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.tournament-management-actions button:hover {
  border-color: var(--border-accent);
  color: var(--text);
}

.tournament-management-actions button.tournament-delete-button:hover {
  border-color: rgba(255, 130, 110, .6);
  color: var(--warn);
}

/* Inscritos */
.tournament-entry-list,
.tournament-entry-manager { display: grid; gap: var(--sp-2); }

.tournament-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
}

.tournament-entry-info { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }

.tournament-entry-info img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.tournament-entry-info strong { font-size: var(--ui); }

.tournament-entry-status {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tournament-entry-actions { display: flex; gap: var(--sp-2); }

.tournament-entry-actions button {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--label);
  font-size: 12px;
  cursor: pointer;
}

/* Cuadro y tablas dentro de la página */
.tpage-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ui);
}

.tpage-body thead th {
  padding: 8px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.tpage-body tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.tpage-body tbody tr:last-child td { border-bottom: 0; }

.tpage-body tbody tr:hover td { background: var(--nav-hover-bg); }

.tournament-invitation-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--input-bg);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .tournament-detail-summary {
    grid-template-columns: 1fr;
    padding: var(--sp-1) var(--sp-4);
  }

  .dt-row:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .dt-row:last-child { border-bottom: 0; }

  .tournament-detail-section { padding: var(--sp-4); border-radius: var(--r-md); }

  .tpage-body table { font-size: 12.5px; }
  .tpage-body thead th,
  .tpage-body tbody td { padding: 8px 6px; }
}

/* La ficha: la etiqueta no se estruja y el valor ocupa lo que queda. */
.dt-label { flex: 0 0 auto; }
.dt-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 1000px) {
  #tpage-body .tournament-detail-summary { grid-template-columns: 1fr; }
}

/* --- Creador de torneos: pasos claros, nada amontonado --- */
.creator-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.creator-side {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 4px;
  padding: var(--sp-3);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.creator-side-title {
  margin: 0 0 var(--sp-2);
  padding: 0 var(--sp-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.creator-tab {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 10px var(--sp-3);
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--label);
  font-size: var(--ui);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.creator-tab:hover { background: var(--nav-hover-bg); color: var(--text); }

.creator-tab.is-active {
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px var(--nav-active-border);
  color: var(--nav-active-text);
}

.creator-step {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.creator-tab.is-active .creator-step {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}

.creator-panel {
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
  overflow: hidden;
}

.creator-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--input-bg);
}

.creator-cover {
  width: 96px;
  height: 60px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
}

.creator-head-text h3 { margin: 0 0 2px; font-size: 18px; letter-spacing: -.02em; }
.creator-head-meta { margin: 0; font-size: var(--ui); color: var(--text); }
.creator-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.creator-body { padding: var(--sp-5); display: grid; gap: var(--sp-4); }

.creator-group-title {
  margin: var(--sp-2) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.creator-body > .creator-group-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.creator-subblock {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
}

.creator-body .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.creator-body .field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.creator-body .field { display: grid; gap: 6px; min-width: 0; }

.creator-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-end;
  margin: 0;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--input-bg);
}

.creator-actions .message { margin-right: auto; }

@media (max-width: 1000px) {
  .creator-shell { grid-template-columns: 1fr; gap: var(--sp-3); }

  .creator-side {
    position: sticky;
    top: 56px;
    z-index: 20;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    border-radius: 0 0 var(--r-md) var(--r-md);
    scrollbar-width: none;
  }

  .creator-side-title { display: none; }

  .creator-tab {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 12px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .creator-head { grid-template-columns: 72px minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); }
  .creator-cover { width: 72px; height: 48px; }
  .creator-body { padding: var(--sp-4); }
  .creator-body .field-row,
  .creator-body .field-row-3 { grid-template-columns: 1fr; }
  .creator-actions { flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); }
  .creator-actions > button { flex: 1 1 auto; justify-content: center; }
}

/* Asistente de creación · build 143 */
.creator-stepper {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.auth-card .creator-stepper .creator-tab {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  justify-content: flex-start;
}

.auth-card .creator-stepper .creator-tab:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.auth-card .creator-stepper .creator-tab.is-complete {
  color: var(--accent-text);
}

.creator-progress {
  display: grid;
  gap: 8px;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.creator-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}

.creator-progress-head strong {
  color: var(--text);
  font-size: var(--ui);
}

.creator-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

#creator-progress-fill {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms ease;
}

.creator-review-intro {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.creator-review-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
  background: var(--surface);
}

.creator-review-row {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  gap: var(--sp-3);
  padding: 11px var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.creator-review-row:last-child { border-bottom: 0; }

.creator-review-row dt {
  color: var(--muted);
  font-size: var(--ui);
}

.creator-review-row dd {
  margin: 0;
  color: var(--text);
  font-size: var(--ui);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.creator-review-note {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
}

.creator-review-note strong { color: var(--text); }
.creator-review-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: var(--ui);
  line-height: 1.5;
}

.creator-actions button[hidden] { display: none !important; }
.creator-step-actions {
  display: flex;
  flex: 0 0 auto;
  gap: var(--sp-2);
}

@media (max-width: 1000px) {
  .creator-side {
    /* En tablet/móvil los pasos ocupan su espacio y no tapan los campos. */
    position: static;
    top: auto;
    z-index: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .creator-stepper {
    display: flex;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: thin;
  }
  .auth-card .creator-stepper .creator-tab {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    padding: 8px 12px;
    white-space: nowrap;
  }
  .creator-progress { padding: var(--sp-3) var(--sp-4); }
  .creator-review-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .creator-actions .message { flex: 1 1 100%; }
  .creator-step-actions { flex: 1 1 100%; }
  .creator-step-actions button { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 560px) {
  .creator-actions > #creator-cancel,
  .creator-actions > #creator-prev-step {
    flex: 1 1 0;
  }
}

/* --- Invitar jugadores: un bloque que se entiende de un vistazo --- */
.tournament-invite {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.tournament-invite h5,
.tournament-entry-manager h5 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.015em;
}

.tournament-invite > p,
.tournament-entry-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.tournament-invite input[type="search"],
.tournament-entry-form input[type="text"] {
  width: 100%;
  height: var(--h-control);
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--input-bg);
  color: var(--text);
  font-size: var(--ui);
}

.tournament-invite input[type="search"]:focus,
.tournament-entry-form input[type="text"]:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Resultados: filas, no botones sueltos pegados unos a otros. */
.invite-results { display: grid; gap: var(--sp-2); }

.invite-results button {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 46px;
  padding: 8px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--input-bg);
  color: var(--text);
  font-size: var(--ui);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.invite-results button:hover {
  border-color: var(--border-accent);
  background: var(--nav-hover-bg);
}

.invite-results button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Separación clara entre lo que eliges y lo que confirmas. */
.tournament-invite > button,
.tournament-invite .invite-actions button {
  justify-self: start;
  min-width: 160px;
}

.tournament-invite .invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

/* Añadir plaza a mano */
.tournament-entry-manager {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
}

.tournament-entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--sp-3);
}

.tournament-entry-form label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tournament-entry-form button {
  height: var(--h-control);
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--label);
  font-size: var(--ui);
  font-weight: 600;
  cursor: pointer;
}

.tournament-entry-form button:hover { border-color: var(--border-accent); color: var(--text); }

/* Que nunca haya dos botones pegados sin aire. */
.tournament-detail-section button + button,
.tournament-detail-section .message + button { margin-left: var(--sp-2); }

@media (max-width: 900px) {
  .tournament-invite,
  .tournament-entry-manager { padding: var(--sp-4); border-radius: var(--r-md); }

  .tournament-entry-form { grid-template-columns: 1fr; }
  .tournament-entry-form button { width: 100%; }
  .tournament-invite > button { justify-self: stretch; }
}

/* --- Inicio: módulos como tarjetas, no como cajas --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.feature-card {
  display: grid;
  gap: var(--sp-2);
  align-content: start;
  padding: var(--sp-5);
  font: inherit;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}

.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.feature-card:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.feature-card h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }

.feature-card p {
  margin: 0;
  font-size: var(--ui);
  line-height: 1.55;
  color: var(--muted);
}

.feature-state {
  justify-self: start;
  padding: 3px 9px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* --- Listado de torneos --- */
.tournament-list { display: grid; gap: var(--sp-3); }

.tournament-card {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
  transition: border-color .12s ease;
}

.tournament-card:hover { border-color: var(--border-accent); }

.tournament-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.tournament-card h4,
.tournament-card-heading h4 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
}

.tournament-card > p {
  margin: 0;
  font-size: var(--ui);
  color: var(--muted);
  line-height: 1.55;
}

.tournament-card-roles { display: flex; flex-wrap: wrap; gap: 6px; }

.tournament-role {
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.tournament-role-organizer {
  border-color: var(--border-accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}

.tournament-view-button {
  justify-self: start;
  height: 38px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--label);
  font-size: var(--ui);
  font-weight: 600;
  cursor: pointer;
}

.tournament-view-button:hover { border-color: var(--border-accent); color: var(--text); }

/* --- Jugadores --- */
.player-result { padding: 2px; border-radius: var(--r-md); }

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .feature-card { padding: var(--sp-4); border-radius: var(--r-md); }
  .feature-card h3 { font-size: 16px; }
  .tournament-card { padding: var(--sp-4); border-radius: var(--r-md); }
  .tournament-view-button { width: 100%; }
}

/* Las tarjetas de Inicio: la regla vieja estaba dentro de .auth-card y ganaba por especificidad. */
.auth-card button.feature-card {
  display: grid;
  gap: var(--sp-2);
  align-content: start;
  padding: var(--sp-5);
  text-align: left;
  color: var(--text);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--panel));
  box-shadow: var(--elev-2);
  transition: transform .12s ease, border-color .12s ease;
}

.auth-card button.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.auth-card button.feature-card h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }

.auth-card button.feature-card p {
  margin: 0;
  font-size: var(--ui);
  line-height: 1.55;
  color: var(--muted);
}

.auth-card button.feature-card .feature-state {
  justify-self: start;
  position: static;
  padding: 3px 9px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .auth-card button.feature-card { padding: var(--sp-4); border-radius: var(--r-md); }
}

/* Inscritos: nombre arriba, estado debajo. Nunca pegados en la misma línea. */
.tournament-entry-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 3px;
  min-width: 0;
}

.tournament-entry-info strong {
  grid-column: 1;
  font-size: var(--ui);
  line-height: 1.3;
}

.tournament-entry-info .tournament-entry-status {
  grid-column: 1;
  margin: 0;
  font-size: 11px;
  letter-spacing: .06em;
}

.tournament-entry-row {
  align-items: start;
  padding: var(--sp-3);
  gap: var(--sp-3);
}

.tournament-entry-row + .tournament-entry-row { margin-top: var(--sp-2); }

.tournament-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: flex-end;
  align-self: center;
}

.tournament-entry-actions button { min-height: 32px; }


/* Build 144: resumen del torneo agrupado en tarjetas */
.creator-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--sp-3);
  min-width: 0;
}

.creator-review-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: linear-gradient(155deg, var(--surface), var(--panel));
  box-shadow: var(--elev-1);
}

.creator-review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--input-bg);
}

.creator-review-card-title {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .01em;
}

.creator-review-count {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.creator-review-details {
  display: grid;
  margin: 0;
  padding: 4px var(--sp-4) 8px;
}

.creator-review-item {
  display: grid;
  grid-template-columns: minmax(80px, .8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.creator-review-item:last-child { border-bottom: 0; }

.creator-review-item dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.creator-review-item dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .creator-review-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  .creator-review-card-head,
  .creator-review-details {
    padding-left: 12px;
    padding-right: 12px;
  }

  .creator-review-item {
    grid-template-columns: minmax(78px, .85fr) minmax(0, 1.15fr);
    gap: 8px;
  }
}


/* Build 145 · navegación móvil agrupada por finalidad */
.sheet-section {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 5px 0 9px;
}

.sheet-section + .sheet-section {
  margin-top: 3px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.sheet-section-label {
  margin: 0;
  padding: 0 8px 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.sheet-section .menu-item {
  width: 100%;
  min-height: 42px;
  text-align: left;
  border-radius: var(--r-md);
}

.sheet-section[hidden] { display: none !important; }


/* Navegación móvil única: #bottom-nav */
@media (max-width: 760px) {
  /* En móvil se utiliza #bottom-nav, no la navegación de escritorio. */
  #authenticated-panel .primary-nav {
    display: none !important;
  }

  #bottom-nav:not([hidden]) {
    display: grid;
  }

  #bottom-nav[hidden] {
    display: none !important;
  }
}

/* Indicador de foco de la barra inferior móvil */
.bottom-nav button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--nav-hover-bg);
  color: var(--text);
}

/* === Fase 2: navegación de escritorio integrada en la cabecera (build 158) === */
.topbar .primary-nav {
  position: static;
  z-index: auto;
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar .primary-nav::-webkit-scrollbar { display: none; }

body:has(main #authenticated-panel:not([hidden])) .topbar .primary-nav { display: flex; }

.topbar .primary-nav .nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  box-shadow: none;
  font-size: var(--ui);
  font-weight: 600;
  color: var(--label);
  letter-spacing: .005em;
  white-space: nowrap;
  cursor: pointer;
}

.topbar .primary-nav .nav-item:hover {
  background: var(--nav-hover-bg);
  color: var(--text);
}

.topbar .primary-nav .nav-item[aria-current="page"] {
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px var(--nav-active-border);
  color: var(--nav-active-text);
}

@media (max-width: 900px) {
  .topbar .primary-nav { padding: 0 2px; justify-content: flex-start; gap: 4px; }
  .topbar .primary-nav .nav-item { padding: 9px 13px; }
}

@media (max-width: 760px) {
  .topbar .primary-nav { display: none !important; }
}

/* Preview Inicio: armazón aislado, el interior de otros módulos no cambia. */
body.shell-authenticated { --inicio-bg:#071011; --inicio-panel:#0c1719; --inicio-line:#2b3838; --inicio-text:#e5e9e7; --inicio-muted:#9ba9aa; --inicio-gold:#e3be55; background:var(--inicio-bg); }
html[data-theme="light"] body.shell-authenticated { --inicio-bg:#f2f1ea;--inicio-panel:#fffef9;--inicio-line:#ccc8b9;--inicio-text:#233030;--inicio-muted:#596865;--inicio-gold:#806018; }
body.shell-authenticated main { width:auto!important;max-width:none;margin:0 24px 40px 252px!important;padding:20px 0 0!important;display:block; }
body.shell-authenticated main>.hero, body.shell-authenticated .beta, body.shell-authenticated #bottom-more, body.shell-authenticated #quick-report {display:none!important;}
body.shell-authenticated .auth-card {max-width:none;width:100%;border:0;background:none;box-shadow:none;padding:0;}
body.shell-authenticated .app-main {padding:0;}
body.shell-authenticated .topbar {height:76px;padding:0 26px;gap:24px;background:var(--inicio-bg);border-bottom:1px solid var(--inicio-line);}
body.shell-authenticated .topbar .brand {width:204px;flex-shrink:0;}
body.shell-authenticated .topbar .brand-wordmark {width:128px;max-width:128px;height:auto;object-fit:contain;}
body.shell-authenticated .topbar .primary-nav {display:flex!important;position:fixed;top:76px;left:0;bottom:0;width:228px;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:36px 18px;gap:12px;border-right:1px solid var(--inicio-line);background:repeating-linear-gradient(135deg,#ffffff03 0 2px,transparent 2px 7px),repeating-linear-gradient(45deg,#ffffff02 0 2px,transparent 2px 7px),#091213;}
body.shell-authenticated .topbar .primary-nav:before {content:"";height:128px;margin:0 0 20px;background:url('/inicio/Logo.png') center/contain no-repeat;}
body.shell-authenticated .topbar .primary-nav .nav-item {border-radius:12px;min-height:54px;text-align:left;padding:15px 20px;color:#edf0ed;border:1px solid transparent;font-size:15px;}
body.shell-authenticated .topbar .primary-nav .nav-item[aria-current] {border-color:#b08d34;background:linear-gradient(160deg,#998031,#43351a 55%,#7b6528);color:#fff7dc;box-shadow:inset 0 1px 3px #ffe5a080,0 4px 14px #0008;}
#shell-search {display:none;}body.shell-authenticated #shell-search {display:flex;max-width:500px;flex:1;gap:0;align-items:center;}
#shell-search input {min-width:0;width:100%;border:1px solid var(--inicio-line);border-radius:9px 0 0 9px;background:var(--inicio-panel);color:var(--inicio-text);height:40px;padding:0 14px;}
#shell-search button {height:40px;min-width:42px;border:1px solid var(--inicio-line);border-radius:0 9px 9px 0;background:var(--inicio-panel);color:var(--inicio-gold);font-size:25px;}
#shell-messages {display:none;}body.shell-authenticated #shell-messages {display:block;}
body.shell-authenticated .topbar-actions {margin-left:auto;gap:12px;}body.shell-authenticated .topbar-icon {color:var(--inicio-text);background:var(--inicio-panel);border:1px solid var(--inicio-line);width:40px;height:40px;}
body.shell-authenticated .user-menu-button {width:42px;height:42px;border:1px solid #b09044;background:#243536;color:#f1cf76;}
.shell-theme {display:flex;gap:8px;padding:10px;} .shell-theme button {flex:1;padding:8px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;}
.shell-theme button[aria-pressed="true"] {border-color:#b09044;}
.inicio-hero {min-height:255px;box-sizing:border-box;border:1px solid var(--inicio-line);border-radius:12px;overflow:hidden;padding:25px 28px 18px;background:linear-gradient(90deg,#020a0c99,transparent 75%),url('/inicio/hero.png') center 55%/cover;position:relative;color:#f4f2e8;margin-bottom:16px;box-shadow:0 10px 28px #0004;}
.inicio-eyebrow {color:#edcc60;font-weight:700;font-size:24px;margin:0 0 6px;}.inicio-wordmark {width:290px;max-width:65%;height:auto;}.inicio-hero>p:not(.inicio-eyebrow) {font-size:15px;line-height:1.5;margin:30px 0 0;}.inicio-hero #welcome-title {font-size:12px;font-weight:400;color:#d4d9d5;margin:7px 0 0;}
.inicio-grid {display:grid;grid-template-columns:minmax(0,1.8fr) minmax(0,1fr);gap:14px;color:var(--inicio-text);}
.inicio-panel {min-width:0;border:1px solid var(--inicio-line);border-radius:12px;padding:16px;background:linear-gradient(130deg,#ffffff04,transparent 60%),var(--inicio-panel);box-shadow:inset 0 1px 0 #ffffff08,0 4px 12px #0002;}
.inicio-panel h3 {font-size:17px;margin:0 0 14px;font-weight:600;color:var(--inicio-text);}.inicio-panel h3>span {color:var(--inicio-gold);margin-right:8px;}.inicio-heading {display:flex;justify-content:space-between;align-items:baseline;gap:10px;}.auth-card .inicio-heading button {background:transparent;border:0;padding:0;font-size:11px;color:var(--inicio-muted);width:auto;}
.inicio-tabs {display:flex;gap:7px;margin:0 0 12px;flex-wrap:wrap;}.auth-card .inicio-tabs button {width:auto;min-height:28px;font-size:11px;padding:6px 10px;border-radius:6px;border:1px solid var(--inicio-line);background:transparent;color:var(--inicio-muted);}.auth-card .inicio-tabs button[aria-selected="true"] {color:var(--inicio-gold);border-color:#aa8937;background:linear-gradient(135deg,#aa843a55,#aa843a15);box-shadow:inset 0 1px 2px #f5cf7640;}
.inicio-empty {color:var(--inicio-muted);font-size:13px;line-height:1.65;border:1px solid var(--inicio-line);border-radius:8px;padding:24px 18px;min-height:90px;display:flex;align-items:center;margin:0;box-sizing:border-box;}
.auth-card .inicio-row {display:flex;flex-direction:column;gap:7px;width:100%;text-align:left;background:transparent;color:var(--inicio-text);border:1px solid var(--inicio-line);border-radius:8px;padding:13px;margin-bottom:8px;min-width:0;overflow-wrap:anywhere;}.inicio-row strong {font-size:13px;font-weight:600;}.inicio-row small {font-size:11px;color:var(--inicio-muted);line-height:1.5;}.auth-card .inicio-row:hover {border-color:var(--inicio-gold);}
.inicio-quick {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}.auth-card .inicio-quick button {min-height:136px;padding:12px 6px;border-radius:11px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:7px;color:#fff;border:1px solid;box-shadow:inset 0 1px 4px #ffffff40,0 3px 8px #0006;}.inicio-quick b {font-size:29px;font-weight:400;line-height:1;}.inicio-quick strong {font-size:12px;}.inicio-quick small {font-size:10px;opacity:.65;}.auth-card .quick-green {background:linear-gradient(140deg,#078d7b,#092b29 70%,#08191c);border-color:#13a38b!important;}.auth-card .quick-blue {background:linear-gradient(140deg,#176ca6,#102c43 70%,#0a1923);border-color:#2389c2!important;}.auth-card .quick-gold {background:linear-gradient(140deg,#9f7a25,#3b311c 70%,#211d13);border-color:#bc943a!important;}.auth-card .quick-purple {background:linear-gradient(140deg,#65458e,#30273e 70%,#1c1a25);border-color:#8866a9!important;}
.auth-card .inicio-gold {width:100%;margin-top:12px;border:1px solid #a7893c;background:linear-gradient(150deg,#94732c,#382d17);color:#ffe087;font-size:12px;box-shadow:inset 0 1px 3px #f6d47370;padding:9px;}
.inicio-community {grid-column:1/-1;}.inicio-community #inicio-community:has(.inicio-row img) {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}.inicio-community .inicio-row:has(img) {padding:0 0 18px;overflow:hidden;min-height:175px;}.inicio-row img {width:100%;height:80px;object-fit:cover;}.inicio-row:has(img) strong,.inicio-row:has(img) small {padding:0 12px;}
body.shell-authenticated #bottom-nav {display:none!important;}
@media(max-width:1000px) and (min-width:701px) {body.shell-authenticated main {margin-left:205px!important;margin-right:18px!important;}body.shell-authenticated .topbar .primary-nav {width:186px;padding:22px 12px;}body.shell-authenticated .topbar .brand {width:158px;} .inicio-grid {grid-template-columns:1fr;}.inicio-community {grid-column:auto;}.inicio-hero {min-height:235px;}.inicio-tournaments {display:none;}}
@media(max-width:700px) {body.shell-authenticated main {margin:0 12px 100px!important;padding-top:12px!important;}body.shell-authenticated .topbar {height:66px;padding:0 12px;gap:8px;}body.shell-authenticated .topbar .brand {width:auto;gap:6px;}body.shell-authenticated .topbar .brand-wordmark {width:108px;max-width:108px;}body.shell-authenticated .brand-mark {width:29px;height:29px;}body.shell-authenticated .topbar .primary-nav {display:none!important;}body.shell-authenticated #bottom-nav {display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));padding:6px 6px calc(6px + env(safe-area-inset-bottom));background:var(--inicio-bg);border-top:1px solid var(--inicio-line);}body.shell-authenticated #bottom-nav button {min-width:0;padding:5px 2px;color:var(--inicio-muted);font-size:10px;}body.shell-authenticated #bottom-nav button[aria-current] {border:1px solid #ad8b39;background:linear-gradient(150deg,#92742c,#372c17);border-radius:12px;color:#ffe081;}body.shell-authenticated .topbar-actions {gap:7px;}body.shell-authenticated .topbar-icon {width:30px;height:34px;border:0;background:transparent;}body.shell-authenticated .user-menu-button {width:34px;height:34px;}body.shell-authenticated #shell-search {flex:0 0 28px;width:28px;margin-left:auto;}#shell-search input {display:none;}#shell-search:focus-within {position:absolute;left:12px;right:110px;width:auto!important;z-index:5;background:var(--inicio-bg);}#shell-search:focus-within input {display:block;}#shell-search button {width:28px;min-width:28px;border:0;background:transparent;} .inicio-hero {min-height:210px;padding:42px 14px 14px;background-position:57% center;border-radius:9px;margin-bottom:12px;}.inicio-eyebrow {font-size:17px;}.inicio-wordmark {width:200px;}.inicio-hero>p:not(.inicio-eyebrow) {font-size:12px;margin-top:23px;}.inicio-hero #welcome-title {font-size:10px;}.inicio-grid {grid-template-columns:minmax(0,1fr);gap:12px;}.inicio-panel {padding:14px;border-radius:12px;}.inicio-panel h3 {font-size:17px;}.inicio-tournaments {display:none;}.inicio-activity {order:0;}.inicio-shortcuts {order:1;}.inicio-notices {order:2;}.inicio-community {order:3;grid-column:auto;}.inicio-quick {gap:6px;}.auth-card .inicio-quick button {min-height:100px;padding:10px 3px;gap:9px;}.inicio-quick strong {font-size:10px;line-height:1.3;}.inicio-quick small {display:none;}.inicio-quick b {font-size:27px;}.inicio-tabs {gap:5px;}.auth-card .inicio-tabs button {font-size:10px;padding:6px 8px;}.inicio-community #inicio-community:has(.inicio-row img) {grid-template-columns:1fr;}.inicio-empty {min-height:90px;font-size:12px;}.user-menu-panel {max-width:calc(100vw - 24px);}}
html[data-theme="light"] body.shell-authenticated .topbar .primary-nav {background:#e6e2d5;}html[data-theme="light"] body.shell-authenticated .topbar .primary-nav .nav-item:not([aria-current]) {color:#344340;}
@media(prefers-reduced-motion:reduce) {.inicio-panel * {transition:none!important;}}
body.shell-authenticated {padding-top:76px;}
body.shell-authenticated .topbar {position:fixed;inset:0 0 auto;z-index:100;flex-wrap:nowrap;}
html[data-theme="light"] body.shell-authenticated .topbar .primary-nav {background:repeating-linear-gradient(135deg,#776b5110 0 2px,transparent 2px 7px),#e6e2d5;}
body.shell-authenticated .topbar .primary-nav:before {flex:0 0 128px;}
@media(max-width:700px){body.shell-authenticated {padding-top:66px;}}
@media(max-width:700px){body.shell-authenticated .medicion-banner {bottom:88px;z-index:110;}}
body.shell-authenticated .user-menu-panel {background:var(--inicio-panel);color:var(--inicio-text);border:1px solid var(--inicio-line);box-shadow:0 14px 35px #0008;backdrop-filter:none;opacity:1;z-index:120;animation:none;}
body.shell-authenticated .user-menu-name,body.shell-authenticated .user-menu-panel .menu-item {color:var(--inicio-text);}
body.shell-authenticated .user-menu-panel .menu-item-danger {color:#e27c72;}
html[data-theme="light"] body.shell-authenticated .user-menu-panel .menu-item-danger {color:#a33128;}

/* Daniel 23/10 22:48 · neutral carbon + raster brand adaptations + Lucide 0.468.0. */
body.shell-authenticated {
 --inicio-bg:#141516;--inicio-panel:#1b1c1e;--inicio-line:#36383c;--inicio-text:#f0f0f1;--inicio-muted:#b1b3b8;--inicio-gold:#e3be66;
 --bg:var(--inicio-bg);--bg-2:#18191b;--surface:var(--inicio-panel);--surface-2:#242528;--panel:var(--inicio-panel);--input-bg:#202124;--card-bg:var(--inicio-panel);--text:var(--inicio-text);--muted:var(--inicio-muted);--label:#d4d5d8;--border:var(--inicio-line);
 --carbon-texture:repeating-linear-gradient(130deg,#ffffff02 0 1px,transparent 1px 5px),repeating-linear-gradient(40deg,#00000012 0 1px,transparent 1px 5px);
 background:var(--carbon-texture),var(--inicio-bg);
}
html[data-theme="light"] body.shell-authenticated {
 --inicio-bg:#ededee;--inicio-panel:#fafafa;--inicio-line:#c9cace;--inicio-text:#252629;--inicio-muted:#606167;--inicio-gold:#795914;--bg-2:#e4e4e6;--surface-2:#f3f3f4;--input-bg:#fff;--label:#34353a;
 --carbon-texture:repeating-linear-gradient(130deg,#00000003 0 1px,transparent 1px 5px),repeating-linear-gradient(40deg,#ffffff25 0 1px,transparent 1px 5px);
}
body.shell-authenticated .topbar,body.shell-authenticated #bottom-nav {background:var(--carbon-texture),var(--inicio-bg);}
body.shell-authenticated .topbar .primary-nav,html[data-theme="light"] body.shell-authenticated .topbar .primary-nav {background:var(--carbon-texture),var(--inicio-bg);}
body.shell-authenticated .topbar .primary-nav:before {background-image:url('/inicio/logo-transparent-dark.png');}
html[data-theme="light"] body.shell-authenticated .topbar .primary-nav:before {background-image:url('/inicio/logo-transparent-light.png');}
body.shell-authenticated .topbar .primary-nav .nav-item {justify-content:flex-start;gap:12px;padding:14px 16px;color:var(--inicio-text);}
html[data-theme="light"] body.shell-authenticated .topbar .primary-nav .nav-item:not([aria-current]) {color:var(--inicio-text);}
body.shell-authenticated .user-menu-button {background:#28292c;}
html[data-theme="light"] body.shell-authenticated .user-menu-button {background:#f5f3ed;color:#765714;}
.inicio-panel {background:var(--carbon-texture),var(--inicio-panel);box-shadow:inset 0 1px 0 #ffffff08,0 3px 10px #00000016;}
.inicio-hero {background-image:linear-gradient(90deg,#090909b0,transparent 80%),url('/inicio/hero-desktop-v165.webp');}
.inicio-wordmark {width:290px;max-width:78%;}
.ui-icon {width:24px;height:24px;display:inline-block;vertical-align:middle;flex:none;stroke-width:2;}
.inicio-panel h3 {display:flex;align-items:center;gap:10px;}
.inicio-panel h3>span {display:inline-flex;margin:0;}
.inicio-quick b {display:flex;align-items:center;justify-content:center;}
.inicio-quick .ui-icon {width:32px;height:32px;}
.inicio-quick small {opacity:1;color:#cdd0d6;}
.inicio-tabs button {display:inline-flex;align-items:center;gap:6px;}
.inicio-tabs .ui-icon {width:15px;height:15px;}
#shell-search button,body.shell-authenticated #shell-messages {display:flex;align-items:center;justify-content:center;}
body.shell-authenticated .menu-item {display:flex;align-items:center;gap:10px;}
body.shell-authenticated .menu-item .ui-icon {width:20px;height:20px;}
body.shell-authenticated :is(button,input,a):focus-visible {outline:2px solid var(--inicio-gold);outline-offset:3px;}
body.shell-authenticated footer {background:var(--inicio-bg);border-color:var(--inicio-line);color:var(--inicio-muted);}
@media(max-width:700px) {
 .inicio-wordmark {width:225px;max-width:82%;}.inicio-quick .ui-icon {width:28px;height:28px;}
 .inicio-hero {padding-top:32px;}.inicio-hero>p:not(.inicio-eyebrow) {margin-top:20px;}
 body.shell-authenticated .topbar .brand-wordmark {width:104px;max-width:104px;height:auto;object-fit:contain;}
 .inicio-tabs {gap:5px;}.auth-card .inicio-tabs button {padding:6px;gap:4px;}
 body.shell-authenticated #bottom-nav .ui-icon {width:24px;height:24px;}
}

/* Approved desktop photograph: keep ball clear of wordmark in tablet crop. */
@media(min-width:701px) and (max-width:1100px){.inicio-hero{background-position:25% center;}}

/* V0: mobile-specific art; desktop composition intentionally unchanged. */
@media(max-width:700px){
 .inicio-hero{background-image:linear-gradient(90deg,#090909c9 0%,#09090988 48%,transparent 85%),url("/inicio/hero-mobile-v0.jpg");background-position:center;background-size:cover;min-height:230px;padding-top:28px;}
 .inicio-wordmark{width:200px;max-width:64%;}
 .inicio-hero>p:not(.inicio-eyebrow){max-width:62%;font-size:12px;}
}

/* Inicio167 — propuesta aprobada de materiales, aislada para revisión. */
body.shell-authenticated {
 --inicio-bg:#08090a;--inicio-panel:#151618;--inicio-line:#343435;--inicio-muted:#b8b8bb;
 --carbon-texture:repeating-linear-gradient(135deg,#ffffff06 0 1px,#00000020 1px 3px,transparent 3px 6px),repeating-linear-gradient(45deg,#ffffff02 0 1px,transparent 1px 6px);
 background:radial-gradient(ellipse at 65% 0,#b88a2310,transparent 55%),var(--carbon-texture),var(--inicio-bg);
}
body.shell-authenticated .topbar {box-shadow:0 5px 24px #0005;border-bottom-color:#cda64b30;}
body.shell-authenticated .topbar .brand-wordmark {display:none;}
body.shell-authenticated .topbar .brand-mark {width:38px;height:38px;object-fit:contain;}
body.shell-authenticated .topbar .primary-nav:before {display:none;}
body.shell-authenticated .topbar .primary-nav {padding-top:28px;box-shadow:8px 0 30px #0003;background:#111214;opacity:1;backdrop-filter:none;}
html[data-theme="light"] body.shell-authenticated .topbar .primary-nav {background:#efeeea;opacity:1;backdrop-filter:none;box-shadow:6px 0 20px #40341c0e;}
body.shell-authenticated .topbar .primary-nav .nav-item[aria-current] {background:linear-gradient(120deg,#c7a45226,#c7a45208);border-color:#ad8b3c70;box-shadow:inset 3px 0 #d8b55d,inset 0 1px #ffe8b01c,0 5px 16px #0005;color:#f3d68d;}
.inicio-grid {gap:18px;}
.inicio-panel {position:relative;background:radial-gradient(ellipse at 0 0,#d8b55d0b,transparent 65%),linear-gradient(150deg,#202123,#111214 75%);border-color:#3e3d39;box-shadow:inset 0 1px #ffffff20,inset 1px 0 #ffffff06,inset 0 -1px #000a,0 14px 30px #0007,0 3px 6px #0008;}
.inicio-panel:before {content:"";position:absolute;top:-1px;left:22px;right:50%;height:1px;background:linear-gradient(90deg,transparent,#d7b96988,transparent);pointer-events:none;}
.inicio-panel h3 {letter-spacing:.015em;}
.inicio-empty,.auth-card .inicio-row {background:linear-gradient(140deg,#08090a80,#11121460);border-color:#ffffff0e;box-shadow:inset 0 2px 6px #0005;}
.auth-card .inicio-quick button {position:relative;background:radial-gradient(ellipse at 50% 0,#e4c37118,transparent 75%),linear-gradient(155deg,#28292b,#101113 80%);border:1px solid #77633b88!important;color:#f2eee4;box-shadow:inset 0 1px #fff3,0 6px 12px #0006;transition:transform .16s,box-shadow .16s,border-color .16s;}
.inicio-quick b {color:#ddbf75;filter:drop-shadow(0 2px 3px #0008);border-radius:12px;padding:9px;background:linear-gradient(145deg,#e4c37116,#0002);box-shadow:inset 0 1px #fff1;}
.inicio-quick small {color:#bcb9b0;}
.auth-card .inicio-quick button:hover {transform:translateY(-2px);border-color:#d3b367!important;box-shadow:inset 0 1px #fff4,0 10px 18px #0008;}
.auth-card .inicio-quick button:active {transform:translateY(0);}
.auth-card .inicio-gold {background:linear-gradient(135deg,#c0a15a,#806128);color:#100e08;border-color:#d9b96a;box-shadow:inset 0 1px #fff7,0 4px 12px #0005;font-weight:650;}
.inicio-hero {border-color:#ac8b493d;box-shadow:inset 0 1px #ffffff18,0 16px 32px #0008;}
html[data-theme="light"] body.shell-authenticated {--inicio-bg:#e7e6e2;--inicio-panel:#faf9f6;--inicio-line:#cbc7bd;--inicio-muted:#5d5b55;--carbon-texture:repeating-linear-gradient(135deg,#00000007 0 1px,#ffffff40 1px 3px,transparent 3px 6px),repeating-linear-gradient(45deg,#00000003 0 1px,transparent 1px 6px);}
html[data-theme="light"] .inicio-panel {background:radial-gradient(ellipse at 0 0,#c8a34b0e,transparent 65%),linear-gradient(145deg,#fff,#f2f0e9);border-color:#c8c1b1;box-shadow:inset 0 1px #fff,inset 1px 0 #ffffffb0,0 12px 26px #40341c1c,0 3px 6px #40341c16;}
html[data-theme="light"] .inicio-empty,html[data-theme="light"] .auth-card .inicio-row {background:#eae7df66;border-color:#b4aa922b;box-shadow:inset 0 1px 4px #79654310;}
html[data-theme="light"] .auth-card .inicio-quick button {background:radial-gradient(ellipse at 50% 0,#d0b06420,transparent 80%),linear-gradient(145deg,#fff,#e9e4d8);color:#27251f;box-shadow:inset 0 1px #fff,0 5px 12px #40341c20;}
html[data-theme="light"] .inicio-quick b {color:#80601c;filter:none;background:linear-gradient(145deg,#c8a34b16,#fff8);}
html[data-theme="light"] .inicio-quick small {color:#625c50;}
html[data-theme="light"] body.shell-authenticated .topbar .primary-nav .nav-item[aria-current] {color:#604711;box-shadow:inset 3px 0 #987225,0 4px 12px #40341c10;}
@media(max-width:700px){
 .inicio-hero{background-image:linear-gradient(90deg,#050607c9,transparent 90%),url('/inicio/hero-desktop-v165.webp');background-position:43% center;min-height:230px;padding:25px 14px 18px;}
 .inicio-wordmark{width:180px;max-width:58%;}
 .inicio-eyebrow{font-size:16px;}
 .inicio-hero>p:not(.inicio-eyebrow){max-width:54%;font-size:12px;margin-top:26px;text-shadow:0 2px 4px #000;}
 .inicio-hero #welcome-title{max-width:54%;}
 .inicio-grid{gap:15px;}.inicio-quick b{padding:7px;border-radius:9px;}
 body.shell-authenticated .topbar .brand-mark{width:34px;height:34px;}
}
@media(prefers-reduced-motion:reduce){.auth-card .inicio-quick button{transition:none;}.auth-card .inicio-quick button:hover{transform:none;}}

/* Jugar168: propuesta visual acotada. No altera el tanteo ni sus colores. */
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .workspace-section{padding:0;background:none;border:0;box-shadow:none;max-width:none;}
.jugar-title h2{font-size:30px;letter-spacing:-.035em;margin:2px 0 20px;color:var(--inicio-text);}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .section-tabs{display:flex;gap:8px;border:0;padding:5px;background:var(--inicio-panel);width:max-content;max-width:100%;border-radius:12px;box-shadow:inset 0 1px #fff1,0 5px 15px #0003;margin-bottom:22px;}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .section-tabs button{min-height:44px;min-width:120px;border:1px solid transparent;border-radius:9px;background:none;color:var(--inicio-muted);padding:10px 24px;}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .section-tabs button[aria-current]{border-color:#b2944c70;background:linear-gradient(135deg,#c4a45c29,#c4a45c0a);color:var(--inicio-gold);box-shadow:inset 0 1px #e9c97d30;}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .page-head{padding:24px;border:1px solid var(--inicio-line);border-radius:14px;background:linear-gradient(135deg,#ffffff08,transparent),var(--inicio-panel);box-shadow:inset 0 1px #ffffff18,0 12px 24px #0003;margin-bottom:18px;}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .page-head h3{font-size:26px;color:var(--inicio-text);margin:0 0 12px;}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .muted{color:var(--inicio-muted);line-height:1.65;}
.jugar-example{border:1px solid #b2944c55;border-radius:14px;padding:20px 26px;background:radial-gradient(ellipse at 50% 0,#c4a45c18,transparent 75%),var(--inicio-panel);box-shadow:inset 0 1px #fff2,0 12px 24px #0004;position:relative;margin-bottom:14px;}
.jugar-example-tag{position:absolute;right:16px;top:16px;font-size:10px;text-transform:uppercase;letter-spacing:.12em;color:var(--inicio-muted);}
.jugar-example-meta{color:var(--inicio-gold);font-size:12px;}
.jugar-example-score{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;color:var(--inicio-text);}
.jugar-example-score span{font-size:15px;font-weight:600;}.jugar-example-score strong{font-size:52px;letter-spacing:-.05em;white-space:nowrap;font-variant-numeric:tabular-nums;}.jugar-example-score i{font-style:normal;color:var(--inicio-gold);font-weight:300;}
.jugar-example-status{font-size:11px;color:var(--inicio-muted);border-top:1px solid var(--inicio-line);padding-top:10px;}
.jugar-discover{margin:12px 0 28px;}.auth-card .jugar-discover button{width:auto;min-height:44px;padding:12px 22px;background:linear-gradient(135deg,#c0a15a,#806128);border:1px solid #d9b96a;color:#100e08;font-weight:650;box-shadow:inset 0 1px #fff6,0 4px 12px #0004;}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .workspace-heading{margin-top:28px;color:var(--inicio-text);}
:is([data-view-panel="marker"],[data-view-panel="vsvs"]) :is(.vsvs-card,.vsvs-history,.marker-created){background:var(--inicio-panel);border:1px solid var(--inicio-line);border-radius:12px;padding:18px;box-shadow:inset 0 1px #fff1,0 8px 18px #0002;}
[data-view-panel="marker"] .marker-new{min-height:48px;background:linear-gradient(135deg,#c0a15a,#806128);color:#100e08;border:1px solid #d9b96a;margin-top:16px;}
html[data-theme="light"] :is([data-view-panel="marker"],[data-view-panel="vsvs"]) .page-head{box-shadow:inset 0 1px #fff,0 10px 22px #40341c16;}
html[data-theme="light"] .jugar-example{box-shadow:inset 0 1px #fff,0 10px 22px #40341c1c;}
@media(min-width:1100px){[data-view-panel="vsvs"] .workspace-section{display:grid;grid-template-columns:1.05fr 1fr;gap:0 24px;}[data-view-panel="vsvs"] .workspace-section>*{grid-column:1/-1;}[data-view-panel="vsvs"] .jugar-intro{grid-column:1;grid-row:3/5;margin-bottom:24px;align-items:flex-start;min-height:220px;}[data-view-panel="vsvs"] .jugar-example{grid-column:2;grid-row:3;}[data-view-panel="vsvs"] .jugar-discover{grid-column:2;grid-row:4;margin-bottom:24px;}}
@media(max-width:700px){.jugar-title h2{font-size:25px;margin-bottom:14px;}:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .page-head{padding:18px;}:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .section-tabs{width:100%;box-sizing:border-box;}:is([data-view-panel="marker"],[data-view-panel="vsvs"]) .section-tabs button{min-width:0;flex:1;}.jugar-example{padding:18px;}.jugar-example-score strong{font-size:40px;}.jugar-example-score span{font-size:12px;}.jugar-example-score{gap:10px;}.jugar-example-tag{font-size:9px;}.jugar-discover{margin-bottom:20px;}}
.marker-board { z-index: 150; }
.marker-topbar { z-index: 8; }
/* Recorrido Jugar aprobado: contenido real y diálogo espacioso, no modal anidado. */
[data-view-panel="vsvs"] .workspace-section{display:block}
[data-view-panel="vsvs"] .jugar-intro{min-height:0;margin-bottom:24px;align-items:center}
#vsvs-list h4{margin:24px 0 12px;color:var(--inicio-text)}
#vsvs-dialog{width:min(880px,calc(100vw - 40px));max-width:880px;max-height:calc(100dvh - 40px);box-sizing:border-box;background:var(--inicio-panel,var(--bg-card));color:var(--inicio-text);border:1px solid var(--inicio-border);border-radius:16px;overflow:auto}
#vsvs-dialog :is(button,input,select){min-height:44px;max-width:100%;box-sizing:border-box}
#vsvs-dialog :is(button,input,select):focus-visible{outline:2px solid var(--inicio-gold);outline-offset:3px}
#vsvs-dialog :is(h3,p,.detail-value){overflow-wrap:anywhere}
#vsvs-create-form{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:20px}
#vsvs-create-form[hidden]{display:none}
#vsvs-create-form :is(#vsvs-date-field,#vsvs-summary){grid-column:1/-1}
#vsvs-search{padding:20px}
#vsvs-search input{width:100%}
#vsvs-players .vsvs-item{width:100%;margin-top:12px}
#vsvs-dialog .detail-dialog-actions{display:flex;flex-wrap:wrap;gap:12px}
@media(max-width:700px){#vsvs-dialog{width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;margin:0;border-radius:0;padding:16px}#vsvs-create-form{grid-template-columns:1fr;padding:0}#vsvs-dialog .detail-dialog-foot{padding-bottom:24px}}

/* Jugar169 · composición de partidas, acotada al recorrido 1vs1. */
[data-view-panel="vsvs"] .jugar-intro{padding:22px 0 24px;border:0;border-bottom:1px solid var(--inicio-line);border-radius:0;background:none;box-shadow:none;gap:28px}
[data-view-panel="vsvs"] .jugar-intro h3{font-size:34px;margin-bottom:6px}
[data-view-panel="vsvs"] .jugar-intro .muted{max-width:520px;margin:0;font-size:14px}
[data-view-panel="vsvs"] .page-head-actions{flex-shrink:0;gap:10px}
.auth-card #vsvs-new,#vsvs-dialog #vsvs-create-send{background:linear-gradient(135deg,#e0c47e,#af883c);color:#211a0b;border:1px solid #e4c77e;box-shadow:inset 0 1px #fff6,0 5px 15px #0003;font-weight:700;min-height:48px}
#vsvs-list{display:grid;gap:22px}
#vsvs-list .jugar-group{min-width:0}
#vsvs-list h4{font-size:15px;letter-spacing:.01em;margin:0 0 12px;display:flex;align-items:center;gap:10px}
#vsvs-list h4:before{content:'';width:18px;height:2px;background:var(--inicio-gold)}
.jugar-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.auth-card .jugar-match-card,.jugar-match-card{display:flex;flex-direction:column;gap:12px;min-width:0;width:100%;box-sizing:border-box;margin:0;padding:20px 22px;text-align:left;color:var(--inicio-text);border:1px solid var(--inicio-line);border-radius:16px;background:radial-gradient(ellipse at 50% 0,#ffffff09,transparent 65%),var(--inicio-panel);box-shadow:inset 0 1px #fff2,0 8px 22px #0003;white-space:normal}
.auth-card button.jugar-match-card:hover{border-color:var(--inicio-gold);filter:none;transform:translateY(-1px)}
.jugar-match-card[data-state="pending"]{border-top:2px solid var(--inicio-gold)}
.jugar-match-card[data-state="in_progress"]{box-shadow:inset 3px 0 var(--inicio-gold),inset 0 1px #fff2,0 8px 22px #0003}
.jugar-match-card[data-state="completed"] .jugar-score{color:var(--inicio-gold)}
.jugar-card-top{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px;flex-wrap:wrap}
.jugar-status{display:inline-flex;border:1px solid var(--inicio-line);border-radius:5px;padding:5px 8px;color:var(--inicio-muted);font-weight:600}
[data-state="pending"] .jugar-status,[data-state="awaiting_confirmation"] .jugar-status{color:var(--inicio-gold);border-color:color-mix(in srgb,var(--inicio-gold) 45%,transparent)}
[data-state="in_progress"] .jugar-status{background:var(--inicio-gold);border-color:var(--inicio-gold);color:var(--inicio-panel)}
.jugar-turn{color:var(--inicio-gold);font-weight:700}
.jugar-matchup{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:16px;align-items:center;width:100%;min-width:0;padding:12px 0}
.jugar-person{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;text-align:center}
.jugar-avatar{display:grid;place-items:center;position:relative;overflow:hidden;width:54px;height:54px;flex-shrink:0;border-radius:50%;background:linear-gradient(145deg,#ffffff15,#0002),var(--inicio-panel);border:1px solid var(--inicio-line);box-shadow:inset 0 1px #fff3,0 4px 10px #0003;color:var(--inicio-text);font-size:18px;font-weight:600;letter-spacing:.03em}
.jugar-avatar img{position:absolute;width:100%;height:100%;object-fit:cover;inset:0}
.jugar-name{font-size:14px;font-weight:600;line-height:1.4;overflow-wrap:anywhere;max-width:100%}
.jugar-score{font-size:38px;line-height:1;letter-spacing:-.05em;font-weight:650;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--inicio-text)}
[data-state="pending"] .jugar-score{font-size:22px;font-weight:400;color:var(--inicio-muted);letter-spacing:.06em}
.jugar-rules{border-top:1px solid var(--inicio-line);padding-top:12px;font-size:12px;color:var(--inicio-text);line-height:1.5}
.jugar-date{font-size:11px;color:var(--inicio-muted);line-height:1.5;overflow-wrap:anywhere}
.jugar-empty{display:flex;align-items:center;gap:18px;margin:0;padding:24px;min-height:90px;box-sizing:border-box;border:1px solid var(--inicio-line);border-radius:12px;color:var(--inicio-muted);font-size:13px;line-height:1.6;background:linear-gradient(120deg,#ffffff05,transparent),var(--inicio-panel)}
.jugar-empty:before{content:'';display:block;flex-shrink:0;width:26px;height:26px;border:1px solid var(--inicio-line);border-radius:50%;box-shadow:7px 0 0 -2px var(--inicio-panel),8px 0 0 -2px var(--inicio-line)}
.jugar-group.is-empty .jugar-card-grid{grid-template-columns:1fr}


#vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty) .jugar-group:nth-child(2) .jugar-empty{min-height:132px;background:radial-gradient(ellipse at 90% 10%,#c4a45c12,transparent 60%),var(--inicio-panel)}
[data-view-panel="vsvs"] #vsvs-history{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0;border:0;box-shadow:none;background:none;gap:16px}
#vsvs-history>.jugar-empty{grid-column:1/-1}
#vsvs-dialog{border-color:var(--inicio-line);box-shadow:0 28px 90px #0008;padding:28px}
#vsvs-dialog .detail-dialog-head{padding:0 0 20px;border-bottom:1px solid var(--inicio-line)}
#vsvs-dialog .detail-dialog-head h3{font-size:24px;letter-spacing:-.025em}
#vsvs-dialog .eyebrow{color:var(--inicio-gold)}
#vsvs-dialog .detail-dialog-body{padding:18px 0;display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
#vsvs-dialog-body:empty{display:none}
#vsvs-dialog .jugar-matchup{grid-column:1/-1;border:1px solid var(--inicio-line);background:radial-gradient(ellipse at 50% 0,#c4a45c12,transparent 70%);border-radius:14px;padding:22px;box-sizing:border-box;margin-bottom:18px;gap:24px}
#vsvs-dialog .jugar-avatar{width:64px;height:64px;font-size:22px}
#vsvs-dialog .jugar-score{font-size:48px}
#vsvs-dialog[data-state="pending"] .jugar-score,#vsvs-dialog:not([data-state]) .jugar-score{font-size:26px;color:var(--inicio-gold)}
#vsvs-dialog .detail-row{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 0;border-bottom:1px solid var(--inicio-line);min-width:0}
#vsvs-dialog .detail-key{font-size:11px;color:var(--inicio-muted);text-transform:none;letter-spacing:0}
#vsvs-dialog .detail-value{font-size:13px;text-align:left;line-height:1.5}
#vsvs-create-form{display:block;padding:0;margin:0}
.jugar-conditions{display:grid;grid-template-columns:1fr 100px 1fr;gap:20px;padding:20px;border:1px solid var(--inicio-line);border-radius:12px;background:var(--input-bg)}
#vsvs-dialog .jugar-conditions .admin-field{min-width:0;margin:0;color:var(--inicio-text)}
#vsvs-dialog .jugar-conditions input,#vsvs-dialog .jugar-conditions select{width:100%;color:var(--inicio-text);background:var(--inicio-panel);border:1px solid var(--inicio-line)}
#vsvs-dialog .jugar-conditions #vsvs-date-field{grid-column:2/-1}
#vsvs-zone{color:var(--inicio-muted);line-height:1.6}
.jugar-invitation-summary{padding:18px 20px;border-left:2px solid var(--inicio-gold);background:color-mix(in srgb,var(--inicio-gold) 7%,transparent);font-size:13px;line-height:1.8;color:var(--inicio-text)}
.jugar-form-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
#vsvs-dialog .jugar-form-actions button{width:auto;min-width:100px}
#vsvs-search{padding:24px 0}
#vsvs-players{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}
#vsvs-dialog .jugar-player-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:16px;border:1px solid var(--inicio-line);border-radius:12px;background:var(--input-bg);color:var(--inicio-text);text-align:left;white-space:normal}
#vsvs-dialog .jugar-player-choice .jugar-person{flex-direction:row;text-align:left}
.jugar-choice-arrow{color:var(--inicio-gold);font-size:24px}
#vsvs-dialog .detail-dialog-actions{padding:18px 0 0}
#vsvs-dialog .detail-dialog-foot{padding:18px 0 0;margin-top:18px;border-top:1px solid var(--inicio-line)}
#vsvs-dialog .detail-dialog-foot{justify-content:flex-start}
#vsvs-dialog:has(#vsvs-create-form:not([hidden])) .detail-dialog-foot{display:none}
:is([data-view-panel="vsvs"],#vsvs-dialog) button:focus-visible{outline:2px solid var(--inicio-gold);outline-offset:4px}
html[data-theme="light"] :is(.jugar-match-card,.jugar-empty){box-shadow:inset 0 1px #fff,0 8px 22px #40341c12}
html[data-theme="light"] .jugar-avatar{background:linear-gradient(140deg,#fff,#d9dadd);box-shadow:inset 0 1px #fff,0 4px 9px #0001}
@media(max-width:1100px){.jugar-card-grid{grid-template-columns:1fr}}
@media(max-width:700px){
 [data-view-panel="vsvs"] .jugar-intro{padding:4px 0 22px;gap:18px;align-items:stretch;flex-direction:column}
 [data-view-panel="vsvs"] .jugar-intro h3{font-size:28px}
 [data-view-panel="vsvs"] .page-head-actions{display:flex;width:100%;flex-wrap:wrap}
 .auth-card #vsvs-new{flex:1}
 #vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty){grid-template-columns:1fr}
 [data-view-panel="vsvs"] #vsvs-history{grid-template-columns:1fr}
 .auth-card .jugar-match-card{padding:18px 16px}
 .jugar-matchup{gap:12px}.jugar-score{font-size:34px}.jugar-name{font-size:13px}
 #vsvs-dialog{padding:20px 16px}#vsvs-dialog .detail-dialog-head h3{font-size:22px}
 #vsvs-dialog .detail-dialog-body{gap:0 16px}
 #vsvs-dialog .jugar-matchup{padding:20px 12px;gap:12px}
 #vsvs-dialog .jugar-avatar{width:50px;height:50px;font-size:17px}
 #vsvs-dialog .jugar-score{font-size:36px}
 .jugar-conditions{padding:16px;grid-template-columns:minmax(0,1fr) 80px;gap:18px 12px}
 .jugar-conditions .admin-field:nth-child(3){grid-column:1/-1}
 #vsvs-dialog .jugar-conditions #vsvs-date-field{grid-column:1/-1}
 #vsvs-dialog .jugar-form-actions{display:grid;grid-template-columns:1fr 1fr}
 #vsvs-dialog .jugar-form-actions button{width:100%;min-width:0}
 #vsvs-dialog #vsvs-create-send{grid-column:1/-1;grid-row:1}
 #vsvs-players{grid-template-columns:1fr}
}
.auth-card #vsvs-refresh{min-height:44px;width:auto;padding:10px 18px}
/* Vacío compacto, sin actividad ficticia. */
#vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty){grid-template-columns:repeat(3,minmax(0,1fr))}
#vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty) .jugar-group:nth-child(2){grid-column:auto}
#vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty) .jugar-empty{min-height:132px}
@media(max-width:1100px){#vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty){grid-template-columns:1fr}}
@media(max-width:700px){.auth-card #vsvs-new{white-space:nowrap;min-width:154px}.auth-card #vsvs-refresh{flex:0 0 auto;padding:10px 12px}#vsvs-list:has(.jugar-group:nth-child(2).is-empty):has(.jugar-group:nth-child(1).is-empty):has(.jugar-group:nth-child(3).is-empty) .jugar-empty{min-height:86px}}
#vsvs-dialog .detail-key{flex:none;opacity:1}
#vsvs-dialog .detail-value{flex:none}
#vsvs-dialog .detail-dialog-body{margin:0}
#vsvs-dialog .jugar-form-actions button{grid-column:auto}
@media(max-width:700px){#vsvs-dialog #vsvs-create-send{grid-column:1/-1;grid-row:1}}
body.shell-authenticated .auth-card #vsvs-list button.jugar-match-card{background:radial-gradient(ellipse at 50% 0,#ffffff09,transparent 65%),var(--inicio-panel);color:var(--inicio-text);border:1px solid var(--inicio-line);box-shadow:inset 0 1px #fff2,0 8px 22px #0003;font-weight:400}
body.shell-authenticated .auth-card #vsvs-list button.jugar-match-card[data-state="pending"]{border-top:2px solid var(--inicio-gold)}
body.shell-authenticated .auth-card #vsvs-list button.jugar-match-card[data-state="in_progress"]{box-shadow:inset 3px 0 var(--inicio-gold),inset 0 1px #fff2,0 8px 22px #0003}
body.shell-authenticated .auth-card #vsvs-list button.jugar-match-card:hover{border-color:var(--inicio-gold)}
html[data-theme="light"] body.shell-authenticated .auth-card #vsvs-list button.jugar-match-card{box-shadow:inset 0 1px #fff,0 8px 22px #40341c12}

/* Marcador170: entrada/lista/preparación. Tablero y colores intactos. */
#marker-home .marker-intro{padding:22px 0 24px;border:0;border-bottom:1px solid var(--inicio-line);border-radius:0;background:none;box-shadow:none;gap:28px;align-items:center}
#marker-home .marker-intro h3{font-size:34px;margin-bottom:6px}
#marker-home .marker-intro .muted{max-width:520px;margin:0;font-size:14px}
#marker-home .marker-intro .field-help{margin:8px 0 0;color:var(--inicio-muted);line-height:1.6}
#marker-home .page-head-actions{flex-shrink:0}
body.shell-authenticated .auth-card #marker-home :is(#marker-new,#marker-create){width:auto;min-height:48px;margin:0;padding:12px 22px;background:linear-gradient(135deg,#e0c47e,#af883c);color:#211a0b;border:1px solid #e4c77e;border-radius:10px;box-shadow:inset 0 1px #fff6,0 5px 15px #0003;font-size:14px;font-weight:700}
#marker-home .marker-created{padding:0;margin:0 0 22px;border-radius:16px;box-shadow:inset 0 1px #fff2,0 8px 22px #0003;background:radial-gradient(ellipse at 50% 0,#ffffff09,transparent 65%),var(--inicio-panel)}
#marker-home .marker-created>summary{min-height:52px;box-sizing:border-box;padding:18px 20px;color:var(--inicio-text);font-size:15px}
#marker-home #marker-created-empty{margin:0;padding:10px 20px 24px;font-size:13px}
#marker-home .marker-active-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:0 18px 18px;margin:0}
#marker-home :is(.marker-active-item,.marker-history-item){padding:18px;border:1px solid var(--inicio-line);border-radius:12px;background:linear-gradient(135deg,#ffffff06,transparent),var(--inicio-panel);box-shadow:inset 0 1px #fff1;min-width:0;color:var(--inicio-text)}
#marker-home .marker-active-item .grow{flex:1 1 170px;overflow-wrap:anywhere}
#marker-home .marker-active-item strong{font-size:15px;line-height:1.5}
#marker-home .marker-active-item .muted{font-size:13px;margin-top:6px}
#marker-home .marker-list-actions{width:100%;justify-content:flex-end;border-top:1px solid var(--inicio-line);padding-top:12px}
#marker-home .marker-list-vs .marker-mini-avatar{width:42px;height:42px;border-radius:50%}
#marker-home .marker-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:0}
#marker-home .marker-form[hidden]{display:none}
#marker-home .marker-player{grid-template-columns:minmax(0,1fr);gap:16px;padding:22px;border:1px solid var(--inicio-line);border-radius:16px;background:radial-gradient(ellipse at 50% 0,#ffffff09,transparent 65%),var(--inicio-panel);box-shadow:inset 0 1px #fff2,0 8px 22px #0003;min-width:0}
#marker-home .marker-player-tag{color:var(--inicio-gold)}
#marker-home .marker-player-name{min-width:0;color:var(--inicio-text)}
#marker-home .marker-player-name strong{font-size:17px}
#marker-home .marker-player-name .marker-mini-avatar{width:54px;height:54px;border-radius:50%;flex-shrink:0}
#marker-home .marker-player-color{justify-content:space-between;border-top:1px solid var(--inicio-line);padding-top:14px}
#marker-home .marker-game{grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));padding:22px;gap:22px;border:1px solid var(--inicio-line);border-radius:14px;background:var(--inicio-panel);box-shadow:inset 0 1px #fff1,0 8px 22px #0002}
#marker-home :is(.marker-field>label,.marker-field-label){color:var(--inicio-muted);text-transform:none;letter-spacing:0;font-size:12px}
body.shell-authenticated .auth-card #marker-home .marker-form :is(input:not([type=checkbox]),select){min-height:44px;padding:10px 12px;border:1px solid var(--inicio-line);border-radius:9px;background:var(--input-bg);color:var(--inicio-text);box-sizing:border-box;max-width:100%}
#marker-home #marker-race{flex:1;width:0;min-width:0}
#marker-home .marker-switch-field .check{height:44px;width:52px}
#marker-home .marker-switch-field .switch-slider{top:9px;bottom:9px}
#marker-home .marker-switch-field .check input:checked+.switch-slider::before{transform:translateX(26px)}
#marker-home .marker-form-actions{grid-column:1/-1;flex-wrap:wrap;padding:4px 0 18px}
#marker-home #marker-form-message{grid-column:1/-1;margin:0}
body.shell-authenticated .auth-card #marker-home :is(button,select,input:not([type=checkbox])){min-height:44px}
#marker-home :is(button,input,select,summary):focus-visible{outline:2px solid var(--inicio-gold);outline-offset:4px}
#marker-home .check:has(input:focus-visible){outline:2px solid var(--inicio-gold);outline-offset:4px}
#marker-home .player-result{min-width:0;flex-wrap:wrap}
#marker-home .player-result-info{min-width:0;overflow-wrap:anywhere}
html[data-theme=light] #marker-home :is(.marker-created,.marker-player,.marker-game){box-shadow:inset 0 1px #fff,0 8px 22px #40341c12}
@media(max-width:1100px){#marker-home .marker-active-list{grid-template-columns:1fr}}
@media(max-width:700px){
 #marker-home .marker-intro{padding:4px 0 22px;gap:18px;align-items:stretch;flex-direction:column}
 #marker-home .marker-intro h3{font-size:28px}
 #marker-home .page-head-actions{width:100%;display:flex}
 body.shell-authenticated .auth-card #marker-home #marker-new{flex:1}
 #marker-home .marker-form{grid-template-columns:minmax(0,1fr);gap:16px}
 #marker-home .marker-player{padding:18px}
 #marker-home .marker-game{grid-template-columns:repeat(2,minmax(0,1fr));padding:18px;gap:18px 14px;align-items:start}
 #marker-home .marker-active-list{padding:0 12px 12px}
 #marker-home .marker-active-item{padding:16px}
 #marker-home .marker-form-actions{display:grid;grid-template-columns:1fr 1fr}
 body.shell-authenticated .auth-card #marker-home #marker-create{grid-column:1/-1;grid-row:1;width:100%}
}
#marker-home #marker-unlimited{min-width:44px;flex-shrink:0}
#marker-home .color-swatch-btn{width:44px;height:44px}
#marker-home .color-select-panel{left:auto;right:0}
#marker-home #marker-create{grid-column:auto;flex:0 0 auto}
