:root {
  --board-bg: rgba(255, 255, 255, 0.9);
  --board-border: #bfdbfe;
  --rank-bg: #ffffff;
  --rank-border: #dbeafe;
  --rank-name: #0f172a;
  --rank-meta: #64748b;
  --footer: #64748b;
}

html[data-theme="dark"] {
  --board-bg: rgba(15, 23, 42, 0.9);
  --board-border: #334155;
  --rank-bg: #0b1222;
  --rank-border: #334155;
  --rank-name: #e2e8f0;
  --rank-meta: #94a3b8;
  --footer: #94a3b8;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 34px 0 54px;
}

.brand-logo {
  margin: 0 0 18px;
  font-size: clamp(36px, 8vw, 74px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  background: linear-gradient(90deg, #1d4ed8 0%, #7c3aed 45%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 30px rgba(124, 58, 237, 0.25);
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 26px;
  backdrop-filter: blur(8px);
  box-shadow: var(--elev-shadow);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(90deg, #f472b6, #a78bfa, #60a5fa);
  color: #fff;
}

.title {
  margin: 16px 0 12px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0f172a, #1d4ed8 45%, #7e22ce 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.features {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.feature:nth-child(1) { background: linear-gradient(135deg, #fee2e2, #fef3c7); }
.feature:nth-child(2) { background: linear-gradient(135deg, #dbeafe, #e0e7ff); }
.feature:nth-child(3) { background: linear-gradient(135deg, #cffafe, #dcfce7); }
.feature:nth-child(4) { background: linear-gradient(135deg, #fae8ff, #fce7f3); }
.feature:nth-child(5) { background: linear-gradient(135deg, #fde68a, #fca5a5); }

.panel-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1e1b4b;
}

.panel-subtitle {
  margin: 8px 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stat-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(148, 163, 184, 0.2);
}

.stat-item.primary {
  background: linear-gradient(140deg, #1d4ed8, #0ea5e9 65%, #22d3ee);
  color: #fff;
}

.stat-item.secondary {
  background: linear-gradient(140deg, #a21caf, #ec4899 70%, #fb7185);
  color: #fff;
}

.stat-label {
  font-size: 13px;
  opacity: 0.92;
  margin-bottom: 4px;
}

.stat-value {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  line-height: 1.1;
}

.live-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  animation: livePulse 1.6s ease-in-out infinite;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
  animation: dotBlink 1.4s ease-out infinite;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.92; }
}

@keyframes dotBlink {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.checklist {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.checklist li {
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: #1f2937;
}

.leaderboard-wrap {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.big-leaderboard {
  background: var(--board-bg);
  border: 1px solid var(--board-border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--elev-shadow);
}

.big-leaderboard-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 900;
  color: #1e3a8a;
}

.big-leaderboard-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  color: #475569;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--rank-bg);
  border: 1px solid var(--rank-border);
  border-radius: 14px;
  padding: 12px;
}

.rank-item.loyal {
  grid-template-columns: 1fr auto;
}

.rank-no {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
}

.rank-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.rank-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--rank-name);
}

.rank-meta {
  font-size: 12px;
  color: var(--rank-meta);
}

.rank-score {
  font-size: 14px;
  font-weight: 900;
  color: #be185d;
}

.loyal-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pair-avatar-stack {
  display: inline-flex;
  align-items: center;
}

.pair-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  background: #eff6ff;
}

.pair-avatar + .pair-avatar {
  margin-left: -8px;
}

.empty-rank {
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed #bfdbfe;
  font-size: 14px;
  color: #64748b;
  text-align: center;
}

.footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--footer);
}

html[data-theme="dark"] .feature {
  color: #0f172a;
}

html[data-theme="dark"] .checklist li {
  color: #ffffff;
}

html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .big-leaderboard-title {
  color: #bfdbfe;
}

html[data-theme="dark"] .panel-subtitle,
html[data-theme="dark"] .big-leaderboard-subtitle {
  color: #cbd5e1;
}

html[data-theme="dark"] .auth-login {
  background: #0b1222;
  border-color: #334155;
  color: #cbd5e1;
}

html[data-theme="dark"] .input-field {
  background: #0b1222;
  border-color: #334155;
  color: #e2e8f0;
}

.cta-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cta-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cta-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.cta-channel { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.cta-group { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.cta-bot { background: linear-gradient(135deg, #16a34a, #22c55e); }

.auth-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-field:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-full {
  width: 100%;
}

.auth-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.auth-login {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.auth-register {
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #ffffff;
}

.brand-signature {
  color: #000000;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 2px 2px #fe2c55;
  animation: flicker 5s infinite alternate;
  text-decoration: none;
  cursor: pointer;
}

@keyframes flicker {
  0% { opacity: 1; text-shadow: 2px 2px #fe2c55; transform: translate(0, 0); }
  10% { opacity: 0.85; text-shadow: 1px 1px #fe2c55; transform: translate(-1px, 0); }
  20% { opacity: 1; text-shadow: 3px 3px #fe2c55; transform: translate(1px, 0); }
  30% { opacity: 0.9; text-shadow: 2px 2px #fe2c55; transform: translate(0, -1px); }
  40% { opacity: 1; text-shadow: 2px 2px #fe2c55; transform: translate(0, 1px); }
  50% { opacity: 0.8; text-shadow: 1px 1px #fe2c55; transform: translate(-1px, 1px); }
  60% { opacity: 1; text-shadow: 3px 3px #fe2c55; transform: translate(1px, -1px); }
  70% { opacity: 0.9; text-shadow: 2px 2px #fe2c55; transform: translate(0, 0); }
  80% { opacity: 1; text-shadow: 3px 3px #fe2c55; transform: translate(1px, 1px); }
  90% { opacity: 0.85; text-shadow: 1px 1px #fe2c55; transform: translate(-1px, -1px); }
  100% { opacity: 1; text-shadow: 2px 2px #fe2c55; transform: translate(0, 0); }
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .leaderboard-wrap { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .cta-row { grid-template-columns: 1fr; }
  .auth-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .live-value,
  .live-dot,
  .brand-signature {
    animation: none;
  }
}
