/* ══════════════════════════════════════════════════════════════════════════════
   PLAYBUILD DESIGN SYSTEM — Deep Indigo / Amber / Premium Dark
   ══════════════════════════════════════════════════════════════════════════════ */
:root {
  --bg:         #06060f;
  --bg2:        #0c0c1d;
  --bg3:        #12122b;
  --bg4:        #1a1a3a;
  --primary:    #8b5cf6;
  --primary-dim:#7c3aed;
  --primary-muted: rgba(139,92,246,0.12);
  --accent:     #f59e0b;
  --accent-dim: #d97706;
  --accent-muted: rgba(245,158,11,0.12);
  --success:    #10b981;
  --success-dim:#059669;
  --danger:     #ef4444;
  --danger-dim: #dc2626;
  --cyan:       #06b6d4;
  --text:       #f1f5f9;
  --text-dim:   #64748b;
  --text-muted: #475569;
  --border:     #1e1e3e;
  --border-light: rgba(255,255,255,0.06);
  --glow-primary: 0 0 20px rgba(139,92,246,0.25), 0 0 60px rgba(139,92,246,0.08);
  --glow-accent: 0 0 20px rgba(245,158,11,0.3), 0 0 60px rgba(245,158,11,0.08);
  --glow-success: 0 0 20px rgba(16,185,129,0.3);
  --glass: rgba(12,12,29,0.7);
  --glass-border: rgba(255,255,255,0.08);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle radial glows */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(139,92,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(245,158,11,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(16px) } to { opacity:1; transform:translateY(0) } }
@keyframes scaleIn { from { opacity:0; transform:scale(0.95) } to { opacity:1; transform:scale(1) } }
@keyframes spin { to { transform:rotate(360deg) } }
@keyframes bootGlow {
  0%,100% { text-shadow: 0 0 20px rgba(139,92,246,0.4), 0 0 60px rgba(139,92,246,0.15); }
  50% { text-shadow: 0 0 40px rgba(139,92,246,0.6), 0 0 80px rgba(139,92,246,0.25); }
}
@keyframes bootBar { from { width:0 } to { width:100% } }
@keyframes bootFadeIn { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:translateY(0) } }
@keyframes ringFill { from { stroke-dashoffset: 283 } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes dropBounce { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width:6px; height:6px }
::-webkit-scrollbar-track { background:var(--bg) }
::-webkit-scrollbar-thumb { background:var(--bg4); border-radius:3px }
::-webkit-scrollbar-thumb:hover { background:var(--primary-dim) }

/* ══════════════════════════════════════════════════════════════════════════════
   BOOT SCREEN
   ══════════════════════════════════════════════════════════════════════════════ */
#boot {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.2rem;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#boot.gone { opacity:0; visibility:hidden; pointer-events:none }

.boot-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bootGlow 2.5s ease infinite;
  filter: drop-shadow(0 0 30px rgba(139,92,246,0.3));
}

.boot-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0;
  animation: bootFadeIn 0.4s ease forwards;
}

.boot-bar-wrap {
  width: min(320px, 70vw);
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.6rem;
}
.boot-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: bootBar 2.2s cubic-bezier(0.4,0,0.2,1) forwards;
  box-shadow: 0 0 12px rgba(139,92,246,0.5);
}

.boot-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: bootFadeIn 0.3s ease forwards;
}

/* ══════════════════════════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════════════════════════ */
#app { display:none; flex-direction:column; min-height:100vh; position:relative; z-index:1 }
#app.on { display:flex }

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6,6,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  display: flex; align-items: center;
  height: 64px;
  gap: 1.5rem;
}

.header-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  cursor: pointer;
  transition: filter 0.2s;
  text-decoration: none;
}
.header-logo:hover { filter: brightness(1.2) }
.header-logo-sub {
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  -webkit-text-fill-color: var(--text-dim);
  margin-left: 0.8rem;
}

.header-nav {
  display: flex; gap: 0.15rem;
  margin-left: 1.5rem;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display:none }

.nav-tab {
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: none;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.02em;
  position: relative;
}
.nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.04) }
.nav-tab.active {
  color: var(--primary);
  background: var(--primary-muted);
}
.nav-tab.active::after {
  content: '';
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 0.8rem;
  flex-shrink: 0;
}

.crosslink-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.crosslink-btn:hover {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 0 20px rgba(16,185,129,0.15);
  transform: translateY(-1px);
}

.section { display:none; flex:1; flex-direction:column; animation: fadeUp 0.35s ease both }
.section.active { display:flex }

/* ── SECTION: DASHBOARD HOME ── */
.hero {
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--primary), #c084fc, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}
.hero-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.7rem 1.8rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  color: #fff;
  box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(139,92,246,0.45);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--primary);
  background: var(--primary-muted);
  color: var(--primary);
}
.btn-sm {
  font-size: 0.78rem;
  padding: 0.5rem 1.2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 0 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover {
  border-color: rgba(139,92,246,0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 30px rgba(139,92,246,0.08);
}
.feature-card:hover::before { opacity:1 }

.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}
.feature-icon.purple { background: var(--primary-muted); }
.feature-icon.amber { background: var(--accent-muted); }
.feature-icon.green { background: rgba(16,185,129,0.12); }
.feature-icon.cyan { background: rgba(6,182,212,0.12); }
.feature-icon.red { background: rgba(239,68,68,0.12); }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.feature-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.feature-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  margin-top: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.feature-tag.ready { background: rgba(16,185,129,0.12); color: var(--success); }

/* ── COMMON PANEL STYLES ── */
.panel {
  background: var(--bg2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  animation: fadeUp 0.4s ease both;
}
.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.panel-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.panel-title .dot.purple { background: var(--primary); }
.panel-title .dot.amber { background: var(--accent); }
.panel-title .dot.green { background: var(--success); }

/* ── SECTION: CAPSULE ANALYZER ── */
.analyzer-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  min-height: 240px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.8rem;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-muted);
  animation: dropBounce 0.4s ease;
}
.upload-zone.has-image {
  padding: 0;
  border-style: solid;
  border-color: var(--border-light);
}
.upload-zone .upload-icon { font-size: 2.5rem; opacity: 0.6; }
.upload-zone .upload-text { font-size: 0.9rem; color: var(--text-dim); }
.upload-zone .upload-hint { font-size: 0.72rem; color: var(--text-muted); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview { width: 100%; border-radius: var(--radius); display: block; }
.upload-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }

.score-display {
  display: flex; flex-direction: column;
  align-items: center; gap: 1.2rem; padding: 1.5rem 0;
}
.score-ring-wrap { position: relative; width: 160px; height: 160px; }
.score-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: var(--bg4); stroke-width: 8; }
.score-ring-fill {
  fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 283; stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1), stroke 0.5s;
}
.score-ring-fill.good { stroke: var(--success); }
.score-ring-fill.ok { stroke: var(--accent); }
.score-ring-fill.bad { stroke: var(--danger); }
.score-value {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 2.5rem; font-weight: 800; color: var(--text);
}
.score-value small { font-size: 1rem; font-weight: 400; color: var(--text-dim); }
.score-label { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.score-grade {
  font-size: 0.78rem; font-weight: 700; padding: 0.3rem 1rem; border-radius: 50px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.score-grade.good { background: rgba(16,185,129,0.12); color: var(--success); }
.score-grade.ok { background: var(--accent-muted); color: var(--accent); }
.score-grade.bad { background: rgba(239,68,68,0.12); color: var(--danger); }

.suggestions-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.suggestion-item {
  display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.9rem 1rem;
  background: var(--bg3); border-radius: var(--radius-sm); border: 1px solid var(--border-light);
  transition: border-color 0.2s;
}
.suggestion-item:hover { border-color: var(--primary); }
.suggestion-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.suggestion-icon.warn { background: var(--accent-muted); }
.suggestion-icon.fix { background: rgba(239,68,68,0.12); }
.suggestion-icon.tip { background: rgba(16,185,129,0.12); }
.suggestion-text { font-size: 0.82rem; color: var(--text); line-height: 1.5; }
.suggestion-text strong { color: var(--primary); }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 2rem; gap: 1rem; text-align: center; color: var(--text-dim); min-height: 250px;
}
.empty-state .empty-icon { font-size: 3rem; opacity: 0.3; }
.empty-state p { font-size: 0.88rem; line-height: 1.5; }

/* ── SECTION: SHELF SIMULATOR ── */
.shelf-controls { display: flex; align-items: center; gap: 1rem; padding: 1.5rem 2rem; flex-wrap: wrap; }
.shelf-controls label { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; }
.shelf-select {
  font-family: var(--font); font-size: 0.82rem; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 0.45rem 0.8rem; border-radius: var(--radius-sm); outline: none;
  cursor: pointer; transition: border-color 0.2s;
}
.shelf-select:hover, .shelf-select:focus { border-color: var(--primary); }
.shelf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem; padding: 0 2rem 2rem; max-width: 1200px; margin: 0 auto; width: 100%;
}
.shelf-item { border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; transition: all 0.3s; position: relative; cursor: pointer; }
.shelf-item img { width: 100%; aspect-ratio: 460/215; object-fit: cover; display: block; transition: filter 0.3s; }
.shelf-item:hover img { filter: brightness(1.1); }
.shelf-item.user-capsule { border-color: var(--primary); box-shadow: var(--glow-primary); animation: dropBounce 0.5s ease; }
.shelf-item.user-capsule::after {
  content: 'YOUR CAPSULE'; position: absolute; top: 6px; right: 6px; font-size: 0.6rem; font-weight: 700;
  color: #fff; background: var(--primary); padding: 0.2rem 0.5rem; border-radius: 4px; letter-spacing: 0.08em;
}
.shelf-item-placeholder {
  width: 100%; aspect-ratio: 460/215; background: linear-gradient(135deg, var(--bg3), var(--bg4));
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.06em;
}

/* ── SECTION: PAGE ANALYZER ── */
.page-analyzer-input { display: flex; gap: 0.8rem; padding: 2rem; max-width: 800px; margin: 0 auto; width: 100%; flex-wrap: wrap; position: relative; z-index: 20; }
.url-input {
  flex: 1; font-family: var(--font-mono); font-size: 0.88rem; background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); padding: 0.7rem 1.2rem; border-radius: var(--radius); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; min-width: 280px;
}
.url-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.url-input::placeholder { color: var(--text-muted); }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; padding: 0 2rem 2rem; max-width: 1000px; margin: 0 auto; width: 100%; }
.metric-card { background: var(--bg2); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.5rem; text-align: center; transition: all 0.3s; }
.metric-card:hover { border-color: rgba(139,92,246,0.2); transform: translateY(-2px); }
.metric-label { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.8rem; }
.metric-score { font-size: 2rem; font-weight: 800; margin-bottom: 0.3rem; }
.metric-score.good { color: var(--success); }
.metric-score.ok { color: var(--accent); }
.metric-score.bad { color: var(--danger); }
.metric-score.neutral { color: var(--text-dim); }
.metric-bar { height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; margin-top: 0.8rem; }
.metric-bar-fill { height: 100%; border-radius: 2px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); width: 0%; }
.metric-bar-fill.good { background: var(--success); }
.metric-bar-fill.ok { background: var(--accent); }
.metric-bar-fill.bad { background: var(--danger); }

/* ── SECTION: VISIBILITY SCORE ── */
.visibility-hero { display: flex; flex-direction: column; align-items: center; padding: 3rem 2rem; gap: 1.5rem; }
.vis-ring-wrap { position: relative; width: 200px; height: 200px; }
.vis-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.vis-ring-bg { fill:none; stroke:var(--bg4); stroke-width:10 }
.vis-ring-fill {
  fill:none; stroke:var(--primary); stroke-width:10; stroke-linecap:round; stroke-dasharray:565; stroke-dashoffset:565;
  transition: stroke-dashoffset 2s cubic-bezier(0.4,0,0.2,1), stroke 0.5s;
}
.vis-ring-fill.good { stroke: var(--success); }
.vis-ring-fill.ok { stroke: var(--accent); }
.vis-score-center { position: absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align: center; }
.vis-score-num { font-size: 3.5rem; font-weight: 900; }
.vis-score-label { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.vis-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding: 0 2rem 3rem; max-width: 900px; margin: 0 auto; width: 100%; }
.vis-metric { background: var(--bg2); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.3rem; display: flex; align-items: center; gap: 1rem; transition: all 0.3s; }
.vis-metric:hover { border-color: rgba(139,92,246,0.2); transform: translateY(-2px); }
.vis-metric-icon { font-size: 1.5rem; flex-shrink: 0; }
.vis-metric-info { flex:1 }
.vis-metric-name { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; margin-bottom: 0.3rem; }
.vis-metric-score { font-size: 1.4rem; font-weight: 700; }

/* ── SECTION: LAUNCH CHECKLIST ── */
.checklist-wrap { max-width: 800px; margin: 0 auto; width: 100%; padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.checklist-group { background: var(--bg2); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.checklist-group-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.5rem; background: var(--bg3); border-bottom: 1px solid var(--border-light); cursor: pointer; }
.checklist-group-title { font-size: 0.92rem; font-weight: 700; display: flex; align-items: center; gap: 0.6rem; }
.checklist-group-progress { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; }
.checklist-items { padding: 0.5rem 0; }
.checklist-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 1.5rem; cursor: pointer; transition: background 0.15s; user-select: none; }
.checklist-item:hover { background: rgba(255,255,255,0.02); }
.check-box { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; font-size: 0.8rem; color: transparent; }
.checklist-item.checked .check-box { background: var(--success); border-color: var(--success); color: #fff; }
.check-label { font-size: 0.85rem; color: var(--text); transition: all 0.2s; }
.checklist-item.checked .check-label { color: var(--text-dim); text-decoration: line-through; }
.check-hint { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }
.checklist-progress-bar { height: 4px; background: var(--bg4); border-radius: 2px; margin: 0 1.5rem 1rem; overflow: hidden; }
.checklist-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 2px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

/* ── SECTION: RESEARCH & BLUEPRINTS (NEW) ── */
.research-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.blueprint-flow { display: flex; flex-direction: column; gap: 1.2rem; position: relative; padding-left: 1.5rem; margin-top: 0.5rem; }
.blueprint-flow::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.blueprint-node { position: relative; background: var(--bg3); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1.2rem; transition: all 0.25s; }
.blueprint-node:hover { border-color: var(--primary); transform: translateX(4px); }
.blueprint-node::before {
  content: '↓'; position: absolute; left: -21px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg2);
  color: #fff; font-size: 0.65rem; font-weight: bold; display: flex; align-items: center; justify-content: center;
}
.blueprint-node-title { font-size: 0.88rem; font-weight: 700; color: var(--accent); margin-bottom: 0.4rem; display: flex; align-items: center; justify-content: space-between; }
.blueprint-node-pct { font-size: 0.72rem; color: var(--text-dim); background: var(--bg4); padding: 0.15rem 0.5rem; border-radius: 4px; }
.blueprint-node-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }

.competitor-list { display: flex; flex-direction: column; gap: 0.8rem; }
.competitor-item {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem;
  background: var(--bg3); border: 1px solid var(--border-light); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: border-color 0.2s;
}
.competitor-item:hover { border-color: var(--primary); }
.competitor-img { width: 80px; aspect-ratio: 460/215; object-fit: cover; border-radius: 4px; border: 1px solid var(--border-light); }
.competitor-info { flex: 1; }
.competitor-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.competitor-id { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); margin-top: 0.2rem; }

.keyword-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.keyword-chip {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--cyan);
  background: rgba(6,182,212,0.08); border: 1px solid rgba(6,182,212,0.2);
  padding: 0.3rem 0.8rem; border-radius: 50px;
}

/* ── SECTION: ANALYTICS & TRENDS (NEW) ── */
.analytics-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.color-palette-list { display: flex; flex-direction: column; gap: 0.8rem; }
.color-palette-item { background: var(--bg3); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; transition: all 0.25s; }
.color-palette-item:hover { border-color: var(--primary); }
.color-palette-game { font-size: 0.82rem; font-weight: 600; color: var(--text); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-palette-swatches { display: flex; gap: 0.35rem; }
.color-swatch { width: 32px; height: 32px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); cursor: pointer; position: relative; transition: transform 0.2s; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch::after {
  content: attr(data-hex); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-6px);
  background: var(--bg); border: 1px solid var(--border); color: var(--text); font-family: var(--font-mono);
  font-size: 0.6rem; padding: 0.25rem 0.5rem; border-radius: 4px; opacity: 0; pointer-events: none;
  transition: opacity 0.15s; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 10;
}
.color-swatch:hover::after { opacity: 1; }

.tags-analytics-list { display: flex; flex-direction: column; gap: 0.8rem; }
.tag-analytics-item { display: flex; align-items: center; gap: 1rem; }
.tag-name { font-size: 0.8rem; color: var(--text); width: 140px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-weight: 500; }
.tag-progress-bar { flex: 1; height: 8px; background: var(--bg4); border-radius: 4px; overflow: hidden; }
.tag-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }
.tag-percentage { font-size: 0.78rem; color: var(--text-dim); width: 40px; text-align: right; font-family: var(--font-mono); }

/* ── SECTION HEADERS (per-section) ── */
.section-hero { padding: 2rem 2rem 1rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.section-hero h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.6rem; }
.section-hero p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; }

/* ── FOOTER ── */
.footer { border-top: 1px solid var(--border-light); padding: 1.2rem 2rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); background: rgba(6,6,15,0.6); flex-wrap: wrap; gap: 0.5rem; margin-top: auto; }
.footer a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ── TOAST ── */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(60px); background: linear-gradient(135deg, var(--primary), var(--primary-dim)); color: #fff; padding: 0.8rem 1.6rem; border-radius: var(--radius); font-size: 0.82rem; font-weight: 500; z-index: 5000; opacity: 0; transition: all 0.4s cubic-bezier(0.16,1,0.3,1); pointer-events: none; max-width: 90vw; text-align: center; box-shadow: 0 8px 30px rgba(139,92,246,0.3); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 768px) {
  .header { padding: 0 1rem; gap: 0.8rem }
  .header-logo-sub { display: none }
  .header-nav { margin-left: 0.5rem; gap: 0 }
  .nav-tab { padding: 0.4rem 0.7rem; font-size: 0.72rem }
  .analyzer-layout { grid-template-columns: 1fr; }
  .research-layout, .analytics-layout { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1.5rem 2rem }
  .hero h1 { font-size: 1.8rem }
  .features-grid { padding: 0 1.2rem 2rem; gap: 1rem }
  .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 0 1rem 1.5rem }
  .metrics-grid { padding: 0 1.2rem 2rem }
  .vis-breakdown { padding: 0 1.2rem 2rem }
  .checklist-wrap { padding: 1.5rem 1rem }
  .footer { padding: 1rem 1.2rem }
}
@media (max-width: 480px) {
  .header { height: 56px }
  .header-nav { display: none }
  .mobile-nav { display: flex !important }
  .crosslink-btn span.crosslink-text { display: none }
}

.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(6,6,15,0.95); backdrop-filter: blur(20px); border-top: 1px solid var(--border-light); z-index: 100; justify-content: space-around; padding: 0.5rem 0.3rem; gap: 0; }
.mobile-nav-btn { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; font-family: var(--font); font-size: 0.6rem; color: var(--text-dim); background: none; border: none; padding: 0.4rem 0.6rem; cursor: pointer; border-radius: 8px; transition: all 0.2s; }
.mobile-nav-btn:hover, .mobile-nav-btn.active { color: var(--primary); background: var(--primary-muted); }
.mobile-nav-btn .mn-icon { font-size: 1.1rem }

/* ── MODAL ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; padding: 1rem; }
.modal.show { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--bg2); border: 1px solid var(--primary-muted); border-radius: var(--radius-lg); width: 100%; max-width: 600px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 10px 40px rgba(0,0,0,0.5); transform: translateY(20px); transition: transform 0.3s; }
.modal.show .modal-content { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; }

/* ── STEAM-STYLE AUTOCOMPLETE DROPDOWN ── */
.autocomplete-wrapper { position: relative; flex-grow: 1; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
  background: #1b2838; border: 1px solid #4b6a88; border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  max-height: 320px; overflow-y: auto;
  opacity: 0; transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.autocomplete-dropdown.visible {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.autocomplete-dropdown .ac-header {
  padding: 0.5rem 0.75rem; font-size: 0.72rem; font-weight: 600;
  color: #8f98a0; letter-spacing: 0.04em; text-transform: none;
  border-bottom: 1px solid rgba(75,106,136,0.35);
  background: rgba(27,40,56,0.95);
}
.autocomplete-dropdown .ac-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.75rem; cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid rgba(75,106,136,0.15);
}
.autocomplete-dropdown .ac-item:last-child { border-bottom: none; }
.autocomplete-dropdown .ac-item:hover,
.autocomplete-dropdown .ac-item.ac-active {
  background: rgba(102,143,182,0.18);
}
.autocomplete-dropdown .ac-img {
  width: 120px; height: 45px; object-fit: cover;
  border-radius: 3px; flex-shrink: 0;
  background: #0e1a26;
}
.autocomplete-dropdown .ac-info { flex: 1; min-width: 0; }
.autocomplete-dropdown .ac-name {
  font-size: 0.82rem; font-weight: 500; color: #c6d4df;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.autocomplete-dropdown .ac-price {
  font-size: 0.7rem; color: #8f98a0; margin-top: 2px;
}
.autocomplete-dropdown .ac-price .ac-discount {
  background: #4c6b22; color: #a4d007; padding: 1px 4px;
  border-radius: 2px; font-weight: 700; font-size: 0.65rem; margin-right: 4px;
}
.autocomplete-dropdown .ac-price .ac-original {
  text-decoration: line-through; color: #6b7f8d; margin-right: 4px;
}
.autocomplete-dropdown .ac-footer {
  padding: 0.5rem 0.75rem; text-align: center;
  font-size: 0.72rem; color: #8f98a0; cursor: pointer;
  border-top: 1px solid rgba(75,106,136,0.35);
  transition: background 0.12s;
}
.autocomplete-dropdown .ac-footer:hover {
  background: rgba(102,143,182,0.18); color: #c6d4df;
}
.autocomplete-dropdown .ac-loading {
  padding: 1rem; text-align: center; color: #8f98a0;
  font-size: 0.78rem; font-style: italic;
}

/* ── DESCRIPTION EDITOR & GENERATOR SYSTEM ── */
.editor-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 3rem auto;
  width: 100%;
  padding: 0 2rem;
}

@media (max-width: 990px) {
  .editor-layout {
    grid-template-columns: 1fr;
    padding: 0 1.2rem;
  }
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.setting-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.platform-toggle {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  gap: 0.25rem;
}

.toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

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

.toggle-btn.active {
  background: var(--primary);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.raw-draft-input {
  width: 100%;
  height: 180px;
  min-height: 120px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.8rem 1rem;
  font-family: var(--font);
  font-size: 0.85rem;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.raw-draft-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Stepper Overlay */
.editor-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 29, 0.94);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: var(--radius-lg);
  gap: 2rem;
}

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

.loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(139, 92, 246, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.stepper-wrap {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.step-item {
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.step-item.active {
  color: var(--accent);
  font-weight: 600;
  opacity: 1;
  transform: translateX(4px);
}

.step-item.done {
  color: var(--success);
  opacity: 0.8;
  font-weight: 500;
}

.step-item.done::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

/* Results Formatting styling */
.editor-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.editor-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.editor-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.editor-tab-btn.active {
  color: var(--primary);
  background: var(--primary-muted);
}

.editor-tab-content {
  display: none;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 0.8rem;
  flex-grow: 1;
}

.editor-tab-content.active {
  display: flex;
}

.preview-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preview-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  color: #c6d4df;
  font-size: 0.82rem;
  min-height: 48px;
}

.preview-box h2, .preview-box h3 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.2rem;
  margin-top: 1rem;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-box h2:first-child, .preview-box h3:first-child {
  margin-top: 0;
}

.preview-box ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}

.preview-box li {
  margin-bottom: 0.3rem;
}

.preview-box p {
  margin-bottom: 0.8rem;
}

.preview-box p:last-child {
  margin-bottom: 0;
}

.code-textarea {
  width: 100%;
  height: 380px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 1rem;
  outline: none;
  resize: vertical;
}

.code-textarea:focus {
  border-color: var(--primary);
}