/* ========================================
   DBTI - Dota Behavioral Type Indicator
   Dota 2 Dark Fantasy Theme
   ======================================== */

:root {
  --bg-deep:      #080b10;
  --bg-primary:   #0d1117;
  --bg-card:      #151b25;
  --bg-card-alt:  #1a2233;
  --bg-hover:     #1e2a3a;

  --gold:         #c8aa6e;
  --gold-dim:     #8b7a4a;
  --gold-bright:  #e8d5a3;
  --gold-glow:    rgba(200, 170, 110, 0.25);

  --red:          #c23c2a;
  --green:        #5ba527;
  --blue:         #4a90d9;
  --teal:         #3fbfbf;

  --text:         #e0ddd8;
  --text-muted:   #7a7876;
  --text-dim:     #52504e;

  --radius:       8px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --border:       1px solid rgba(200,170,110,0.15);

  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(200,170,110,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(74,144,217,0.03) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3 { color: var(--gold); line-height: 1.3; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; text-align: center; }
h3 { font-size: 1.15rem; }
p  { margin-bottom: 0.8rem; }
strong { color: var(--gold-bright); }

/* ---- Layout ---- */
.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Pages ---- */
.page {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.4s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 10px 24px;
  transition: var(--transition);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #0d1117;
  box-shadow: 0 2px 12px var(--gold-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 4px 20px var(--gold-glow);
}

.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text);
  border: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
}
.btn-text:hover { color: var(--gold); }

.btn-lg { font-size: 1.1rem; padding: 14px 40px; border-radius: 10px; }

/* ========================================
   LANDING PAGE
   ======================================== */
.hero-section {
  text-align: center;
  padding: 18vh 0 8vh;
}
.logo-text {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-bottom: 1rem;
  line-height: 1;
}
.hero-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.hero-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 1.2rem;
}

/* About */
.about-section {
  padding: 4rem 0 3rem;
  border-top: var(--border);
  color: var(--text-muted);
  text-align: center;
}
.about-section p { max-width: 600px; margin-left: auto; margin-right: auto; }

/* Dimension Cards */
.dimensions-section { padding: 3rem 0; }
.dim-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 1.5rem;
}
.dim-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: var(--transition);
}
.dim-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.dim-card-icon { font-size: 2rem; margin-bottom: 8px; }
.dim-card h3 {
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.dim-card-label {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.dim-card p:last-child {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* FAQ */
.faq-section { padding: 3rem 0; }
.faq-item {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--gold-dim);
  transition: var(--transition);
}
.faq-item[open] summary::after {
  content: '−';
  color: var(--gold);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p {
  padding: 0 20px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: var(--border);
}

/* ========================================
   QUIZ PAGE
   ======================================== */
.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  position: sticky;
  top: 0;
  background: var(--bg-deep);
  z-index: 10;
}
.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Progress Bar */
.progress-track {
  height: 3px;
  background: rgba(255,255,255,0.06);
  position: sticky;
  top: 48px;
  z-index: 10;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  width: 0%;
  transition: width 0.4s ease;
}

/* Question */
.quiz-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding-top: 40px;
  padding-bottom: 40px;
}
.question-card {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeIn 0.35s ease;
}
.question-number {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  max-width: 560px;
}

/* Options */
.options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 2.5rem;
}
.option-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.option-btn:hover {
  background: var(--bg-card-alt);
  border-color: rgba(200,170,110,0.3);
  color: var(--text);
}
.option-btn.selected {
  background: rgba(200,170,110,0.12);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
}

/* Quiz Nav */
.quiz-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ========================================
   RESULTS PAGE
   ======================================== */
.results-body {
  padding-top: 60px;
  padding-bottom: 60px;
  text-align: center;
}
.results-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

/* Hero Card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid rgba(200,170,110,0.2);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  animation: heroReveal 0.6s ease;
}
@keyframes heroReveal {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-portrait-wrap {
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(200,170,110,0.1);
}
.hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.type-code {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 4px 14px;
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  color: var(--gold);
  margin-bottom: 10px;
}
.result-hero-name {
  font-size: 2rem;
  color: var(--gold-bright);
  margin-bottom: 4px;
}
.result-hero-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 12px;
}
.result-match {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  margin: 0;
}
.result-match span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Result Sections */
.result-section {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 1.5rem;
  text-align: left;
}
.result-section h3 {
  text-align: center;
  margin-bottom: 1.2rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

/* Dimension Bars */
.dim-bars { display: flex; flex-direction: column; gap: 20px; }
.dim-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}
.dim-bar-label-left { color: var(--teal); font-weight: 600; }
.dim-bar-label-right { color: var(--gold); font-weight: 600; }
.dim-bar-track {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
  background: rgba(255,255,255,0.04);
}
.dim-bar-fill-left {
  height: 100%;
  background: var(--teal);
  border-radius: 5px 0 0 5px;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
  min-width: 3%;
}
.dim-bar-fill-right {
  height: 100%;
  background: var(--gold);
  border-radius: 0 5px 5px 0;
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
  min-width: 3%;
}
.dim-bar-percent {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* Quote & Description */
.result-quote {
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  margin: 0 0 1.2rem;
  font-style: italic;
  color: var(--gold-bright);
  background: rgba(200,170,110,0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05rem;
}
.result-description {
  color: var(--text-muted);
  line-height: 1.85;
  font-size: 0.95rem;
  margin: 0;
}

/* Actions */
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* Disclaimer */
.results-disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ========================================
   TOAST
   ======================================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card-alt);
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
  .hero-section { padding: 12vh 0 6vh; }
  .logo-text { font-size: 3.2rem; }
  .hero-title { font-size: 1.35rem; }
  .hero-subtitle { font-size: 0.95rem; }

  .dim-cards { grid-template-columns: 1fr; }

  .question-text { font-size: 1.1rem; }
  .quiz-body { padding-top: 24px; padding-bottom: 24px; }

  .hero-portrait-wrap { width: 140px; height: 140px; }
  .result-hero-name { font-size: 1.5rem; }
  .result-match { font-size: 1.8rem; }

  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
}

@media (max-width: 360px) {
  .logo-text { font-size: 2.6rem; }
  .hero-title { font-size: 1.15rem; }
  h2 { font-size: 1.3rem; }
}

/* ========================================
   EXTRA POLISH
   ======================================== */
::selection {
  background: var(--gold);
  color: var(--bg-deep);
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-card-alt); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* Option button entrance */
.option-btn {
  animation: optionSlideIn 0.25s ease both;
}
.option-btn:nth-child(1) { animation-delay: 0.03s; }
.option-btn:nth-child(2) { animation-delay: 0.06s; }
.option-btn:nth-child(3) { animation-delay: 0.09s; }
.option-btn:nth-child(4) { animation-delay: 0.12s; }
.option-btn:nth-child(5) { animation-delay: 0.15s; }

@keyframes optionSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Subtle pulse on hero portrait */
.hero-portrait-wrap {
  animation: portraitPulse 3s ease-in-out infinite alternate;
}
@keyframes portraitPulse {
  from { box-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(200,170,110,0.1); }
  to   { box-shadow: 0 0 40px var(--gold-glow), 0 0 80px rgba(200,170,110,0.15); }
}

/* Focus outline for accessibility */
.btn:focus-visible, .option-btn:focus-visible, details summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
