/* === Mind10 Public Site — Shared Styles === */
:root {
  --bg: #0f1115;
  --bg-grad: linear-gradient(180deg, #0f1115 0%, #131620 100%);
  --panel: #181b22;
  --panel-2: #20242e;
  --border: #2a2f3a;
  --text: #e7eaf0;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --accent-hover: #6aa1ff;
  --success: #34d399;
  --error: #f87171;
  --warn: #fbbf24;
  --duel: #a855f7;
  --duel-bg: #1a0f2e;
  --gold: #fbbf24;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* === NAV === */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,21,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-inner {
  max-width: 900px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: -0.5px;
  text-decoration: none;
}
.nav-logo img { width: 24px; height: 24px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* === LOGO === */
.logo-hero { width: 80px; height: 80px; margin: 0 auto 16px; display: block; }
.logo-inline { width: 24px; height: 24px; vertical-align: middle; display: inline-block; }

/* === LAYOUT === */
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
.center { text-align: center; }

/* === HERO === */
.hero { text-align: center; padding: 60px 20px 40px; }
.hero h1 { font-size: 42px; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.hero h1 .accent { color: var(--accent); }
.hero p { font-size: 18px; color: var(--muted); max-width: 500px; margin: 0 auto 32px; }
.hero-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.badge {
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; font-size: 13px; color: var(--muted); font-weight: 600;
}

/* === BUTTONS === */
.btn {
  display: inline-block; padding: 14px 32px; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--panel); color: var(--text); }
.btn-duel { background: var(--duel); color: white; }
.btn-duel:hover { background: #c084fc; color: white; }

/* === CARDS === */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; margin-bottom: 16px;
}
.card-hover:hover { border-color: var(--accent); }

/* === FEATURES === */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 40px 0; }
.feature {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; text-align: center;
}
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.feature p { font-size: 13px; color: var(--muted); }

/* === SUPPORTER AVATAR FRAMES (animated, matches app) === */
/* Galaxy: purple/pink/blue rotating sweep + glow + sparks */
/* Fire: orange/gold rotating sweep + glow + sparks         */
/* Ice: light-blue/white rotating sweep + glow + sparks     */

@keyframes frame-rotate {
  to { transform: rotate(360deg); }
}

@keyframes frame-glow-galaxy {
  0%, 100% { box-shadow: 0 0 6px 2px rgba(124,58,237,0.25); }
  50%      { box-shadow: 0 0 14px 4px rgba(124,58,237,0.6); }
}
@keyframes frame-glow-fire {
  0%, 100% { box-shadow: 0 0 6px 2px rgba(255,69,0,0.25); }
  50%      { box-shadow: 0 0 14px 4px rgba(255,69,0,0.6); }
}
@keyframes frame-glow-ice {
  0%, 100% { box-shadow: 0 0 6px 2px rgba(129,212,250,0.25); }
  50%      { box-shadow: 0 0 14px 4px rgba(129,212,250,0.6); }
}

/* Wrapper needed for rotating conic-gradient border */
.frame-wrapper {
  position: relative;
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Ranking avatars (36px) */
.frame-wrapper > .rank-avatar {
  width: 36px; height: 36px;
}
.frame-wrapper > .rank-avatar-placeholder {
  width: 36px; height: 36px; font-size: 16px;
}
/* Profile avatars (88px) */
.frame-wrapper > .profile-avatar {
  width: 88px; height: 88px;
}
.frame-wrapper > .profile-avatar-placeholder {
  width: 88px; height: 88px; font-size: 36px;
}
.frame-wrapper::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  z-index: 0;
}
/* The avatar sits above the rotating border */
.frame-wrapper > .rank-avatar,
.frame-wrapper > .rank-avatar-placeholder,
.frame-wrapper > .profile-avatar,
.frame-wrapper > .profile-avatar-placeholder {
  position: relative;
  z-index: 1;
  border: none !important;
}

/* Galaxy frame — rotating gradient on ::before only, avatar stays static */
.frame-galaxy::before {
  background: conic-gradient(from 0deg, #7c3aed, #ec4899, #3b82f6, #7c3aed);
  animation: frame-rotate 6s linear infinite;
}
.frame-galaxy > .rank-avatar,
.frame-galaxy > .profile-avatar,
.frame-galaxy > .rank-avatar-placeholder,
.frame-galaxy > .profile-avatar-placeholder {
  animation: frame-glow-galaxy 2.5s ease-in-out infinite;
}

/* Fire frame */
.frame-fire::before {
  background: conic-gradient(from 0deg, #ff4500, #ffa500, #ffd700, #ff4500);
  animation: frame-rotate 6s linear infinite;
}
.frame-fire > .rank-avatar,
.frame-fire > .profile-avatar,
.frame-fire > .rank-avatar-placeholder,
.frame-fire > .profile-avatar-placeholder {
  animation: frame-glow-fire 2.5s ease-in-out infinite;
}

/* Ice frame */
.frame-ice::before {
  background: conic-gradient(from 0deg, #e0f7fa, #81d4fa, #b3e5fc, #e0f7fa);
  animation: frame-rotate 8s linear infinite;
}
.frame-ice > .rank-avatar,
.frame-ice > .profile-avatar,
.frame-ice > .rank-avatar-placeholder,
.frame-ice > .profile-avatar-placeholder {
  animation: frame-glow-ice 2.5s ease-in-out infinite;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .frame-galaxy::before, .frame-fire::before, .frame-ice::before {
    animation: none;
  }
  .frame-galaxy > .rank-avatar,
  .frame-galaxy > .profile-avatar,
  .frame-galaxy > .rank-avatar-placeholder,
  .frame-galaxy > .profile-avatar-placeholder,
  .frame-fire > .rank-avatar,
  .frame-fire > .profile-avatar,
  .frame-fire > .rank-avatar-placeholder,
  .frame-fire > .profile-avatar-placeholder,
  .frame-ice > .rank-avatar,
  .frame-ice > .profile-avatar,
  .frame-ice > .rank-avatar-placeholder,
  .frame-ice > .profile-avatar-placeholder {
    animation: none;
  }
}

/* === RANKING TABLE === */
.rank-tabs {
  display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.rank-tab {
  padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.rank-tab:hover { color: var(--text); }
.rank-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.rank-tab.active.duel { background: var(--duel); border-color: var(--duel); }

.rank-list { list-style: none; }
.rank-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 8px; transition: border-color 0.2s;
}
.rank-item:hover { border-color: var(--accent); }
.rank-num { font-size: 18px; font-weight: 800; color: var(--muted); min-width: 32px; text-align: center; }
.rank-num.top1 { color: var(--gold); }
.rank-num.top2 { color: var(--silver); }
.rank-num.top3 { color: var(--bronze); }
.rank-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: var(--panel-2); flex-shrink: 0;
}
.rank-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 16px; color: var(--muted);
}
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 600; }
.rank-meta { font-size: 11px; color: var(--muted); }
.rank-score { font-size: 18px; font-weight: 800; color: var(--accent); }
.rank-score.duel { color: var(--duel); }

/* === DUEL DETAIL === */
.duel-header { text-align: center; padding: 20px 0; }
.duel-result { font-size: 28px; font-weight: 900; margin-bottom: 16px; }
.duel-result.victory { color: var(--success); }
.duel-result.defeat { color: var(--error); }
.duel-result.draw { color: var(--accent); }
.duel-scores { display: flex; justify-content: center; align-items: center; gap: 30px; }
.duel-score-col { text-align: center; }
.duel-score-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.duel-score-val { font-size: 36px; font-weight: 800; }
.duel-vs { font-size: 16px; color: var(--muted); }

.duel-q {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.duel-q-text { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.duel-q-cat { font-size: 11px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.duel-opt {
  padding: 8px 12px; border-radius: 8px; margin-bottom: 4px; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.duel-opt.correct { background: rgba(52,211,153,0.15); color: var(--success); }
.duel-opt.wrong { background: rgba(248,113,113,0.12); color: var(--error); }
.duel-opt.neutral { background: var(--panel-2); color: var(--muted); }
.duel-opt-who { font-size: 10px; font-weight: 700; }
.duel-answer-summary {
  display: flex; justify-content: space-between; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px;
}

/* === FOOTER === */
.footer {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border); margin-top: 40px;
}
.footer a { margin: 0 8px; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 12px; }
  .duel-scores { gap: 20px; }
  .duel-score-val { font-size: 28px; }
  .profile-header-top { flex-direction: column; text-align: center; }
  .profile-header-info { text-align: center; }
  .profile-meta { justify-content: center; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-duel-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === PROFILE PAGE === */
.profile-page { max-width: 600px; }

.profile-header { padding: 28px 24px; }
.profile-header-top {
  display: flex; gap: 20px; align-items: center; margin-bottom: 24px;
}
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  background: var(--panel-2); flex-shrink: 0;
}
.profile-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--muted);
}
.profile-header-info { flex: 1; min-width: 0; }
.profile-username {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.supporter-badge {
  color: var(--accent); font-size: 18px; font-weight: 400;
}
.profile-bio {
  font-size: 14px; color: var(--text); margin: 6px 0 10px;
  line-height: 1.5; opacity: 0.9;
}
.profile-meta {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.profile-meta-item { font-weight: 600; }

.profile-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.profile-stat { text-align: center; }
.profile-stat-value {
  font-size: 24px; font-weight: 800; color: var(--accent);
}
.profile-stat-label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 2px;
}

.profile-section-title {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
}

.profile-categories { display: flex; flex-direction: column; gap: 12px; }
.profile-cat-header {
  display: flex; justify-content: space-between; margin-bottom: 4px;
  font-size: 13px;
}
.profile-cat-label { color: var(--text); font-weight: 600; }
.profile-cat-value { color: var(--muted); font-weight: 700; }
.profile-cat-bar {
  height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden;
}
.profile-cat-fill {
  height: 100%; border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.profile-duel-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
