/* ============================================================
   BitHero — estilos de autenticación + panel del jugador.
   Carga DESPUÉS de styles.css (reutiliza sus tokens).
   ============================================================ */

/* ---------- Banner de demostración ---------- */
.demo-banner {
  background: repeating-linear-gradient(135deg, rgba(231,135,43,.16) 0 14px, rgba(231,135,43,.08) 14px 28px);
  border-bottom: 1px solid rgba(231,135,43,.35);
  color: var(--text);
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 9px 16px;
  position: relative;
  z-index: 60;
}
.demo-banner strong { color: var(--orange); }

/* ============================================================
   AUTENTICACIÓN (login / registro)
   ============================================================ */
.auth-wrap {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 48px 22px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid rgba(96,97,97,.45);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow);
}
.auth-card .auth-logo { display: block; height: 34px; width: auto; margin: 0 auto 22px; }
.auth-card h1 { font-size: 26px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--text-dim); font-size: 14.5px; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
  letter-spacing: .02em;
}
.field input {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder { color: #8a8a8a; }
.field input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(231,135,43,.18);
}
.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 20px; line-height: 1.5;
}
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--orange); flex-shrink: 0; }
.check a { color: var(--orange); }

.auth-card .btn { width: 100%; justify-content: center; }
.auth-error {
  background: rgba(238,50,51,.12);
  border: 1px solid rgba(238,50,51,.4);
  color: #ff9a9a;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 18px;
  display: none;
}
.auth-error.show { display: block; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-disabled); font-size: 12px;
  margin: 22px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(96,97,97,.4); }
.auth-alt { text-align: center; font-size: 14px; color: var(--text-dim); margin-top: 22px; }
.auth-alt a { color: var(--orange); font-weight: 600; }
.auth-note { font-size: 11.5px; color: var(--text-disabled); text-align: center; margin-top: 22px; line-height: 1.6; }

/* ============================================================
   PANEL DEL JUGADOR
   ============================================================ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* Topbar */
.app-topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 22px;
  background: #1f1f1f;
  border-bottom: 1px solid rgba(96,97,97,.4);
  position: sticky; top: 0; z-index: 40;
}
.app-topbar .brand img { height: 26px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.wallet-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2);
  border: 1px solid rgba(231,135,43,.4);
  border-radius: 999px;
  padding: 7px 15px;
}
.wallet-chip .lbl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.wallet-chip .val { font-size: 16px; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #5b5c5a, #3f403e);
  border: 1px solid rgba(231,135,43,.5);
  display: grid; place-items: center; overflow: hidden;
}
.user-chip .avatar img { width: 84%; }
.user-chip .uname { font-size: 14px; font-weight: 600; }
.user-chip .urank { font-size: 11px; color: var(--orange); }
.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--text); }

/* Sidebar */
.app-side {
  background: #1c1c1c;
  border-right: 1px solid rgba(96,97,97,.4);
  padding: 22px 14px;
}
.app-side nav { display: grid; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 11px;
  color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
  font-family: var(--font); transition: background .2s, color .2s;
}
.side-link svg { width: 19px; height: 19px; flex-shrink: 0; }
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.active { background: rgba(231,135,43,.14); color: var(--orange); }
.side-foot { margin-top: 18px; padding: 14px; font-size: 11px; color: var(--text-disabled); line-height: 1.6; border-top: 1px solid rgba(96,97,97,.3); }

/* Contenido */
.app-main { padding: 30px clamp(18px, 3vw, 38px) 60px; max-width: 1080px; }
.view { display: none; animation: fade .3s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 22px; }
.view-head h2 { font-size: clamp(24px, 3.5vw, 34px); }
.view-head p { color: var(--text-dim); font-size: 15px; margin: 4px 0 0; }

.panel-grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: 1.4fr 1fr; }
.box {
  background: var(--surface);
  border: 1px solid rgba(96,97,97,.4);
  border-radius: var(--radius);
  padding: 24px;
}
.box h3 { color: var(--text); font-size: 17px; margin-bottom: 16px; }
.box-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); display: block; margin-bottom: 6px; }

/* ---------- Subasta vigente ---------- */
.auction { background: linear-gradient(180deg, rgba(231,135,43,.08), var(--surface) 55%); border-color: rgba(231,135,43,.3); }
.auction-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.auction-id { font-size: 13px; color: var(--text-dim); }
.auction-id b { color: var(--text); }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.live-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(238,50,51,.6); } 50% { box-shadow: 0 0 0 7px rgba(238,50,51,0); } }

.clock-xl { font-size: clamp(46px, 11vw, 70px); font-weight: 800; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); }
.clock-xl.urgent { color: var(--red); }
.clock-cap { text-align: center; font-size: 12px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; margin-top: 8px; }
.pot { margin: 22px 0 6px; }
.pot .pot-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.pot .pot-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pot .pot-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-bright)); width: 50%; transition: width .6s ease; }

/* Tu jugada */
.your-bit { display: flex; gap: 12px; align-items: stretch; margin-top: 6px; }
.your-bit input {
  flex: 1; font-family: var(--font); font-size: 22px; font-weight: 700;
  text-align: center; color: var(--text);
  background: var(--bg); border: 2px solid var(--border); border-radius: 12px; padding: 10px;
  font-variant-numeric: tabular-nums;
}
.your-bit input:focus { outline: none; border-color: var(--orange); }
.your-bit .btn { white-space: nowrap; }
.bit-help { font-size: 12.5px; color: var(--text-dim); margin-top: 10px; }

/* Estado de la jugada */
.bit-state { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; margin-top: 14px; font-weight: 600; font-size: 15px; border: 1px solid transparent; }
.bit-state .badge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.bit-state.win { background: rgba(231,135,43,.14); border-color: rgba(231,135,43,.45); color: var(--orange); }
.bit-state.win .badge { background: var(--orange); color: #242424; }
.bit-state.unique { background: rgba(247,149,55,.1); border-color: rgba(247,149,55,.35); color: var(--orange-bright); }
.bit-state.unique .badge { background: var(--orange-bright); color: #242424; }
.bit-state.dup { background: rgba(238,50,51,.12); border-color: rgba(238,50,51,.4); color: #ff9a9a; }
.bit-state.dup .badge { background: var(--red); color: #fff; }
.bit-state.none { background: var(--surface-2); border-color: rgba(96,97,97,.4); color: var(--text-dim); }
.bit-state.none .badge { background: var(--border); color: var(--text); }

/* Ranking de la ronda */
.round-list { display: grid; gap: 8px; }
.round-row {
  display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; background: var(--bg); font-size: 14px;
}
.round-row.me { background: rgba(231,135,43,.12); border: 1px solid rgba(231,135,43,.35); }
.round-row .pos { font-weight: 800; color: var(--text-dim); }
.round-row .who { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-row .who .tagme { color: var(--orange); font-size: 11px; font-weight: 700; margin-left: 6px; }
.round-row .amount { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.round-row .st { width: 11px; height: 11px; border-radius: 50%; }
.st.s-win { background: var(--orange); }
.st.s-uni { background: var(--orange-bright); }
.st.s-dup { background: var(--red); }

/* ---------- Tablas / historial ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid rgba(96,97,97,.4); }
.table td { padding: 13px 12px; border-bottom: 1px solid rgba(96,97,97,.22); color: var(--text-dim); }
.table td b { color: var(--text); font-weight: 600; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.won { background: rgba(231,135,43,.16); color: var(--orange); }
.pill.lost { background: rgba(96,97,97,.22); color: var(--text-dim); }

/* ---------- Rango / avatar ---------- */
.rank-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.rank-hero .avatar-big { width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle at 50% 42%, rgba(231,135,43,.25), transparent 60%), radial-gradient(circle, #5b5c5a, #3f403e 70%); display: grid; place-items: center; border: 1px solid rgba(231,135,43,.45); }
.rank-hero .avatar-big img { width: 78%; }
.rank-hero .rk h2 { font-size: 30px; color: var(--text); }
.rank-hero .rk p { color: var(--text-dim); font-size: 14px; }
.xp { margin-top: 16px; }
.xp .xp-bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.xp .xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-bright)); }
.rank-track { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 22px; }
.rank-node { text-align: center; padding: 16px 8px; border-radius: 12px; background: var(--bg); border: 1px solid rgba(96,97,97,.3); font-size: 13px; color: var(--text-dim); }
.rank-node.done { border-color: rgba(231,135,43,.5); color: var(--orange); }
.rank-node.current { background: rgba(231,135,43,.14); border-color: var(--orange); color: var(--orange); font-weight: 700; }
.rank-node b { display: block; font-size: 15px; color: inherit; }

/* ---------- Herramientas ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.tool { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 12px; background: var(--bg); border: 1px solid rgba(96,97,97,.35); }
.tool .ic { width: 46px; height: 46px; border-radius: 11px; background: rgba(231,135,43,.14); color: var(--orange); display: grid; place-items: center; flex-shrink: 0; }
.tool .ic svg { width: 24px; height: 24px; }
.tool h4 { font-size: 15px; color: var(--text); margin-bottom: 2px; }
.tool p { font-size: 12.5px; color: var(--text-dim); margin: 0; }
.tool .count { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--orange); }

/* ---------- Actividad ---------- */
.feed { display: grid; gap: 2px; }
.feed-row { display: flex; gap: 14px; align-items: flex-start; padding: 13px 4px; border-bottom: 1px solid rgba(96,97,97,.2); }
.feed-row .fic { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--orange); display: grid; place-items: center; flex-shrink: 0; }
.feed-row .fic svg { width: 17px; height: 17px; }
.feed-row .ftxt { font-size: 14px; color: var(--text); }
.feed-row .ftxt span { display: block; font-size: 12px; color: var(--text-disabled); margin-top: 2px; }

/* Footer mini del panel */
.app-foot { grid-column: 1 / -1; border-top: 1px solid rgba(96,97,97,.3); padding: 18px 22px; font-size: 11.5px; color: var(--text-disabled); text-align: center; line-height: 1.6; background: #1c1c1c; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(40px); background: var(--surface-2); border: 1px solid rgba(231,135,43,.5); color: var(--text); padding: 13px 22px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 100; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Botón menú móvil del panel */
.app-menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; cursor: pointer; }
.app-menu-btn svg { width: 20px; height: 20px; color: var(--text); display: block; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .app-side {
    position: fixed; top: 64px; bottom: 0; left: 0; width: 244px; z-index: 45;
    transform: translateX(-105%); transition: transform .3s var(--ease-back);
  }
  .app-side.open { transform: none; }
  .app-menu-btn { display: block; }
  .cols-2 { grid-template-columns: 1fr; }
  .wallet-chip .lbl { display: none; }
}
@media (max-width: 560px) {
  .tool-grid, .rank-track { grid-template-columns: 1fr; }
  .user-chip .uname, .user-chip .urank { display: none; }
  .round-row { grid-template-columns: 26px 1fr auto auto; gap: 8px; }
}
