/* Hobbit Quiz - Shire Style Theme */
:root {
  --shire-green: #295328;
  --shire-green-hover: #346833;
  --shire-dark: #1b351a;
  --shire-gold: #c68a2c;
  --shire-gold-light: #e6b356;
  --parchment: #fdfaf3;
  --parchment-card: #ffffff;
  --parchment-border: #e2d7c0;
  --text-main: #2b261f;
  --text-muted: #6b6357;
  --option-bg: #faf6ed;
  --option-border: #e3d8c2;
  --option-hover-bg: #eef5ea;
  --option-hover-border: #52894f;
  --option-selected-bg: #295328;
  --option-selected-text: #ffffff;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(35, 25, 10, 0.06);
  --shadow-md: 0 8px 24px rgba(35, 25, 10, 0.1);
  --shadow-lg: 0 16px 36px rgba(35, 25, 10, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Georgia", "Cinzel", serif;
  background-color: #f4ede1;
  background-image: 
    radial-gradient(#29532808 1px, transparent 1px),
    radial-gradient(#c68a2c0a 1px, #f4ede1 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 40px;
}

.app-wrapper {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* Header bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 20px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--parchment-border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--shire-green);
  box-shadow: var(--shadow-sm);
}

.door-icon-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  vertical-align: middle;
}

.header-controls {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--parchment-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #ffffff;
  color: var(--shire-green);
  border-color: var(--shire-green);
  transform: translateY(-1px);
}

/* Hero card */
.quiz-card {
  background: var(--parchment-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--parchment-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.hero-banner {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background-color: var(--shire-dark);
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
  transition: transform 0.6s ease;
}

.hero-banner:hover img {
  transform: scale(1.03);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(27, 53, 26, 0.15) 0%,
    rgba(27, 53, 26, 0.3) 60%,
    rgba(255, 255, 255, 0.95) 100%
  );
}

/* Card content body */
.card-content {
  padding: 24px 28px 32px;
}

@media (max-width: 540px) {
  .hero-banner {
    height: 170px;
  }
  .card-content {
    padding: 20px 18px 24px;
  }
}

/* Welcome view */
.welcome-view {
  text-align: center;
}

.quiz-title {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--shire-dark);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.quiz-subtitle {
  font-size: 0.95rem;
  color: var(--shire-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.quiz-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 24px;
}

.quiz-perks {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.perk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--option-bg);
  border: 1px solid var(--parchment-border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--shire-green) 0%, var(--shire-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 14px 34px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(41, 83, 40, 0.35);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--shire-green-hover) 0%, var(--shire-green) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(41, 83, 40, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Question view */
.progress-bar-container {
  margin-bottom: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--shire-green);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--parchment-border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--shire-gold) 0%, var(--shire-green) 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-box {
  animation: fadeIn 0.3s ease-out;
}

.question-title {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--shire-dark);
  line-height: 1.35;
  margin-bottom: 22px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--option-bg);
  border: 1.5px solid var(--option-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.option-btn:hover {
  background: var(--option-hover-bg);
  border-color: var(--option-hover-border);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.option-btn.selected {
  background: var(--option-selected-bg);
  border-color: var(--shire-dark);
  color: var(--option-selected-text);
  box-shadow: 0 4px 14px rgba(41, 83, 40, 0.3);
}

.option-btn.selected .opt-indicator {
  background: #ffffff;
  color: var(--shire-green);
  border-color: #ffffff;
}

.opt-indicator {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--option-border);
  background: #ffffff;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.opt-text {
  flex: 1;
}

/* Navigation controls */
.quiz-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--parchment-border);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--parchment-border);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: #ffffff;
  border-color: var(--text-muted);
  color: var(--text-main);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Result view */
.result-view {
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.result-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--option-bg);
  border: 1px solid var(--parchment-border);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--shire-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

/* Circular score dial */
.score-dial-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.score-circle-bg {
  fill: none;
  stroke: var(--parchment-border);
  stroke-width: 10;
}

.score-circle-bar {
  fill: none;
  stroke: var(--shire-green);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-dial-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--shire-dark);
  line-height: 1;
}

.score-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.result-title {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--shire-dark);
  margin-bottom: 12px;
}

.result-personality {
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--shire-green);
  margin-bottom: 14px;
}

.result-lore {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 28px;
  background: var(--option-bg);
  border: 1px solid var(--parchment-border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Accordion for review */
.review-section {
  text-align: left;
  border-top: 1px dashed var(--parchment-border);
  padding-top: 20px;
  margin-top: 20px;
}

.review-toggle-btn {
  width: 100%;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 4px;
}

.review-toggle-btn:hover {
  color: var(--shire-green);
}

.review-content {
  display: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  background: var(--option-bg);
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
}

.review-item-q {
  font-weight: 600;
  color: var(--shire-dark);
  margin-bottom: 4px;
}

.review-item-a {
  color: var(--shire-green);
  font-weight: 500;
}

/* Toast message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--shire-dark);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer note */
.page-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

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