@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0e;
  --bg2:         #111118;
  --bg3:         #1a1a26;
  --bg4:         #22223a;
  --accent:      #ff66ab;
  --accent2:     #ff3380;
  --glow:        rgba(255,102,171,0.25);
  --glow2:       rgba(255,102,171,0.08);
  --blue:        #66b3ff;
  --blue-glow:   rgba(102,179,255,0.2);
  --text:        #eeeef8;
  --text-muted:  #7070a0;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.14);
  --radius:      14px;
  --radius-sm:   8px;
  --sans:        'DM Sans', sans-serif;
  --mono:        'Space Mono', monospace;
  --sidebar-w:   320px;
  --nav-h:       60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── LANDING ────────────────────────────────────────── */
.landing {
  position: relative;
  overflow-x: hidden;
}

#hero-canvas, #particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

[hidden] { display: none !important; }

/* (hero + login-btn defined in consolidated block below) */

/* (landing styles consolidated in appended block below) */

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes ripple {
  from { transform: scale(0.8); opacity: 0.6; }
  to   { transform: scale(1.4); opacity: 0; }
}

/* ─── DASHBOARD ──────────────────────────────────────── */
.dash { display: flex; min-height: 100vh; flex-direction: column; }

/* NAV */
nav.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,10,14,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-brand svg { width: 28px; height: 28px; filter: drop-shadow(0 0 8px var(--accent)); flex-shrink: 0; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  background: var(--bg3);
}

.nav-username {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.nav-logout {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}

.nav-logout:hover { color: var(--accent); border-color: rgba(255,102,171,0.4); }

/* BODY LAYOUT */
.dash-body {
  display: flex;
  padding-top: var(--nav-h);
  flex: 1;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 12px;
}

/* Mode selector */
.mode-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  margin-bottom: 12px;
}

.mode-tab {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 7px 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mode-tab.active {
  background: var(--bg3);
  border-color: rgba(255,102,171,0.4);
  color: var(--accent);
}

.mode-tab:hover:not(.active) { border-color: var(--border2); color: var(--text); }

/* Score type tabs */
.score-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.score-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.score-tab.active { color: var(--accent); border-color: var(--accent); }
.score-tab:hover:not(.active) { color: var(--text); }

/* Score list */
.score-list { flex: 1; overflow-y: auto; padding: 0 12px; }

.score-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
  margin-bottom: 6px;
}

.score-item:hover { background: var(--bg3); border-color: var(--border); }
.score-item.active-score { background: var(--bg3); border-color: rgba(255,102,171,0.3); }

.score-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.score-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.rank-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--mono);
  flex-shrink: 0;
}

.rank-X, .rank-XH { background: rgba(255,200,60,0.2); color: #ffc83c; }
.rank-S, .rank-SH { background: rgba(255,200,80,0.15); color: #ffcb50; }
.rank-A { background: rgba(60,220,100,0.15); color: #3cdc64; }
.rank-B { background: rgba(60,130,255,0.15); color: #4682ff; }
.rank-C { background: rgba(180,60,255,0.15); color: #b43cff; }
.rank-D { background: rgba(255,60,60,0.15); color: #ff4040; }

.score-item-stats {
  display: flex;
  gap: 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.score-item-pp { color: var(--accent); font-weight: 700; }

.sidebar-refresh {
  padding: 12px;
  margin-top: 8px;
}

.btn-refresh {
  width: 100%;
  padding: 9px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-refresh:hover { border-color: var(--border2); color: var(--text); }

.score-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ─── MAIN ───────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  max-width: 900px;
}

/* Input tabs */
.input-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  width: fit-content;
}

.input-tab {
  padding: 8px 22px;
  border-radius: calc(var(--radius) - 4px);
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.input-tab.active { background: var(--bg3); color: var(--text); }
.input-tab:hover:not(.active) { color: var(--text); }

.input-panel { display: none; }
.input-panel.active { display: block; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  background: var(--bg2);
  overflow: hidden;
}

.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--glow2), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(255,102,171,0.04);
}

.dropzone:hover::before, .dropzone.dragover::before { opacity: 1; }

.dropzone-icon { font-size: 2.5rem; margin-bottom: 16px; display: block; }

.dropzone h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Score URL input */
.score-url-form { display: flex; flex-direction: column; gap: 12px; }

.input-field {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { border-color: rgba(255,102,171,0.5); box-shadow: 0 0 0 3px var(--glow2); }

/* Customization bar */
.customize-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0;
}

.customize-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customize-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Template picker */
.template-picker {
  display: flex;
  gap: 8px;
}

.tpl-btn {
  padding: 7px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tpl-btn.active {
  background: rgba(255,102,171,0.12);
  border-color: rgba(255,102,171,0.5);
  color: var(--accent);
}

.tpl-btn:hover:not(.active) { border-color: var(--border2); color: var(--text); }

/* Color picker */
.color-row { display: flex; align-items: center; gap: 8px; }

.color-input-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border2);
  cursor: pointer;
}

.color-input-wrap input[type="color"] {
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  border: none;
  cursor: pointer;
  padding: 0;
  background: none;
}

.color-hex {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 70px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  outline: none;
  color: var(--text);
}

/* Resolution toggle */
.res-toggle { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }

.res-btn {
  padding: 7px 16px;
  background: var(--bg3);
  border: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid var(--border);
}

.res-btn:last-child { border-right: none; }
.res-btn.active { background: rgba(255,102,171,0.12); color: var(--accent); }

/* Generate button */
.btn-generate {
  padding: 14px 40px;
  background: var(--accent);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 0 24px var(--glow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 0 40px var(--glow); }
.btn-generate:active { transform: none; }
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Loading */
.loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  gap: 20px;
}

.loader.visible { display: flex; }

.loader-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--bg4);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 16px var(--glow);
}

.loader p { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; }

/* Preview */
.preview-section {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fade-up 0.5s ease both;
}

.preview-section.visible { display: flex; }

.preview-img-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  position: relative;
}

.preview-img-wrap img {
  width: 100%;
  display: block;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-download, .btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.btn-download {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--glow);
}

.btn-download:hover { box-shadow: 0 0 28px var(--glow); transform: translateY(-1px); }

.btn-copy {
  background: var(--bg2);
  color: var(--text);
}

.btn-copy:hover { border-color: var(--border2); background: var(--bg3); }

.preview-res-toggle {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-left: auto;
}

.preview-res-btn {
  padding: 8px 14px;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.preview-res-btn:last-child { border-right: none; }
.preview-res-btn.active { background: var(--bg3); color: var(--accent); }

/* ─── TOASTS ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border2);
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 320px;
  animation: fade-up 0.3s ease both;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.toast.success { border-color: rgba(60,220,100,0.4); color: #3cdc64; }
.toast.error   { border-color: rgba(255,80,80,0.4); color: #ff5050; }
.toast.info    { border-color: rgba(102,179,255,0.4); color: var(--blue); }

.toast-close {
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin-left: auto;
  padding: 0;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* ─── UTILS ──────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE — index.html classes
   ═══════════════════════════════════════════════════════════ */

#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 50;
  background: rgba(10,10,14,0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-login {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s;
}
.nav-login:hover { color: var(--accent); border-color: rgba(255,102,171,0.4); }

/* Hero — centered single column */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 60px) 24px 80px;
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: rgba(255,102,171,0.08);
  border: 1px solid rgba(255,102,171,0.22);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  animation: fade-up 0.6s ease both;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.04em;
  animation: fade-up 0.7s 0.08s ease both;
}
.hero-title .accent { color: var(--accent); }

.hero-sub {
  margin-top: 22px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  animation: fade-up 0.7s 0.16s ease both;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 16px 34px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 32px var(--glow), 0 4px 20px rgba(255,102,171,0.3);
  animation: fade-up 0.7s 0.24s ease both;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 0 48px var(--glow), 0 8px 28px rgba(255,102,171,0.4); }
.login-btn:active { transform: none; }

.hero-hint {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  animation: fade-up 0.7s 0.3s ease both;
}

/* Sections — shared container */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 44px;
}

/* Features section */
.features {
  position: relative;
  z-index: 1;
  padding: 80px 40px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  text-align: left;
}

.template-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.template-card:hover {
  border-color: rgba(255,102,171,0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.5);
}

.tc-preview {
  position: relative;
  height: 130px;
  overflow: hidden;
}

.tc-dark .tc-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a0e22, #0e1a2e);
}
.tc-dark .tc-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
}
.tc-dark .tc-content {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}
.tc-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--glow);
}
.tc-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tc-line { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.15); }
.tl-wide { width: 80%; }
.tl-med  { width: 55%; }
.tl-white { background: rgba(255,255,255,0.25); }
.tl-dim   { background: rgba(255,255,255,0.1); }
.tc-pp-big { font-size: 1.5rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.tc-pp-big small { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }

.tc-minimal .tc-solid-bg {
  position: absolute; inset: 0;
  background: #0a0a0a;
}
.tc-content-min {
  position: absolute !important;
  inset: 0;
  display: flex !important;
  align-items: stretch;
  padding: 0 !important;
  gap: 0 !important;
}
.tc-av-sm {
  width: 36px; height: 36px;
  margin: 16px 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  flex-shrink: 0;
  align-self: flex-start;
}
.tc-divider {
  width: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 0;
  flex-shrink: 0;
}
.tc-content-min .tc-lines { padding: 12px; flex: 1; }
.tc-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.tc-cell { display: flex; flex-direction: column; gap: 3px; }
.tc-cell-val { height: 9px; border-radius: 3px; background: rgba(255,255,255,0.2); }
.tc-cell-lbl { height: 6px; border-radius: 2px; background: rgba(255,255,255,0.08); width: 70%; }

.tc-glass .tc-bg-glass {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a0e2a, #0e1a2e);
}
.tc-glass-panel {
  position: absolute; inset: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 10px;
  backdrop-filter: blur(4px);
}
.tc-av-glow {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: 0 0 14px var(--glow);
  flex-shrink: 0;
}
.tc-glass-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  flex: 1;
}
.tc-mini-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  height: 28px;
}

.tc-retro-bg {
  position: absolute; inset: 0;
  background: #000;
  overflow: hidden;
}
.tc-scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,0.35) 2px, rgba(0,0,0,0.35) 4px
  );
  pointer-events: none;
}
.tc-retro-content {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 10px;
  z-index: 1;
}
.tc-pixel-avatar {
  width: 38px; height: 38px;
  background: var(--accent);
  flex-shrink: 0;
  image-rendering: pixelated;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.4), inset 3px 3px 0 rgba(255,255,255,0.2);
}
.tc-retro-text { display: flex; flex-direction: column; gap: 4px; }
.tc-r-line {
  font-family: 'Courier New', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  color: #00ff41;
  text-shadow: 0 0 4px #00ff41;
  white-space: nowrap;
}
.r2 { color: var(--accent); text-shadow: 0 0 6px var(--accent); }
.r3 { font-size: 0.45rem; color: #aaa; text-shadow: none; }
.tc-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  z-index: 0;
  pointer-events: none;
}
.tc-info { padding: 14px 16px; }
.tc-name { font-size: 0.88rem; font-weight: 700; margin-bottom: 5px; }
.tc-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* How it works */
.how-it-works {
  position: relative;
  z-index: 1;
  padding: 60px 40px 80px;
}
.hiw-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.hiw-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 240px;
  text-align: left;
}
.hiw-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  font-family: var(--mono);
  flex-shrink: 0;
}
.hiw-text h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.hiw-text p  { font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; }
.hiw-arrow { font-size: 1.4rem; color: var(--text-muted); opacity: 0.3; padding-top: 4px; }

/* Landing footer */
.landing-footer {
  position: relative;
  z-index: 1;
  padding: 28px 40px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.landing-footer a { color: var(--accent); text-decoration: none; }
.footer-sep { opacity: 0.3; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — dashboard.html classes
   ═══════════════════════════════════════════════════════════ */

body.dashboard { display: block; }

/* Dashboard nav */
.dash-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,10,14,0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Dashboard layout */
.dash-layout {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* Sidebar */
.dash-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 0 12px;
  overflow: hidden;
}

.sidebar-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 18px;
  margin-bottom: 12px;
}

/* Score type tabs */
.score-type-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.stt-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.stt-btn.active { color: var(--accent); border-color: var(--accent); }
.stt-btn:hover:not(.active) { color: var(--text); }

/* Mode tabs */
.mode-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  margin-bottom: 10px;
}

.mode-btn {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-btn svg { width: 16px; height: 16px; }
.mode-btn.active { background: var(--bg3); border-color: rgba(255,102,171,0.4); color: var(--accent); }
.mode-btn:hover:not(.active) { border-color: var(--border2); color: var(--text); }

/* Score list */
.score-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
}

.score-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.spinner-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--bg4);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.score-error {
  padding: 20px 12px;
  text-align: center;
  color: #ff5050;
  font-size: 0.8rem;
  line-height: 1.6;
}
.score-error small { color: var(--text-muted); font-size: 0.72rem; }

/* Score item */
.score-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.score-item:hover { background: var(--bg3); border-color: var(--border); }
.score-item.selected {
  background: rgba(255,102,171,0.07);
  border-color: rgba(255,102,171,0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}
.score-item.selected:hover { background: rgba(255,102,171,0.11); }

.si-rank {
  min-width: 30px;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.rank-x  { background: rgba(255,200,60,0.2);  color: #ffc83c; }
.rank-s  { background: rgba(255,200,80,0.15); color: #ffcb50; }
.rank-a  { background: rgba(60,220,100,0.15); color: #3cdc64; }
.rank-b  { background: rgba(60,130,255,0.15); color: #4682ff; }
.rank-c  { background: rgba(180,60,255,0.15); color: #b43cff; }
.rank-d  { background: rgba(255,60,60,0.15);  color: #ff4040; }

.si-info { flex: 1; min-width: 0; }
.si-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.si-diff {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 4px;
}
.si-meta { display: flex; gap: 8px; font-size: 0.72rem; font-family: var(--mono); color: var(--text-muted); }
.si-pp { color: var(--accent); font-weight: 700; }

/* Refresh button */
.refresh-btn {
  margin: 8px 12px 0;
  padding: 9px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}
.refresh-btn svg { width: 14px; height: 14px; }
.refresh-btn:hover { border-color: var(--border2); color: var(--text); }

/* Main content */
.dash-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input section */
.input-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.input-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  padding: 0;
  width: auto;
  gap: 0;
}

.input-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 22px;
  border-radius: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.input-tab svg { width: 15px; height: 15px; }
.input-tab.active { color: var(--accent); border-color: var(--accent); }
.input-tab:hover:not(.active) { color: var(--text); }

.input-panels { padding: 0; }
.input-panel { display: none; }
.input-panel.active { display: block; }

/* URL form */
.url-form {
  display: flex;
  gap: 10px;
  padding: 20px;
  align-items: center;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.url-input::placeholder { color: var(--text-muted); }
.url-input:focus { border-color: rgba(255,102,171,0.5); box-shadow: 0 0 0 3px var(--glow2); }

/* Generate button */
.generate-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 0 20px var(--glow);
  white-space: nowrap;
  flex-shrink: 0;
}
.generate-btn svg { width: 14px; height: 14px; }
.generate-btn:hover { transform: translateY(-1px); box-shadow: 0 0 32px var(--glow); }
.generate-btn:active { transform: none; }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border2);
  border-radius: 0;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: transparent;
  position: relative;
}
.dropzone:hover, .dropzone.dz-hover { border-color: var(--accent); background: rgba(255,102,171,0.04); }
.dz-icon { margin-bottom: 14px; }
.dz-icon svg { width: 48px; height: 48px; color: var(--text-muted); }
.dz-text { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.dz-text code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); color: var(--accent); }
.dz-sub { font-size: 0.82rem; color: var(--text-muted); }
.dz-link { color: var(--accent); cursor: pointer; }
.dz-filename {
  margin-top: 10px;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--accent);
  background: rgba(255,102,171,0.1);
  padding: 4px 12px;
  border-radius: 100px;
  display: inline-block;
}

.input-panel #panel-upload .generate-btn {
  display: flex;
  width: calc(100% - 40px);
  margin: 16px 20px 20px;
  justify-content: center;
}

/* Customize bar */
.customize-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cb-group { display: flex; flex-direction: column; gap: 7px; }

.cb-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Template picker */
.template-picker { display: flex; gap: 6px; flex-wrap: wrap; }

.tp-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tp-btn.active {
  background: rgba(255,102,171,0.1);
  border-color: rgba(255,102,171,0.45);
  color: var(--accent);
}
.tp-btn:hover:not(.active) { border-color: var(--border2); color: var(--text); }

.tp-icon {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.tp-dark    { background: linear-gradient(135deg, #1a0e22, #0e1a2e); border: 1px solid rgba(255,102,171,0.4); }
.tp-minimal { background: #0a0a0a; border: 1px solid rgba(255,255,255,0.15); }
.tp-glass   { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); }
.tp-retro   { background: #000; border: 1px solid #00ff41; }
.tp-thumb   { background: linear-gradient(135deg, #0d1117, #161b22); border: 1px solid rgba(255,102,171,0.25); }

/* Color picker */
.color-wrap { display: flex; align-items: center; gap: 8px; }

.color-input {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  cursor: pointer;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--accent);
}
.color-swatch:hover { transform: scale(1.08); box-shadow: 0 0 8px var(--glow); }

/* Resolution toggle */
.res-toggle { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }

.res-btn {
  padding: 7px 14px;
  background: var(--bg3);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.res-btn:last-child { border-right: none; }
.res-btn.active { background: rgba(255,102,171,0.1); color: var(--accent); }

/* Generating state */
.generating-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gen-spinner { display: flex; align-items: center; justify-content: center; }

.osu-spinner {
  width: 60px;
  height: 60px;
  animation: spin 1.2s linear infinite;
  filter: drop-shadow(0 0 10px var(--accent));
}

.gen-text { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }

/* Preview */
.preview-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fade-up 0.4s ease both;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.preview-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-select-wrap { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

.dl-res-btn {
  padding: 6px 12px;
  background: var(--bg3);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.dl-res-btn:last-child { border-right: none; }
.dl-res-btn.active { background: rgba(255,102,171,0.1); color: var(--accent); }

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn svg { width: 14px; height: 14px; }
.action-btn:hover { border-color: var(--border2); background: var(--bg4); }
.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--glow);
}
.action-btn.primary:hover { box-shadow: 0 0 24px var(--glow); transform: translateY(-1px); }

.preview-img-wrap { overflow: hidden; background: #000; }
.preview-img { width: 100%; display: block; }

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border2);
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}
.toast-visible { opacity: 1; transform: translateX(0); }
.toast-success { border-color: rgba(60,220,100,0.4); color: #3cdc64; }
.toast-error   { border-color: rgba(255,80,80,0.4);  color: #ff5050; }
.toast-warn    { border-color: rgba(255,180,60,0.4); color: #ffb43c; }
.toast-info    { border-color: rgba(102,179,255,0.4); color: var(--blue); }

/* Upload panel layout */
#panel-upload {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#panel-upload .generate-btn {
  margin: 12px 20px 20px;
  align-self: flex-start;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { flex-direction: column; padding: 100px 32px 60px; text-align: center; }
  .hero-visual { display: none; }
  .features, .how-it-works { padding: 60px 24px; }
  .dash-sidebar { display: none; }
  .dash-main { margin-left: 0; padding: 24px 20px; }
  .hiw-steps { flex-direction: column; align-items: flex-start; }
  .hiw-arrow { transform: rotate(90deg); }
}
