:root {
  --bg: #0a0812;
  --ink: #f7f2ff;
  --muted: #b7aec6;
  --muted-2: #8a8299;

  --gold: #ffb347;
  --gold-2: #ffd07a;
  --orange: #ff8a3d;
  --orange-deep: #e8620a;

  --cyan: #37e0d8;
  --pink: #ff5fae;
  --green: #35d07f;
  --red: #f85149;
  --discord: #5865f2;

  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.08);
  --brd: rgba(255, 255, 255, 0.12);
  --brd-soft: rgba(255, 255, 255, 0.07);

  --pad: clamp(18px, 3.2vw, 56px);

  --font: 'Kanit', system-ui, sans-serif;
  --mono: ui-monospace, 'Kanit', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 1.6vw, 22px) var(--pad);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- Fondo: foto Vice atardecer (Miami) ---------- */
.bg {
  position: fixed; inset: 0; z-index: -3;
  background: url('/static/img/bg.jpg') center 42% / cover no-repeat, var(--bg);
  transform: scale(1.03);
  animation: bgdrift 40s ease-in-out infinite alternate;
}
@keyframes bgdrift { to { transform: scale(1.10) translateY(-1.5%); } }

.bg-overlay {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(58vw 52vh at 50% 24%, rgba(255,150,70,.22), transparent 60%),
    linear-gradient(180deg, rgba(8,6,14,.78) 0%, rgba(8,6,14,.30) 24%, rgba(8,6,14,.22) 50%, rgba(8,6,14,.62) 84%, var(--bg) 100%),
    radial-gradient(130vw 95vh at 50% 42%, transparent 40%, rgba(0,0,0,.50) 100%);
}

/* ---------- Contenedor ---------- */
.shell {
  position: relative; z-index: 1;
  width: 100%; max-width: 1240px; margin: 0 auto;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 2px 2px clamp(10px, 2vh, 18px);
  animation: fade .5s ease;
}
@keyframes fade { from { opacity: 0; } }

.user {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid var(--brd);
  padding: 5px 14px 5px 5px; border-radius: 999px; backdrop-filter: blur(12px);
}
.user-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--brd); }
.user-av--ph { display: grid; place-items: center; background: var(--glass-2); font-weight: 800; font-size: 12px; color: var(--muted); }
.user-name { font-weight: 700; font-size: 13px; letter-spacing: .3px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.user-name.muted { color: var(--muted); font-weight: 600; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--brd);
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600; color: var(--muted);
  backdrop-filter: blur(12px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: .3s; }
.dot.online { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.offline { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- Zona central: dos columnas ---------- */
.hero {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(460px, 580px);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(8px, 1.6vh, 20px) 0;
  animation: rise .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Columna izquierda: marca */
.hero-left {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(16px, 2.6vh, 26px);
  text-align: left;
}

.hero-logo {
  width: auto; max-width: min(420px, 100%); height: auto; display: block;
  filter: drop-shadow(0 14px 40px rgba(255,138,61,.42)) drop-shadow(0 3px 10px rgba(0,0,0,.7));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-5px); } }

.hero-tagline {
  color: var(--muted); font-size: clamp(14px, 1.15vw, 16px); line-height: 1.55;
  max-width: 46ch; text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.hero-tagline b { color: var(--gold-2); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--glass); border: 1px solid var(--brd);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  color: #e6e0f2; backdrop-filter: blur(12px);
  transition: transform .15s, border-color .2s, background .2s;
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.chip:hover { transform: translateY(-2px); border-color: rgba(255,179,71,.5); background: var(--glass-2); }

/* ---------- Tarjeta de cola ---------- */
.card {
  width: 100%;
  background: linear-gradient(180deg, rgba(18,12,30,.66), rgba(10,7,18,.74));
  border: 1px solid var(--brd);
  border-radius: 26px;
  padding: clamp(22px, 3.4vw, 32px);
  backdrop-filter: blur(22px);
  box-shadow: 0 34px 90px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
  text-align: left;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--muted); text-transform: uppercase;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-2); }

/* Bloque de posición (protagonista, centrado) */
.pos-block { text-align: center; margin: clamp(6px, 1.4vh, 14px) 0 clamp(12px, 2.2vh, 20px); }
.position { display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; }
.pos-hash { font-family: var(--font); font-style: italic; font-size: clamp(30px, 5vw, 46px); font-weight: 800; color: var(--gold); align-self: flex-start; margin-top: .18em; }
.pos-num {
  font-family: var(--font); font-weight: 900; font-style: italic;
  font-size: clamp(78px, 14vw, 126px); letter-spacing: -2px; line-height: 1.28;
  padding: .1em .12em 0; /* aire arriba/lados para que el glifo en cursiva no se recorte */
  background: linear-gradient(180deg, #fff 6%, var(--gold) 94%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 12px 34px rgba(255,138,61,.5));
}
.pos-num.turn { background: linear-gradient(180deg, #eafff2, var(--green)); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 12px 34px rgba(53,208,127,.55)); }
.pos-caption { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.panel-sub {
  color: var(--gold-2); font-weight: 700; font-size: 13px; letter-spacing: .4px;
  margin-top: 10px; text-transform: uppercase;
}

/* Métricas */
.metrics { display: flex; flex-direction: column; gap: 10px; }
.metric {
  background: rgba(0,0,0,.28); border: 1px solid var(--brd-soft);
  border-radius: 14px; padding: 12px 15px;
}
.metric-top, .metric--row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-top span, .metric--row span { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.metric-top b, .metric--row b { font-family: var(--font); font-style: italic; font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.metric .bar { margin-top: 9px; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  box-shadow: 0 0 14px rgba(255,138,61,.7);
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}

/* Connect */
.connect {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: rgba(0,0,0,.32); border: 1px solid var(--brd-soft);
  border-radius: 14px; padding: 9px 9px 9px 15px;
}
.connect code {
  flex: 1; font-family: var(--mono); font-size: 13px;
  color: #d9d1ec; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .3px;
}
.copy {
  border: 1px solid var(--brd); background: var(--glass-2); color: var(--ink);
  border-radius: 10px; padding: 9px 13px; font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: .15s; white-space: nowrap; text-transform: uppercase; letter-spacing: .5px;
}
.copy:hover { background: var(--gold); color: #241300; border-color: var(--gold); }

/* Acciones */
.actions { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 18px; border: none; border-radius: 14px;
  font: inherit; font-weight: 800; font-size: 14px; letter-spacing: 1.2px; text-transform: uppercase;
  cursor: pointer; text-decoration: none; color: #241300;
  transition: transform .12s ease, filter .2s, box-shadow .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(90deg, var(--orange-deep), var(--gold)); box-shadow: 0 12px 32px rgba(255,138,61,.4); }
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 14px 40px rgba(255,138,61,.55); }
.btn-go { background: linear-gradient(90deg, var(--green), #57e39a); color: #052b17; box-shadow: 0 12px 32px rgba(53,208,127,.4); }
.btn-go:hover { filter: brightness(1.06); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { filter: brightness(1.1); }
.btn-danger { background: transparent; border: 1px solid rgba(248,81,73,.45); color: #ff8b86; }
.btn-danger:hover { background: rgba(248,81,73,.12); border-color: var(--red); }

.foot-note { margin-top: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }
.foot-note a { color: var(--gold-2); text-decoration: none; font-weight: 600; }
.foot-note a:hover { text-decoration: underline; }

/* ---------- Stats del servidor ---------- */
.statline { display: flex; gap: 10px; width: 100%; }
.stat {
  flex: 1;
  display: flex; align-items: center; gap: 11px;
  background: var(--glass); border: 1px solid var(--brd);
  border-radius: 14px; padding: 11px 14px 11px 12px; backdrop-filter: blur(12px);
  position: relative; overflow: hidden; text-align: left;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: currentColor; opacity: .95; }
.stat--online { color: var(--cyan); }
.stat--queue  { color: var(--pink); }
.stat--slots  { color: var(--gold); }
.stat-num { font-family: var(--font); font-style: italic; font-size: 24px; font-weight: 800; line-height: 1; color: currentColor; text-shadow: 0 0 22px currentColor; }
.stat-lbl { font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); line-height: 1.2; }

/* ---------- Footer ---------- */
.brand-foot {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted-2);
}
.brand-foot a { color: var(--muted-2); text-decoration: none; }
.brand-foot a:hover { color: var(--discord); }
.brand-foot span { color: var(--gold); text-shadow: 0 0 14px rgba(255,179,71,.45); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #14101e; border: 1px solid var(--brd); color: var(--ink);
  padding: 11px 20px; border-radius: 12px; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 10px 30px rgba(0,0,0,.6); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[hidden] { display: none !important; }

/* ---------- Responsive ---------- */

/* Pantallas medianas/estrechas: una sola columna, se permite scroll */
@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow-x: hidden; overflow-y: auto; }
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: clamp(18px, 3vh, 28px);
  }
  .hero-left { align-items: center; text-align: center; }
  .chips { justify-content: center; }
  .hero-tagline { max-width: 52ch; }
  .card { max-width: 560px; }
  .statline { max-width: 560px; }
}

@media (max-width: 480px) {
  .topbar .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .statline { flex-direction: column; }
  .stat { justify-content: flex-start; }
}

/* Pantallas muy bajas: reduce el logo para que nada se corte */
@media (min-width: 901px) and (max-height: 720px) {
  .hero-logo { max-width: min(320px, 100%); }
}
