/* ==========================================================================
   Jeevan Dharma — unified stylesheet
   Single file for all breakpoints. Order:
   1. Tokens & reset
   2. Layout shell & screens
   3. Component styles (landing, quiz, result, account, modals)
   4. Inline responsive blocks (legacy, preserved)
   5. Unified responsive layer (end of file)
   Breakpoints: 320 | 360 | 380 | 481-767 | 768-1023 | 1024+ |
   1280-1440 short laptop | 1441+ | 1920+ | landscape | coarse touch
   ========================================================================== */

@font-face {
  font-family: "Greyhound";
  src: url("../font/greyhoundbold.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Norma";
  src: url("../font/norma-compr.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Souvenir";
  src: url("../font/Souvenir Gothic CG Demi Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  --app-height: 100svh;
  --app-height-fallback: 100vh;
  --design-width: 402;
  --design-height: 874;
  --copy-shadow: 0 2px 0 rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.45);
  --gold: #f4c36b;
  --cream: #fff6d8;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --frame-inset: clamp(28px, 5.5vw, 80px);
  --content-gutter: clamp(12px, 3.2vw, 28px);
  --device-max-width: 450px;
  --device-aspect: 2.174;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: var(--app-height-fallback);
  min-height: var(--app-height);
  overflow: hidden;
  color: #fff;
  background: url('../img/bg_new.png??') repeat;
  background-size: 450px;
  font-family: "Greyhound", Georgia, serif;
  user-select: none;
  touch-action: manipulation;
}

html, body {
    touch-action: manipulation;
    overflow: hidden;
}
body {
  touch-action: pan-x pan-y;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
}

.page {
  min-height: 100vh;
  min-height: var(--app-height);
  display: block;
  padding: 0;
}

.device-frame {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: var(--app-height);
  overflow: hidden;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #150905;
  isolation: isolate;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.landing-screen,
.quiz-screen,
.result-screen,
.account-screen {
  transition: opacity 360ms ease, transform 440ms ease, visibility 0s linear 440ms;
}

.landing-screen {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.quiz-screen,
.result-screen,
.account-screen {
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8%) scale(1.02);
}

.app-shell[data-active-screen="quiz"] .landing-screen {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8%) scale(0.985);
}

.app-shell[data-active-screen="quiz"] .quiz-screen {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  transition-delay: 80ms, 80ms, 0s;
}

.app-shell[data-active-screen="result"] .landing-screen,
.app-shell[data-active-screen="result"] .quiz-screen {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8%) scale(0.985);
}

.app-shell[data-active-screen="result"] .result-screen {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  transition-delay: 80ms, 80ms, 0s;
}

.app-shell[data-active-screen="account"] .landing-screen,
.app-shell[data-active-screen="account"] .quiz-screen,
.app-shell[data-active-screen="account"] .result-screen {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8%) scale(0.985);
}

.app-shell[data-active-screen="account"] .account-screen {
  z-index: 3;
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  transition-delay: 80ms, 80ms, 0s;
}

.landing-backdrop,
.landing-vignette {
  position: absolute;
  inset: 0;
}

.landing-backdrop {
  background: url("../img/landing_bg.jpg") center / cover no-repeat;
}

.landing-vignette {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0.02) 26%, rgba(0, 0, 0, 0.03) 60%, rgba(0, 0, 0, 0.65) 100%),
    radial-gradient(circle at 55% 36%, rgba(255, 239, 135, 0.16), transparent 19%);
  pointer-events: none;
}

.landing-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12.7% 0 12.3%;
}

.hero-copy {
  width: 100%;
  text-align: center;
}

.hero-logo {
  width: 79.1%;
  margin: 0 auto;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.65));
}

.hero-subtitle {
  margin: 11px 0 0;
  color: #f7efe6;
  font-family: "Norma", Impact, sans-serif;
  font-size: clamp(25px, 7.45vw, 34px);
  line-height: 1;
  letter-spacing: 1px;
  text-shadow: var(--copy-shadow);
}

.landing-message {
  width: 100%;
  margin-top: auto;
  padding-bottom: 16.3%;
  text-align: center;
}

.landing-message h1 {
  margin: 0;
  font-family: "Souvenir", "Greyhound", serif;
  font-size: clamp(25px, 7.1vw, 32px);
  line-height: 1.18;
  color: #fff;
  text-shadow: var(--copy-shadow);
}

.landing-meter {
  position: relative;
  width: 94%;
  height: auto;
  display: grid;
  place-items: start center;
}

.reputation-line {
  display: block;
  width: 93.8%;
  margin-top: -30px;
}

.image-button {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.45));
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.image-button img {
  width: 100%;
}

.image-button span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 1px;
  font-family: "Norma", Impact, sans-serif;
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(102, 31, 0, 0.9), 0 4px 8px rgba(42, 9, 0, 0.7);
}

.image-button:active {
  transform: scale(0.985);
}

.start-journey {
  width: 71.15%;
  margin-top: 4px;
}

.start-journey span {
  z-index: 2;
  display: grid;
  color: #fff4cd;
  font-family: "Souvenir", serif;
  font-size: clamp(22px, 5.8vw, 32px);
  text-shadow: var(--copy-shadow);
  pointer-events: none;
}



.quiz-content {
  position: relative;
  container-type: inline-size;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* padding: 0 0 2.2%; */
  background: #15161c;
  /* background:
    linear-gradient(180deg, #1d0d05 0%, #3b1c0c 10%, #311508 100%); */
}
.quiz-frame{
  width: 100%;
            height: 100%;
            margin: 0;
            overflow: hidden;
            background: #3a0000;
            position: relative;
}

.quiz-frame::before {

            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 1000;
            border-style: solid;
            border-width: 80px;
            border-image-slice: 50 60 50 60 fill;
            border-image-width: 50px;
            border-image-repeat: stretch;
            border-image-source: url("../img/frame.png");
            box-sizing: border-box;
}

/* .quiz-content::before,
.quiz-content::after {
  content: "";
  position: absolute;
  z-index: 4;
  pointer-events: none;
} */

/* .quiz-content::before {
  inset: 0;
  background:
    url("../img/scene_border_left_right.png") left bottom / 9px 90% no-repeat,
    url("../img/scene_border_left_right.png") right bottom / 9px 90% no-repeat;
  background:
    url("../img/scene_border_left_right.png") left bottom / 2.29cqw 90% no-repeat,
    url("../img/scene_border_left_right.png") right bottom / 2.29cqw 90% no-repeat;
} */

/* .quiz-content::after {
  left: 0;
  right: 0;
  bottom: -3px;
  height: 15px;
  height: 3.58cqw;
  background: url("../img/scene_border_bottom.png") center bottom / 100% 100% no-repeat;
} */

.result-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 156, 55, 0.26), transparent 34%),
    /* linear-gradient(180deg, rgba(10, 4, 2, 0.28) 0%, rgba(14, 7, 4, 0.66) 48%, rgba(8, 3, 1, 0.94) 100%), */
    url("../img/landing_bg.jpg") center / cover no-repeat;
  filter: saturate(0.82) brightness(0.50);
}

.result-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  border-style: solid;
  border-width: 80px;
  border-image-slice: 50 60 50 60 fill;
  border-image-width: 50px;
  border-image-repeat: stretch;
  border-image-source: url("../img/frame.png");
  box-sizing: border-box;
}

.result-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 44px);
}

.result-panel {
  position: relative;
  width: min(88vw, 430px);
  overflow: hidden;
  padding: clamp(30px, 10vh, 30px) clamp(18px, 5vw, 15px) clamp(20px, 4vh, 15px);
  border-style: solid;
  border-width: 60px 20px 40px 20px;
  border-image-slice: 290 71 200 71 fill;
  border-image-width: 80px 20px 50px 20px;
  border-image-outset: 0px 0px 0px 0px;
  border-image-repeat: stretch stretch;
  border-image-source: url("../img/chapter_summary_bg.png");
  box-sizing: border-box;
  /* background:
    linear-gradient(180deg, rgba(18, 31, 24, 0.96), rgba(7, 14, 10, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 212, 111, 0.04) 0 1px, transparent 1px 7px),
    #0d130e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 207, 96, 0.32),
    inset 0 0 36px rgba(0, 0, 0, 0.72),
    0 24px 46px rgba(0, 0, 0, 0.62); */
  text-align: center;
}

/* .result-panel::before {
  content: "JD";
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(50px, 13vw, 66px);
  height: clamp(50px, 13vw, 66px);
  border: 2px solid #c58b2a;
  clip-path: polygon(50% 0, 94% 18%, 84% 82%, 50% 100%, 16% 82%, 6% 18%);
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 222, 116, 0.24), transparent 38%),
    linear-gradient(135deg, #1b2317, #6b4315);
  color: #ffe2a2;
  font-family: "Souvenir", serif;
  font-size: clamp(17px, 4vw, 24px);
  line-height: 1;
  text-shadow: var(--copy-shadow);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
} */

/* .result-panel::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(211, 149, 42, 0.7);
  clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
} */

.result-panel h2 {
  position: relative;
  z-index: 3;
  margin: 0 0 10px;
  color: #f0b84f;
  font-family: "Souvenir", serif;
  font-size: clamp(31px, 7.4vw, 44px);
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.86),
    0 0 12px rgba(235, 155, 32, 0.2);
}

.result-panel p {
  margin: 0;
}

.result-panel #resultSummary {
  position: relative;
  z-index: 3;
  min-height: 44px;
  color: #ffe8b3;
  font-family: "Souvenir", serif;
  font-size: clamp(18px, 4.8vw, 24px);
  line-height: 1.12;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}

.result-stats {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: clamp(18px, 3vh, 24px) 0 14px;
}

.result-stat {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-height: clamp(75px, 14vh, 92px);
  padding: 10px 12px;
  /* border: 1px solid #b87b24;
  clip-path: polygon(10% 0, 90% 0, 100% 14%, 100% 86%, 90% 100%, 10% 100%, 0 86%, 0 14%);
  background:
    linear-gradient(180deg, rgba(45, 36, 10, 0.9), rgba(7, 12, 8, 0.96)),
    #15160b;
  box-shadow:
    inset 0 0 0 1px rgba(255, 216, 100, 0.12),
    inset 0 -14px 20px rgba(0, 0, 0, 0.32); */
      border-style: solid;
      border-image-slice:27 27 27 27 fill;
      border-image-width:10px 10px 10px 10px;
      border-image-outset:0px 0px 0px 0px;
      border-image-repeat:stretch stretch;
      border-image-source: url("../img/summary_tile.png");
      text-align: left;
}

.result-stat img {
  grid-row: 1 / 3;
  width: 42px;
  max-height: 46px;
  object-fit: contain;
  justify-self: center;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.7));
}

.result-stat span {
  color: #e6b84f;
  font-family: "Souvenir", serif;
  font-size: clamp(13px, 3vw, 17px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.result-stat strong,
.result-meta strong {
  color: #fff1c4;
  font-family: "Souvenir", serif;
  font-size: clamp(25px, 6vw, 34px);
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}

.result-meta {
  position: relative;
  z-index: 3;
  margin: 14px 0 0;
  color: #f0bd5c;
  font-family: "Souvenir", serif;
  font-size: clamp(17px, 4.2vw, 22px);
  line-height: 1;
}

.result-panel .image-button {
  position: relative;
  z-index: 3;
  display: block;
  width: min(92%, 330px);
  min-height: auto;
  margin: clamp(18px, 3vh, 24px) auto 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
  color: transparent;
}

.result-panel .image-button img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.result-panel .image-button span {
  display: none;
}

.result-panel .play-again,
.result-panel .share-journey {
  /* width: min(44%, 156px); */
  margin-inline: 4px;
}

.result-panel .play-again span,
.result-panel .share-journey span {
  font-size: clamp(16px, 4vw, 22px);
}

.quiz-header {
  flex-shrink: 0;
  position: relative;
  z-index: 6;
}

.quiz-body {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* .quiz-frame-corners {
  display: none;
} */

.play-panel {
  position: relative;
  border-style: solid;
  border-width: 1px;
  border-image-slice: 50 60 50 60 fill;
  border-image-width: 50px;
  border-image-repeat: stretch;
  border-image-source: url("../img/frame_question.png");
  box-sizing: border-box;
}

.play-panel {
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* background: url('../img//question_bg_noise.jpg'); */
}

.chapter-title {
  position: relative;
  width: 100%;
  aspect-ratio: 392 / 64;
  margin: 0;
  line-height: 0;

    background:url('../img/bg_noise.jpg')
    /* linear-gradient(180deg, #1d0d05 0%, #3b1c0c 10%, #311508 100%); */
}

.chapter-title img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.chapter-title h2 {
  position: absolute;
  inset: 0 8%;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--cream);
  font-family: "Souvenir", serif;
  font-size: clamp(20px, 5.4vw, 28px);
  padding-top: clamp(2px, 0.5vw, 4px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 0 #0b1119, 0 4px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.stats-strip {
  position: relative;
  width: 97%;
  margin-left:1.5%;
  aspect-ratio: 480 / 60;
  height: auto;
  margin-top: 0;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr 0.95fr 1.05fr;
  align-items: center;
  padding: 8px 4% 2.4% 4.2%;
  z-index: 200;
}

.stats-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.stat-item {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff8d8;
  font-family: "Souvenir", Impact, sans-serif;
  font-size: clamp(22px, 5vw, 29px);
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.stat-item img {
  flex: 0 0 auto;
}

.stat-item > span {
  display: inline-block;
  transition: color 220ms ease, transform 220ms ease, text-shadow 220ms ease;
}

.stat-item.stat-animate-up,
.stat-item.stat-animate-up > span {
  color: #22c55e;
}

.stat-item.stat-animate-up > span {
  transform: scale(1.14);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.72),
    0 0 14px rgba(34, 197, 94, 0.75);
}

.stat-item.stat-animate-down,
.stat-item.stat-animate-down > span {
  color: #ef4444;
}

.stat-item.stat-animate-down > span {
  transform: scale(1.08);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.72),
    0 0 14px rgba(239, 68, 68, 0.7);
}

.stat-item:nth-child(2) img,
.stat-item:nth-child(4) img {
  width: clamp(26px, 7.4vw, 32px);
}

.stat-item:nth-child(3) img {
  width: clamp(26px, 7.4vw, 32px);
}

.stat-wealth img {
  width: clamp(26px, 7.4vw, 32px);
}

.scene-wrap {
  position: relative;
  z-index: 1;
  container-type: inline-size;
  height: 35%;
  overflow: hidden;
  background: #25150f;
}



.scene-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

/* .scene-wrap::before {
  content: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
 border-style: solid;
  border-width: 1px;
  border-image-slice: 50 60 50 60;
  border-image-width: 50px;
  border-image-repeat: stretch;
  border-image-source: url("../img/frame_question.png");
  box-sizing: border-box; 
} */

/* .scene-wrap::after {
  content: none;
} */

.scene-wrap::before {
  inset: 0;
  background:
    url("../img/scene_border_left_right.png") left top / 9px 100% no-repeat,
    url("../img/scene_border_left_right.png") right top / 9px 100% no-repeat;
  background:
    url("../img/scene_border_left_right.png") left top / 2.29cqw 100% no-repeat,
    url("../img/scene_border_left_right.png") right top / 2.29cqw 100% no-repeat;
}

.scene-wrap::after {
  left: 0;
  right: 0;
  bottom: -3px;
  height: 15px;
  height: 3.58cqw;
  background: url("../img/scene_border_bottom.png") center bottom / 100% 100% no-repeat;
}

.quiz-content {
  position: relative;
}

.quiz-screen.impact-active .quiz-body .scene-wrap,
.quiz-screen.impact-active .quiz-body .play-panel {
  display: none !important;
}

.quiz-screen.impact-active .quiz-body {
  background: transparent;
}

.quiz-screen.impact-active .impact-overlay {
  display: flex !important;
}

.question-area {
  position: relative;
  z-index: 2;
  container-type: inline-size;
  /* margin-top: 8px; */
  padding: 0 4.8%;
}

.question-area::before,
.question-area::after,
.choose-wisely::before,
.choose-wisely::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
  display: none;
}

.question-area::before,
.choose-wisely::before {
  inset: 0;
  background:
    url("../img/scene_border_left_right.png") left top / 9px 100% no-repeat,
    url("../img/scene_border_left_right.png") right top / 9px 100% no-repeat;
  background:
    url("../img/scene_border_left_right.png") left top / 2.29cqw 100% no-repeat,
    url("../img/scene_border_left_right.png") right top / 2.29cqw 100% no-repeat;
}

.question-area::after,
.choose-wisely::after {
  left: 0;
  right: 0;
  bottom: -3px;
  height: 15px;
  height: 3.58cqw;
  /* background: url("../img/scene_border_bottom.png") center bottom / 100% 100% no-repeat; */
}



.question-area::after {
  display: block;
  left: -4.8%;
  right: -4.8%;
}

.question-card {
  position: relative;
  z-index: 1;
  width: calc(100% + 9.6%);
  margin: 0 -4.8% 13px;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.42));
}

.question-card img {
  width: 100%;
  height: 130px;
  object-fit: fill;
}

.question-card p {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 14px 18px 12px;
  color: var(--cream);
  font-family: "Souvenir", serif;
  font-size: clamp(20px, 5.55vw, 25px);
  line-height: 1;
  text-align: center;
  /* text-shadow: 0 2px 0 rgba(71, 28, 3, 0.85), 0 3px 8px rgba(0, 0, 0, 0.55); */
  text-shadow: 0 2px 0 #0b1119, 0 4px 6px rgba(0, 0, 0, 0.6);
}

.question-card::after {
  content: "";
  position: absolute;

  left: 0;
  right: 0;
  bottom: 3px;

  /* height: 15px; */
  height: 0.58cqw;

  background: url("../img/question_border_bottom.png") center bottom / 100% 100% no-repeat;
}

.impact-overlay {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  /* background: rgba(0, 0, 0, 0.72); */
  z-index: 20;
  opacity: 0;
  transition: opacity 180ms ease;
}

.impact-overlay.is-visible {
  opacity: 1;
}

.impact-card {
  z-index:500;
  width: min(420px, 88vw);
  /* padding: 28px 22px; */
  /* border-radius: 28px; */
  /* border: 1px solid rgba(255, 195, 90, 0.65); */
  /* background: #583F26; */
  /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65); */
  color: #f7e4b3;
  text-align: center;
  font-family: 'Souvenir', serif;
  
  border-style: solid;
  border-width: 50px;
  /* border-image-slice: 50 60 50 60 fill;
  border-image-width: 1;
  border-image-repeat: stretch; */
border-image-slice:145 122 195 136 fill;
border-image-width:30px 30px 50px 30px;
border-image-outset:0px 0px 0px 0px;
border-image-repeat:stretch stretch;
  border-image-source: url("../img/impact_bg.png");
  box-sizing: border-box;

}

.impact-card h3 {
  margin: 0 0 12px;
  font-size: clamp(24px, 5vw, 32px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffd87a;
  font-family: "Souvenir", serif;
}

.impact-card p {
  margin: 0 0 22px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #f0d8b8;
}

.impact-stats {
  display: grid;
  gap: 10px;
  margin: 0 auto 18px;
  max-width: 320px;
  text-transform: uppercase;
}

.impact-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 213, 131, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.05rem;
  font-family: 'Souvenir', serif;
  color: #fff;
  border-image-slice:60 fill;
border-image-width:15px 15px 15px 15px;
border-image-outset:0px 0px 0px 0px;
border-image-repeat:stretch stretch;
border-image-source:url("../img/impact_border.png");

}

.impact-stats div span {
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  gap: 8px;
}

.impact-stats div:nth-child(1) {
  color: #FA4600;
}

.impact-stats div:nth-child(2) {
  color: #F07DF0;
}

.impact-stats div:nth-child(3) {
  color: #F7FA6D;
}

.impact-stats div:nth-child(4) {
  color: #FFD328;
}

.impact-card .image-button {
  width: min(280px, 82%);
  margin: 0 auto;
}

.quiz-options {
  position: relative;
  z-index: 1;
  width: 90%;
  margin-inline: auto;
  display: grid;
  gap: 10px;
}

.quiz-option {
  --option-scale: 1;
  position: relative;
  width: 100%;
  min-height: 52px;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--cream);
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.48));
  opacity: 0;
  transform: translateY(10px) scale(var(--option-scale));
  transform-origin: center center;
  pointer-events: none;
  transition:
    transform 340ms cubic-bezier(0.18, 0.9, 0.24, 1.18),
    filter 300ms ease;
  will-change: transform;
}

.quiz-option.is-visible {
  animation: optionIn 360ms ease forwards;
  animation-delay: var(--delay, 0ms);
}

.quiz-option.is-ready {
  pointer-events: auto;
  filter: brightness(1) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.52));
}

.quiz-option.is-selected {
  --option-scale: 1.04;
  filter: brightness(1.5) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.52));
}

.quiz-option.is-ready:active {
  --option-scale: 0.985;
  transition-duration: 120ms;
}

.quiz-option::after {
  content: ">";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 24px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #f39501;
  font-family: "Souvenir", serif;
  font-size: 26px;
  font-weight: bolder;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(95, 43, 0, 0.9),
    0 4px 7px rgba(0, 0, 0, 0.75),
    0 0 9px rgba(255, 191, 45, 0.5);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.62));
  opacity: 0;
  transform: translateY(-50%) scale(0.45) rotate(-16deg);
  pointer-events: none;
}

.quiz-option.is-selected::after {
  animation: tickPop 360ms cubic-bezier(0.2, 1.35, 0.35, 1) forwards;
}

.quiz-option::after {
  content: "\2713";
}

.quiz-option img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  -webkit-box-shadow: 0px 10px 13px -7px #000000, 5px 33px 25px -20px #000000; 
box-shadow: 0px 10px 13px -7px #000000, 5px 33px 25px -20px #000000;
}

.quiz-option span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 52px;
  padding: 8px 64px 8px 26px;
  font-family: "Souvenir", serif;
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.05;
  text-align: left;
  /* text-shadow: 0 2px 0 rgba(20, 10, 0, 0.8), 0 3px 7px rgba(0, 0, 0, 0.55); */
  text-shadow: 0 2px 0 #0b1119, 0 4px 6px rgba(0, 0, 0, 0.6);
  transform: translateY(1px);
  white-space: normal;
}

.choose-wisely {
  container-type: inline-size;
  width: 73.9%;
  margin: auto auto 10px;
  z-index: 3;
}

.choose-wisely img {
  position: relative;
  z-index: 1;
}

.choose-wisely span {
  z-index: 2;
  font-size: clamp(20px, 5.6vw, 28px);
}

.choose-wisely.is-disabled {
  opacity: 0.58;
  filter: grayscale(0.16) brightness(0.82);
  pointer-events: none;
}

.choose-wisely.is-enabled {
  opacity: 1;
  pointer-events: auto;
}

@keyframes optionIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(var(--option-scale));
  }
}

@keyframes tickPop {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0.45) rotate(-16deg);
  }

  68% {
    opacity: 1;
    transform: translateY(-50%) scale(1.22) rotate(5deg);
  }

  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1) rotate(0deg);
  }
}

@media (max-height: 760px) {
  .landing-content {
    padding-top: 11.5%;
    padding-bottom: 10.8%;
  }

  .landing-message {
    padding-bottom: 11.5%;
  }

  .stats-strip {
    height: auto;
  }

  .scene-wrap {
    height: 35%;
  }

  .question-card {
    margin-bottom: 9px;
  }

  .question-card img {
    height: 100px;
  }

  .quiz-options {
    gap: 6px;
  }

  .quiz-option {
    min-height: 44px;
  }

  .quiz-option span {
    font-size: clamp(18px, 4.6vw, 23px);
    min-height: 44px;
    padding: 6px 58px 6px 24px;
  }

  .question-card p {
    font-size: clamp(18px, 4.8vw, 23px);
  }

  .choose-wisely {
    width: min(70%, 310px);
  }

  .choose-wisely span {
    font-size: clamp(19px, 5vw, 24px);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .page {
    display: grid;
    place-items: center;
    padding: 14px;
  }

  .device-frame {
    width: min(calc(100vw - 28px), 45.995vh);
    height: min(calc(var(--app-height) - 28px), 217.413vw);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  }
}

@media (min-width: 1024px) {
  .page {
    display: grid;
    place-items: center;
    padding: 14px;
    background: #080503;
  }

  .quiz-body
  {
    /* margin-top: 50px; */
  }

  .device-frame {
    width: min(calc(100vw - 28px), var(--device-max-width));
    max-width: var(--device-max-width);
    height: min(calc(var(--app-height) - 28px), calc(var(--device-max-width) * var(--device-aspect)));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  }

  .play-panel,
  .scene-wrap::before
  {
    border-width: 80px;
  }

  /* .scene-wrap::before {
    content: "";
  } */

  /* .app-shell {
    background:
      linear-gradient(90deg, rgba(12, 7, 5, 0.84), rgba(28, 18, 11, 0.52) 46%, rgba(10, 6, 5, 0.9)),
      url("../img/bg.jpg") center / cover repeat;
  } */

  .landing-backdrop {
    background:
      /* linear-gradient(90deg, rgba(9, 5, 3, 0.78) 0%, rgba(12, 6, 4, 0.3) 45%, rgba(8, 4, 3, 0.86) 100%), */
      url("../img/landing_bg.jpg") center 35% / cover no-repeat;
  }

  .landing-content {
    align-items: center;
    justify-content: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 7vw 32px;
  }

  .hero-copy,
  .landing-message {
    width: min(560px, 44vw);
    text-align: center;
  }

  .hero-logo {
    width: min(420px, 100%);
    margin: -8px auto 0;
  }

  .hero-subtitle {
    font-size: clamp(34px, 3vw, 52px);
  }

  .landing-message {
    margin-top: 2.2vh;
    padding-bottom: 0;
  }

  .landing-message h1 {
    font-size: clamp(32px, 3.4vw, 56px);
    line-height: 1.08;
  }

  .landing-meter {
    width: min(460px, 40vw);
    height: auto;
    margin-top: 24px;
  }

  .start-journey {
    width: 286px;
    margin-top: 18px;
  }

  .quiz-content {
    --desktop-panel-top-gap: clamp(26px, 3vh, 36px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding: 5px clamp(42px, 4.6vw, 88px) clamp(28px, 3.2vh, 50px);
    background:
      radial-gradient(circle at 26% 52%, rgba(172, 94, 29, 0.18), transparent 36%),
      linear-gradient(180deg, rgba(18, 19, 26, 0.96), rgba(18, 11, 7, 0.97)),
      url("../img/bg_new.png") center / 760px repeat;
  }

  .quiz-content::before {
    inset: 0;
    z-index: 4;
    border: 12px solid transparent;
    border-image: linear-gradient(180deg, #6d3b14, #b77728 48%, #5b2c0d) 1;
    background: none;
    box-shadow:
      inset 0 0 0 2px rgba(245, 186, 89, 0.42),
      inset 0 0 22px rgba(0, 0, 0, 0.62);
  }

  .quiz-content::after {
    inset: 12px;
    height: auto;
    border: 1px solid rgba(214, 137, 48, 0.34);
    background: none;
    pointer-events: none;
  }

  /* .quiz-frame-corners {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    pointer-events: none;
  } */

  /* .quiz-frame-corner {
    position: absolute;
    width: clamp(88px, 7vw, 122px);
    aspect-ratio: 663 / 662;
    background: url("../img/cornor_frame.png") center / contain no-repeat;
    transform-origin: center;
    filter: drop-shadow(0 2px 1px rgba(60, 26, 3, 0.5));
  } */

  .corner-top-left {
    top: 9px;
    left: 9px;
  }

  .corner-top-right {
    top: 9px;
    right: 9px;
    transform: rotate(90deg);
  }

  .corner-bottom-right {
    right: 9px;
    bottom: 9px;
    transform: rotate(180deg);
  }

  .corner-bottom-left {
    left: 9px;
    bottom: 9px;
    transform: rotate(270deg);
  }

  .quiz-header {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    gap: 0;
    max-width: none;
    padding: 0 0 8px;
    position: relative;
    z-index: 1;
  }

  .quiz-body {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(30px, 3.2vh, 42px) clamp(42px, 4.6vw, 86px);
    align-items: stretch;
    min-height: 0;
  }

  .chapter-title {
    position: relative;
    z-index: 1;
    width: calc(100% + (2 * clamp(42px, 6vw, 88px)));
    margin: 0 calc(-1 * clamp(42px, 6vw, 88px));
    justify-self: stretch;
    min-height: 116px;
    aspect-ratio: auto;

    /* background: linear-gradient(180deg, #0F161C, #131e24); */
    
    /* background: linear-gradient(180deg, rgba(37, 59, 75, 0.98), rgba(35, 56, 72, 0.98)); */
    /* border-top: 1px solid rgba(172, 113, 38, 0.72); */
    /* border-style: double; */
    background:
        url("../img/bg_noise.jpg");
    border-bottom: 5px double #6f3a05;
    /* border-left: 0; */
    /* border-right: 0; */
    /* box-shadow:
      inset 0 1px 0 rgba(230, 174, 87, 0.15),
      inset 0 -12px 24px rgba(0, 0, 0, 0.12); */
    /* background-image: url('../img/bg_noise.png'); */
    overflow: hidden;
  }


  .chapter-title::before,
  .chapter-title::after {
    content: "";
    position: absolute;
    inset: 12px 18px;
    pointer-events: none;
  }

  .chapter-title::before {
    inset: auto 0 0;
    height: 1px;
    border: 0;
    /* background: linear-gradient(90deg, transparent 3%, rgba(186, 132, 52, 0.3) 18%, rgba(186, 132, 52, 0.3) 82%, transparent 97%); */
  }

  .chapter-title::after {
    inset: auto 0 44px;
    height: 1px;
    /* background: linear-gradient(90deg, transparent 4%, rgba(196, 140, 59, 0.12) 18%, rgba(196, 140, 59, 0.12) 82%, transparent 96%); */
  }

  .chapter-title h2 {
    inset: 0 30px 50px;
    color: #F5CF94;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 5px;
    font-size: clamp(19px, 3vw, 30px);
    font-family: "Souvenir", serif;
    font-weight: 400;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.32), 0 3px 8px rgba(0, 0, 0, 0.24);
    white-space: nowrap;
    gap: 6px;
    text-transform: uppercase;
  }

  .chapter-title h2::before {
    content: "Chapter - ";
    flex: 0 0 auto;
  }

  .chapter-title img {
    display: none;
  }

  .stats-strip {
    position: relative;
    z-index: 1;
    width: min(580px, 50vw);
    justify-self: center;
    align-self: end;
    min-height: 52px;
    aspect-ratio: auto;
    margin: -29px auto 0;
    padding: 8px 18px 9px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* background:
      linear-gradient(180deg, rgba(92, 48, 17, 0.96), rgba(47, 24, 10, 0.98)),
      linear-gradient(90deg, rgba(213, 154, 65, 0.08), rgba(255, 255, 255, 0));
    border: 1px solid rgba(171, 112, 39, 0.72);
    box-shadow:
      inset 0 0 0 1px rgba(232, 175, 87, 0.18),
      0 8px 16px rgba(0, 0, 0, 0.16); */
    overflow: hidden;
  }

  .stats-strip::before,
  .stats-strip::after {
    display: none;
  }

  .stat-item {
    gap: 6px;
    font-size: clamp(20px, 1.25vw, 28px);
  }

  .stat-item:not(.stat-wealth)::after {
    content: "";
    position: absolute;
    right: -2px;
    top: 50%;
    width: 1px;
    height: 64%;
    transform: translateY(-50%);
    background: linear-gradient(180deg, transparent, rgba(217, 163, 76, 0.55), transparent);
  }

  .stat-item:nth-child(2) img,
  .stat-item:nth-child(4) img {
    width: 30px;
  }

  .stat-item:nth-child(3) img {
    width: 30px;
  }

  .stat-wealth img {
    width: 30px;
  }

  .scene-wrap {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.48);
    overflow: hidden;
    z-index: 1;
    /* border-width: 20px;
    border-image-slice: 121 121 126 126;
    border-image-width: 20px 20px 20px 20px;
    border-image-outset: 0;
    border-image-repeat: stretch;
    border-image-source: url('../img/frame_question.png'); */
  }

  /* .scene-wrap::after {
    content: none;
  } */

  .scene-image {
    position: absolute;
    z-index: 0;
    object-position: center;
  }


  .play-panel {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(12px, 1.7vh, 20px);
    padding: var(--desktop-panel-top-gap) 0 0;
  }



  .question-area {
    display: block;
    padding: 0;
  }

  .question-area::after {
    display: none;
  }

  .question-card {
    width: 100%;
    margin: 0 0 clamp(14px, 1.8vh, 22px);
    min-height: clamp(118px, 12vh, 150px);
  }

  .question-card img {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .question-card p {
    position: relative;
    min-height: clamp(118px, 12vh, 150px);
    padding: clamp(18px, 2.1vh, 26px) 34px;
    font-size: clamp(21px, 1.45vw, 29px);
    line-height: 1.08;
  }

  .question-card::before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: 3px;
    height: 2px;
    background: url("../img/question_border_bottom.png") center top / 100% 100% no-repeat;
  }

  .question-card::after {
    z-index: 2;
    height: 2px;
  }

  .quiz-options {
    gap: clamp(10px, 1.15vh, 14px);
  }

  .quiz-option {
    min-height: clamp(56px, 5.4vh, 68px);
  }

  .quiz-option span {
    min-height: clamp(56px, 5.4vh, 68px);
    padding: 10px 64px 10px 24px;
    font-size: clamp(19px, 1.2vw, 25px);
    line-height: 1.05;
  }

  .quiz-option::after {
    right: 24px;
    width: 28px;
    height: 28px;
    font-size: 26px;
  }

  .choose-wisely {
    width: min(270px, 46%);
    margin: clamp(4px, 0.8vh, 10px) auto 0;
  }

  .quiz-content > img[style] {
    display: none;
  }

  .impact-overlay {
    padding-inline: 24px;
    box-sizing: border-box;
  }

  .impact-card {
    width: min(520px, 90vw);
    /* padding: 34px 30px;
    border-radius: 10px; */
  }

  .impact-card h3 {
    font-size: 38px;
  }

  .impact-card p,
  .impact-stats div {
    font-size: 22px;
  }

  .result-content {
    padding: 32px;
  }

  .result-panel {
    width: min(430px, 78vh, 88vw);
    max-width: 370px;
    padding: 30px 0px 28px;
  }

  .result-panel h2 {
    font-size: clamp(34px, 3vw, 44px);
  }

  .result-panel #resultSummary {
    min-height: 48px;
    font-size: clamp(20px, 1.65vw, 24px);
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .result-stat {
    grid-template-columns: 42px 1fr;
    justify-items: stretch;
    text-align: left;
    min-height: 86px;
  }

  .result-stat img {
    grid-row: 1 / 3;
  }

  .result-stat span {
    font-size: 16px;
  }

  .result-stat strong,
  .result-meta strong {
    font-size: 32px;
  }

  .result-panel .continue-chapter,
  .result-panel .complete-journey,
  .result-panel .play-again,
  .result-panel .share-journey {
    width: min(92%, 330px);
    margin: 20px auto 0;
    vertical-align: top;
  }

  .result-panel .complete-journey,
  .result-panel .share-journey {
    width: min(92%, 330px);
  }

  .result-panel .image-button img {
    max-height: 70px;
    object-fit: contain;
  }
}

@media (min-width: 1024px) {
  body.force-desktop-portrait .page {
    display: grid;
    place-items: center;
    padding: 14px;
    background: #080503;
  }

  body.force-desktop-portrait .device-frame {
    width: min(calc(100vw - 28px), var(--device-max-width));
    max-width: var(--device-max-width);
    height: min(calc(var(--app-height) - 28px), calc(var(--device-max-width) * var(--device-aspect)));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  }

  body.force-desktop-portrait .quiz-frame::before,
  body.force-desktop-portrait .result-screen::before {
    border-width: 42px;
    border-image-width: 28px;
  }

  body.force-desktop-portrait .landing-content {
    max-width: none;
    margin: 0;
    padding: 10px 14px 12px;
    gap: 8px;
    overflow: hidden;
  }

  body.force-desktop-portrait .landing-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }

  body.force-desktop-portrait .landing-left {
    align-items: center;
    width: 100%;
  }

  body.force-desktop-portrait .hero-copy,
  body.force-desktop-portrait .landing-message {
    width: 100%;
    text-align: center;
  }

  body.force-desktop-portrait .hero-logo {
    width: min(280px, 76vw);
    margin: 0 auto;
  }

  body.force-desktop-portrait .landing-message {
    margin-top: auto;
  }

  body.force-desktop-portrait .landing-message h1 {
    font-size: clamp(18px, 5.6vw, 27px);
  }

  body.force-desktop-portrait .landing-meter {
    width: 100%;
    margin-top: 8px;
  }

  body.force-desktop-portrait .start-journey {
    width: min(272px, 82vw);
    margin-top: 8px;
  }

  body.force-desktop-portrait .landing-side {
    width: 100%;
    gap: 8px;
  }

  body.force-desktop-portrait .auth-card {
    width: min(300px, 88vw);
    margin: 0 auto;
    padding: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.force-desktop-portrait .auth-card h2,
  body.force-desktop-portrait .auth-card p {
    display: none;
  }

  body.force-desktop-portrait .quiz-content {
    --desktop-panel-top-gap: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: #15161c;
  }

  body.force-desktop-portrait .quiz-content::before,
  body.force-desktop-portrait .quiz-content::after {
    display: none;
  }

  body.force-desktop-portrait .quiz-header {
    display: block;
    flex-shrink: 0;
    max-width: none;
    padding: 0;
  }

  body.force-desktop-portrait .quiz-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    overflow: hidden;
  }

  body.force-desktop-portrait .chapter-title {
    width: 100%;
    min-height: 0;
    aspect-ratio: 392 / 64;
    margin: 0;
    border-bottom: 0;
  }

  body.force-desktop-portrait .chapter-title h2 {
    inset: 0 8%;
    padding-top: clamp(2px, 0.5vw, 4px);
    font-size: clamp(20px, 5.4vw, 28px);
    white-space: nowrap;
  }

  body.force-desktop-portrait .chapter-title h2::before {
    content: none;
  }

  body.force-desktop-portrait .stats-strip {
    width: 100%;
    min-height: 0;
    aspect-ratio: 500 / 60;
    margin-top: 0;
    padding: 15px 4.2% 3.4% 4.2%;
  }

  body.force-desktop-portrait .stat-item {
    gap: 4px;
    font-size: clamp(22px, 5vw, 29px);
  }

  body.force-desktop-portrait .stat-item:not(.stat-wealth)::after {
    content: none;
  }

  body.force-desktop-portrait .scene-wrap {
    height: 35%;
    max-height: none;
    border-width: 0;
    box-shadow: none;
  }

  body.force-desktop-portrait .play-panel {
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
    padding-top: 0;
    border-width: 1px;
    border-image-width: 50px;
  }

  body.force-desktop-portrait .question-area {
    display: block;
    flex: initial;
    padding: 0 4.8%;
    overflow: visible;
  }

  body.force-desktop-portrait .question-card {
    width: calc(100% + 9.6%);
    margin: 0 -4.8% 13px;
    min-height: 0;
    max-height: none;
  }

  body.force-desktop-portrait .question-card p {
    min-height: 0;
    max-height: none;
    padding: 14px 18px 12px;
    font-size: clamp(20px, 5.55vw, 25px);
    line-height: 1;
  }

  body.force-desktop-portrait .quiz-options {
    width: 90%;
    min-height: 0;
    display: grid;
    gap: clamp(7px, 1.2vh, 10px);
    overflow: visible;
  }

  body.force-desktop-portrait .quiz-option {
    flex: initial;
    min-height: 52px;
    max-height: none;
  }

  body.force-desktop-portrait .quiz-option span {
    min-height: 52px;
    height: auto;
    padding: 8px 64px 8px 26px;
    font-size: clamp(20px, 5vw, 20px);
    line-height: 1.05;
  }

  body.force-desktop-portrait .choose-wisely {
    flex-shrink: initial;
    width: 73.9%;
    margin: auto auto 10px;
  }

  body.force-desktop-portrait .choose-wisely img {
    max-height: none;
    width: 100%;
  }
}

@media (max-width: 360px) {
  .hero-subtitle {
    font-size: 25px;
  }

  .landing-message h1,
  .image-button span {
    font-size: 25px;
  }

  .chapter-title h2 {
    font-size: 19px;
  }

  .stat-item {
    font-size: 23px;
  }

  .question-card p,
  .quiz-option span {
    font-size: 18px;
  }

  .choose-wisely span {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-screen,
  .quiz-screen,
  .account-screen,
  .image-button,
  .age-accordion-panel-inner,
  .age-accordion-body--expanded,
  .age-accordion-body--collapsed,
  .badge-progress-bar__fill,
  .age-accordion-icon {
    transition: none;
  }

  .quiz-option.is-visible {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Landing menu/auth UI */
.landing-screen {
  --panel-bg: rgba(17, 13, 8, 0.82);
  --panel-line: rgba(219, 143, 28, 0.72);
  --panel-glow: rgba(255, 190, 64, 0.24);
  font-family: "Souvenir", serif;
}

.landing-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  border-style: solid;
  border-width: 80px;
  border-image-slice: 50 60 50 60 fill;
  border-image-width: 50px;
  border-image-repeat: stretch;
  border-image-source: url("../img/frame.png");
  box-sizing: border-box;
}

.landing-screen button,
.landing-screen input,
.landing-screen select,
.landing-screen textarea {
  font-family: "Souvenir", Georgia, serif;
}

.landing-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12.7% 0 12.3%;
}

.landing-topbar,
.landing-main,
.landing-feature-strip {
  position: relative;
  z-index: 2;
}

.landing-topbar {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top:10px;
}

.online-pill,

.landing-secondary-actions button,
.mobile-action-deck button,
.landing-feature-strip button,
.landing-feature-strip div,
.player-card,
.auth-card,
.landing-panel {
  border: 1px solid var(--panel-line);
  background:
    linear-gradient(180deg, rgba(34, 25, 16, 0.82), rgba(8, 8, 7, 0.88)),
    rgba(16, 12, 8, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(255, 208, 117, 0.14),
    0 12px 24px rgba(0, 0, 0, 0.34);
  color: #fff3ca;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: clamp(14px, 1.25vw, 20px);
  text-shadow: var(--copy-shadow);
}

.online-pill span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #72d64a;
  box-shadow: 0 0 10px rgba(113, 233, 70, 0.9);
}

.landing-actions {
  display: flex;
  gap: clamp(8px, 1.3vw, 5px);
}

.landing-icon-button {
  min-width: clamp(56px, 6.4vw, 86px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff0bf;
  cursor: pointer;
  text-align: center;
  text-shadow: var(--copy-shadow);
}

.landing-icon-button[hidden] {
  display: none;
}

.landing-icon-button strong {
  display: grid;
  place-items: center;
  width: clamp(46px, 4.5vw, 45px);
  height: clamp(46px, 4.5vw, 45px);
  margin: 0 auto 5px;
  /* border: 2px solid #b46c18;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255, 216, 104, 0.2), rgba(9, 8, 7, 0.94) 68%); */
  color: #ffc75a;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1;
}

.signin-button strong {
  color: #2f5fb9;
  /* background: radial-gradient(circle at 38% 30%, #fff, #dfe6ff 58%, #101010 60%); */
}

.account-button strong {
  color: #fff;
  /* background: radial-gradient(circle at 38% 30%, #4f86e8, #2f5fb9 58%, #1a3f7a 100%); */
  border-color: #d4a63a;
}

.settings-button strong img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.landing-icon-button span {
  display: block;
  font-size: clamp(11px, 1.05vw, 16px);
  line-height: 1.1;
}

.landing-main {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.landing-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.hero-copy,
.landing-message {
  width: 100%;
  text-align: center;
}

.hero-logo {
  width: min(430px, 100%);
  margin-top: -6px;
}

.hero-subtitle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80%;
  min-height: 44px;
  margin-top: -6px;
  border: 1px solid rgba(230, 154, 34, 0.75);
  background: linear-gradient(180deg, rgba(14, 36, 36, 0.86), rgba(8, 21, 22, 0.88));
  color: #fff2c8;
  font-family: "Souvenir", serif;
  font-size: clamp(25px, 2.3vw, 40px);
  text-transform: uppercase;
}

.landing-message {
  width: 100%;
  margin-top: auto;
  padding-bottom: 16.3%;
  text-align: center;
}

.landing-message h1 {
  margin: 0;
  color: #fff;
  font-family: "Souvenir", "Greyhound", serif;
  font-size: clamp(25px, 7.1vw, 32px);
  line-height: 1.18;
  text-shadow: var(--copy-shadow);
}

.landing-meter {
  position: relative;
  width: 94%;
  height: auto;
  display: grid;
  place-items: start center;
}

.reputation-line {
  display: block;
  width: 93.8%;
  margin-top: -30px;
}

.start-journey {
  width: 71.15%;
  margin: 4px auto 0;
}

body.is-firebase-signed-in .auth-card {
  display: none;
}

body.is-firebase-signed-in .signin-button {
  display: none;
}

body:not(.is-firebase-signed-in) .account-button {
  display: none;
}

body.is-firebase-signed-in .start-journey {
  width: min(320px, 82vw);
  min-height: auto;
  padding: 0;
  border: 0;
  clip-path: none;
  background: transparent;
  box-shadow: none;
}

body.is-firebase-signed-in .start-journey img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-card [hidden] {
  display: none !important;
}

.landing-secondary-actions,
.mobile-action-deck {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

.landing-secondary-actions button,
.mobile-action-deck button,
.landing-feature-strip button,
.guest-button,
.google-signin,
.landing-list button {
  cursor: pointer;
}

.landing-secondary-actions button,
.mobile-action-deck button,
.landing-feature-strip button {
  min-height: 48px;
  padding: 9px 18px;
  color: #ffe7a5;
  font-size: clamp(15px, 1.2vw, 19px);
  text-transform: uppercase;
}

.landing-secondary-actions span,
.mobile-action-deck span,
.landing-feature-strip button span {
  margin-right: 9px;
  color: #ffc75a;
}

.landing-side {
  display: none;
}

body:not(.is-firebase-signed-in) .landing-main {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

body:not(.is-firebase-signed-in) .landing-left {
  align-items: center;
}

.player-card,
.auth-card {
  position: relative;
  padding: clamp(16px, 1.8vw, 24px);
}

.player-card {
  display: none;
  grid-template-columns: 76px 1fr;
  gap: 14px 18px;
}

body.is-firebase-signed-in .player-card {
  display: grid;
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 2px solid #d89426;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #eee7d0, #1b1d1c 66%);
  color: #211b14;
  font-size: 38px;
}

.player-info {
  position: relative;
  min-width: 0;
}

.player-info h2,
.auth-card h2,
.landing-panel h2 {
  margin: 0;
  color: #ffe6a4;
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1;
  text-shadow: var(--copy-shadow);
}

.profile-signout {
  position: absolute;
  top: -4px;
  right: 0;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 208, 100, 0.75);
  background: rgba(20, 12, 4, 0.72);
  color: #ffd064;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.profile-signout[hidden] {
  display: none;
}

.player-info p,
.auth-card p {
  margin: 10px 0 0;
  color: #fff3cf;
  font-size: 16px;
}

.xp-track {
  height: 9px;
  margin-top: 8px;
  border: 1px solid #9e6a25;
  background: #111;
}

.xp-track span {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, #61c741, #d7e86a);
}

.wallet-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.wallet-row div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid rgba(221, 150, 43, 0.8);
  color: #ffe78e;
  font-size: clamp(17px, 1.4vw, 22px);
  background: rgba(8, 8, 8, 0.54);
}

.wallet-row img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.auth-card {
  text-align: center;
}

.google-signin,
.guest-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border: 2px solid #d28a1f;
  color: #fff6dc;
  font-size: clamp(16px, 1.35vw, 21px);
  text-transform: uppercase;
  text-shadow: var(--copy-shadow);
}

.google-signin {
  background: linear-gradient(180deg, #a51e16, #5c0d08);
}

.google-signin:disabled {
  opacity: 0.65;
  cursor: wait;
}

.google-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-family: "Souvenir", serif;
  font-weight: 700;
  text-shadow: none;
}

.guest-button {
  background: linear-gradient(180deg, rgba(42, 39, 31, 0.92), rgba(12, 12, 11, 0.96));
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: #f7d37b;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 173, 59, 0.85), transparent);
}

.mobile-action-deck {
  display: none;
}

.landing-feature-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.landing-feature-strip button {
  display: none;
}

.landing-feature-strip div {
  min-height: 78px;
  padding: 13px 18px 12px;
  border-left-width: 0;
}

.landing-feature-strip div:first-of-type {
  border-left-width: 1px;
}

.landing-feature-strip strong,
.landing-feature-strip span {
  display: block;
}

.landing-feature-strip strong {
  color: #ffd66f;
  font-size: clamp(14px, 1.2vw, 18px);
  text-transform: uppercase;
}

.landing-feature-strip span {
  margin-top: 6px;
  color: #fff4d0;
  font-family: "Souvenir", serif;
  font-size: clamp(12px, 1vw, 16px);
  line-height: 1.28;
}

.landing-panels {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.landing-panels::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  opacity: 0;
  transition: opacity 180ms ease;
}

.landing-panels.has-active-panel,
.landing-panels:has(.landing-panel.is-active) {
  pointer-events: auto;
}

.landing-panels.has-active-panel::before,
.landing-panels:has(.landing-panel.is-active)::before {
  opacity: 1;
}

.landing-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(350px, calc(100vw - 36px));
  max-height: min(680px, calc(100% - 84px));
  padding: 16px;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -46%) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

.landing-panel.is-active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s;
}

.landing-panel header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(220, 157, 62, 0.38);
  padding-bottom: 12px;
}

.landing-panel header button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #ffd26a;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow: var(--copy-shadow);
}

.landing-panel header button:first-child {
  font-size: 38px;
}

.landing-panel header button:last-child {
  justify-self: end;
  font-family: "Souvenir", serif;
  font-size: 22px;
  font-weight: 700;
}

.landing-panel h2 {
  text-align: center;
  text-transform: uppercase;
}

.landing-list {
  display: grid;
  gap: 8px;
}

.landing-list button,
.leaderboard-list li,
.landing-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(212, 142, 39, 0.48);
  background: rgba(11, 10, 9, 0.58);
  color: #fff1c9;
  text-align: left;
  font-size: 16px;
}

.landing-list em {
  color: #ffd574;
  font-style: normal;
  white-space: nowrap;
}

.setting-toggle b {
  position: relative;
  width: 40px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #46372a, #6a5340);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: background 160ms ease, filter 160ms ease;
}

.setting-toggle b::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f6dba0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease;
}

.setting-toggle.is-on b {
  /* background: linear-gradient(90deg, #ffea04, #8c7c03); */
background: linear-gradient(90deg, #BF6B04, #BF6B04);
}

.setting-toggle.is-on b::after {
  transform: translateX(20px);
}

.setting-toggle:active b {
  filter: brightness(1.2);
}

.landing-summary {
  margin-bottom: 12px;
  justify-content: center;
  color: #ffe5a5;
}

.landing-summary strong {
  margin-left: 10px;
  color: #fff;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.leaderboard-list li strong {
  color: #ffd66f;
}

@media (max-width: 1023px) {
  .landing-backdrop {
    background-position: center top;
  }

  .landing-content {
    padding: 20px 25px 12px 12px;
    gap: 8px;
    overflow: hidden;
  }

  .landing-screen::before {
    border-width: 42px;
    border-image-width: 50px;
  }

  .landing-topbar {
    align-items: center;
  }

  .online-pill {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .online-pill span {
    width: 7px;
    height: 7px;
  }

  .landing-actions {
    gap: 7px;
  }

  .landing-icon-button {
    min-width: 43px;
  }

  .landing-icon-button:nth-child(-n + 2) {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
  }

  .landing-icon-button strong {
    width: 36px;
    height: 36px;
    margin-bottom: 2px;
    font-size: 18px;
  }

  .landing-icon-button span {
    font-size: 10px;
  }

  .landing-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
  }

  .landing-left {
    align-items: center;
    width: 100%;
  }

  .hero-copy,
  .landing-message {
    width: 100%;
    text-align: center;
  }

  .hero-logo {
    /* width: min(280px, 76vw); */
    margin: 0 auto;
  }

  .hero-subtitle {
    width: min(230px, 68vw);
    min-height: 28px;
    margin-top: -3px;
    font-size: clamp(18px, 6vw, 25px);
  }

  .landing-message {
    margin-top: auto;
  }

  .landing-message h1 {
    font-size: clamp(18px, 5.6vw, 27px);
  }

  .landing-meter {
    width: 100%;
    margin-top: 8px;
  }

  .start-journey {
    width: min(272px, 82vw);
    margin-top: 8px;
  }

  body.is-firebase-signed-in .start-journey {
    min-height: 48px;
  }

  body.is-firebase-signed-in .start-journey span {
    font-size: clamp(16px, 5vw, 22px);
  }

  .landing-secondary-actions {
    display: none;
  }

  .landing-side {
    width: 100%;
    gap: 8px;
  }

  .player-card {
    display: none;
  }

  body.is-firebase-signed-in .player-card {
    display: grid;
  }

  .auth-card {
    width: min(300px, 88vw);
    margin: 0 auto;
    padding: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .auth-card h2,
  .auth-card p {
    display: none;
  }

  .google-signin,
  .guest-button {
    min-height: 36px;
    margin-top: 6px;
    font-size: 13px;
  }

  .google-mark {
    width: 24px;
    height: 24px;
  }

  .auth-divider {
    margin-top: 5px;
    font-size: 12px;
  }

  .mobile-action-deck {
    z-index: 2;
    display: grid;
    width: min(330px, 92vw);
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0 auto;
  }

  .mobile-action-deck button {
    min-height: 46px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .mobile-action-deck span {
    display: block;
    margin: 0 0 3px;
    font-size: 17px;
  }

  .landing-feature-strip {
    z-index: 2;
    width: min(330px, 92vw);
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin: 0 auto;
  }

  .landing-feature-strip button {
    display: block;
    min-height: 44px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .landing-feature-strip button span {
    display: block;
    margin: 0 0 3px;
    font-size: 16px;
  }

  .landing-feature-strip div {
    display: none;
  }

  .landing-panel {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(420px, calc(100vw - 28px));
    max-height: calc(100% - 28px);
    padding: 14px;
    transform: translate(-50%, -46%) scale(0.98);
  }

  .landing-panel.is-active {
    transform: translate(-50%, -50%) scale(1);
  }

  .landing-panel header {
    grid-template-columns: 36px 1fr 36px;
    margin-bottom: 12px;
  }
}

@media (max-height: 760px) and (max-width: 1023px) {
  .hero-logo {
    width: min(230px, 68vw);
  }

  .hero-subtitle {
    min-height: 24px;
    font-size: clamp(16px, 5vw, 21px);
  }

  .landing-message h1 {
    font-size: clamp(17px, 5vw, 22px);
  }

  .start-journey {
    width: min(230px, 74vw);
  }

  body.is-firebase-signed-in .start-journey {
    min-height: 42px;
  }

  .google-signin,
  .guest-button {
    min-height: 32px;
  }

  .mobile-action-deck button,
  .landing-feature-strip button {
    min-height: 38px;
  }
}

@media (min-width: 1280px) and (max-width: 1440px) and (min-height: 560px) and (max-height: 680px) {
  .landing-screen::before {
    border-width: 34px;
    border-image-width: 22px;
  }

  .landing-content {
    padding: 8px 30px 10px;
    gap: 7px;
  }

  .landing-main {
    grid-template-columns: minmax(360px, 1fr) 360px;
    gap: 42px;
  }

  .hero-logo {
    width: 360px;
  }

  .hero-subtitle {
    width: 290px;
    min-height: 34px;
    font-size: 28px;
  }

  .landing-message {
    margin-top: 16px;
  }

  .landing-message h1 {
    font-size: 32px;
  }

  .start-journey {
    width: 300px;
    margin-top: 14px;
  }

  .player-card,
  .auth-card {
    padding: 14px;
  }

  .landing-feature-strip div {
    min-height: 58px;
    padding: 9px 14px;
  }

  .quiz-frame::before {
    border-width: 34px;
    border-image-width: 22px;
  }

  .quiz-content {
    --desktop-panel-top-gap: 8px;
    height: 100%;
    padding: 2px 28px 10px;
    overflow: hidden;
  }

  .quiz-header {
    padding: 0 0 4px;
  }

  .chapter-title {
    min-height: 68px;
  }

  .chapter-title h2 {
    inset: 0 24px 34px;
    font-size: 22px;
  }

  .stats-strip {
    width: min(480px, 72vw);
    min-height: 42px;
    margin: -18px auto 0;
    padding: 5px 12px 6px;
  }

  .stat-item {
    font-size: 20px;
    gap: 4px;
  }

  .stat-item:nth-child(2) img,
  .stat-item:nth-child(3) img,
  .stat-item:nth-child(4) img,
  .stat-wealth img {
    width: 24px;
  }

  .quiz-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 28px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .scene-wrap {
    height: 100%;
    max-height: 100%;
    border-width: 12px;
    border-image-width: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  }

  .scene-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .play-panel {
    height: 100%;
    min-height: 0;
    gap: 6px;
    padding-top: var(--desktop-panel-top-gap);
    border-width: 34px;
    border-image-width: 22px;
    overflow: hidden;
  }

  .question-area {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .question-card {
    flex: 0 1 auto;
    margin: 0 0 6px;
    min-height: 0;
    max-height: 72px;
  }

  .question-card p {
    min-height: 0;
    max-height: 72px;
    padding: 8px 20px;
    font-size: 17px;
    line-height: 1.05;
  }

  .quiz-options {
    flex: 1 1 0;
    width: 80%;
    margin-inline: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 4px;
    overflow: hidden;
  }

  .quiz-option {
    flex: 1 1 0;
    min-height: 0;
    max-height: 38px;
  }

  .quiz-option span {
    min-height: 0;
    height: 100%;
    padding: 4px 48px 4px 18px;
    font-size: 15px;
    line-height: 1.02;
  }

  .quiz-option::after {
    right: 16px;
    width: 22px;
    height: 22px;
    font-size: 20px;
  }

  .choose-wisely {
    flex-shrink: 0;
    width: min(200px, 38%);
    margin: 2px auto 0;
  }

  .choose-wisely img {
    max-height: 40px;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
  }

  .impact-overlay {
    align-items: center;
    padding: 0 12px;
  }

  .impact-card {
    width: min(400px, 58vw);
    padding: 18px 0 25px;
    border-width: 28px;
    border-image-slice: 130 200 200 200 fill;
  }

  .impact-card h3 {
    margin-bottom: 8px;
    font-size: 26px;
    letter-spacing: 0.12em;
  }

  .impact-card p {
    margin-bottom: 12px;
    font-size: 12px;
  }

  #impactTitle {
    max-width: 100px;
  }

  .impact-stats {
    gap: 6px;
    margin-bottom: 12px;
    max-width: 300px;
  }

  .impact-stats div {
    padding: 8px 10px;
    font-size: 14px;
  }

  .impact-card .image-button {
    width: min(220px, 100%);
    margin-top: 10px !important;
  }

  .impact-card .image-button img {
    max-height: 40px;
    object-fit: contain;
  }

  body.force-desktop-portrait .start-journey {
    width: min(190px, 82vw);
  }

  body.force-desktop-portrait .landing-message h1 {
    font-size: clamp(18px, 5.6vw, 20px);
  }

  .landing-icon-button strong {
    width: clamp(30px, 2vw, 45px);
    height: clamp(30px, 2vw, 45px);
  }

  .landing-icon-button {
    min-width: clamp(16px, 2vw, 20px);
  }

  .landing-icon-button span {
    font-size: clamp(8px, 0.5vw, 16px);
  }

  .landing-panel {
    width: min(250px, calc(100vw - 36px));
    max-height: min(680px, calc(100% - 84px));
  }

  .player-info h2,
  .auth-card h2,
  .landing-panel h2 {
    font-size: clamp(18px, 1vw, 30px);
  }

  body.force-desktop-portrait .chapter-title h2 {
    font-size: clamp(16px, 3.4vw, 16px);
  }

  body.force-desktop-portrait .stats-strip {
    padding: 5px 2.2% 1.4%;
  }

  body.force-desktop-portrait .stat-item {
    font-size: clamp(14px, 2vw, 10px);
  }

  body.force-desktop-portrait .question-card p {
    font-size: clamp(16px, 2.55vw, 18px);
  }

  body.force-desktop-portrait .quiz-option {
    min-height: 40px;
    margin: 2px;
  }

  body.force-desktop-portrait .quiz-option span {
    min-height: 40px;
    padding: 8px 68px 8px 26px;
    font-size: clamp(14px, 2vw, 14px);
  }

  body.force-desktop-portrait .quiz-options {
    width: 90%;
    display: inline;
  }

  .result-content {
    padding: 14px;
  }

  .result-panel {
    width: min(230px, 78vh, 88vw);
    max-width: 260px;
    padding: 0;
    border-image-width: 50px 20px 30px 20px;
  }

  .result-panel #resultSummary {
    min-height: 20px;
    font-size: clamp(12px, 0.5vw, 12px);
  }

  .result-stat {
    grid-template-columns: 20px 1fr;
    min-height: 50px;
    column-gap: 5px;
    padding: 5px;
  }

  .result-stat span {
    font-size: 10px;
  }

  .result-stat strong,
  .result-meta strong {
    font-size: 14px;
  }

  .result-meta {
    font-size: clamp(12px, 1.2vw, 12px);
  }
}

/* My Account screen */
.account-screen {
  font-family: "Souvenir", Georgia, serif;
}

.account-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 156, 55, 0.2), transparent 34%),
    url("../img/landing_bg.jpg") center / cover no-repeat;
  filter: saturate(0.72) brightness(0.42);
}

.account-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  border-style: solid;
  border-width: 80px;
  border-image-slice: 50 60 50 60 fill;
  border-image-width: 50px;
  border-image-repeat: stretch;
  border-image-source: url("../img/frame.png");
  box-sizing: border-box;
}

.account-content {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(54px, 12vw, 72px) clamp(18px, 5.2vw, 28px) clamp(24px, 5vw, 36px);
  -webkit-overflow-scrolling: touch;

  border-image-slice:70 70 75 70 fill;
border-image-width:20px 20px 20px 20px;
border-image-outset:0px 0px 0px 0px;
border-image-repeat:stretch stretch;
border-image-source:url("../img/account_bg.png");
  /* Firefox */
  scrollbar-width: none;
  
  /* IE and Edge */
  -ms-overflow-style: none;
}

.account-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.account-back {
  position: absolute;
  top: clamp(54px, 12vw, 72px);
  left: clamp(18px, 5.2vw, 28px);
  z-index: 6;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f0c45f;
  font-size: 42px;
  line-height: 0.8;
  cursor: pointer;
  text-shadow: var(--copy-shadow);
}

.account-brand {
  text-align: center;
  margin-bottom: 10px;
}

.account-brand-logo {
  width: min(220px, 58vw);
  margin: 0 auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65));
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 18px;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  /* border: 2px solid #d89426; */
  /* border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #eee7d0, #1b1d1c 66%); */
  color: #211b14;
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
}

.account-avatar.has-photo {
  background-size: cover;
  background-position: center;
}

.account-avatar.has-photo span {
  display: none;
}

.account-username {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 4.8vw, 22px);
  line-height: 1.1;
  text-shadow: var(--copy-shadow);
}

.account-section-title {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 400;
  text-shadow: var(--copy-shadow);
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.account-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px 12px;
  border-style: solid;
  border-width: 18px 12px;
  border-image-slice: 40 28 fill;
  border-image-width: 18px 12px;
  border-image-repeat: stretch;
  border-image-source: url("../img/summary_tile.png");
  box-sizing: border-box;
}

.account-stat-card img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.account-stat-copy {
  min-width: 0;
}

.account-stat-copy span {
  display: block;
  color: #f0c45f;
  font-size: clamp(11px, 2.9vw, 13px);
  letter-spacing: 0.4px;
  line-height: 1.1;
}

.account-stat-copy strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: clamp(28px, 7.4vw, 34px);
  line-height: 1;
  font-weight: 700;
  text-shadow: var(--copy-shadow);
}

.account-badges-block {
  display: grid;
  gap: 12px;
}

.age-accordion {
  display: grid;
  gap: 8px;
}

.age-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.age-accordion-trigger:disabled {
  cursor: not-allowed;
}

.age-accordion-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid #f0c45f;
  border-bottom: 2px solid #f0c45f;
  transform: rotate(45deg);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  flex: 0 0 auto;
  margin-right: 4px;
}

.age-accordion.is-expanded .age-accordion-icon {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.age-accordion.is-locked .age-accordion-icon {
  opacity: 0.35;
}

.age-accordion-panel {
  position: relative;
  padding: 10px 10px 12px;
  border-style: solid;
  border-image-slice: 27 27 27 27;
  border-image-width: 20px 20px 20px 20px;
  border-image-outset: 0;
  border-image-repeat: stretch stretch;
  border-image-source: url("../img/secondary_param_border.png");
  box-sizing: border-box;
  overflow: hidden;
}

.age-accordion-panel-inner {
  position: relative;
  overflow: hidden;
  transition: height 420ms cubic-bezier(0.4, 0, 0.2, 1);
}

.age-accordion-body--expanded,
.age-accordion-body--collapsed {
  transition: opacity 320ms ease, transform 320ms ease, visibility 320ms ease;
}

.age-accordion.is-expanded .age-accordion-body--collapsed {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}

.age-accordion.is-collapsed .age-accordion-body--expanded {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}

.age-accordion.is-expanded .age-accordion-body--expanded,
.age-accordion.is-collapsed .age-accordion-body--collapsed {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.age-accordion-lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.age-accordion-lock[hidden] {
  display: none !important;
}

.age-accordion.is-locked .age-accordion-lock:not([hidden]) {
  display: flex;
}

.age-accordion.is-locked .age-accordion-panel {
  min-height: 88px;
}

.age-accordion.is-locked .age-accordion-body--collapsed {
  opacity: 0.42;
  filter: saturate(0.55);
}

.age-accordion-lock img {
  width: 96%;
  max-width: 340px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

.badge-grid.badge-grid--compact {
  padding: 4px 2px 2px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
}

/* .badge-grid--compact .secondary-param-icon {
  width: 36px;
  height: 40px;
} */

.badge-grid.badge-grid--compact .badge-item > span {
  font-size: clamp(10px, 3.2vw, 12px);
  line-height: 1.3;
}

.secondary-param-icon {
  position: relative;
  /* width: 42px;
  height: 46px; */
  flex: 0 0 auto;
}

.secondary-param-icon__bg,
.secondary-param-icon__ico {
  display: block;
  pointer-events: none;
  user-select: none;
}

.secondary-param-icon__bg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.secondary-param-icon__ico {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

.badge-item .secondary-param-icon {
  margin: 0 auto;
}

.badge-progress-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 0px 25px 0px 25px;
}

.badge-progress-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 20px;
  align-items: start;
}

.badge-progress-row .secondary-param-icon {
  width: 60px;
  height: 60px;
}

.badge-progress-copy {
  min-width: 0;
}

.badge-progress-meta {
  /* display: grid; */
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

.badge-progress-meta strong {
  color: #fff;
  font-size: clamp(12px, 3.2vw, 14px);
  min-width: 34px;
  text-shadow: var(--copy-shadow);
}

.badge-progress-bar {
  position: relative;
  width: 100%;
  min-width: 0;
  height: clamp(20px, 5.4vw, 26px);
}

.badge-progress-bar__outer {
  position: absolute;
  inset: 0;
  background: url("../img/outer_bar.png") center / 100% 100% no-repeat;
  pointer-events: none;
}

.badge-progress-bar__fill-wrap {
  position: absolute;
  left: 6.8%;
  right: 6.8%;
  top: 22%;
  bottom: 22%;
  overflow: hidden;
}

.badge-progress-bar__fill {
  height: 100%;
  width: calc(var(--progress, 0) * 1%);
  max-width: 100%;
  overflow: hidden;
  transition: width 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.badge-progress-bar.is-animating .badge-progress-bar__fill {
  transition: none;
  width: 0;
}

.badge-progress-bar__fill::before {
  content: "";
  display: block;
  height: 100%;
  width: calc(100% * 100 / max(var(--progress, 1), 1));
  background: url("../img/progress_filler.png") left center / 100% 100% no-repeat;
}

.badge-progress-bar[style*="--progress: 0"] .badge-progress-bar__fill,
.badge-progress-bar[style*="--progress:0"] .badge-progress-bar__fill {
  width: 0;
}

.badge-progress-label {
  display: block;
  margin-top: 4px;
  color: #f0c45f;
  font-size: clamp(10px, 3.2vw, 12px);
  letter-spacing: 0.3px;
}

.badge-age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(240, 196, 95, 0.75);
  color: #f0c45f;
  font-size: clamp(11px, 2.8vw, 13px);
  line-height: 1;
  background: rgba(8, 8, 8, 0.55);
  flex: 0 0 auto;
}

.badge-row-title {
  margin: 0;
  color: #fff;
  font-size: clamp(11px, 2.9vw, 13px);
  line-height: 1.25;
}

.badge-row-quote {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(10px, 2.6vw, 12px);
  font-style: italic;
  line-height: 1.25;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 4px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.badge-item > span {
  color: #f0c45f;
  font-size: clamp(10px, 3.2vw, 12px);
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.2px;
}

.account-signout {
  display: block;
  width: 100%;
  margin-top: 18px;
  min-height: 44px;
  border: 1px solid rgba(240, 196, 95, 0.75);
  background: rgba(8, 8, 8, 0.72);
  color: #ffd064;
  font-size: 15px;
  text-transform: uppercase;
  cursor: pointer;
}

.account-signout[hidden] {
  display: none;
}

@media (max-width: 380px) {
  .badge-grid.badge-grid--compact {
    gap: 8px 6px;
  }
}

/* Progress save modal */
.progress-save-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 28px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

.progress-save-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.progress-save-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.progress-save-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: clamp(28px, 7vw, 38px) clamp(18px, 5vw, 24px) clamp(22px, 5vw, 28px);
  border: 1px solid rgba(240, 196, 95, 0.82);
  background:
    linear-gradient(180deg, rgba(34, 25, 16, 0.96), rgba(8, 8, 7, 0.98)),
    #120b07;
  box-shadow:
    inset 0 0 0 1px rgba(255, 208, 117, 0.14),
    0 18px 36px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.progress-save-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.progress-save-close img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.progress-save-title {
  margin: 0 0 clamp(22px, 5vw, 30px);
  color: #f0c45f;
  font-family: "Souvenir", Georgia, serif;
  font-size: clamp(24px, 6.4vw, 32px);
  line-height: 1.08;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-shadow: var(--copy-shadow);
}

.progress-save-actions {
  display: grid;
  gap: 14px;
}

.progress-save-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(240, 196, 95, 0.82);
  background: rgba(8, 8, 8, 0.55);
  color: #fff;
  font-family: "Souvenir", Georgia, serif;
  font-size: clamp(16px, 4.2vw, 20px);
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.progress-save-option:hover {
  background: rgba(20, 14, 8, 0.82);
  border-color: #f0c45f;
}

.progress-save-option strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  font-weight: 400;
}

.progress-save-option strong img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.progress-save-note {
  margin: clamp(18px, 4vw, 24px) 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Souvenir", Georgia, serif;
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.35;
}

/* ==========================================================================
   UNIFIED RESPONSIVE LAYER
   Ordered: extra-small → small → short → mobile → tablet → desktop →
   laptop-short → large-desktop → landscape → accessibility
   ========================================================================== */

/* Extra-small phones */
@media (max-width: 320px) {
  .landing-content,
  .account-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-logo {
    width: min(220px, 88vw);
  }

  .landing-message h1 {
    font-size: clamp(16px, 5vw, 18px);
  }

  .progress-save-dialog {
    padding: 22px 14px 18px;
  }

  .progress-save-title {
    font-size: clamp(20px, 6vw, 24px);
  }
}

/* Large phones / phablets */
@media (min-width: 481px) and (max-width: 767px) {
  .device-frame {
    width: min(100vw, 420px);
    margin: 0 auto;
  }

  .landing-content {
    padding-left: var(--content-gutter);
    padding-right: var(--content-gutter);
  }
}

/* Tablet portrait */
@media (min-width: 768px) and (max-width: 1023px) {
  .landing-content {
    max-width: 720px;
    margin: 0 auto;
  }

  .account-content {
    max-width: 640px;
    margin: 0 auto;
  }

  .progress-save-dialog {
    width: min(480px, 92vw);
  }
}

@media (min-width: 1024px) {
  .badge-progress-label,
  .badge-item > span,
  .badge-grid.badge-grid--compact .badge-item > span {
    font-size: 12px;
  }

  .badge-progress-meta strong {
    font-size: 12px;
  }
}

/* Large desktop */
@media (min-width: 1441px) {
  .landing-content {
    max-width: var(--device-max-width);
  }

  .quiz-content {
    max-width: var(--device-max-width);
    margin: 0 auto;
  }

  .account-content {
    max-width: 100%;
    margin: 0 auto;
  }
}

/* Ultra-wide */
@media (min-width: 1920px) {
  body.force-desktop-portrait .device-frame {
    width: min(calc(100vw - 28px), var(--device-max-width));
    max-width: var(--device-max-width);
    height: min(calc(var(--app-height) - 28px), calc(var(--device-max-width) * var(--device-aspect)));
  }

  .landing-content {
    max-width: var(--device-max-width);
  }
}

/* Phone landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .landing-content {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 4px;
  }

  .landing-message {
    margin-top: 4px;
    padding-bottom: 0;
  }

  .landing-message h1 {
    font-size: clamp(14px, 3.5vh, 18px);
    line-height: 1.1;
  }

  .hero-logo {
    width: min(180px, 32vh);
  }

  .start-journey {
    width: min(200px, 40vw);
    margin-top: 4px;
  }

  .reputation-line {
    margin-top: -12px;
  }

  .quiz-body {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 10px;
  }

  .question-card p {
    font-size: clamp(14px, 2.8vh, 17px);
  }

  .quiz-option span {
    font-size: clamp(13px, 2.5vh, 16px);
    min-height: 36px;
    padding: 4px 44px 4px 16px;
  }

  .account-brand-logo {
    width: min(160px, 40vw);
  }

  .account-stats-grid {
    gap: 8px;
  }
}

/* Tall narrow phones */
@media (min-width: 360px) and (max-width: 430px) and (min-height: 740px) {
  .landing-content {
    justify-content: space-between;
  }

  .landing-message {
    padding-bottom: 10%;
  }
}

/* Touch targets on coarse pointers */
@media (pointer: coarse) {
  .landing-icon-button,
  .age-accordion-trigger,
  .progress-save-option,
  .account-back,
  .quiz-option,
  .image-button {
    min-height: 44px;
  }
}

/* High-DPI crisp borders */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .landing-screen::before,
  .quiz-frame::before,
  .result-screen::before,
  .account-screen::before {
    image-rendering: auto;
  }
}
