:root {
  --bg-dark: #0e1324;
  --panel-bg: rgba(21, 29, 48, 0.88);
  --card-bg: linear-gradient(155deg, #17203a 0%, #10162b 100%);
  --border-subtle: rgba(255, 255, 255, 0.11);
  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-pink: #f472b6;
  --accent-gold: #fbbf24;
  --accent-emerald: #34d399;
  --accent-rose: #fb7185;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-main: 'Prompt', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 60px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: -2;
}

.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}
.glow-1 { top: -120px; left: -100px; background: var(--accent-indigo); }
.glow-2 { bottom: -120px; right: -100px; background: var(--accent-cyan); }
.glow-3 { top: 35%; left: 45%; width: 380px; height: 380px; background: var(--accent-pink); opacity: 0.12; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.brand-badge {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(244, 114, 182, 0.2));
  color: #f9a8d4;
  border: 1px solid rgba(244, 114, 182, 0.4);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

.site-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-header .accent {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  color: #e2e8f0;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 455px 1fr;
  gap: 26px;
  align-items: start;
}

@media (max-width: 1040px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.step-box {
  background: var(--panel-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.highlight-step {
  border-color: rgba(56, 189, 248, 0.35);
}
.studio-box {
  border-color: rgba(129, 140, 248, 0.35);
}
.match-box {
  border-color: rgba(244, 114, 182, 0.38);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.step-num {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.studio-tag {
  background: rgba(129, 140, 248, 0.22);
  color: #c7d2fe;
}
.match-tag {
  background: rgba(244, 114, 182, 0.22);
  color: #fbcfe8;
}

.step-header h2 {
  font-size: 0.98rem;
  font-weight: 600;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

textarea, input[type="text"], select {
  width: 100%;
  background: rgba(10, 14, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.8rem;
  padding: 8px 10px;
}

textarea {
  font-family: var(--font-mono);
  resize: vertical;
  margin-bottom: 10px;
}

textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* Avatar Studio Drawer */
.studio-drawer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-field label {
  font-size: 0.73rem;
  color: #cbd5e1;
  font-weight: 500;
}

.studio-field input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(10, 14, 26, 0.85);
  cursor: pointer;
  padding: 2px;
}

/* Relationship Mode Selector */
.rel-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.rel-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 6px;
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.rel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.rel-btn.active {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.28), rgba(129, 140, 248, 0.28));
  border-color: var(--accent-pink);
  color: #fff;
}

.sample-compare-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sample-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
}

/* Buttons */
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  color: #fff;
  flex: 1;
}
.btn-accent:hover { filter: brightness(1.12); transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { color: var(--text-main); border-color: rgba(255,255,255,0.28); }

.preset-roster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.preset-person-btn {
  text-align: left;
  justify-content: flex-start;
  font-size: 0.74rem;
  padding: 7px 9px;
}

.preset-person-btn.active {
  box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(244, 114, 182, 0.5);
  filter: brightness(1.18);
}

.btn-sample-pink {
  background: rgba(244, 114, 182, 0.16);
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.4);
}
.btn-sample-pink:hover { background: rgba(244, 114, 182, 0.26); }

.btn-sample-gold {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.btn-sample-gold:hover { background: rgba(251, 191, 36, 0.25); }

.btn-sample-cyan {
  background: rgba(56, 189, 248, 0.15);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.btn-sample-cyan:hover { background: rgba(56, 189, 248, 0.25); }

.btn-sample-warn {
  background: rgba(244, 63, 94, 0.15);
  color: #fecdd3;
  border: 1px solid rgba(244, 63, 94, 0.42);
}
.btn-sample-warn:hover { background: rgba(244, 63, 94, 0.25); }

.toast {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  font-size: 0.8rem;
}

.error-msg {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  font-size: 0.8rem;
}

.prompt-preview {
  margin-top: 10px;
  background: #070a14;
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #cbd5e1;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.hidden { display: none !important; }

/* RPG Status Card */
.rpg-card {
  background: var(--card-bg);
  border: 1px solid rgba(129, 140, 248, 0.38);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
}

.rpg-card.rarity-ur {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 20px 55px rgba(251, 191, 36, 0.14);
}
.rpg-card.rarity-sr {
  border-color: rgba(56, 189, 248, 0.5);
}
.rpg-card.rarity-r {
  border-color: rgba(148, 163, 184, 0.4);
}

.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.rarity-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rarity-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 3px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #fff;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.class-role-pill {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}

.verify-status {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
}
.verify-status.unverified {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.verify-status.custom-mode {
  background: rgba(251, 191, 36, 0.16);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.model-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* HERO AVATAR STAGE */
.avatar-hero-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.avatar-stage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-frame {
  width: 245px;
  height: 255px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.28), rgba(15, 23, 42, 0.94));
  border: 2px solid rgba(56, 189, 248, 0.48);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 0 28px rgba(56, 189, 248, 0.16);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.friend-frame {
  border-color: rgba(244, 114, 182, 0.55);
  background: radial-gradient(circle at 50% 35%, rgba(244, 114, 182, 0.24), rgba(15, 23, 42, 0.94));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 0 28px rgba(244, 114, 182, 0.16);
}

.drag-3d-hint {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 7px;
  border-radius: 99px;
  pointer-events: none;
  z-index: 3;
}

.avatar-svg-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}
.avatar-svg-wrap:active {
  cursor: grabbing;
}
.avatar-svg-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.quick-floating-btn {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.15s ease;
}
.quick-floating-btn.right {
  left: auto;
  right: 8px;
}
.quick-floating-btn:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: var(--accent-cyan);
}

.friend-stage-tag {
  position: absolute;
  bottom: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(244, 114, 182, 0.45);
  color: #fbcfe8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}

/* Match Center Connector */
.match-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.38);
  border-radius: 16px;
  min-width: 120px;
  text-align: center;
}
.chemistry-heart {
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 4px;
}
.chemistry-score-pill {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f9a8d4;
}
.chemistry-label {
  font-size: 0.74rem;
  color: #fce7f3;
  font-weight: 600;
  margin-top: 2px;
}

/* Identity Center */
.card-identity-center {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}
.card-identity-center h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}
.char-title {
  color: #cbd5e1;
  font-size: 0.88rem;
  margin: 4px 0 10px;
}
.type-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}
.badge-mbti {
  background: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.35);
}
.badge-ennea {
  background: rgba(52, 211, 153, 0.15);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.badge-archetype {
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* Brain Specs Grid */
.brain-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.spec-card {
  background: rgba(9, 13, 24, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.spec-card.highlight-gai { border-color: rgba(56, 189, 248, 0.4); }
.spec-card.highlight-cpi { border-color: rgba(129, 140, 248, 0.4); }

.spec-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.spec-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
}
.highlight-gai .spec-value { color: var(--accent-cyan); }
.highlight-cpi .spec-value { color: var(--accent-indigo); }

.spec-sub {
  display: block;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Radar & Stat Bars */
.stats-section {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 18px;
  align-items: center;
  background: rgba(9, 13, 24, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

@media (max-width: 720px) {
  .stats-section { grid-template-columns: 1fr; justify-items: center; }
  .brain-specs-grid { grid-template-columns: 1fr; }
}

.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-legend {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  margin-top: 4px;
}

.stat-bars {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
}

.stat-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  transition: width 0.4s ease;
}

/* Insights & Deep Scan */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .insights-grid { grid-template-columns: 1fr; }
}

.insight-box {
  background: rgba(9, 13, 24, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
}
.buff-box { border-left: 3px solid var(--accent-emerald); }
.debuff-box { border-left: 3px solid var(--accent-rose); }

.insight-box h3 {
  font-size: 0.88rem;
  margin-bottom: 8px;
}
.buff-box h3 { color: var(--accent-emerald); }
.debuff-box h3 { color: var(--accent-rose); }

.insight-box ul {
  padding-left: 16px;
  font-size: 0.82rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upgrade-banner {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.upgrade-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}
.upgrade-banner p {
  font-size: 0.82rem;
  color: #f1f5f9;
}

.evidence-section {
  background: rgba(9, 13, 24, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.evidence-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.evidence-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}
.quest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quest-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.77rem;
  color: #e2e8f0;
}

.deep-brain-explain {
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 14px;
  padding: 14px;
  font-size: 0.82rem;
  color: #e2e8f0;
  margin-bottom: 16px;
}

/* Match Report Container */
.match-report-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.match-card-block {
  background: rgba(9, 13, 24, 0.68);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
}
.match-card-block.pink-glow {
  border-color: rgba(244, 114, 182, 0.45);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.12), rgba(129, 140, 248, 0.1));
}
.match-card-block h3 {
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: #f9a8d4;
}
.match-card-block p, .match-card-block ul {
  font-size: 0.83rem;
  color: #e2e8f0;
}
.match-card-block ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Reference Scale Section */
.benchmark-section {
  background: rgba(9, 13, 24, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.benchmark-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.pool-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-emerald);
}

.bell-curve-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 24px;
  border-radius: 8px;
  overflow: visible;
  position: relative;
  font-family: var(--font-main);
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  line-height: 24px;
}
.zone-avg { background: rgba(148, 163, 184, 0.2); border-radius: 8px 0 0 8px; color: #cbd5e1; }
.zone-high { background: rgba(56, 189, 248, 0.22); color: #bae6fd; }
.zone-sweet { background: rgba(129, 140, 248, 0.3); color: #e0e7ff; font-weight: 700; }
.zone-gifted { background: rgba(251, 191, 36, 0.3); border-radius: 0 8px 8px 0; color: #fef3c7; }

.benchmark-marker {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  transition: left 0.4s ease;
}
.marker-pin {
  background: var(--accent-cyan);
  color: #090d16;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.friend-marker .marker-pin {
  background: var(--accent-pink);
  color: #fff;
}

/* Footer Item Slot */
.item-slot-footer {
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 12px;
  font-size: 0.8rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.item-slot-label {
  color: var(--accent-gold);
  font-weight: 600;
}
.item-slot-value {
  color: #cbd5e1;
}
.card-disclaimer {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================================
   SINGLE-SCREEN VERTICAL SHOWCASE CARD + ZOOM-MORPH OVERLAY ARCHITECTURE
   ============================================================================ */

/* Top Mode Switcher Bar */
.screen-mode-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 12, 22, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 14px;
}

.screen-mode-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-switch-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.mode-switch-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mode-switch-btn:hover {
  color: #f8fafc;
}

.mode-switch-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.28));
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.2);
}

.quick-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-bar-pill {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.quick-bar-pill:hover {
  border-color: var(--accent-cyan);
  color: #fff;
  background: rgba(56, 189, 248, 0.14);
}

.quick-bar-pill.pink-pill {
  border-color: rgba(244, 114, 182, 0.4);
  color: #fbcfe8;
  background: rgba(244, 114, 182, 0.12);
}
.quick-bar-pill.pink-pill:hover {
  background: rgba(244, 114, 182, 0.24);
  border-color: #f472b6;
}

/* Full-Screen Single-Viewport Vertical Card Mode (100dvh Zero Overflow!) */
body.mode-vertical-card {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  padding-bottom: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.mode-vertical-card .site-header,
body.mode-vertical-card .control-panel {
  display: none !important;
}

body.mode-vertical-card .main-grid {
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  padding: 4px 8px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

body.mode-vertical-card .card-column {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* The Vertical Card Frame itself */
#statusCard.rpg-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.mode-vertical-card #statusCard.rpg-card {
  width: min(96vw, 480px);
  height: auto;
  max-height: none;
  padding: 10px 12px;
  border-radius: 20px;
  margin: 0 auto;
  justify-content: space-between;
  transform-origin: top center;
  flex-shrink: 0;
}

/* Even in Studio 2-Column Mode, keep the card clean & vertical-friendly */
body:not(.mode-vertical-card) #statusCard.rpg-card {
  max-width: 500px;
  margin: 0 auto;
  padding: 14px 16px;
}

/* Main Card Viewport (Scales down & fades out when Detail Overlay zooms in!) */
#cardMainViewport {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  transform: scale(1);
  opacity: 1;
  filter: blur(0px);
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.3s ease;
  will-change: transform, opacity, filter;
}

#statusCard.has-detail-open #cardMainViewport {
  transform: scale(0.84);
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

/* Compact adjustments inside Vertical Card so everything fits 100% in 1 screen */
body.mode-vertical-card .card-top-bar {
  margin-bottom: 0;
  padding-bottom: 4px;
}

body.mode-vertical-card .rarity-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
}

body.mode-vertical-card .class-role-pill,
body.mode-vertical-card .verify-status,
body.mode-vertical-card .model-tag {
  font-size: 0.64rem;
  padding: 2px 7px;
}

body.mode-vertical-card .avatar-hero-stage {
  margin: 0;
  padding: 2px 0;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

body.mode-vertical-card .avatar-frame {
  width: 138px;
  height: 144px;
  border-radius: 14px;
}

/* When Duo Match Mode is active inside Vertical Card, size both avatars neatly */
#statusCard.is-duo-mode .avatar-frame {
  width: 124px !important;
  height: 132px !important;
}

#statusCard.is-duo-mode .match-connector {
  padding: 3px 5px;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#statusCard.is-duo-mode .match-connector:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(244, 114, 182, 0.35);
}

body.mode-vertical-card .card-identity-center {
  margin-bottom: 0;
}

body.mode-vertical-card .card-identity-center h2 {
  font-size: 1.02rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.mode-vertical-card .char-title {
  font-size: 0.69rem;
  line-height: 1.25;
  margin: 2px 0 4px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.mode-vertical-card .type-badges {
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

body.mode-vertical-card .badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 100%;
}

/* Visual Dashboard Row: Left = Brain Specs + Scale Bar, Right = 6-Axis Radar */
.vertical-visual-dashboard {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.visual-widget-card {
  position: relative;
  background: rgba(9, 13, 24, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 6px 8px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
}

.visual-widget-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.14);
}

.widget-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
}

.widget-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-zoom-hint {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.13);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 5px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Compact Brain Specs inside Left Visual Widget */
.compact-brain-triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.mini-spec-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 4px 3px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.mini-spec-box.gai { border-color: rgba(56, 189, 248, 0.4); }
.mini-spec-box.cpi { border-color: rgba(129, 140, 248, 0.4); }

.mini-spec-lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: #94a3b8;
  white-space: nowrap;
}

.mini-spec-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.mini-spec-box.gai .mini-spec-val { color: var(--accent-cyan); }
.mini-spec-box.cpi .mini-spec-val { color: var(--accent-indigo); }

.mini-spec-sub {
  display: block;
  font-size: 0.53rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini Population Scale Bar inside Brain Widget */
.mini-scale-wrap {
  margin-top: 2px;
  padding: 0 4px;
}

.mini-scale-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: #94a3b8;
  margin-bottom: 13px;
}

.mini-scale-wrap .bell-curve-bar {
  height: 16px;
  line-height: 16px;
  font-size: 0.52rem;
}

.mini-scale-wrap .benchmark-marker {
  top: -13px;
}

.mini-scale-wrap .marker-pin {
  font-size: 0.54rem;
  padding: 1px 4px;
}

/* Compact Radar Chart inside Right Visual Widget */
.compact-radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.compact-radar-wrap canvas {
  width: 168px !important;
  height: 134px !important;
  display: block;
}

.compact-radar-wrap .radar-legend {
  font-size: 0.58rem;
  gap: 6px;
  margin-top: 0;
}

/* Bottom Interactive Pills Grid (Click to Zoom-Morph into Full Detail!) */
.interactive-pills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.zoom-pill-card {
  position: relative;
  background: rgba(9, 13, 24, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 5px 8px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.zoom-pill-card:hover {
  transform: translateY(-2px) scale(1.01);
  background: rgba(15, 23, 42, 0.92);
}

.zoom-pill-card.pill-buff { border-left: 3px solid var(--accent-emerald); }
.zoom-pill-card.pill-buff:hover { border-color: var(--accent-emerald); }

.zoom-pill-card.pill-debuff { border-left: 3px solid var(--accent-rose); }
.zoom-pill-card.pill-debuff:hover { border-color: var(--accent-rose); }

.zoom-pill-card.pill-upgrade { border-left: 3px solid var(--accent-cyan); }
.zoom-pill-card.pill-upgrade:hover { border-color: var(--accent-cyan); }

.zoom-pill-card.pill-item { border-left: 3px solid var(--accent-gold); }
.zoom-pill-card.pill-item:hover { border-color: var(--accent-gold); }

.zoom-pill-card.pill-match {
  grid-column: 1 / -1;
  border: 1px solid rgba(244, 114, 182, 0.5);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.16), rgba(129, 140, 248, 0.14));
}
.zoom-pill-card.pill-match:hover {
  border-color: #f472b6;
  box-shadow: 0 4px 16px rgba(244, 114, 182, 0.25);
}

/* Sponsor / Featured Channel Slot + Permanent Mini Creator Badge */
.zoom-pill-card.pill-sponsor {
  grid-column: 1 / -1;
  padding: 4px 8px;
  border: 1px solid rgba(251, 191, 36, 0.48);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(15, 23, 42, 0.92));
}
.zoom-pill-card.pill-sponsor:hover {
  border-color: #fbbf24;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.22);
}

.sponsor-cta-pill {
  text-decoration: none;
  font-weight: 700;
  color: #fef3c7 !important;
  background: rgba(239, 68, 68, 0.28) !important;
  border: 1px solid rgba(248, 113, 113, 0.5);
  transition: transform 0.15s ease, background 0.15s ease;
}
.sponsor-cta-pill:hover {
  transform: scale(1.05);
  background: rgba(239, 68, 68, 0.48) !important;
}
.sponsor-cta-pill.tiktok {
  background: rgba(56, 189, 248, 0.24) !important;
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe !important;
}
.sponsor-cta-pill.tiktok:hover {
  background: rgba(56, 189, 248, 0.42) !important;
}

.creator-card-tag {
  text-decoration: none;
  color: #fde68a !important;
  border: 1px solid rgba(251, 191, 36, 0.42) !important;
  background: rgba(251, 191, 36, 0.13) !important;
  font-weight: 600;
  transition: all 0.18s ease;
}
.creator-card-tag:hover {
  background: rgba(251, 191, 36, 0.28) !important;
  border-color: #fbbf24 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.creator-mini-pill {
  text-decoration: none;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #fde68a !important;
  background: rgba(251, 191, 36, 0.12) !important;
}
.creator-mini-pill:hover {
  background: rgba(251, 191, 36, 0.25) !important;
  border-color: #fbbf24 !important;
  color: #fff !important;
}

.pill-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.pill-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f8fafc;
}

.pill-buff .pill-card-title { color: #6ee7b7; }
.pill-debuff .pill-card-title { color: #fda4af; }
.pill-upgrade .pill-card-title { color: #7dd3fc; }
.pill-item .pill-card-title { color: #fde68a; }
.pill-match .pill-card-title { color: #f9a8d4; }

.pill-expand-badge {
  font-size: 0.6rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 99px;
}

.pill-card-preview {
  font-size: 0.68rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   THE ZOOM-MORPH DETAIL OVERLAY (#cardDetailOverlay)
   Expands from clicked widget's coordinates while #cardMainViewport shrinks!
   ============================================================================ */
.card-detail-overlay {
  position: absolute;
  inset: 10px;
  z-index: 40;
  background: linear-gradient(165deg, rgba(12, 18, 34, 0.98), rgba(7, 11, 21, 0.99));
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.18);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transform: scale(0.22);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  overflow: hidden;
}

#statusCard.has-detail-open .card-detail-overlay {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.detail-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.detail-overlay-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-overlay-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.detail-overlay-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

.btn-close-detail {
  border: 1px solid rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.15);
  color: #fecdd3;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-close-detail:hover {
  background: rgba(244, 63, 94, 0.32);
  color: #fff;
  transform: scale(1.04);
}

.detail-overlay-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

/* Custom sleek scrollbar inside overlay if content is tall */
.detail-overlay-body::-webkit-scrollbar {
  width: 5px;
}
.detail-overlay-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 99px;
}

.detail-overlay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  flex-wrap: wrap;
}

.detail-nav-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.detail-nav-btn {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.detail-nav-btn:hover,
.detail-nav-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* ============================================================================
   CLEAN SCREENSHOT CAPTURE MODE (#statusCard.clean-capture-mode)
   Hides floating edit buttons and "🔍 กดขยาย" hints so users get a clean card,
   while keeping Sponsor/Channel CTA pills visible!
   ============================================================================ */
#statusCard.clean-capture-mode .quick-floating-btn,
#statusCard.clean-capture-mode .drag-3d-hint,
#statusCard.clean-capture-mode .widget-zoom-hint,
#statusCard.clean-capture-mode .pill-expand-badge:not(.sponsor-cta-pill) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ============================================================================
   ONBOARDING BANNER, AI QUICK LINKS & MOBILE ERGONOMICS (360x640 SAFE)
   ============================================================================ */
.quick-bar-pill.emerald-pill {
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.14);
}
.quick-bar-pill.emerald-pill:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #fff;
}

.cta-pulse-btn:not(.active) {
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.quick-ai-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #bae6fd;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.72rem;
  transition: all 0.15s ease;
}
.quick-ai-link:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

.card-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.demo-onboarding-banner {
  width: min(96vw, 480px);
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.demo-banner-text {
  line-height: 1.3;
  flex: 1;
}

.demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.demo-cta-btn {
  border: 1px solid rgba(56, 189, 248, 0.6);
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.demo-cta-btn:hover {
  filter: brightness(1.14);
  transform: scale(1.03);
}

.demo-dismiss-btn {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 0.7rem;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.demo-dismiss-btn:hover {
  color: #fff;
  background: rgba(244, 63, 94, 0.3);
}

/* Floating Restore Top-Bar Pill (Visible when user hides top bar for 100% full-screen card) */
.floating-restore-bar-btn {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 300;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.18s ease;
}
.floating-restore-bar-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

body.top-bar-hidden .screen-mode-bar,
body.top-bar-hidden .demo-onboarding-banner {
  display: none !important;
}

.tools-toggle-btn {
  display: none;
}

@media (max-width: 920px) {
  .screen-mode-bar {
    position: relative;
    padding: 3px 6px;
    z-index: 220;
  }
  .screen-mode-inner {
    gap: 4px;
  }
  .mode-switch-group {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding: 2px;
  }
  .mode-switch-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.68rem;
    padding: 4px 6px;
    white-space: nowrap;
  }
  .tools-toggle-btn {
    display: inline-flex;
    flex: 0 0 auto;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
  }
  .tools-toggle-btn.open {
    background: rgba(56, 189, 248, 0.22);
    border-color: var(--accent-cyan);
    color: #fff;
  }
  .hide-bar-btn {
    flex: 0 0 auto;
    padding: 4px 7px;
    font-size: 0.66rem;
    color: #cbd5e1;
  }

  /* Collapsible Floating Tools Drawer so it NEVER pushes the card down! */
  .quick-bar-actions.collapsed-mobile {
    display: none !important;
  }
  .quick-bar-actions:not(.collapsed-mobile) {
    position: absolute;
    top: calc(100% + 4px);
    left: 6px;
    right: 6px;
    z-index: 260;
    background: rgba(10, 15, 29, 0.97);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  }
  .quick-bar-pill {
    white-space: nowrap;
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.7rem;
    padding: 5px 8px;
  }

  /* Hide the extra onboarding banner row in full-screen card mode on mobile so the card gets 100% height */
  body.mode-vertical-card .demo-onboarding-banner {
    display: none !important;
  }
}

@media (max-width: 680px) {
  body.mode-vertical-card .main-grid {
    padding: 2px 4px 4px;
  }
  body.mode-vertical-card #statusCard.rpg-card {
    width: calc(100vw - 10px);
    max-width: 440px;
    padding: 7px 9px;
    border-radius: 16px;
  }
  body.mode-vertical-card #cardMainViewport {
    gap: 4px;
  }
  body.mode-vertical-card .card-top-bar {
    padding-bottom: 2px;
  }
  body.mode-vertical-card .rarity-badge {
    font-size: 0.66rem;
    padding: 1px 6px;
  }
  body.mode-vertical-card .class-role-pill,
  body.mode-vertical-card .verify-status,
  body.mode-vertical-card .model-tag {
    font-size: 0.58rem;
    padding: 1px 5px;
  }
  body.mode-vertical-card .avatar-hero-stage {
    padding: 1px 0;
    gap: 6px !important;
  }
  body.mode-vertical-card .avatar-frame {
    width: 112px;
    height: 116px;
    border-radius: 12px;
  }
  #statusCard.is-duo-mode .avatar-frame {
    width: 96px !important;
    height: 102px !important;
  }
  body.mode-vertical-card .card-identity-center h2 {
    font-size: 0.92rem;
    line-height: 1.12;
  }
  body.mode-vertical-card .char-title {
    font-size: 0.63rem;
    line-height: 1.2;
    margin: 1px 0 2px;
    -webkit-line-clamp: 1;
  }
  body.mode-vertical-card .badge {
    font-size: 0.55rem;
    padding: 1px 5px;
  }
  body.mode-vertical-card .vertical-visual-dashboard {
    gap: 4px;
  }
  body.mode-vertical-card .visual-widget-card {
    padding: 4px 6px;
    border-radius: 10px;
  }
  body.mode-vertical-card .widget-title {
    font-size: 0.62rem;
  }
  body.mode-vertical-card .widget-zoom-hint {
    font-size: 0.52rem;
    padding: 1px 4px;
  }
  body.mode-vertical-card .mini-spec-box {
    padding: 3px 2px;
  }
  body.mode-vertical-card .mini-spec-lbl {
    font-size: 0.49rem;
  }
  body.mode-vertical-card .mini-spec-val {
    font-size: 0.84rem;
  }
  body.mode-vertical-card .mini-spec-sub {
    font-size: 0.49rem;
  }
  body.mode-vertical-card .mini-scale-label {
    font-size: 0.52rem;
    margin-bottom: 10px;
  }
  body.mode-vertical-card .mini-scale-wrap .bell-curve-bar {
    height: 14px;
    line-height: 14px;
    font-size: 0.47rem;
  }
  body.mode-vertical-card .compact-radar-wrap canvas {
    width: 130px !important;
    height: 104px !important;
  }
  body.mode-vertical-card .interactive-pills-grid {
    gap: 4px;
  }
  body.mode-vertical-card .zoom-pill-card {
    padding: 4px 7px;
    border-radius: 8px;
  }
  body.mode-vertical-card .pill-card-title {
    font-size: 0.65rem;
  }
  body.mode-vertical-card .pill-card-preview {
    font-size: 0.61rem;
  }
  body.mode-vertical-card .pill-expand-badge {
    font-size: 0.54rem;
    padding: 1px 5px;
  }
}


