/* ============================================================
   TOCAYJUEGA — Estilos de autenticación (login / registro)
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #07071a;
  --surface:  #0d0d26;
  --surface2: #12122e;
  --border:   rgba(255, 255, 255, .09);
  --accent:   #ff2d55;
  --accent2:  #7c3aed;
  --text:     #f0f0ff;
  --muted:    rgba(255, 255, 255, .5);
  --ok:       #10b981;
  --err:      #ff4d6d;
}

/* ── Barra de scroll a juego con el tema ───────────────── */
html { scrollbar-width: thin; scrollbar-color: var(--accent2) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(124, 58, 237, .25), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(255, 45, 85, .18), transparent 55%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.page {
  width: 100%;
  max-width: 420px;
}

/* ── Logo ──────────────────────────────────────────────── */
.logo {
  text-align: center;
  margin-bottom: 22px;
}
.logo-icon {
  font-size: 2.6rem;
  display: inline-block;
  filter: drop-shadow(0 6px 18px rgba(124, 58, 237, .5));
}
.logo-img {
  width: 88px;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 6px 22px rgba(255, 45, 85, .45));
}

/* ── Pantalla de inicio (splash + precarga) ────────────── */
#tj-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  background:
    radial-gradient(900px 600px at 50% 30%, rgba(255, 47, 143, .22), transparent 70%),
    radial-gradient(700px 480px at 50% 90%, rgba(124, 58, 237, .18), transparent 70%),
    #060713;
  transition: opacity .6s ease;
}
#tj-splash.tj-hide { opacity: 0; pointer-events: none; }
#tj-splash .tj-logo {
  width: 148px;
  height: auto;
  filter: drop-shadow(0 0 26px rgba(255, 47, 143, .45));
  animation: tj-logo-in .8s ease both, tj-logo-pulse 2.4s ease-in-out .8s infinite;
}
@keyframes tj-logo-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes tj-logo-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
#tj-splash .tj-loader {
  width: min(74vw, 260px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
#tj-splash.tj-loading .tj-loader { opacity: 1; transform: translateY(0); }
#tj-splash .tj-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
}
#tj-splash .tj-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2f8f, #7c3aed);
  box-shadow: 0 0 14px rgba(255, 47, 143, .6);
}
#tj-splash.tj-loading .tj-bar-fill { animation: tj-fill 1.8s linear forwards; }
@keyframes tj-fill { from { width: 0; } to { width: 100%; } }
#tj-splash .tj-pct {
  font-family: 'Orbitron', sans-serif;
  font-size: .8rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, .7);
}
.logo h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.9rem;
  letter-spacing: 2px;
  margin-top: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo p {
  font-size: .78rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
}

/* ── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: 1px;
  transition: all .18s ease;
}
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 18px rgba(255, 45, 85, .35);
}

/* ── Card ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

/* ── Mensajes ──────────────────────────────────────────── */
.error-msg,
.errors {
  background: rgba(255, 77, 109, .12);
  border: 1px solid rgba(255, 77, 109, .35);
  color: var(--err);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .85rem;
  margin-bottom: 16px;
}
.errors strong { display: block; margin-bottom: 6px; }
.errors ul { margin: 0; padding-left: 18px; }
.errors li { margin: 2px 0; }

/* ── Campos ────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field-wrap {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field-wrap:focus-within {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}
.field-wrap .fi {
  font-size: 1.05rem;
  margin-right: 8px;
  opacity: .9;
}
.field-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .95rem;
  padding: 13px 0;
  font-family: inherit;
}
.field-wrap input::placeholder { color: rgba(255, 255, 255, .28); }

/* ── Botón ─────────────────────────────────────────────── */
.btn {
  width: 100%;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: 1px;
  padding: 14px 0;
  border-radius: 12px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 26px rgba(255, 45, 85, .35);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 14px 32px rgba(124, 58, 237, .45); }
.btn:active { transform: translateY(1px) scale(.99); }

/* ── Notas ─────────────────────────────────────────────── */
.coins-note {
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
  margin-top: 16px;
  padding: 11px 12px;
  background: rgba(245, 158, 11, .1);
  border: 1px solid rgba(245, 158, 11, .28);
  border-radius: 12px;
}
.coins-note span {
  color: #ffd166;
  font-weight: 700;
}
.hint {
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
  margin-top: 14px;
}
.hint a {
  color: #8ab4ff;
  text-decoration: none;
  font-weight: 600;
}
.hint a:hover { text-decoration: underline; }

/* ── Botón Instalar app (PWA) ──────────────────────────── */
.btn-install {
  width: 100%;
  margin-top: 14px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: 1px;
  color: var(--text);
  padding: 13px 0;
  border-radius: 12px;
  background: rgba(124, 58, 237, .14);
  border: 1px solid rgba(124, 58, 237, .5);
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.btn-install:hover {
  background: rgba(124, 58, 237, .26);
  box-shadow: 0 8px 22px rgba(124, 58, 237, .35);
}
.btn-install:active { transform: translateY(1px) scale(.99); }

.install-ios {
  margin-top: 14px;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  line-height: 1.5;
}
.install-ios b { color: var(--text); }
