/* =========================================================
   AutoMatchApp Design System CSS · v1
   Escalable, modular y orientado a migración progresiva
   ---------------------------------------------------------
   Estrategia:
   1) Mantener compatibilidad con clases legacy actuales
   2) Introducir nuevas clases prefijadas con am-
   3) Centralizar tokens visuales
   4) Reducir duplicados y choques entre pantallas
   ========================================================= */

/* =========================================================
   01. TOKENS / DESIGN SYSTEM
   ========================================================= */

:root {
  /* Tipografía */
  --am-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* Color base */
  --am-color-white: #ffffff;
  --am-color-black: #000000;
  --am-color-text-strong: #101828;
  --am-color-text: #344054;
  --am-color-text-soft: #475467;
  --am-color-text-muted: #667085;

  /* Fondos */
  --am-color-bg-page: #f5f7fa;
  --am-color-bg-soft: #f8fafc;
  --am-color-bg-empty: #f0f0f0;
  --am-color-bg-dark-1: #101828;
  --am-color-bg-dark-2: #1d2939;

  /* Bordes */
  --am-color-border-light: #e5e7eb;
  --am-color-border-mid: #d0d5dd;
  --am-color-border-dark-soft: rgba(255,255,255,0.08);
  --am-color-border-dark: rgba(255,255,255,0.12);
  --am-color-dashed: #cccccc;

  /* Marca / tema */
  --am-brand-primary: #1570ef;
  --am-brand-primary-rgb: 21, 112, 239;

  --am-brand-secondary: #53b1fd;
  --am-brand-secondary-rgb: 83, 177, 253;

  --am-brand-accent: #12b76a;
  --am-brand-accent-rgb: 18, 183, 106;

  /* Alias compatibilidad */
  --am-color-primary: var(--am-brand-primary);

  /* Derivados marca */
  --am-brand-primary-soft: rgba(var(--am-brand-primary-rgb), 0.08);
  --am-brand-primary-soft-2: rgba(var(--am-brand-primary-rgb), 0.14);
  --am-brand-primary-soft-3: rgba(var(--am-brand-primary-rgb), 0.20);
  --am-brand-primary-border: rgba(var(--am-brand-primary-rgb), 0.26);
  --am-brand-primary-border-strong: rgba(var(--am-brand-primary-rgb), 0.42);
  --am-brand-primary-shadow: rgba(var(--am-brand-primary-rgb), 0.22);

  --am-brand-secondary-soft: rgba(var(--am-brand-secondary-rgb), 0.10);
  --am-brand-secondary-border: rgba(var(--am-brand-secondary-rgb), 0.24);

  --am-brand-accent-soft: rgba(var(--am-brand-accent-rgb), 0.14);
  --am-brand-accent-border: rgba(var(--am-brand-accent-rgb), 0.26);

  /* Estados semánticos */
  --am-color-success: #22c55e;
  --am-color-success-soft: #d1fae5;
  --am-color-warning-soft: rgba(255,200,0,0.25);
  --am-color-danger-soft: rgba(255,80,80,0.25);
  --am-color-danger-strong: rgba(255,80,80,0.45);

  /* Sombras */
  --am-shadow-xs: 0 0 2px rgba(0,0,0,0.10);
  --am-shadow-sm: 0 7px 14px rgba(0,0,0,0.16);
  --am-shadow-md: 0 10px 18px rgba(0,0,0,0.18);
  --am-shadow-lg: 0 10px 24px rgba(16,24,40,0.08);
  --am-shadow-xl: 0 12px 30px rgba(0,0,0,0.18);

  /* Radios */
  --am-radius-xs: 8px;
  --am-radius-sm: 10px;
  --am-radius-md: 12px;
  --am-radius-lg: 14px;
  --am-radius-xl: 16px;
  --am-radius-2xl: 18px;
  --am-radius-3xl: 20px;
  --am-radius-pill: 999px;
  --am-radius-circle: 50%;

  /* Espaciados */
  --am-space-2xs: 4px;
  --am-space-xs: 6px;
  --am-space-sm: 8px;
  --am-space-md: 10px;
  --am-space-lg: 12px;
  --am-space-xl: 14px;
  --am-space-2xl: 16px;
  --am-space-3xl: 18px;
  --am-space-4xl: 20px;
  --am-space-5xl: 22px;
  --am-space-6xl: 24px;

  /* Layout */
  --am-page-pad-x: 16px;
  --am-page-pad-top: 18px;
  --am-page-pad-bottom: 24px;
  --am-container-sm: 600px;
  --am-container-md: 760px;

  /* Componentes */
  --am-action-min-height: 190px;
  --am-action-min-height-mobile: 180px;
  --am-action-yellow-min-height: 120px;
  --am-action-icon-w: 74px;
  --am-action-icon-h: 58px;
  --am-action-icon-w-mobile: 68px;
  --am-action-icon-h-mobile: 54px;

  --am-avatar-size: 75px;
  --am-player-slot-w: 97px;
  --am-player-slot-h: 125px;

  /* Transiciones */
  --am-transition-fast: 0.12s ease;
  --am-transition-base: 0.18s ease;
}

/* =========================================================
   02. RESET SUAVE / BASE
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--am-font-sans);
}

img {
  max-width: 100%;
  display: block;
}

/* =========================================================
   03. HELPERS UTILITARIOS
   ========================================================= */

.am-text-left { text-align: left !important; }
.am-text-center { text-align: center !important; }
.am-text-right { text-align: right !important; }

.am-hidden-scrollbar::-webkit-scrollbar { height: 0; width: 0; }

.am-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* =========================================================
   04. LAYOUT HOME ACTIONS
   Nuevo: .am-home-actions
   Compatibilidad: .home-actions
   ========================================================= */

.am-home-actions,
.home-actions {
  padding: var(--am-page-pad-top) var(--am-page-pad-x) var(--am-page-pad-bottom);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--am-space-xl);
}

@media (max-width: 360px) {
  .am-home-actions,
  .home-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   05. ACTION CARD
   Nuevo: .am-action-card + modificadores
   Compatibilidad: .button.black.action / .button.yellow.action
   ========================================================= */

.am-action-card,
.button.black.action,
.button.yellow.action {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--am-radius-md);
  padding: 18px 16px 18px;
  border: 1px solid rgba(var(--am-brand-primary-rgb), 0.16);
  box-shadow:
    var(--am-shadow-md),
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 -1px 0 rgba(0,0,0,0.18) inset;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--am-transition-fast),
    box-shadow var(--am-transition-fast),
    opacity var(--am-transition-fast);
}

.am-action-card::after,
.button.black.action::after,
.button.yellow.action::after {
  content: '';
  position: absolute;
  inset: auto -20% -30% auto;
  width: 130px;
  height: 130px;
  background: radial-gradient(
    circle,
    rgba(var(--am-brand-primary-rgb), 0.18) 0%,
    rgba(var(--am-brand-primary-rgb), 0.00) 70%
  );
  pointer-events: none;
}

.am-action-card,
.button.black.action {
  min-height: var(--am-action-min-height);
}

.am-action-card--yellow,
.button.yellow.action {
  min-height: var(--am-action-yellow-min-height);
  max-width: var(--am-container-sm);
}

.am-action-card::before,
.button.black.action::before,
.button.yellow.action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.18),
    rgba(255,255,255,0.06) 35%,
    rgba(255,255,255,0) 60%
  );
  pointer-events: none;
}

.am-action-card:active,
.button.black.action:active,
.button.yellow.action:active {
  transform: translateY(1px);
  box-shadow:
    var(--am-shadow-sm),
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 -1px 0 rgba(0,0,0,0.20) inset;
}

/* =========================================================
   06. ACTION TEXT
   Nuevo: .am-action-text
   Compatibilidad: .action-text
   ========================================================= */

.am-action-text,
.action-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--am-space-sm);
  max-width: 72%;
  color: var(--am-color-white);
  text-shadow: 0 2px 2px rgba(0,0,0,0.25);
}

.am-action-text strong,
.action-text strong {
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: 0.4px;
}

.am-action-text small,
.action-text small {
  font-size: 15px;
  line-height: 1.25;
  opacity: 0.88;
}

.am-action-text--left small,
.action-text small.text-left {
  text-align: left;
}

.am-action-text--right small,
.action-text small.text-right {
  text-align: right;
}

/* fallback para legacy donde no haya clase helper */
.action-text small:not(.text-left):not(.text-right) {
  text-align: left;
}

/* =========================================================
   07. ACTION ICON
   Nuevo: .am-action-icon
   Compatibilidad: .action-icon
   ========================================================= */

.am-action-icon,
.action-icon {
  position: absolute;
  right: 14px;
  bottom: 16px;
  z-index: 1;
  width: var(--am-action-icon-w);
  height: var(--am-action-icon-h);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,0.14));
  opacity: 0.95;
  transition: transform var(--am-transition-fast);
}

.am-action-icon::after,
.action-icon::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -10px;
  height: 12px;
  background: radial-gradient(
    ellipse at center,
    rgba(255,255,255,0.22),
    rgba(255,255,255,0) 70%
  );
  opacity: 0.45;
  pointer-events: none;
}

.am-action-card:active .am-action-icon,
.button.black.action:active .action-icon,
.button.yellow.action:active .action-icon {
  transform: translateY(1px) scale(0.99);
}

/* Mapeo de iconos actual */
.action-reservar .action-icon,
.am-action-card--reservar .am-action-icon {
  background-image: url('/images/ui/icon-reservar.png');
}

.action-abierta .action-icon,
.am-action-card--abierta .am-action-icon {
  background-image: url('/images/ui/icon-partida-abierta.png');
}

.action-privada .action-icon,
.am-action-card--privada .am-action-icon {
  background-image: url('/images/ui/icon-partida-privada.png');
}

.action-misreservas .action-icon,
.am-action-card--misreservas .am-action-icon {
  background-image: url('/images/ui/icon-mis-reservas.png');
}

@media (max-width: 420px) {
  .am-action-card,
  .button.black.action {
    min-height: var(--am-action-min-height-mobile);
  }

  .am-action-text strong,
  .action-text strong {
    font-size: 24px;
  }

  .am-action-text small,
  .action-text small {
    font-size: 14px;
  }

  .am-action-icon,
  .action-icon {
    width: var(--am-action-icon-w-mobile);
    height: var(--am-action-icon-h-mobile);
    right: 12px;
    bottom: 14px;
  }
}

/* =========================================================
   08. HOME MESSAGES CAROUSEL
   Nuevo: .am-home-messages
   Compatibilidad: .home-messages
   ========================================================= */

.am-home-messages,
.home-messages {
  padding: 10px 16px 6px;
  display: flex;
  gap: var(--am-space-xl);
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 16px;
}

.am-home-messages::-webkit-scrollbar,
.home-messages::-webkit-scrollbar {
  height: 0;
}

.am-home-messages .am-msg-card,
.home-messages .msg-card {
  flex: 0 0 75vw;
  display: flex;
  align-items: center;
  min-height: 80px;
  max-height: 110px;
  overflow: hidden;
  border-radius: var(--am-radius-md);
  scroll-snap-align: start;
}

.am-home-messages .am-msg-card:only-child,
.home-messages .msg-card:only-child {
  flex-basis: 100%;
}

@media (max-width: 420px) {
  .am-home-messages .am-msg-card,
  .home-messages .msg-card {
    flex-basis: 75vw;
    min-height: 75px;
    max-height: 115px;
  }
}

/* =========================================================
   09. PLAYER SLOT / AVATAR
   Nuevo: .am-player-slot / .am-avatar / .am-player-name
   Compatibilidad: .player-slot / .avatar / .player-name / .empty
   ========================================================= */

.am-player-slot,
.player-slot {
  float: left;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--am-space-2xs);
  width: var(--am-player-slot-w);
  height: var(--am-player-slot-h);
  margin: 6px;
  padding: 8px;
  border-radius: var(--am-radius-sm);
  text-align: center;
  font-family: var(--am-font-sans);
  transition: background 0.3s ease;
}

.am-player-slot--empty,
.empty {
  background-color: var(--am-color-bg-empty);
  border: 2px dashed var(--am-color-dashed);
  color: #999999;
  font-size: 28px;
  font-weight: 700;
}

.am-avatar,
.avatar {
  width: var(--am-avatar-size);
  height: var(--am-avatar-size);
  border-radius: var(--am-radius-circle);
  object-fit: cover;
  border: 2px solid var(--am-color-white);
  box-shadow: var(--am-shadow-xs);
}

.am-player-name,
.player-name {
  font-size: 13px;
  line-height: 1.1;
  font-weight: 500;
  color: #333333;
}

/* =========================================================
   10. SURFACE CARD BASE
   Base reutilizable para cards blancas de backoffice/intelligence
   ========================================================= */

.am-surface-card {
  max-width: var(--am-container-md);
  margin: 16px auto 0;
  padding: 20px;
  border-radius: var(--am-radius-3xl);
  background: var(--am-color-white);
  border: 1px solid var(--am-color-border-light);
  box-shadow: var(--am-shadow-lg);
  font-family: var(--am-font-sans);
}

.am-surface-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-surface-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--am-color-text-soft);
}

/* =========================================================
   11. INTELLIGENCE CARD (dark)
   ========================================================= */

.am-intelligence-card {
  max-width: var(--am-container-md);
  margin: 18px auto;
  padding: 22px;
  border-radius: var(--am-radius-3xl);
  background: linear-gradient(135deg, var(--am-color-bg-dark-1) 0%, var(--am-color-bg-dark-2) 100%);
  border: 1px solid var(--am-color-border-dark-soft);
  box-shadow: var(--am-shadow-xl);
  color: var(--am-color-white);
  font-family: var(--am-font-sans);
}

.am-intelligence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.am-intelligence-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.96);
}

.am-intelligence-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(255,255,255,0.72);
}

.am-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--am-space-sm);
  padding: 8px 14px;
  border-radius: var(--am-radius-pill);
  background: rgba(255,255,255,0.10);
  color: var(--am-color-white);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.am-main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.am-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.am-box {
  padding: 18px;
  border-radius: var(--am-radius-2xl);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.am-box-highlight {
  background: linear-gradient(135deg, rgba(16,185,129,0.18) 0%, rgba(59,130,246,0.12) 100%);
  border: 1px solid rgba(255,255,255,0.12);
}

.am-label {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.68);
}

.am-big-number {
  margin: 0;
  font-size: 54px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.am-big-number small {
  font-size: 22px;
  font-weight: 700;
  opacity: 0.85;
}

.am-helper {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255,255,255,0.78);
}

.am-value {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
}

.am-value-secondary {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}

.am-footer-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.68);
}

.am-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--am-radius-circle);
  background: var(--am-color-success);
}

.am-confidence {
  font-weight: 700;
  color: var(--am-color-success-soft);
}

@media (max-width: 800px) {
  .am-main-grid,
  .am-bottom-grid {
    grid-template-columns: 1fr;
  }

  .am-big-number {
    font-size: 44px;
  }
}

/* =========================================================
   12. PROBABILITY STATES
   ========================================================= */

.prob-low {
  background: linear-gradient(135deg, #3f1d1d, #1f2937);
  border: 1px solid var(--am-color-danger-soft);
}

.prob-medium {
  background: linear-gradient(135deg, #4a3a15, #1f2937);
  border: 1px solid var(--am-color-warning-soft);
}

.prob-good {
  background: linear-gradient(135deg, #133a3a, #1f2937);
  border: 1px solid rgba(0,200,180,0.25);
}

.prob-high {
  background: linear-gradient(135deg, #134e2a, #1f2937);
  border: 1px solid rgba(0,255,160,0.35);
}

/* =========================================================
   13. LEVEL SELECTION CARD
   ========================================================= */

.am-levels-card {
  max-width: var(--am-container-md);
  margin: 16px auto 0;
  padding: 20px;
  border-radius: var(--am-radius-3xl);
  background: var(--am-color-white);
  border: 1px solid var(--am-color-border-light);
  box-shadow: var(--am-shadow-lg);
  font-family: var(--am-font-sans);
}

.am-levels-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-levels-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--am-color-text-soft);
}

.am-levels-grid {
  display: grid;
  gap: 14px;
}

.am-level-radio {
  display: none;
}

.am-level-option {
  display: block;
  cursor: pointer;
}

.am-level-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 2px solid var(--am-color-border-light);
  border-radius: var(--am-radius-2xl);
  background: var(--am-color-bg-soft);
  transition: all var(--am-transition-base);
}

.am-level-option:hover .am-level-inner {
  transform: translateY(-1px);
  border-color: var(--am-brand-primary-border);
  box-shadow: 0 8px 18px rgba(var(--am-brand-primary-rgb), 0.06);
}

.am-level-radio:checked + .am-level-inner {
  border-color: var(--am-brand-primary);
  background: linear-gradient(
    180deg,
    rgba(var(--am-brand-primary-rgb), 0.08) 0%,
    rgba(var(--am-brand-primary-rgb), 0.03) 100%
  );
  box-shadow: 0 0 0 4px rgba(var(--am-brand-primary-rgb), 0.10);
}

.am-level-left {
  display: flex;
  flex-direction: column;
  gap: var(--am-space-sm);
}

.am-level-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.am-level-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-selected-pill {
  display: none;
  padding: 6px 10px;
  border-radius: var(--am-radius-pill);
  background: var(--am-brand-primary);
  color: var(--am-color-white);
  font-size: 12px;
  font-weight: 800;
}

.am-level-radio:checked + .am-level-inner .am-selected-pill {
  display: inline-block;
}

.am-level-meta {
  font-size: 14px;
  line-height: 1.45;
  color: var(--am-color-text-muted);
}

.am-level-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 120px;
}

.am-level-score {
  font-size: 15px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-level-tag {
  display: inline-block;
  padding: 7px 12px;
  border-radius: var(--am-radius-pill);
  background: var(--am-brand-primary-soft);
  border: 1px solid var(--am-brand-primary-border);
  color: var(--am-color-text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.am-level-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.am-btn-primary,
.am-btn-secondary {
  appearance: none;
  padding: 12px 18px;
  border-radius: var(--am-radius-lg);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--am-transition-fast);
}

.am-btn-primary {
  border: none;
  background: var(--am-brand-primary);
  color: var(--am-color-white);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(var(--am-brand-primary-rgb), 0.18);
}

.am-btn-primary:hover {
  filter: brightness(0.98);
}

.am-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.am-btn-secondary {
  border: 1px solid var(--am-color-border-mid);
  background: var(--am-color-white);
  color: var(--am-color-text);
  font-weight: 700;
}

@media (max-width: 700px) {
  .am-level-inner {
    flex-direction: column;
  }

  .am-level-side {
    min-width: auto;
    align-items: flex-start;
  }
}

/* =========================================================
   14. WARNING BOX
   ========================================================= */

.am-warning-box {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--am-radius-2xl);
  background: linear-gradient(135deg, #3a1010, #1f2937);
  border: 1px solid var(--am-color-danger-strong);
  box-shadow: 0 0 0 2px rgba(255,80,80,0.08);
}

.am-warning-title {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffb4b4;
}

.am-warning-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--am-color-white);
}

.am-warning-desc {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #ffd6d6;
}

/* =========================================================
   15. EXISTING SEEDS CARD
   ========================================================= */

.am-existing-seeds-card {
  max-width: var(--am-container-md);
  margin: 16px auto 0;
  padding: 20px;
  border-radius: var(--am-radius-3xl);
  background: var(--am-color-white);
  border: 1px solid var(--am-color-border-light);
  box-shadow: var(--am-shadow-lg);
  font-family: var(--am-font-sans);
}

.am-existing-seeds-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-existing-seeds-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--am-color-text-soft);
}

.am-existing-seed-row {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: var(--am-radius-xl);
  border: 1px solid var(--am-color-border-light);
  background: var(--am-color-bg-soft);
}

.am-existing-seed-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.am-existing-seed-id {
  font-size: 18px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-existing-seed-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--am-radius-pill);
  background: var(--am-brand-primary-soft);
  border: 1px solid var(--am-brand-primary-border);
  color: var(--am-color-text);
  font-size: 12px;
  font-weight: 800;
}

.am-existing-seed-meta {
  font-size: 14px;
  line-height: 1.6;
  color: var(--am-color-text-soft);
}

.am-existing-seed-empty {
  padding: 16px;
  border-radius: var(--am-radius-xl);
  border: 1px dashed var(--am-color-border-mid);
  background: var(--am-color-bg-soft);
  color: var(--am-color-text-soft);
  font-size: 15px;
}

/* =========================================================
   16. RESULT CARD SYSTEM
   ---------------------------------------------------------
   Pantalla base reutilizable para:
   - éxito
   - espera/procesando
   - aviso
   - error
   ========================================================= */

.am-result-shell {
  max-width: var(--am-container-md);
  margin: 24px auto;
  padding: 0 16px;
}

.am-result-card {
  position: relative;
  padding: 22px;
  border-radius: var(--am-radius-3xl);
  background: var(--am-color-white);
  border: 1px solid var(--am-color-border-light);
  box-shadow: var(--am-shadow-lg);
  font-family: var(--am-font-sans);
}

.am-result-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.am-result-icon-wrap {
  flex: 0 0 auto;
}

.am-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  box-shadow: 0 8px 18px rgba(15,23,42,0.08);
  border: 1px solid rgba(16,24,40,0.06);
}

.am-result-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.am-result-content {
  flex: 1;
  min-width: 0;
}

.am-result-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: var(--am-radius-pill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.am-result-title {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--am-color-text-strong);
}

.am-result-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--am-color-text);
  font-weight: 600;
}

.am-result-detail {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--am-radius-2xl);
  background: var(--am-color-bg-soft);
  border: 1px solid var(--am-color-border-light);
}

.am-result-detail-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-result-detail-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--am-color-text-soft);
}

.am-result-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--am-radius-lg);
  font-size: 14px;
  font-weight: 700;
}

.am-result-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.am-result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Variantes */
.am-result-card--success {
  border-color: #ccebd9;
  background: linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
}

.am-result-card--success .am-result-icon {
  background: linear-gradient(180deg, #ecfdf3 0%, #dff7e8 100%);
}

.am-result-card--success .am-result-eyebrow {
  background: #ecfdf3;
  color: #067647;
}

.am-result-card--success .am-result-status {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
}

.am-result-card--success .am-result-status-dot {
  background: #12b76a;
}

.am-result-card--processing {
  border-color: var(--am-brand-primary-border);
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    rgba(var(--am-brand-primary-rgb), 0.03) 100%
  );
}

.am-result-card--processing .am-result-icon {
  background: linear-gradient(
    180deg,
    rgba(var(--am-brand-primary-rgb), 0.08) 0%,
    rgba(var(--am-brand-primary-rgb), 0.16) 100%
  );
}

.am-result-card--processing .am-result-eyebrow {
  background: var(--am-brand-primary-soft);
  color: var(--am-brand-primary);
}

.am-result-card--processing .am-result-status {
  background: var(--am-brand-primary-soft);
  border: 1px solid var(--am-brand-primary-border);
  color: var(--am-brand-primary);
}

.am-result-card--processing .am-result-status-dot {
  background: var(--am-brand-primary);
}

.am-result-card--warning {
  border-color: #f7d8a8;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
}

.am-result-card--warning .am-result-icon {
  background: linear-gradient(180deg, #fff7e8 0%, #fdecc8 100%);
}

.am-result-card--warning .am-result-eyebrow {
  background: #fff7e8;
  color: #b54708;
}

.am-result-card--warning .am-result-status {
  background: #fff7e8;
  border: 1px solid #f7d8a8;
  color: #b54708;
}

.am-result-card--warning .am-result-status-dot {
  background: #f79009;
}

.am-result-card--error {
  border-color: #f3c7c7;
  background: linear-gradient(180deg, #ffffff 0%, #fffafb 100%);
}

.am-result-card--error .am-result-icon {
  background: linear-gradient(180deg, #fef3f2 0%, #fde2e1 100%);
}

.am-result-card--error .am-result-eyebrow {
  background: #fef3f2;
  color: #d92d20;
}

.am-result-card--error .am-result-status {
  background: #fef3f2;
  border: 1px solid #f3c7c7;
  color: #d92d20;
}

.am-result-card--error .am-result-status-dot {
  background: #f04438;
}

@media (max-width: 640px) {
  .am-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .am-result-title {
    font-size: 28px;
  }

  .am-result-text {
    font-size: 16px;
  }

  .am-result-actions {
    flex-direction: column;
  }

  .am-result-actions .am-btn-primary,
  .am-result-actions .am-btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* =========================================================
   17. RESULT SUPPORT LAYOUT
   ---------------------------------------------------------
   Para móvil: primero CTA de horario cercano
   Para desktop: dos columnas (explicación + opciones)
   ========================================================= */

.am-result-support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.am-result-support-grid .am-result-detail {
  margin-top: 0;
}

.am-result-detail--nearby{
  border: 1px solid var(--am-brand-primary-border);
  background: linear-gradient(
    180deg,
    rgba(var(--am-brand-primary-rgb), 0.04) 0%,
    rgba(var(--am-brand-primary-rgb), 0.08) 100%
  );
  box-shadow: 0 10px 24px rgba(var(--am-brand-primary-rgb), 0.10);
}

.am-result-detail--nearby .am-result-detail-title {
  margin-bottom: 8px;
}

.am-result-detail--nearby .am-result-detail-text {
  margin-bottom: 14px;
}

.am-result-highlight-slot {
  margin-top: 2px;
}

.am-result-highlight-slot .am-nearby-slot{
  border: 1px solid var(--am-brand-primary-border);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(var(--am-brand-primary-rgb), 0.12);
  padding: 16px 18px;
}

.am-result-highlight-slot .am-nearby-slot:hover{
  border-color: var(--am-brand-primary-border-strong);
  box-shadow: 0 12px 26px rgba(var(--am-brand-primary-rgb), 0.16);
  transform: translateY(-1px);
}

.am-result-highlight-slot .am-nearby-slot-time{
  font-size: 20px;
  font-weight: 900;
  color: #101828;
  letter-spacing: -0.02em;
}

.am-result-highlight-slot .am-nearby-slot-cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--am-brand-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(var(--am-brand-primary-rgb), 0.22);
}

.am-nearby-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin: 6px 0 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--am-brand-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(var(--am-brand-primary-rgb), 0.20);
}

.am-nearby-slot.is-featured{
  border: 2px solid var(--am-brand-primary-border-strong);
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    rgba(var(--am-brand-primary-rgb), 0.06) 100%
  );
  box-shadow: 0 12px 26px rgba(var(--am-brand-primary-rgb), 0.14);
}

.am-nearby-slot.is-featured .am-nearby-slot-time{
  font-size: 18px;
  font-weight: 900;
}

.am-nearby-slot.is-featured .am-nearby-slot-cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--am-brand-primary);
  color: #fff;
  box-shadow: 0 6px 14px rgba(var(--am-brand-primary-rgb), 0.22);
}

.am-nearby-slots {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.am-nearby-slot-form {
  margin: 0;
}

.am-nearby-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--am-color-border-light);
  background: #fff;
  cursor: pointer;
  transition: all .18s ease;
}

.am-nearby-slot:hover {
  transform: translateY(-1px);
  border-color: var(--am-brand-primary-border);
  box-shadow: 0 8px 18px rgba(var(--am-brand-primary-rgb), 0.08);
}

.am-nearby-slot-time {
  font-size: 16px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-nearby-slot-cta {
  font-size: 13px;
  font-weight: 800;
  color: var(--am-brand-primary);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .am-nearby-slot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 768px) {
  .am-result-support-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
    align-items: start;
  }
}

.am-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(16, 24, 40, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}

.am-modal-card {
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.am-modal-overlay .am-result-card {
  margin: 0;
}

body.am-modal-open {
  overflow: hidden;
}

/* =========================================================
   COURT TYPE SELECTOR
   Selector visual de modalidad: Pádel / Tenis / Individual
   ========================================================= */

.am-court-type-selector {
  display: flex;
  gap: var(--am-space-sm);
  padding: 10px 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.am-court-type-selector::-webkit-scrollbar {
  height: 0;
}

.am-court-type-btn {
  appearance: none;
  border: 1px solid var(--am-brand-primary-border);
  background: var(--am-brand-primary-soft);
  color: var(--am-brand-primary);
  border-radius: var(--am-radius-pill);
  padding: 10px 16px;
  font-family: var(--am-font-sans);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--am-transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.am-court-type-btn.is-active {
  background: var(--am-brand-primary);
  color: var(--am-color-white);
  border-color: var(--am-brand-primary);
  box-shadow: 0 6px 14px var(--am-brand-primary-shadow);
}

.am-court-type-btn:active {
  transform: translateY(1px);
}

/* =========================================================
   WALLET / MONEDERO DIGITAL
   ========================================================= */

.am-wallet-page {
  max-width: var(--am-container-md);
  margin: 0 auto;
  padding: 18px 16px 28px;
  font-family: var(--am-font-sans);
}

.am-wallet-balance-card {
  position: relative;
  overflow: hidden;
  padding: 24px 22px;
  border-radius: var(--am-radius-3xl);
  background: linear-gradient(
    135deg,
    var(--am-color-bg-dark-1) 0%,
    var(--am-color-bg-dark-2) 100%
  );
  color: var(--am-color-white);
  box-shadow: var(--am-shadow-xl);
  border: 1px solid var(--am-color-border-dark);
}

.am-wallet-balance-card::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--am-brand-primary-rgb), 0.38) 0%,
    rgba(var(--am-brand-primary-rgb), 0) 70%
  );
}

.am-wallet-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 7px 12px;
  border-radius: var(--am-radius-pill);
  background: rgba(255,255,255,0.10);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.78);
}

.am-wallet-amount {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  font-size: 64px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.am-wallet-amount span {
  font-size: 28px;
  font-weight: 800;
  opacity: 0.9;
  margin-left: 4px;
}

.am-wallet-note {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255,255,255,0.72);
}

.am-wallet-recharge-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--am-radius-3xl);
  background: var(--am-color-white);
  border: 1px solid var(--am-color-border-light);
  box-shadow: var(--am-shadow-lg);
}

.am-wallet-recharge-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
  color: var(--am-color-text-strong);
  letter-spacing: -0.03em;
}

.am-wallet-recharge-card p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--am-color-text-soft);
  font-weight: 600;
}

.am-wallet-options {
  display: grid;
  gap: 12px;
}

.am-wallet-option {
  width: 100%;
  margin: 0;
  padding: 16px;
  border-radius: var(--am-radius-2xl);
  background: var(--am-color-bg-soft);
  border: 1px solid var(--am-color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all var(--am-transition-base);
}

.am-wallet-option:hover {
  transform: translateY(-1px);
  border-color: var(--am-brand-primary-border);
  box-shadow: 0 10px 22px rgba(var(--am-brand-primary-rgb), 0.08);
}

.am-wallet-option strong {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: var(--am-color-text-strong);
  letter-spacing: -0.03em;
}

.am-wallet-option span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--am-color-text-muted);
}

.am-wallet-option button {
  appearance: none;
  border: none;
  border-radius: var(--am-radius-lg);
  padding: 12px 16px;
  background: var(--am-brand-primary);
  color: var(--am-color-white);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(var(--am-brand-primary-rgb), 0.18);
  transition: all var(--am-transition-fast);
}

.am-wallet-option button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.am-wallet-option--featured {
  border-color: var(--am-brand-primary-border);
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    rgba(var(--am-brand-primary-rgb), 0.06) 100%
  );
}

@media (max-width: 520px) {
  .am-wallet-page {
    padding: 14px 14px 24px;
  }

  .am-wallet-balance-card,
  .am-wallet-recharge-card {
    border-radius: var(--am-radius-2xl);
  }

  .am-wallet-amount {
    font-size: 56px;
  }

  .am-wallet-option {
    align-items: stretch;
    flex-direction: column;
  }

  .am-wallet-option button {
    width: 100%;
  }
}

.am-form-group {
  margin-bottom: 18px;
}

.am-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--am-color-text-strong);
}

.am-form-input,
.am-form-select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--am-radius-xl);
  border: 1px solid var(--am-color-border-light);
  background: var(--am-color-bg-soft);
  font-size: 15px;
  font-weight: 700;
  color: var(--am-color-text-strong);
  outline: none;
  transition: all var(--am-transition-base);
}

.am-form-input:focus,
.am-form-select:focus {
  border-color: var(--am-brand-primary-border-strong);
  box-shadow: 0 0 0 4px rgba(var(--am-brand-primary-rgb), 0.10);
}

.am-wallet-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.am-wallet-actions .am-btn-primary,
.am-wallet-actions .am-btn-secondary {
  flex: 1;
  text-align: center;
}

@media (max-width: 520px) {

  .am-wallet-actions {
    flex-direction: column;
  }

}

/* =========================================================
   18. MIGRACIÓN PROGRESIVA RECOMENDADA
   ---------------------------------------------------------
   Fase 1
   - Cargar este CSS global en toda la app
   - Mantener HTML legacy funcionando

   Fase 2
   - En pantallas nuevas usar solo clases am-
   - Ejemplo:
     .am-home-actions
     .am-action-card
     .am-action-text
     .am-action-icon
     .am-result-card

   Fase 3
   - Eliminar dependencias legacy poco a poco:
     .button.black.action
     .button.yellow.action
     .home-actions
     .action-text
     .action-icon

   Fase 4
   - Separar en archivos:
     /css/core/am-tokens.css
     /css/core/am-base.css
     /css/components/am-actions.css
     /css/components/am-cards.css
     /css/components/am-player-slot.css
     /css/modules/am-intelligence.css
     /css/modules/am-result.css
   ========================================================= */
