@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-0: #07070c;
  --bg-1: #0d0d16;
  --surface: rgba(20, 20, 32, 0.55);
  --surface-2: rgba(30, 30, 48, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0ff;
  --text-dim: #a5a9c4;
  --text-mute: #6e7190;
  --accent: #7c5cff;
  --accent-2: #00e5ff;
  --accent-3: #ffd166;
  --success: #22e6a5;
  --danger: #ff5c7a;
  --grad-primary: linear-gradient(135deg, #7c5cff 0%, #00e5ff 100%);
  --grad-gold: linear-gradient(135deg, #ffd166 0%, #ff8a3d 100%);
  --grad-success: linear-gradient(135deg, #22e6a5 0%, #00e5ff 100%);
  --shadow-lg: 0 20px 60px -20px rgba(0,0,0,0.6);
  --shadow-md: 0 12px 40px -12px rgba(0,0,0,0.5);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
}

[data-theme="light"] {
  --bg-0: #f4f5fb;
  --bg-1: #e9ebf6;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(255, 255, 255, 0.9);
  --border: rgba(20, 20, 40, 0.08);
  --border-strong: rgba(20, 20, 40, 0.16);
  --text: #14142b;
  --text-dim: #4a4d6b;
  --text-mute: #7d80a0;
  --accent: #5b3cff;
  --accent-2: #0088a8;
  --accent-3: #c98a00;
  --success: #0ea47a;
  --danger: #d63a5a;
  --shadow-lg: 0 20px 60px -20px rgba(60,60,120,0.25);
  --shadow-md: 0 12px 40px -12px rgba(60,60,120,0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body { height: 100%; }

body {
  background: var(--bg-0);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px 16px 40px;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: -50%;
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 92, 255, 0.35), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(0, 229, 255, 0.25), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(255, 209, 102, 0.15), transparent 50%);
  filter: blur(80px);
  z-index: -2;
  animation: aurora 22s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  z-index: -1;
  pointer-events: none;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 92, 255, 0.25), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(0, 180, 220, 0.2), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(255, 180, 80, 0.18), transparent 50%);
  filter: blur(90px);
}

[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(20,20,40,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,20,40,0.05) 1px, transparent 1px);
}

@keyframes aurora {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3%, -2%) scale(1.05); }
  100% { transform: translate(-3%, 2%) scale(1.02); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

/* ============ HEADER ============ */
header {
  width: 100%;
  max-width: 520px;
  margin-bottom: 22px;
  padding: 22px 20px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 0% 50%, rgba(124,92,255,0.28), transparent 40%),
    radial-gradient(circle at 100% 50%, rgba(0,229,255,0.2), transparent 40%);
  pointer-events: none;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124,92,255,0.6), transparent 40%, rgba(0,229,255,0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  gap: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.brand-logo-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,0.55), rgba(0,229,255,0.25) 50%, transparent 70%);
  filter: blur(11px);
  animation: logoPulse 3.5s ease-in-out infinite;
  z-index: 0;
}

.brand-logo-wrap::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #7c5cff, #00e5ff, #ffd166, #7c5cff);
  filter: blur(5px);
  opacity: 0.6;
  animation: spinGlow 6s linear infinite;
  z-index: 0;
}

.brand-logo-ring {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(30,30,48,0.95), rgba(12,12,22,0.95));
  border: 1.5px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
  box-shadow: inset 0 0 20px rgba(124,92,255,0.35), 0 0 20px rgba(124,92,255,0.35);
}

.brand-logo-ring img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(124,92,255,0.9));
  animation: logoFloat 4s ease-in-out infinite;
}

.brand-logo-ring img.hidden { display: none; }

.brand-logo-ring .brand-fallback {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(124,92,255,0.9));
}

@keyframes logoPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.12); }
}
@keyframes spinGlow { to { transform: rotate(360deg); } }
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 0%, #a8b6ff 55%, #00e5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .brand-name {
  background: linear-gradient(135deg, #14142b 0%, #5b3cff 55%, #0088a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  flex-shrink: 0;
  font-family: inherit;
}

.theme-toggle svg { width: 14px; height: 14px; }

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(124,92,255,0.45);
}

/* ============ CONTAINER ============ */
.container {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
  animation: fadeUp 0.5s ease both;
}

h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

h3 { font-weight: 700; letter-spacing: -0.01em; }

/* ============ MENÚ ADMIN ============ */
.admin-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.menu-btn {
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
}

.menu-btn svg { width: 14px; height: 14px; }

.menu-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.menu-btn.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(124,92,255,0.7);
}

.view-section { display: none; }
.view-section.active { display: block; animation: fadeUp 0.35s ease both; }

/* ============ FORM ============ */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.25s ease;
  font-family: inherit;
}

[data-theme="light"] input { background: rgba(255,255,255,0.7); }
input::placeholder { color: var(--text-mute); font-weight: 400; }

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124,92,255,0.18);
  background: rgba(0,0,0,0.35);
}

[data-theme="light"] input:focus { background: #fff; }

/* ============ BOTONES ============ */
.btn {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
  background: var(--surface-2);
  color: var(--text);
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  text-decoration: none;
}

.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-aqua {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px -10px rgba(124,92,255,0.6);
}
.btn-aqua:hover { box-shadow: 0 15px 40px -10px rgba(124,92,255,0.85); }

.btn-yellow {
  background: var(--grad-gold);
  color: #1a1200;
  border: none;
  box-shadow: 0 10px 30px -10px rgba(255,180,60,0.6);
}
.btn-yellow:hover { box-shadow: 0 15px 40px -10px rgba(255,180,60,0.85); }

.btn-green {
  background: var(--grad-success);
  color: #00221a;
  border: none;
  box-shadow: 0 10px 30px -10px rgba(34,230,165,0.6);
}
.btn-green:hover { box-shadow: 0 15px 40px -10px rgba(34,230,165,0.85); }

/* ============ CARD ============ */
.card-info {
  background: var(--surface-2);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 18px;
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: fadeUp 0.4s ease both;
}

.points-badge {
  font-size: 2.7rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 12px 0 4px;
  filter: drop-shadow(0 0 22px rgba(255,180,60,0.55));
}

/* ============ HISTORIAL ============ */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  margin-bottom: 6px;
}

[data-theme="light"] .history-item { background: rgba(20,20,40,0.04); }

/* ============ RANKING ============ */
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

[data-theme="light"] .rank-item { background: rgba(20,20,40,0.04); }

.rank-item.rank-top {
  background: linear-gradient(135deg, rgba(255,209,102,0.12), rgba(255,138,61,0.08));
  border-color: rgba(255,209,102,0.3);
}

.rank-pos {
  font-size: 1.4rem;
  font-weight: 900;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

/* ============ TABLA ============ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 0.85rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.25);
}

[data-theme="light"] th { background: rgba(20,20,40,0.04); }
tbody tr { transition: background 0.2s ease; }
tbody tr:hover { background: rgba(124,92,255,0.08); }
tbody tr:last-child td { border-bottom: none; }

hr {
  margin: 26px 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.25s ease both;
}

.modal-overlay.hidden { display: none; }

.modal-content {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease both;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover { color: var(--danger); border-color: var(--danger); }
.modal-close svg { width: 14px; height: 14px; }

/* ============ TOASTS ============ */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}

.toast {
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s cubic-bezier(0.2, 1, 0.3, 1) both;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-icon svg { width: 13px; height: 13px; }
.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background: rgba(34,230,165,0.18); color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { background: rgba(255,92,122,0.18); color: var(--danger); }
.toast.info { border-left-color: var(--accent-2); }
.toast.info .toast-icon { background: rgba(0,229,255,0.18); color: var(--accent-2); }

.toast-title { font-weight: 700; margin-bottom: 2px; font-size: 0.88rem; }
.toast-msg { color: var(--text-dim); font-size: 0.8rem; line-height: 1.45; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-16px) scale(0.96); }
}

/* ============ ANIMACIÓN FLOTANTE ============ */
.floating-points {
  position: fixed;
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(255,180,60,0.9));
  pointer-events: none;
  z-index: 9999;
  animation: floatUp 1.6s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20%  { opacity: 1; transform: translate(-50%, -80%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}

/* ============ LOCK SCREEN ============ */
.lock-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
  background: var(--bg-0);
}

.lock-screen::before {
  content: '';
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 92, 255, 0.35), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(0, 229, 255, 0.25), transparent 45%);
  filter: blur(80px);
  z-index: 0;
  animation: aurora 22s ease-in-out infinite alternate;
}

.lock-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.5s ease both;
}

.lock-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(30,30,48,0.95), rgba(12,12,22,0.95));
  border: 1.5px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 22px rgba(124,92,255,0.35), 0 0 30px rgba(124,92,255,0.45);
}

.lock-logo img { width: 76%; height: 76%; object-fit: contain; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 28px;
}

.pin-dots.shake { animation: shake 0.5s ease; }

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(124,92,255,0.8);
  transform: scale(1.1);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-key:hover {
  border-color: var(--accent);
  background: rgba(124,92,255,0.12);
}

.pin-key:active {
  transform: scale(0.92);
  background: var(--accent);
  color: #fff;
}

.pin-key-fn {
  color: var(--text-dim);
  font-size: 1.2rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 420px) {
  header { padding: 18px 16px; }
  .brand-logo-wrap, .brand-logo-ring { width: 56px; height: 56px; }
  .brand-logo-ring .brand-fallback { font-size: 1.6rem; }
  .brand-name { font-size: 1.05rem; }
  .brand-sub { font-size: 0.55rem; letter-spacing: 0.16em; }
  .theme-toggle { padding: 7px 10px; font-size: 0.68rem; }
  .theme-toggle span { display: none; }
  .container { padding: 20px; }
  h2 { font-size: 1.15rem; }
  .points-badge { font-size: 2.2rem; }
}

@media (max-width: 360px) {
  .brand-wrapper { gap: 10px; }
  .brand-logo-wrap, .brand-logo-ring { width: 50px; height: 50px; }
  .brand-name { font-size: 0.95rem; }
  .brand-sub { font-size: 0.5rem; }
}

/* ============ PWA STANDALONE ============ */
html.pwa-standalone body {
  padding-top: max(20px, env(safe-area-inset-top, 20px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
}

html.pwa-standalone #pwa-install-btn { display: none !important; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
/* ============================================================
   SPLASH SCREEN CUSTOM (degradado rosa → azul)
============================================================ */
#genesis-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff5fa2 0%, #7c5cff 50%, #00e5ff 100%);
  background-size: 200% 200%;
  animation: splashGradient 6s ease infinite;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#genesis-splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#genesis-splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.15), transparent 45%);
  pointer-events: none;
}

.splash-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: splashZoom 0.8s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.splash-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(255,255,255,0.4),
    inset 0 0 30px rgba(255,255,255,0.2);
  margin-bottom: 24px;
  animation: splashFloat 2.5s ease-in-out infinite;
}

.splash-logo img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.splash-fallback {
  font-size: 3.5rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.splash-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.25);
  margin-bottom: 4px;
}

.splash-sub {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px;
}

.splash-loader {
  display: flex;
  gap: 10px;
}

.splash-loader span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 16px rgba(255,255,255,0.8);
  animation: splashDots 1.4s ease-in-out infinite;
}

.splash-loader span:nth-child(2) { animation-delay: 0.2s; }
.splash-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splashGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes splashZoom {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes splashDots {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1.2); opacity: 1; }
}