:root {
  --bg-color: #4E5933; /* Olive green */
  --text-main: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --btn-bg: #000000;
  --btn-text: #FFFFFF;
  --option-bg: rgba(255, 255, 255, 0.1);
  --option-hover: rgba(255, 255, 255, 0.2);
  --option-border: rgba(255, 255, 255, 0.3);
  --result-bg: #f1f8eb;
  --result-surface: #e1ecd8;
  --result-surface2: #cfddc2;
  --result-ink: #141710;
  --result-muted: #52584c;
  --result-subtle: #82897c;
  --result-divider: #c9d1c3;
  --result-accent: #477200;
  --result-chip: #d5e4c8;
  --result-chipInk: #30411e;
  --result-heroDot: #b2df82;
  --brand-accent: #C6683F;
  --brand-on-accent: #FBF7F1;
}

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

body {
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  background-color: var(--bg-color);
  background-image: url('images/quiz-bg-pattern-v1.png');
  background-repeat: repeat;
  background-size: 620px 620px;
  background-position: center top;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  overflow-y: auto;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.quiz-wrapper, .result-wrapper {
  justify-content: flex-start;
  margin-top: 20px;
}

.main-image {
  width: 100%;
  max-width: 300px;
  margin-bottom: 32px;
  border-radius: 16px;
}

.main-title {
  font-size: 32px;
  line-height: 1.4;
  font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Buttons */
.btn {
  border: none;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn.primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  width: auto;
  min-width: 200px;
}

.btn.primary:hover {
  transform: scale(1.02);
  background: #222;
}

/* Options */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.option-btn {
  background: var(--option-bg);
  border: 1px solid var(--option-border);
  padding: 20px;
  border-radius: 16px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.option-btn:hover {
  background: var(--option-hover);
  border-color: rgba(255, 255, 255, 0.6);
}

.emoji {
  font-size: 24px;
}

/* Quiz UI */
.quiz-header {
  margin-bottom: 30px;
  width: 100%;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: var(--text-main);
  width: 0%;
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.progress-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
}

.question-text {
  font-size: 22px;
  margin-bottom: 32px;
  text-align: left;
  width: 100%;
}

/* Result UI */
#view-result {
  padding: 0;
}

.result-wrapper {
  width: 100%;
  margin-top: 0;
}

.result-card {
  width: 100%;
  background: var(--result-bg);
  color: var(--result-ink);
  border-radius: 0;
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  text-align: left;
  box-shadow: none;
}

.result-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 14px;
}

.nav-title {
  color: var(--result-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.nav-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--result-chip);
  color: var(--result-chipInk);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.nav-icon-btn:disabled,
.result-share-btn:disabled {
  opacity: 0.58;
  cursor: progress;
}

.result-hero,
.share-hero-export {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--result-surface);
}

.result-hero {
  aspect-ratio: auto;
}

.result-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
  display: block;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.20) 55%, rgba(0, 0, 0, 0.78) 100%);
}

.type-marker {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.hero-lockup {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 22px 22px;
  color: #fff;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.role-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--result-heroDot);
}

.type-name {
  margin: 0;
  color: #fff;
  font-size: 40px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.result-body {
  padding: 0 20px 22px;
}

.quote {
  margin: 16px 0 8px;
  color: var(--result-ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
}

.description {
  margin: 0;
  padding: 0;
  color: var(--result-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  text-align: justify;
}

.divider {
  display: block;
  height: 1px;
  margin: 18px 0;
  background: var(--result-divider);
}

.solution-box {
  background: var(--result-surface);
  border-radius: 16px;
  padding: 14px 16px 16px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.solution-box h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--result-ink);
  font-size: 16px;
  font-weight: 700;
}

.solution-box p {
  margin: 0;
  color: var(--result-muted);
  font-size: 14px;
  line-height: 1.65;
}

.bulb-icon {
  color: var(--brand-accent);
  font-weight: 900;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.btn.primary.result-share-btn {
  width: 100%;
  min-width: 0;
  padding: 13px 20px;
  border: 1px solid var(--result-ink);
  border-radius: 14px;
  background: transparent;
  color: var(--result-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.btn.primary.result-share-btn:hover {
  background: var(--result-surface);
  color: var(--result-ink);
}

.btn.secondary.result-secondary-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--result-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}

.result-meta {
  margin-top: 10px;
  color: var(--result-subtle);
  text-align: center;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.waitlist-section {
  width: 100%;
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--result-surface2);
  text-align: left;
  color: var(--result-ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.035);
}

.waitlist-section h3 {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.4;
}

.waitlist-desc {
  font-size: 14px;
  color: var(--result-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.waitlist-form input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--result-divider);
  background: rgba(255, 255, 255, 0.82);
  color: var(--result-ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  text-align: left;
}

.waitlist-form input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(198, 104, 63, 0.16);
}

.waitlist-section .btn.primary {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--brand-accent);
  color: var(--brand-on-accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.waitlist-section .btn.primary:hover {
  background: var(--brand-accent);
}

.success-msg {
  margin-top: 16px;
  color: var(--result-ink);
  font-weight: 600;
  font-size: 15px;
  padding: 12px;
  background: var(--result-surface);
  border-radius: 14px;
}

.waitlist-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8ded8;
  color: #7b2e22;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.mobile-save-page {
  width: min(390px, 100%);
  margin: 0 auto;
  padding: 14px 14px 24px;
  border-radius: 28px;
  background: var(--result-bg);
  color: var(--result-ink);
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(40, 30, 20, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.mobile-save-nav {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.mobile-save-nav-spacer {
  width: 36px;
  height: 36px;
}

.mobile-save-page h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.mobile-save-page > p {
  margin: 0 8px 16px;
  color: var(--result-muted);
  font-size: 14px;
  line-height: 1.6;
}

.mobile-save-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: var(--result-surface);
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

.share-card-export {
  width: 540px;
  height: 960px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--result-bg);
  color: var(--result-ink);
  box-shadow: 0 30px 60px -20px rgba(40, 30, 20, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-family: 'Noto Sans TC', 'PingFang TC', sans-serif;
  display: flex;
  flex-direction: column;
}

.share-hero-export {
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
}

.share-hero-export img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-hero-export .type-name {
  font-size: 42px;
}

.share-content-export {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px 18px;
}

.share-tagline {
  margin: 0;
  color: var(--result-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.share-description {
  margin: 0;
  color: var(--result-muted);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}

.share-advice-card {
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: var(--result-surface);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.share-advice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--result-ink);
  font-size: 19px;
  font-weight: 700;
}

.share-advice-card p {
  margin: 0;
  color: var(--result-muted);
  font-size: 18px;
  line-height: 1.55;
}

.share-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.share-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--result-ink);
  font-size: 14px;
  font-weight: 700;
}

.share-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--brand-accent);
  color: var(--brand-on-accent);
  font-size: 13px;
  font-weight: 900;
}

.share-domain {
  color: var(--result-subtle);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

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

/* Footer Banner like OOOPEN Lab */
.footer-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #111;
  color: #888;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  z-index: 10;
  font-family: 'Inter', sans-serif;
}
.footer-banner span {
  color: #FFF;
  font-weight: bold;
}
