:root {
  color-scheme: light;

  --palace-night: #17243a;
  --palace-night-deep: #10192a;
  --palace-blue: #5c83ad;
  --palace-blue-light: #9abbd2;
  --sky-blue: #cfe6f4;
  --cloud-white: #fffdf7;
  --ivory: #f7f1e6;
  --ivory-deep: #e9dfd0;
  --gold: #c99b49;
  --gold-deep: #936b2f;
  --gold-light: #ead29b;
  --rose: #d9a6a9;
  --rose-light: #f2d8d8;
  --ink: #283142;
  --ink-soft: #667084;
  --ink-muted: #7f8795;
  --panel: rgba(255, 253, 247, 0.88);
  --panel-strong: rgba(255, 253, 247, 0.95);
  --panel-soft: rgba(246, 242, 235, 0.72);
  --border: rgba(255, 255, 255, 0.84);
  --border-gold: rgba(201, 155, 73, 0.42);
  --danger-soft: #8d565c;
  --focus: #2d6ea0;

  --radius-small: 14px;
  --radius-medium: 24px;
  --radius-large: 38px;

  --shadow:
    0 30px 90px rgba(23, 36, 58, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);

  --shadow-small:
    0 14px 35px rgba(23, 36, 58, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);

  --transition: 180ms ease;

  --font-sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang TC",
    "Noto Sans TC",
    "Microsoft JhengHei",
    sans-serif;

  --font-serif:
    "Iowan Old Style",
    "Palatino Linotype",
    "Noto Serif TC",
    "Songti TC",
    serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--palace-night);
  scroll-behavior: auto;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.72;
  background:
    linear-gradient(
      rgba(24, 38, 60, 0.22),
      rgba(24, 38, 60, 0.5)
    ),
    url("assets/background/single-ad-palace-background.webp")
      center top / cover scroll no-repeat,
    radial-gradient(
      circle at 18% 15%,
      rgba(255, 255, 255, 0.8),
      transparent 25%
    ),
    radial-gradient(
      circle at 82% 22%,
      rgba(207, 230, 244, 0.75),
      transparent 26%
    ),
    linear-gradient(
      160deg,
      var(--palace-blue-light),
      var(--palace-night) 65%,
      var(--palace-night-deep)
    );
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.palace-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cloud {
  position: absolute;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 32% 34%,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0.72) 42%,
      rgba(207, 230, 244, 0.16) 72%,
      transparent 75%
    );
  filter: blur(1px);
  opacity: 0.72;
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  border-radius: inherit;
  background: inherit;
}

.cloud-one {
  top: -5rem;
  left: -8rem;
  width: 24rem;
  height: 12rem;
}

.cloud-one::before {
  top: -2rem;
  left: 7rem;
  width: 13rem;
  height: 10rem;
}

.cloud-one::after {
  top: 2rem;
  left: 14rem;
  width: 15rem;
  height: 9rem;
}

.cloud-two {
  top: 21%;
  right: -13rem;
  width: 27rem;
  height: 13rem;
  opacity: 0.52;
}

.cloud-two::before {
  top: -3rem;
  left: 3rem;
  width: 15rem;
  height: 12rem;
}

.cloud-two::after {
  top: 4rem;
  left: -6rem;
  width: 17rem;
  height: 9rem;
}

.cloud-three {
  bottom: -7rem;
  left: 5%;
  width: 31rem;
  height: 15rem;
  opacity: 0.45;
}

.cloud-three::before {
  top: -4rem;
  left: 5rem;
  width: 17rem;
  height: 13rem;
}

.cloud-three::after {
  top: 1rem;
  left: 18rem;
  width: 16rem;
  height: 10rem;
}

.gold-arch {
  position: absolute;
  border: 2px solid rgba(234, 210, 155, 0.34);
  border-bottom: none;
  border-radius: 50% 50% 0 0 / 65% 65% 0 0;
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.08),
    0 0 35px rgba(201, 155, 73, 0.13);
}

.arch-one {
  top: -7rem;
  left: 50%;
  width: min(82vw, 52rem);
  height: 29rem;
  transform: translateX(-50%);
}

.arch-two {
  right: -10rem;
  bottom: -8rem;
  width: 32rem;
  height: 28rem;
  transform: rotate(-12deg);
  opacity: 0.52;
}

.floating-seal {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid rgba(234, 210, 155, 0.6);
  transform: rotate(45deg);
  box-shadow:
    0 0 20px rgba(234, 210, 155, 0.38),
    inset 0 0 5px rgba(255, 255, 255, 0.8);
}

.seal-one {
  top: 18%;
  left: 8%;
}

.seal-two {
  top: 53%;
  right: 8%;
  width: 0.85rem;
  height: 0.85rem;
}

.seal-three {
  bottom: 12%;
  left: 18%;
  width: 0.7rem;
  height: 0.7rem;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 58rem);
  margin: 0 auto;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    1rem
    max(3.5rem, env(safe-area-inset-bottom));
}

.brand-header {
  margin-bottom: 1.25rem;
  text-align: center;
  color: var(--cloud-white);
  text-shadow: 0 2px 18px rgba(16, 25, 42, 0.4);
}

.brand-name {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.brand-location {
  margin: 0.2rem 0 0;
  color: rgba(255, 253, 247, 0.74);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.palace-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(23px) saturate(1.08);
  -webkit-backdrop-filter: blur(23px) saturate(1.08);
}

.palace-panel::before {
  position: absolute;
  inset: 0.45rem;
  z-index: -1;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(201, 155, 73, 0.2);
  border-radius: calc(var(--radius-large) - 0.45rem);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--gold-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.32;
}

h1,
h2 {
  font-family: var(--font-serif);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.45rem);
}

h1 span {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 3.8vw, 1.35rem);
  font-weight: 650;
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.35rem);
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

p {
  margin-top: 0;
}

.lead,
.intro-instructions,
.disclaimer,
.result-section p,
.balance-card p,
.oya-note p,
.relationship-disclaimer p,
.advertising-copy p,
.slogan-card p,
.headline-card,
.nearby-result,
.cta-card p {
  white-space: pre-line;
}

.lead {
  margin: 1.2rem 0 0;
  color: var(--ink-soft);
  font-size: 1.03rem;
}

.intro-instructions {
  margin: 1rem 0 0;
  color: var(--ink-soft);
}

.headline-card {
  margin: 1.15rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(201, 155, 73, 0.25);
  border-radius: var(--radius-medium);
  color: #684b25;
  background:
    linear-gradient(
      135deg,
      rgba(234, 210, 155, 0.34),
      rgba(255, 255, 255, 0.42)
    );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.headline-card:empty {
  display: none;
}

.disclaimer {
  margin: 1rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}

.navigation-row {
  justify-content: space-between;
}

.primary-button,
.secondary-button,
.text-button {
  appearance: none;
  min-height: 3rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    opacity var(--transition);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.15rem;
  font-weight: 750;
}

.primary-button {
  border: 1px solid rgba(147, 107, 47, 0.25);
  color: #2d251b;
  background:
    linear-gradient(
      135deg,
      var(--gold-light),
      #f4dfae 48%,
      var(--gold)
    );
  box-shadow:
    0 13px 28px rgba(147, 107, 47, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.secondary-button {
  border: 1px solid rgba(40, 49, 66, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow-small);
}

.text-button {
  min-height: 2.5rem;
  padding: 0.4rem 0;
  border: none;
  color: var(--ink-soft);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.28rem;
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.text-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.answer-card:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(45, 110, 160, 0.42);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.47;
  transform: none;
}

.progress-wrap {
  margin-bottom: 1.5rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.87rem;
  font-weight: 650;
}

.progress-track {
  width: 100%;
  height: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(40, 49, 66, 0.08);
  border-radius: 999px;
  background: rgba(40, 49, 66, 0.08);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      var(--palace-blue),
      var(--gold-light) 52%,
      var(--rose)
    );
  box-shadow: 0 0 18px rgba(201, 155, 73, 0.28);
  transition: width 240ms ease;
}

.question-title {
  margin-bottom: 1.15rem;
}

.answer-list {
  display: grid;
  gap: 0.78rem;
}

.answer-card {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(40, 49, 66, 0.12);
  border-radius: var(--radius-medium);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  text-align: left;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.answer-card:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 155, 73, 0.42);
}

.answer-card.is-selected {
  border-color: rgba(147, 107, 47, 0.58);
  background:
    linear-gradient(
      135deg,
      rgba(234, 210, 155, 0.43),
      rgba(255, 255, 255, 0.75)
    );
  box-shadow:
    0 15px 38px rgba(147, 107, 47, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.answer-card-inner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
}

.answer-key {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(201, 155, 73, 0.28);
  border-radius: 50%;
  color: var(--gold-deep);
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.answer-text {
  padding-top: 0.12rem;
  color: var(--ink);
}

.tie-result-name {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--gold-deep);
  font-size: 0.83rem;
  font-weight: 800;
}

.ad-stage {
  position: relative;
  margin-bottom: 1.2rem;
}

.result-image,
.ad-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-small);
}

.result-image {
  object-fit: cover;
  background: var(--ivory);
}

.ad-placeholder {
  position: relative;
  display: grid;
  place-content: center;
  gap: 0.6rem;
  padding: 1rem;
  color: var(--ink-soft);
  text-align: center;
  background:
    radial-gradient(
      circle at 28% 24%,
      rgba(255, 255, 255, 0.92),
      transparent 23%
    ),
    radial-gradient(
      circle at 78% 72%,
      rgba(217, 166, 169, 0.28),
      transparent 25%
    ),
    linear-gradient(
      145deg,
      rgba(207, 230, 244, 0.9),
      rgba(247, 241, 230, 0.95) 45%,
      rgba(234, 210, 155, 0.7)
    );
}

.ad-placeholder::before {
  position: absolute;
  inset: 1rem;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(201, 155, 73, 0.44);
  border-radius: calc(var(--radius-large) - 0.75rem);
}

.placeholder-symbols {
  font-size: clamp(2.5rem, 10vw, 5rem);
  letter-spacing: 0.08em;
}

.format-badge {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  max-width: calc(100% - 2rem);
  padding: 0.5rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.86);
  box-shadow: 0 8px 25px rgba(23, 36, 58, 0.16);
  font-size: 0.84rem;
  font-weight: 750;
  backdrop-filter: blur(10px);
}

.result-name {
  margin-bottom: 0.2rem;
  font-size: clamp(1.9rem, 6vw, 3rem);
}

.result-symbols {
  margin-bottom: 1.15rem;
  color: var(--gold-deep);
  font-size: 1.08rem;
}

.campaign-profile {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.campaign-profile article,
.result-section,
.balance-card,
.oya-note,
.advertising-copy,
.slogan-card,
.nearby-result,
.relationship-disclaimer,
.service-list,
.cta-card {
  border: 1px solid rgba(40, 49, 66, 0.1);
  border-radius: var(--radius-medium);
  background: var(--panel-soft);
  box-shadow: var(--shadow-small);
}

.campaign-profile article {
  padding: 1rem;
}

.campaign-profile article p {
  margin: 0;
  white-space: pre-line;
}

.advertising-copy {
  margin-bottom: 1rem;
  padding: 1.15rem;
  color: var(--ink);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.65),
      rgba(207, 230, 244, 0.32)
    );
}

.advertising-copy p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.slogan-card {
  margin-bottom: 1rem;
  padding: 1.1rem;
  border-color: rgba(201, 155, 73, 0.3);
  background:
    linear-gradient(
      135deg,
      rgba(234, 210, 155, 0.35),
      rgba(255, 255, 255, 0.56)
    );
}

.slogan-card strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold-deep);
}

.slogan-card p {
  margin: 0;
}

.result-section,
.balance-card,
.oya-note,
.relationship-disclaimer,
.service-list {
  margin-bottom: 1rem;
  padding: 1.1rem;
}

.result-section p,
.balance-card p,
.oya-note p,
.relationship-disclaimer p {
  margin-bottom: 0;
}

.balance-card {
  border-color: rgba(92, 131, 173, 0.24);
  background:
    linear-gradient(
      135deg,
      rgba(207, 230, 244, 0.52),
      rgba(255, 255, 255, 0.56)
    );
}

.balance-card h3:not(:first-child) {
  margin-top: 1.1rem;
}

.oya-note {
  border-color: rgba(217, 166, 169, 0.34);
  background:
    linear-gradient(
      135deg,
      rgba(242, 216, 216, 0.58),
      rgba(255, 255, 255, 0.52)
    );
}

.strength-list {
  margin: 0;
  padding-left: 1.2rem;
}

.strength-list li + li {
  margin-top: 0.38rem;
}

.nearby-result {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  color: var(--ink-soft);
}

.nearby-result strong {
  color: var(--ink);
}

.cta-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.1rem;
}

.cta-card {
  padding: 1.05rem;
}

.cta-card p {
  color: var(--ink-soft);
}

.cta-card .primary-button,
.cta-card .secondary-button {
  width: 100%;
  margin-top: 0.55rem;
}

.service-list {
  margin-top: 1rem;
}

.service-list p {
  margin-bottom: 0.4rem;
  font-weight: 750;
}

.service-list ul {
  margin: 0;
  padding-left: 1.2rem;
}

.relationship-disclaimer {
  color: var(--ink-soft);
}

.site-footer {
  padding: 1.3rem 0 0;
  color: rgba(255, 253, 247, 0.8);
  text-align: center;
  text-shadow: 0 2px 15px rgba(16, 25, 42, 0.45);
}

.site-footer p {
  margin: 0.25rem 0;
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.72rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--cloud-white);
  background: rgba(23, 36, 58, 0.94);
  box-shadow: 0 15px 45px rgba(16, 25, 42, 0.38);
  transform: translateX(-50%);
  text-align: center;
}

.noscript-message {
  position: relative;
  z-index: 30;
  margin: 1rem;
  padding: 1rem;
  border-radius: var(--radius-small);
  color: var(--ink);
  background: var(--cloud-white);
}

@media (min-width: 42rem) {
  .site-shell {
    padding-inline: 1.5rem;
  }

  .campaign-profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-card-inner {
    padding: 1.05rem 1.15rem;
  }
}

@media (min-width: 54rem) {
  .palace-panel {
    padding: 2.4rem;
  }

  .cta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cta-card {
    display: flex;
    flex-direction: column;
  }

  .cta-card .primary-button:first-of-type,
  .cta-card .secondary-button:first-of-type {
    margin-top: auto;
  }
}

@media (max-width: 31rem) {
  .navigation-row {
    align-items: stretch;
  }

  .navigation-row .primary-button,
  .navigation-row .secondary-button {
    flex: 1 1 100%;
  }

  .format-badge {
    right: 0.7rem;
    bottom: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Final interaction and mobile-layout refinements. */
html {
  scroll-behavior: auto;
}

body {
  background:
    linear-gradient(
      rgba(24, 38, 60, 0.2),
      rgba(24, 38, 60, 0.52)
    ),
    url("assets/background/single-ad-palace-background.webp")
      center top / cover scroll no-repeat,
    linear-gradient(
      160deg,
      var(--palace-blue-light),
      var(--palace-night) 65%,
      var(--palace-night-deep)
    );
}

.palace-background {
  position: absolute;
  min-height: 100vh;
}

.intro-content p {
  margin: 0;
}

.intro-content p + p {
  margin-top: 0.72rem;
}

.browser-tip,
.cta-help {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.browser-tip {
  margin: 0.72rem 0 0;
}

.result-preview-section {
  margin-top: 1.65rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(201, 155, 73, 0.25);
}

.result-preview-section h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.28rem, 3.5vw, 1.72rem);
}

.preview-kicker {
  margin-bottom: 0.3rem;
  color: var(--gold-deep);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.result-preview-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.42rem;
}

.result-preview {
  min-width: 0;
  margin: 0;
}

.result-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 0.7rem;
  background: var(--ivory);
  box-shadow: 0 8px 20px rgba(23, 36, 58, 0.15);
}

.result-preview figcaption {
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.62rem;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cta-help {
  margin: 0.55rem 0 0;
  line-height: 1.5;
}

.cta-card .cta-help + .secondary-button {
  margin-top: 0.5rem;
}

.nearby-result[hidden] {
  display: none !important;
}

@media (min-width: 54rem) {
  .cta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .site-shell {
    width: min(100% - 12px, 790px);
    padding-inline: 0;
  }

  .result-preview-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .result-preview figcaption {
    font-size: 0.58rem;
  }

  body[data-page="quiz"] .site-shell {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding:
      max(6px, env(safe-area-inset-top))
      0
      max(6px, env(safe-area-inset-bottom));
  }

  body[data-page="quiz"] .brand-header,
  body[data-page="quiz"] .site-footer,
  body[data-page="quiz"] .eyebrow {
    display: none;
  }

  body[data-page="quiz"] .palace-panel {
    width: 100%;
    min-height: 0;
    padding: 13px;
    overflow: visible;
    border-radius: 22px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  body[data-page="quiz"] .progress-wrap {
    margin-bottom: 10px;
  }

  body[data-page="quiz"] .progress-meta {
    margin-bottom: 4px;
    font-size: 0.78rem;
  }

  body[data-page="quiz"] .progress-track {
    height: 8px;
  }

  body[data-page="quiz"] .question-title {
    margin-bottom: 10px;
    font-size: clamp(1.22rem, 5.4vw, 1.48rem);
    line-height: 1.28;
  }

  body[data-page="quiz"] .answer-list {
    gap: 7px;
  }

  body[data-page="quiz"] .answer-card,
  body[data-page="quiz"] .progress-bar {
    transition: none;
  }

  body[data-page="quiz"] .answer-card:hover {
    transform: none;
  }

  body[data-page="quiz"] .answer-card-inner {
    gap: 8px;
    min-height: 52px;
    padding: 9px 10px;
  }

  body[data-page="quiz"] .answer-key {
    width: 1.72rem;
    height: 1.72rem;
    font-size: 0.82rem;
  }

  body[data-page="quiz"] .answer-text {
    padding-top: 0;
    font-size: 0.91rem;
    line-height: 1.36;
  }

  body[data-page="quiz"] .navigation-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  body[data-page="quiz"] .navigation-row .primary-button,
  body[data-page="quiz"] .navigation-row .secondary-button {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
  }
}

@media (max-width: 520px) and (max-height: 620px) {
  body[data-page="quiz"] .palace-panel {
    padding: 10px;
  }

  body[data-page="quiz"] .question-title {
    font-size: 1.15rem;
  }

  body[data-page="quiz"] .answer-card-inner {
    min-height: 48px;
    padding: 7px 9px;
  }

  body[data-page="quiz"] .answer-text {
    font-size: 0.84rem;
    line-height: 1.3;
  }

  body[data-page="quiz"] .navigation-row {
    margin-top: 8px;
  }
}

