/* SubRealms — hoja de estilos del panel web.
   Tema oscuro con acento morado (Twitch). Edítala libremente para dar forma al panel. */

:root {
  color-scheme: dark;
  --bg: #0d0d12;
  --bg-elev: #15151d;
  --card: #17171f;
  --border: #272730;
  --border-soft: #21212a;
  --text: #e8e8ee;
  --muted: #9a9aa6;
  --accent: #9146ff;
  --accent-2: #b388ff;
  --accent-ghost: rgba(145, 70, 255, 0.14);
  --danger: #ed4245;
  --danger-dim: #3a1f22;
  --ok: #3fb950;
  --warn: #e3b341;
  --info: #58a6ff;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(145, 70, 255, 0.12), transparent 60%),
    radial-gradient(700px 400px at 110% 0%, rgba(88, 166, 255, 0.07), transparent 55%),
    var(--bg);
}

.wrap { max-width: 900px; margin: 0 auto; padding: 28px 16px 56px; }

/* Cabecera */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 21px; font-weight: 800; letter-spacing: -0.02em;
}
.brand .logo { width: 30px; height: 30px; display: block; }
.brand .name {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; align-items: center; gap: 7px; font-size: 14px; flex-wrap: wrap; }
.nav .who { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 700; padding: 0 2px; }
.nav .who .avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); display: block; object-fit: cover; }
.nav .who .avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-ghost); color: var(--accent-2); font-size: 12px; font-weight: 800; }
.navbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px; line-height: 1;
  color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); background: #1b1b24;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .06s ease;
}
.navbtn:hover { background: #24242e; border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.navbtn.active { background: var(--accent-ghost); border-color: var(--accent); color: var(--accent-2); }
.navbtn.ghost { background: transparent; color: var(--muted); }
.navbtn.ghost:hover { color: var(--text); }

/* Tipografía */
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 14px; }
a { color: var(--accent-2); }
.muted { color: var(--muted); }
p { line-height: 1.5; }

/* Tarjetas */
.card {
  background: linear-gradient(180deg, var(--bg-elev), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 { display: flex; align-items: center; gap: 8px; }
.card .count { color: var(--muted); font-weight: 500; font-size: 14px; }

/* Rejilla de datos (estado, tier, ...) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px 18px;
  margin-bottom: 16px;
}
.k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.v { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff; border: 0; border-radius: 10px;
  padding: 10px 15px; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 600; line-height: 1;
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: #24242e; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #2c2c38; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

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

/* Insignias de estado */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--border);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.active  { color: #8ff0a0; } .badge.active::before  { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.badge.sleeping{ color: #a9c6ff; } .badge.sleeping::before{ background: var(--info); }
.badge.pending { color: #f1d58a; } .badge.pending::before { background: var(--warn); }
.badge.stopped { color: var(--muted); } .badge.stopped::before { background: var(--muted); }
.badge.error   { color: #ff9ea0; } .badge.error::before   { background: var(--danger); }

/* Código / direcciones */
code {
  background: #0c0c11; border: 1px solid var(--border-soft);
  padding: 2px 7px; border-radius: 6px; font-size: 0.92em;
}
.connect { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; }
.connect code { font-size: 15px; padding: 6px 10px; }

/* Formularios */
form { display: inline; }
label { font-size: 14px; }
select, input[type="text"], input[type="date"], input[type="number"] {
  background: #0c0c11; color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; font-size: 14px;
}
input[type="date"] { color-scheme: dark; }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { transform: none; filter: none; }
select:focus, input:focus { outline: none; border-color: var(--accent); }
.field { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 14px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }

/* Aviso/nota */
.note {
  background: var(--accent-ghost); border: 1px solid rgba(145, 70, 255, 0.3);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 4px 0 14px;
}
.note.warn { background: var(--danger-dim); border-color: rgba(237, 66, 69, 0.4); }
.note.danger { background: var(--danger-dim); border-color: rgba(237, 66, 69, 0.65); border-left: 4px solid var(--danger); }

/* Tablas */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Footer */
.footer {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px; text-align: center;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent-2); text-decoration: underline; }
.footer .ver { opacity: 0.7; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* Bienvenida (hero del login) */
.hero {
  text-align: center; padding: 44px 24px;
  background:
    radial-gradient(620px 320px at 50% -30%, var(--accent-ghost), transparent 70%),
    linear-gradient(180deg, var(--bg-elev), var(--card));
}
.hero-crest { margin: -6px 0 10px; }
.hero-crest img { filter: drop-shadow(0 8px 20px rgba(145, 70, 255, 0.45)); }
.hero-badge { display: inline-block; font-weight: 800; letter-spacing: 0.02em; color: var(--accent-2); margin-bottom: 10px; }
.hero-title { font-size: 30px; margin: 6px 0 12px; letter-spacing: -0.02em; line-height: 1.15; }
.hero-sub { font-size: 16px; max-width: 580px; margin: 0 auto 22px; color: var(--text); line-height: 1.6; }
.hero-cta { margin: 6px 0 24px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 12px; }
.hero-feats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.feat {
  background: var(--accent-ghost); border: 1px solid rgba(145, 70, 255, 0.3);
  color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.hero-note { font-size: 13px; max-width: 500px; margin: 0 auto; }

/* Página de error */
.error-card { text-align: center; padding: 40px 24px; }
.error-code {
  font-size: 56px; font-weight: 900; line-height: 1;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 8px;
}

/* Tabla comparativa de tiers (login + crear reino) */
.tiers-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0 2px; }
table.tiers { width: 100%; border-collapse: collapse; min-width: 540px; font-size: 14px; }
table.tiers th, table.tiers td {
  padding: 11px 14px; text-align: center; border-bottom: 1px solid var(--border-soft);
}
table.tiers thead th {
  font-size: 15px; font-weight: 800; color: var(--text);
  text-transform: none; letter-spacing: 0; border-bottom: 2px solid var(--border);
}
table.tiers tbody th {
  text-align: left; color: var(--muted); font-weight: 600;
  font-size: 13px; text-transform: none; letter-spacing: 0; white-space: nowrap;
}
table.tiers tbody td { font-weight: 700; color: var(--text); }
table.tiers tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
table.tiers .feat { background: var(--accent-ghost); }
table.tiers thead th.feat { color: var(--accent-2); }
.tiers .feat-tag {
  display: block; font-size: 11px; font-weight: 700; color: var(--accent-2);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px;
}

/* Progreso de "Mi reino" (operación en curso: crear / cambiar / mods) */
.progress-card .steps { display: flex; gap: 6px; margin: 18px 0 14px; flex-wrap: wrap; }
.progress-card .step {
  flex: 1 1 0; min-width: 110px; display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.progress-card .step .dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); background: transparent;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.progress-card .step.done { color: var(--text); }
.progress-card .step.done .dot { background: var(--ok); border-color: var(--ok); }
.progress-card .step.current { color: var(--accent-2); }
.progress-card .step.current .dot {
  background: var(--accent); border-color: var(--accent-2);
  animation: prog-pulse 1.3s ease-in-out infinite;
}
@keyframes prog-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-ghost); }
  50%      { box-shadow: 0 0 0 7px rgba(145, 70, 255, 0.08); }
}
.progress-card .bar {
  position: relative; height: 8px; border-radius: 999px; overflow: hidden;
  background: #0c0c11; border: 1px solid var(--border-soft); margin: 4px 0 14px;
}
.progress-card .bar-fill {
  position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  animation: prog-slide 1.4s ease-in-out infinite;
}
@keyframes prog-slide { 0% { left: -40%; } 100% { left: 100%; } }
.progress-card .prog-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 0; }
@media (prefers-reduced-motion: reduce) {
  .progress-card .bar-fill { animation: none; left: 0; width: 100%; opacity: .5; }
  .progress-card .step.current .dot { animation: none; }
}
