/* ============================================================================
   ATHENAS · Design System v2 — Components
   Toolkit para vistas internas (auth, panel, tienda, tickets, casino, admin…)
   Depende de los tokens definidos en athenas.css
   ============================================================================ */

/* ── Page header (cabecera de vistas internas) ────────────────────────────── */
.ath-pagehead{padding-block:clamp(22px,4vw,40px)}
.ath-pagehead__row{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
.ath-pagehead h1{font-family:var(--ath-display);font-weight:900;color:#fff;margin:.2em 0 0;
  font-size:clamp(28px,4.4vw,44px);line-height:1.05;text-wrap:balance}
.ath-pagehead p{color:var(--ath-muted);margin:.5em 0 0;max-width:64ch}
.ath-back{display:inline-flex;align-items:center;gap:7px;color:var(--ath-muted);font-size:13px;font-weight:600;
  padding:8px 12px;border-radius:10px;border:1px solid var(--ath-line);transition:all .2s}
.ath-back:hover{color:#fff;border-color:var(--ath-line-strong);background:rgba(255,255,255,.04)}

/* ── Auth (login/registro/recuperación) ───────────────────────────────────── */
.ath-authwrap{min-height:calc(100vh - 66px);display:grid;place-items:center;padding:clamp(24px,5vw,60px) 16px}
.ath-authcard{width:100%;max-width:440px}
.ath-authcard .ath-panel{padding:clamp(24px,4vw,36px)}
.ath-auth-logo{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;margin-bottom:22px}
.ath-auth-logo img{width:64px;height:64px;object-fit:contain;filter:drop-shadow(0 0 16px rgba(255,138,30,.5))}
.ath-auth-logo h1{font-family:var(--ath-display);font-size:24px;color:#fff;margin:0}
.ath-auth-logo p{color:var(--ath-muted);font-size:13.5px;margin:0}
.ath-auth-alt{text-align:center;margin-top:18px;color:var(--ath-muted);font-size:13.5px}

/* ── Formularios ──────────────────────────────────────────────────────────── */
.ath-field{display:flex;flex-direction:column;gap:7px;margin-bottom:16px}
.ath-label{font-size:13px;font-weight:700;color:var(--ath-text);letter-spacing:.01em}
.ath-label .req{color:var(--ath-ember)}
.ath-input,.ath-select,.ath-textarea{
  width:100%;padding:12px 14px;border-radius:12px;
  border:1px solid var(--ath-line-strong);background:rgba(0,0,0,.4);
  color:var(--ath-text);font-family:inherit;font-size:14.5px;line-height:1.4;
  transition:border-color .2s,box-shadow .2s;
}
.ath-input:focus,.ath-select:focus,.ath-textarea:focus{
  outline:none;border-color:var(--ath-gold);box-shadow:0 0 0 3px var(--ath-gold-soft)}
.ath-input::placeholder,.ath-textarea::placeholder{color:var(--ath-faint)}
.ath-textarea{resize:vertical;min-height:110px}
.ath-select{appearance:none;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b7a78e' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 14px center;padding-right:36px}
.ath-help{font-size:12px;color:var(--ath-faint)}
.ath-check{display:flex;align-items:flex-start;gap:10px;font-size:13.5px;color:var(--ath-muted);cursor:pointer}
.ath-check input{width:17px;height:17px;margin-top:1px;accent-color:var(--ath-gold);flex:0 0 auto}
.ath-inputgroup{display:flex;gap:8px}
.ath-inputgroup .ath-input{flex:1}

/* ── Alertas / flash ──────────────────────────────────────────────────────── */
.ath-alert{display:flex;gap:10px;align-items:flex-start;padding:12px 15px;border-radius:12px;margin-bottom:16px;
  font-size:13.5px;line-height:1.5;border:1px solid transparent}
.ath-alert__i{flex:0 0 auto;font-size:16px;line-height:1.3}
.ath-alert--success{background:rgba(63,185,80,.1);border-color:rgba(63,185,80,.34);color:#bff0c6}
.ath-alert--error{background:rgba(229,72,77,.1);border-color:rgba(229,72,77,.34);color:#f6b9bb}
.ath-alert--warning{background:var(--ath-gold-soft);border-color:var(--ath-line-strong);color:#ffd9a3}
.ath-alert--info{background:rgba(74,163,255,.09);border-color:rgba(74,163,255,.3);color:#bcdcff}

/* ── Tablas (rankings, standings, admin) ──────────────────────────────────── */
.ath-tablewrap{overflow-x:auto;border-radius:var(--ath-r);border:1px solid var(--ath-line)}
.ath-table{width:100%;border-collapse:collapse;font-size:14px;min-width:520px}
.ath-table thead th{
  text-align:left;padding:13px 16px;font-size:11px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--ath-faint);font-weight:800;background:rgba(0,0,0,.35);border-bottom:1px solid var(--ath-line)}
.ath-table tbody td{padding:12px 16px;border-bottom:1px solid var(--ath-line);color:var(--ath-text);vertical-align:middle}
.ath-table tbody tr:last-child td{border-bottom:0}
.ath-table tbody tr:hover td{background:rgba(255,255,255,.02)}
.ath-table .num{font-variant-numeric:tabular-nums;text-align:right}
.ath-rank{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:8px;font-weight:800;font-size:13px;
  background:var(--ath-gold-soft);color:var(--ath-gold);border:1px solid var(--ath-line)}
.ath-rank--1{background:linear-gradient(135deg,var(--ath-amber),var(--ath-gold));color:#1c0f00;border-color:transparent}
.ath-rank--2{background:rgba(200,200,210,.2);color:#e8e8ee}
.ath-rank--3{background:rgba(205,127,50,.22);color:#e6b483}

/* ── Tabs (tienda por reino, casino) ──────────────────────────────────────── */
.ath-tabs{display:inline-flex;gap:4px;padding:5px;border-radius:14px;border:1px solid var(--ath-line);
  background:rgba(0,0,0,.35);flex-wrap:wrap}
.ath-tab{padding:9px 18px;border-radius:10px;border:0;background:transparent;cursor:pointer;
  color:var(--ath-muted);font-family:inherit;font-size:13.5px;font-weight:700;transition:all .2s;text-decoration:none}
.ath-tab:hover{color:#fff}
.ath-tab.is-active,.ath-tab[aria-selected="true"]{
  background:linear-gradient(135deg,var(--ath-amber),var(--ath-gold));color:#1c0f00;
  box-shadow:0 6px 18px -8px rgba(255,138,30,.6)}

/* ── Store items ──────────────────────────────────────────────────────────── */
.ath-shopgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}
.ath-item{display:flex;flex-direction:column;border-radius:var(--ath-r);overflow:hidden;
  border:1px solid var(--ath-line);background:var(--ath-card);transition:transform .22s,border-color .22s,box-shadow .22s}
.ath-item:hover{transform:translateY(-4px);border-color:var(--ath-line-strong);box-shadow:0 20px 44px -24px rgba(255,138,30,.45)}
.ath-item__media{aspect-ratio:1/1;background:radial-gradient(circle at 50% 40%,rgba(255,138,30,.12),rgba(0,0,0,.4));
  display:grid;place-items:center;padding:16px;border-bottom:1px solid var(--ath-line)}
.ath-item__media img{max-width:100%;max-height:100%;object-fit:contain;filter:drop-shadow(0 8px 20px rgba(0,0,0,.5))}
.ath-item__body{padding:14px 15px 16px;display:flex;flex-direction:column;gap:8px;flex:1}
.ath-item__name{font-weight:800;font-size:14.5px;color:#fff;line-height:1.25}
.ath-item__desc{font-size:12.5px;color:var(--ath-muted);line-height:1.45;flex:1}
.ath-price{display:inline-flex;align-items:center;gap:6px;font-weight:900;color:var(--ath-gold);
  font-variant-numeric:tabular-nums}
.ath-price small{font-size:11px;color:var(--ath-muted);font-weight:700}

/* Wallet chips (DP / VP) */
.ath-wallet{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:99px;
  border:1px solid var(--ath-line-strong);background:var(--ath-gold-soft);font-weight:800;color:var(--ath-gold);
  font-variant-numeric:tabular-nums}
.ath-wallet--vp{color:#bcdcff;border-color:rgba(74,163,255,.4);background:rgba(74,163,255,.1)}

/* ── Panel: KPIs + tarjetas de personaje ──────────────────────────────────── */
.ath-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.ath-kpi{padding:16px 18px;border-radius:var(--ath-r);border:1px solid var(--ath-line);background:var(--ath-card)}
.ath-kpi__label{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--ath-faint);font-weight:800}
.ath-kpi__value{font-family:var(--ath-display);font-weight:700;font-size:26px;color:#fff;margin-top:4px;
  font-variant-numeric:tabular-nums}
.ath-charcard{display:flex;align-items:center;gap:14px;padding:14px;border-radius:var(--ath-r);
  border:1px solid var(--ath-line);background:var(--ath-card)}
.ath-charcard__av{width:48px;height:48px;border-radius:12px;background:var(--ath-gold-soft);
  border:1px solid var(--ath-line);display:grid;place-items:center;font-size:20px;flex:0 0 auto}

/* ── Tickets: chat ────────────────────────────────────────────────────────── */
.ath-chat{display:flex;flex-direction:column;gap:12px;max-height:60vh;overflow-y:auto;padding:6px 2px}
.ath-msg{max-width:80%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.5;position:relative}
.ath-msg__meta{font-size:11px;color:var(--ath-faint);margin-bottom:4px;font-weight:700}
.ath-msg--me{align-self:flex-end;background:linear-gradient(135deg,rgba(255,138,30,.16),rgba(255,90,28,.1));
  border:1px solid var(--ath-line-strong);border-bottom-right-radius:5px}
.ath-msg--staff{align-self:flex-start;background:rgba(255,255,255,.04);border:1px solid var(--ath-line);
  border-bottom-left-radius:5px}
.ath-msg--staff .ath-msg__meta{color:var(--ath-gold)}

/* ── Countdown / stat pills grande ────────────────────────────────────────── */
.ath-count{display:flex;gap:10px;flex-wrap:wrap}
.ath-count__unit{min-width:64px;padding:12px 10px;border-radius:12px;text-align:center;
  border:1px solid var(--ath-line);background:var(--ath-card)}
.ath-count__n{font-family:var(--ath-display);font-weight:700;font-size:28px;color:#fff;font-variant-numeric:tabular-nums;line-height:1}
.ath-count__l{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--ath-faint);margin-top:4px}

/* ── Paginación ───────────────────────────────────────────────────────────── */
.ath-pager{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-top:22px}
.ath-pager a,.ath-pager span{min-width:38px;height:38px;display:grid;place-items:center;padding:0 10px;
  border-radius:10px;border:1px solid var(--ath-line);color:var(--ath-muted);font-size:13.5px;font-weight:700}
.ath-pager a:hover{color:#fff;border-color:var(--ath-line-strong)}
.ath-pager .is-active{background:var(--ath-gold-soft);color:var(--ath-gold);border-color:var(--ath-line-strong)}
.ath-pager .is-disabled{opacity:.4;pointer-events:none}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.ath-modal{position:fixed;inset:0;z-index:100;display:none;place-items:center;padding:20px;
  background:rgba(5,4,3,.72);backdrop-filter:blur(6px)}
.ath-modal.is-open{display:grid}
.ath-modal__box{width:100%;max-width:460px;border-radius:var(--ath-r-lg);border:1px solid var(--ath-line-strong);
  background:linear-gradient(180deg,var(--ath-surface-solid),var(--ath-bg));box-shadow:var(--ath-shadow);padding:26px;
  animation:ath-modalin .25s ease}
@keyframes ath-modalin{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.ath-modal__title{font-family:var(--ath-display);font-size:20px;color:#fff;margin:0 0 8px}

/* ── Utilidades ───────────────────────────────────────────────────────────── */
.ath-muted{color:var(--ath-muted)}
.ath-faint{color:var(--ath-faint)}
.ath-center{text-align:center}
.ath-mt{margin-top:16px}.ath-mt-lg{margin-top:28px}
.ath-row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.ath-between{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between}
.ath-divider{border:0;border-top:1px solid var(--ath-line);margin:20px 0}
.ath-empty{text-align:center;padding:48px 20px;color:var(--ath-faint)}
.ath-empty__i{font-size:40px;margin-bottom:12px;opacity:.6}
