:root {
  --bg-dark: #111820;
  --bg-mid: #1a2330;
  --paper: #f5e9cb;
  --accent-gold: #d5a948;
  --accent-rust: #bb4f39;
  --ink: #221b13;
  --ok: #2f7d41;
  --warn: #8c2b24;
  --card: rgba(245, 233, 203, 0.12);
  --faith-vw: 100vw;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Avenir", "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at 20% 10%, #2c3b4f 0%, var(--bg-dark) 35%, #0d131c 100%);
  color: var(--paper);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  margin-left: auto;
  margin-right: auto;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  line-height: 1.48;
  text-rendering: optimizeLegibility;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.45;
  z-index: -1;
}

.orb-a {
  width: 260px;
  height: 260px;
  background: #d79047;
  top: -70px;
  right: 5%;
}

.orb-b {
  width: 320px;
  height: 320px;
  background: #8a382b;
  bottom: -80px;
  left: 5%;
}

.app {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem clamp(0.72rem, 2.8vw, 1.2rem) 3rem;
  display: grid;
  gap: 1.15rem;
  overflow-x: clip;
}

.app > * {
  min-width: 0;
}

.site-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 0.72rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(237, 201, 119, 0.22);
  background: rgba(9, 15, 24, 0.72);
  box-shadow: 0 14px 28px rgba(2, 8, 13, 0.16);
  backdrop-filter: blur(10px);
}

.site-topbar-brand {
  color: #f6dba4;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-topbar-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
}

.site-topbar-links a {
  color: #f3cf83;
  text-decoration: none;
  font-weight: 800;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.site-topbar-links a:hover,
.site-topbar-links a:focus-visible,
.site-topbar-brand:hover,
.site-topbar-brand:focus-visible {
  color: #ffe6b5;
  border-color: rgba(255, 230, 181, 0.5);
  transform: translateY(-1px);
}

.hud-grid > *,
.feature-grid > *,
.stage-grid > *,
.story-preview-grid > *,
.era-head > * {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 1.2rem;
  align-items: center;
  animation: fadeUp 650ms ease both;
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 1.35rem clamp(1rem, 2vw, 1.5rem);
  border-radius: 24px;
  border: 1px solid rgba(237, 201, 119, 0.22);
  background:
    radial-gradient(420px 200px at 88% 14%, rgba(213, 169, 72, 0.16), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(12, 19, 29, 0.86));
  box-shadow: 0 22px 48px rgba(2, 7, 12, 0.28);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -38% auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(187, 79, 57, 0.2), transparent 66%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero > div {
  min-width: 0;
}

.logo {
  width: 126px;
  height: 126px;
  object-fit: cover;
  padding: 10px;
  border-radius: 28px;
  border: 1px solid rgba(237, 201, 119, 0.3);
  background: rgba(9, 16, 26, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 18px 34px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #edc977;
  font-weight: 800;
  font-size: 0.75rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #f7d99a;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h2 {
  margin-top: 1.5rem;
  font-size: clamp(1.3rem, 4vw, 2rem);
}

.subtitle {
  margin: 0.35rem 0 0;
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: pretty;
}

.mission {
  margin: 0.45rem 0 0;
  max-width: 68ch;
  font-size: 1.08rem;
  color: #f9deb2;
  font-weight: 800;
  line-height: 1.46;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: pretty;
}

.hero-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(237, 201, 119, 0.24);
  background: rgba(245, 233, 203, 0.08);
  color: #f4dfb1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.hero-cta {
  text-decoration: none;
}

.hero-link {
  color: #f3cf83;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.hero-link:hover,
.hero-link:focus-visible {
  color: #ffe6b5;
  border-color: rgba(255, 230, 181, 0.5);
  transform: translateY(-1px);
}

.premium-band {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.95fr);
  gap: 1rem;
  margin-top: 0.35rem;
  padding: 1.05rem 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(237, 201, 119, 0.24);
  background:
    radial-gradient(300px 180px at 14% 18%, rgba(187, 79, 57, 0.13), transparent 58%),
    linear-gradient(135deg, rgba(17, 24, 35, 0.96), rgba(11, 18, 28, 0.9));
  box-shadow: 0 18px 36px rgba(2, 8, 13, 0.22);
}

.premium-band-copy {
  display: grid;
  gap: 0.4rem;
}

.premium-band-copy h2 {
  margin-top: 0;
  max-width: 22ch;
}

.premium-band-text {
  margin: 0;
  color: #f1ddb3;
  line-height: 1.56;
  max-width: 64ch;
}

.premium-band-panel {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(237, 201, 119, 0.22);
  background: linear-gradient(180deg, rgba(245, 233, 203, 0.08), rgba(245, 233, 203, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.premium-panel-kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
  font-weight: 800;
  color: #edc977;
}

.premium-band-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.52rem;
  color: #f7e5c0;
  line-height: 1.5;
}

.showcase-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.showcase-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(237, 201, 119, 0.24);
  background:
    radial-gradient(220px 140px at 88% 16%, rgba(213, 169, 72, 0.08), transparent 62%),
    rgba(13, 19, 28, 0.72);
  box-shadow: 0 14px 30px rgba(2, 7, 12, 0.16);
}

.showcase-kicker {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #edc977;
}

.showcase-card h3 {
  margin-top: 0;
  font-size: 1.08rem;
  color: #f6dba4;
}

.showcase-card p {
  margin: 0;
  color: #f3dfb7;
  line-height: 1.52;
}

.progress-wrap {
  margin-top: 1.35rem;
  background: linear-gradient(180deg, rgba(17, 24, 35, 0.92), rgba(10, 16, 24, 0.86));
  border: 1px solid rgba(237, 201, 119, 0.24);
  border-radius: 18px;
  padding: 1rem;
  animation: fadeUp 850ms ease both;
  box-shadow: 0 18px 36px rgba(2, 8, 13, 0.22);
  backdrop-filter: blur(10px);
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

#progressText {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.progress-bar {
  margin-top: 0.6rem;
  background: rgba(245, 233, 203, 0.2);
  border-radius: 999px;
  overflow: hidden;
  height: 14px;
}

#progressFill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d58b40, #f0d48e);
  transition: width 320ms ease;
}

.hud-grid {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: center;
}

.difficulty-wrap {
  display: grid;
  gap: 0.35rem;
  grid-column: 1 / -1;
}

.difficulty-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f0cf93;
  font-weight: 800;
}

.difficulty-picker {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.difficulty-btn.active {
  border-color: #f0d48e;
  background: rgba(213, 169, 72, 0.25);
  color: #ffe2ad;
}

.badge-shield-btn {
  grid-column: 1 / -1;
}

.hud-pill {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(245, 233, 203, 0.35);
  background: linear-gradient(180deg, rgba(245, 233, 203, 0.09), rgba(245, 233, 203, 0.04));
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}


.language-wrap {
  display: grid;
  gap: 0.35rem;
  grid-column: 1 / -1;
}

.language-select {
  border: 1px solid rgba(245, 233, 203, 0.4);
  border-radius: 10px;
  background: rgba(245, 233, 203, 0.08);
  color: var(--paper);
  font: inherit;
  font-weight: 800;
  padding: 0.5rem 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.language-select:focus {
  outline: 2px solid rgba(213, 169, 72, 0.65);
  outline-offset: 1px;
}

.daily-word-card {
  margin-top: 1.1rem;
  border: 1px solid rgba(237, 201, 119, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(300px 180px at 85% 10%, rgba(216, 172, 69, 0.1), transparent 58%),
    rgba(13, 19, 28, 0.72);
  padding: 1rem;
  box-shadow: 0 16px 34px rgba(2, 7, 12, 0.2);
}

.daily-word-card h2 {
  margin-top: 0;
}

.daily-thought,
.daily-practical {
  margin: 0.5rem 0 0;
  color: #f8dfb4;
  line-height: 1.45;
  font-weight: 700;
}

.feature-grid {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature-card {
  margin-top: 0.95rem;
  border: 1px solid rgba(237, 201, 119, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(260px 150px at 88% 12%, rgba(216, 172, 69, 0.08), transparent 58%),
    rgba(13, 19, 28, 0.7);
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  box-shadow: 0 14px 30px rgba(2, 7, 12, 0.16);
}

.feature-head {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.feature-head h2 {
  margin-top: 0;
}

.feature-card h3 {
  margin: 0;
}

.campaign-map-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.campaign-divider {
  color: rgba(248, 223, 180, 0.58);
  font-weight: 800;
  padding: 0 0.1rem;
}

.campaign-node {
  border: 1px solid rgba(237, 201, 119, 0.3);
  background: rgba(11, 17, 27, 0.62);
  border-radius: 12px;
  color: var(--paper);
  padding: 0.55rem 0.65rem;
  min-width: 160px;
  display: grid;
  gap: 0.18rem;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.campaign-node:hover,
.campaign-node:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(237, 201, 119, 0.56);
  box-shadow: 0 10px 20px rgba(5, 8, 14, 0.25);
}

.campaign-node.locked {
  opacity: 0.65;
}

.campaign-node.done {
  border-color: rgba(126, 217, 152, 0.52);
  box-shadow: 0 10px 20px rgba(30, 97, 54, 0.18);
}

.campaign-era {
  font-weight: 800;
}

.campaign-intro,
.campaign-progress,
.campaign-boss {
  font-size: 0.86rem;
  color: rgba(248, 223, 180, 0.88);
}

.mastery-bars {
  display: grid;
  gap: 0.5rem;
}

.mastery-row {
  display: grid;
  gap: 0.3rem;
}

.mastery-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 207, 147, 0.24);
  background: rgba(240, 207, 147, 0.08);
  overflow: hidden;
}

.mastery-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(213, 169, 72, 0.95), rgba(126, 217, 152, 0.92));
}

.weak-area-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.weak-chip {
  font-size: 0.9rem;
}

.desktop-controls-card.hidden {
  display: none !important;
}

.plan-list {
  display: grid;
  gap: 0.34rem;
}

.plan-item {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(245, 233, 203, 0.22);
  border-radius: 10px;
  background: rgba(245, 233, 203, 0.06);
  font-weight: 700;
}

.plan-item.done {
  border-color: rgba(126, 217, 152, 0.4);
  background: rgba(47, 125, 65, 0.2);
}

.memory-verse {
  margin: 0;
  border: 1px solid rgba(245, 233, 203, 0.24);
  border-radius: 10px;
  padding: 0.6rem;
  background: rgba(245, 233, 203, 0.08);
  color: #f8dfb4;
  font-weight: 700;
  line-height: 1.45;
}

.feature-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.feature-actions .ghost-btn,
.feature-actions .cta-btn {
  min-width: 120px;
}

.journal-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(245, 233, 203, 0.35);
  background: rgba(245, 233, 203, 0.08);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 0.78rem;
  resize: vertical;
}

.journal-input:focus {
  outline: 2px solid rgba(213, 169, 72, 0.65);
  outline-offset: 1px;
}

.journal-list {
  display: grid;
  gap: 0.55rem;
}

.journal-entry {
  border: 1px solid rgba(245, 233, 203, 0.2);
  border-radius: 10px;
  background: rgba(245, 233, 203, 0.08);
  padding: 0.58rem;
  display: grid;
  gap: 0.32rem;
}

.journal-text {
  margin: 0;
  color: #f8dfb4;
  line-height: 1.45;
}

.toggle-list {
  display: grid;
  gap: 0.5rem;
}

.toggle-row {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 700;
  color: #f8dfb4;
}

.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

body.a11y-large-text {
  font-size: 1.08rem;
}

body.a11y-readable-font {
  font-family: "Verdana", "Trebuchet MS", sans-serif;
}

body.a11y-high-contrast {
  --bg-dark: #05080d;
  --bg-mid: #0d1520;
  --paper: #fff6db;
  --accent-gold: #f5bf4c;
  --accent-rust: #d65a45;
  --card: rgba(255, 246, 219, 0.16);
}

body.a11y-high-contrast .ghost-btn,
body.a11y-high-contrast .option-btn,
body.a11y-high-contrast .answer-input,
body.a11y-high-contrast .journal-input {
  border-color: rgba(255, 246, 219, 0.62);
}

body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

.ghost-btn,
.cta-btn,
.option-btn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

a.ghost-btn,
a.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost-btn {
  padding: 0.58rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--paper);
  border: 1px solid rgba(245, 233, 203, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  background: rgba(245, 233, 203, 0.1);
  border-color: rgba(245, 233, 203, 0.56);
  transform: translateY(-1px);
}

.stage-list {
  margin-top: 0.9rem;
  display: grid;
  gap: 1rem;
}

.era-section {
  border: 1px solid rgba(237, 201, 119, 0.25);
  border-radius: 18px;
  background:
    radial-gradient(280px 140px at 92% 12%, rgba(216, 172, 69, 0.08), transparent 55%),
    rgba(13, 19, 28, 0.66);
  padding: 0.95rem;
  box-shadow: 0 14px 30px rgba(3, 7, 12, 0.18);
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.era-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.era-head h3 {
  font-size: clamp(1rem, 3vw, 1.25rem);
}

.era-stage-grid {
  margin-top: 0;
}

.stage-grid {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.story-preview-panel {
  margin-top: 1.1rem;
}

.story-preview-grid {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.story-preview-card {
  border: 1px solid rgba(237, 201, 119, 0.32);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 28, 41, 0.94), rgba(13, 19, 28, 0.9));
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
  text-align: left;
  box-shadow: 0 12px 24px rgba(2, 6, 10, 0.18);
}

.story-preview-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid rgba(237, 201, 119, 0.3);
  object-fit: cover;
  display: block;
}

.story-preview-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.story-preview-card .meta {
  margin: 0;
  font-size: 0.76rem;
}

.story-preview-card .ghost-btn {
  justify-self: start;
}

.stage-card {
  background: var(--card);
  border: 1px solid rgba(245, 233, 203, 0.2);
  border-radius: 14px;
  padding: 0.9rem;
  display: grid;
  gap: 0.5rem;
  transform: translateY(15px);
  opacity: 0;
  animation: fadeUp 600ms ease forwards;
  transition: border-color 160ms ease, background-color 160ms ease, transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 12px 24px rgba(4, 8, 12, 0.2);
  will-change: transform, opacity;
}

.stage-card:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 201, 119, 0.34);
  background: rgba(245, 233, 203, 0.15);
  box-shadow: 0 16px 30px rgba(4, 8, 12, 0.24);
}

.stage-card:focus-within {
  border-color: rgba(237, 201, 119, 0.5);
  background: rgba(245, 233, 203, 0.14);
  transform: translateY(-1px);
}

.stage-card h3 {
  line-height: 1.2;
  font-size: clamp(0.98rem, 2.3vw, 1.05rem);
}

.meta {
  margin: 0;
  font-size: 0.82rem;
  color: #f0cf93;
  font-weight: 700;
  line-height: 1.35;
}

.stage-card.locked {
  opacity: 0.55;
}

.tag {
  justify-self: start;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag.open {
  background: rgba(213, 169, 72, 0.25);
  color: #ffdba0;
}

.tag.done {
  background: rgba(47, 125, 65, 0.24);
  color: #b7f2c5;
}

.tag.locked {
  background: rgba(187, 79, 57, 0.2);
  color: #f9c0b6;
}

.cta-btn {
  padding: 0.62rem 0.9rem;
  background: linear-gradient(180deg, #f0d496, #c8973f);
  color: #2c1f10;
  box-shadow: 0 12px 22px rgba(201, 151, 63, 0.18);
}

.cta-btn:hover,
.cta-btn:focus-visible {
  background: linear-gradient(180deg, #f5dcaa, #d59e41);
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(201, 151, 63, 0.24);
}

.cta-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.activity-panel {
  margin-top: 0;
  background: rgba(13, 19, 28, 0.8);
  border: 1px solid rgba(237, 201, 119, 0.35);
  border-radius: 12px;
  padding: 1rem;
  animation: fadeUp 400ms ease both;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 164, 0.05), 0 14px 26px rgba(2, 5, 10, 0.28);
}

.stage-header {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.45rem;
}

.stage-top-icon {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(237, 201, 119, 0.5);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}



.cutscene-card {
  border: 1px solid rgba(237, 201, 119, 0.35);
  border-radius: 14px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(18, 27, 39, 0.96), rgba(10, 15, 24, 0.98));
  display: grid;
  gap: 0.65rem;
  animation: fadeUp 350ms ease both;
}

.cutscene-media {
  position: relative;
  min-height: 170px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(237, 201, 119, 0.35);
  background: radial-gradient(circle at 30% 20%, rgba(213, 169, 72, 0.35), rgba(16, 24, 37, 0.92));
}

.cutscene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 0;
  transition: opacity 300ms ease;
  background: #0f1722;
  will-change: opacity;
}

.cutscene-media.has-video .cutscene-video {
  opacity: 1;
}

.cutscene-media::after {
  content: "";
  position: absolute;
  inset: -40% -30%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 224, 164, 0.22) 50%, transparent 65%);
  animation: cutsceneSweep 3.4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.cutscene-media.perf-lite::after {
  display: none;
}

.cutscene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.12) contrast(1.04);
  opacity: 0.92;
  z-index: 0;
  transition: opacity 300ms ease;
}

.cutscene-media.has-video .cutscene-art {
  opacity: 0;
}

.cutscene-label {
  position: absolute;
  left: 0.6rem;
  bottom: 0.55rem;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 13, 20, 0.74);
  border: 1px solid rgba(237, 201, 119, 0.45);
  color: #ffe2a8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}

.cutscene-line {
  margin: 0;
  color: #f7dfb4;
  font-weight: 700;
  line-height: 1.45;
}

.cutscene-footer {
  margin-top: 0.2rem;
  display: grid;
  gap: 0.5rem;
}

.cutscene-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(245, 233, 203, 0.22);
  background: rgba(245, 233, 203, 0.12);
}

.cutscene-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d58b40, #f0d48e);
  transition: width 120ms linear;
}

.cutscene-time {
  margin: 0;
}

body.performance-lite .bg-orb {
  display: none;
}

body.performance-lite .hero,
body.performance-lite .progress-wrap,
body.performance-lite .activity-panel,
body.performance-lite .cutscene-card {
  animation: none;
}

body.performance-lite .cutscene-media::after {
  display: none;
}

body.performance-lite .activity-overlay {
  backdrop-filter: none;
}

body.performance-lite .activity-shell,
body.performance-lite .activity-panel,
body.performance-lite .cutscene-card {
  box-shadow: none;
}

body.performance-lite .cutscene-video,
body.performance-lite .cutscene-art,
body.performance-lite #progressFill,
body.performance-lite .cutscene-progress > span {
  transition-duration: 120ms;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .cutscene-media::after {
    display: none;
  }
}

@keyframes cutsceneSweep {
  from {
    transform: translateX(-45%) translateY(-10%) rotate(0deg);
  }
  to {
    transform: translateX(45%) translateY(10%) rotate(0deg);
  }
}

.activity-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: center;
  justify-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(5, 8, 13, 0.78);
  backdrop-filter: blur(3px);
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.95rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.activity-shell {
  width: min(900px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  margin: auto;
  border-radius: 14px;
  border: 1px solid rgba(237, 201, 119, 0.35);
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.98), rgba(12, 18, 27, 0.98));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 0.9rem;
}

.activity-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

body.has-overlay {
  overflow: hidden;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: center;
  justify-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(3, 6, 10, 0.82);
  backdrop-filter: blur(4px);
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.95rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.welcome-card {
  width: min(680px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(237, 201, 119, 0.38);
  background: linear-gradient(180deg, rgba(17, 24, 35, 0.98), rgba(11, 17, 25, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 1.2rem;
  text-align: left;
}

.welcome-card h2 {
  margin-top: 0.35rem;
}

.welcome-card p {
  margin: 0.65rem 0 1rem;
  color: #f8dfb4;
  font-weight: 700;
}

.theater-card {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  margin: auto;
}

.story-theater-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid rgba(237, 201, 119, 0.35);
  background: #0f1722;
  display: block;
  object-fit: cover;
  box-shadow: 0 16px 28px rgba(2, 6, 11, 0.28);
}

.story-theater-video.still-preview {
  height: min(46vh, 430px);
  object-fit: contain;
  background: linear-gradient(180deg, rgba(10, 16, 25, 0.98), rgba(17, 24, 35, 0.96));
  border-color: rgba(237, 201, 119, 0.45);
}

.welcome-card .cta-btn {
  width: 100%;
}

.welcome-overlay.hidden {
  display: none;
}

.badge-section {
  margin-top: 1.2rem;
}

.about-band {
  margin-top: 1.35rem;
  padding: 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(237, 201, 119, 0.28);
  background:
    radial-gradient(380px 200px at 88% 14%, rgba(213, 169, 72, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(18, 28, 41, 0.94), rgba(11, 18, 28, 0.88));
  box-shadow: 0 18px 36px rgba(2, 8, 13, 0.22);
}

.about-band-head {
  display: grid;
  gap: 0.45rem;
}

.about-band-head h2 {
  margin-top: 0;
  max-width: 22ch;
}

.about-band-copy {
  margin: 0;
  max-width: 72ch;
  color: #f4dfb4;
  font-size: 1rem;
  line-height: 1.55;
}

.about-grid {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.about-card {
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(237, 201, 119, 0.22);
  background:
    linear-gradient(180deg, rgba(245, 233, 203, 0.08), rgba(245, 233, 203, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.about-card h3 {
  margin-top: 0;
  font-size: 1.08rem;
  color: #f6dba4;
}

.about-card p {
  margin: 0;
  color: #f6e3bd;
  line-height: 1.52;
}

.about-kicker {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #edc977;
}

.site-footer {
  margin-top: 1.2rem;
  padding: 1rem 0 0.2rem;
  border-top: 1px solid rgba(237, 201, 119, 0.2);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.site-footer-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
  border: 1px solid rgba(237, 201, 119, 0.24);
  background: rgba(9, 16, 26, 0.4);
}

.site-footer-copy {
  margin: 0.18rem 0 0;
  max-width: 56ch;
  color: #eacb92;
  font-size: 0.92rem;
  line-height: 1.45;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.site-footer-links a {
  color: #f3cf83;
  text-decoration: none;
  font-weight: 800;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
  color: #ffe6b5;
  border-color: rgba(255, 230, 181, 0.5);
  transform: translateY(-1px);
}

.badge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.badge-grid {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.badge-card {
  border: 1px solid rgba(237, 201, 119, 0.3);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 28, 41, 0.94), rgba(13, 19, 28, 0.88));
  padding: 0.82rem;
  display: grid;
  gap: 0.5rem;
  box-shadow: 0 12px 24px rgba(2, 6, 10, 0.18);
}

.badge-card.empty {
  opacity: 0.85;
}

.badge-symbol {
  font-size: 1.6rem;
  line-height: 1;
}

.badge-card h3 {
  font-size: 1rem;
}

.badge-card p {
  margin: 0;
  color: #f6dfb5;
  font-size: 0.9rem;
}

.badge-card .ghost-btn {
  justify-self: start;
}

.daily-word-card,
.site-topbar,
.feature-card,
.premium-band,
.showcase-card,
.about-band,
.about-card,
.era-section,
.story-preview-card,
.badge-card,
.progress-wrap {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.daily-word-card:hover,
.site-topbar:hover,
.feature-card:hover,
.premium-band:hover,
.showcase-card:hover,
.about-band:hover,
.about-card:hover,
.era-section:hover,
.story-preview-card:hover,
.badge-card:hover,
.progress-wrap:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 201, 119, 0.34);
  box-shadow: 0 20px 38px rgba(2, 8, 13, 0.24);
}

.shield-card {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow-y: auto;
}

.badge-shield-progress {
  margin: 0.45rem 0 0.75rem;
}

.difficulty-badge-caption {
  margin: 0.15rem 0 0.45rem;
}

.difficulty-badge-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.difficulty-shield-badge {
  min-height: 70px;
  border: 1px solid rgba(237, 201, 119, 0.35);
  border-radius: 10px;
  background: rgba(237, 201, 119, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.32rem;
}

.difficulty-shield-badge.unlocked {
  background: linear-gradient(180deg, rgba(255, 224, 149, 0.2), rgba(179, 133, 45, 0.22));
  border-color: rgba(237, 201, 119, 0.62);
}

.difficulty-shield-badge.locked {
  filter: grayscale(1);
  opacity: 0.45;
}

.badge-shield-shell {
  margin-top: 0.55rem;
  padding: 1.2rem 0.9rem 1.45rem;
  border: 1px solid rgba(237, 201, 119, 0.38);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 22, 13, 0.94), rgba(18, 13, 8, 0.94));
  box-shadow: inset 0 10px 20px rgba(255, 214, 132, 0.05), 0 16px 30px rgba(0, 0, 0, 0.42);
  overflow-y: auto;
  max-height: min(56vh, 620px);
}

.badge-shield-grid {
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.shield-badge {
  min-height: 84px;
  border: 1px solid rgba(237, 201, 119, 0.35);
  border-radius: 10px;
  background: rgba(237, 201, 119, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.35rem;
}

.shield-badge .badge-symbol {
  font-size: 1.22rem;
}

.shield-badge .shield-name {
  margin-top: 0.18rem;
  font-size: 0.68rem;
  line-height: 1.2;
  color: #f6dfb5;
  font-weight: 800;
}

.shield-badge.locked {
  filter: grayscale(1);
  opacity: 0.35;
}

#badgeShieldOverlay.ceremony-mode .shield-card {
  animation: badgeBoardReveal 340ms ease both;
}

.shield-badge.ceremony-focus {
  border-color: rgba(255, 227, 161, 0.92);
  background: linear-gradient(180deg, rgba(255, 226, 160, 0.32), rgba(193, 141, 45, 0.26));
  box-shadow: 0 0 0 2px rgba(255, 226, 160, 0.34), 0 16px 30px rgba(0, 0, 0, 0.35);
  transform: scale(1.04);
  animation: badgeCeremonyPulse 1.2s ease-in-out infinite;
}

.share-card p,
.final-card p {
  line-height: 1.5;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.share-actions .ghost-btn {
  width: 100%;
}

.final-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  transform-origin: top center;
  perspective: 900px;
}

.final-card::before,
.certificate-shell::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.final-card::before {
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 28%, rgba(255, 232, 176, 0.14) 41%, transparent 54% 100%),
    radial-gradient(circle at 50% 0%, rgba(255, 223, 150, 0.18), transparent 42%);
  opacity: 0;
}

#finalOverlay.certificate-unfolding .final-card {
  animation: certificateUnfold 920ms cubic-bezier(0.2, 0.9, 0.16, 1) both;
}

#finalOverlay.certificate-unfolding .final-card::before {
  animation: certificateSheen 1.25s ease 240ms both;
}

#finalOverlay.certificate-unfolding #finalHeading,
#finalOverlay.certificate-unfolding #finalMessage,
#finalOverlay.certificate-unfolding .certificate-shell,
#finalOverlay.certificate-unfolding .final-actions {
  animation: certificateInk 680ms ease both;
}

#finalOverlay.certificate-unfolding #finalMessage {
  animation-delay: 140ms;
}

#finalOverlay.certificate-unfolding .certificate-shell {
  animation-delay: 240ms;
}

#finalOverlay.certificate-unfolding .final-actions {
  animation-delay: 340ms;
}

.credits-card {
  text-align: center;
  width: min(760px, 100%);
}

.credits-stage {
  margin-top: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(237, 201, 119, 0.4);
  background: radial-gradient(circle at 50% 24%, rgba(43, 57, 86, 0.44), rgba(7, 10, 16, 0.95));
  height: min(62vh, 520px);
  overflow: hidden;
  position: relative;
}

.credits-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.85) 0%, rgba(5, 8, 13, 0) 14%, rgba(5, 8, 13, 0) 82%, rgba(5, 8, 13, 0.92) 100%);
  pointer-events: none;
}

.credits-crawl-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -100%;
  display: grid;
  gap: 2rem;
  justify-items: center;
  padding: 0 1.25rem 4rem;
  transform: translateY(110%);
}

.credits-crawl-track.run {
  animation: creditsCrawl 28s linear forwards;
}

.credits-line {
  margin: 0;
  color: #f6dfb5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2.7vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(255, 215, 140, 0.15);
}

.credits-story {
  margin-top: 0.35rem;
  color: #ffe6b7;
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 900;
}

.certificate-shell {
  margin: 0.85rem auto 0.25rem;
  max-width: 560px;
  border-radius: 14px;
  border: 1px solid rgba(237, 201, 119, 0.46);
  background:
    linear-gradient(90deg, rgba(255, 226, 160, 0.13), transparent 18% 82%, rgba(255, 226, 160, 0.13)),
    repeating-linear-gradient(0deg, rgba(255, 238, 195, 0.05) 0 1px, transparent 1px 16px),
    linear-gradient(180deg, rgba(83, 58, 27, 0.62), rgba(24, 17, 10, 0.78));
  padding: 1rem 1.05rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 231, 171, 0.16),
    inset 0 18px 40px rgba(255, 225, 164, 0.06),
    0 20px 46px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.certificate-shell::before {
  inset: 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 225, 164, 0.25);
}

.certificate-title {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #f6dfb5;
}

.certificate-name {
  margin: 0.25rem 0 0.15rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 900;
  color: #ffe8bd;
}

.certificate-line {
  margin: 0;
  color: #f8dfb4;
  font-weight: 700;
  line-height: 1.45;
}

@keyframes certificateUnfold {
  0% {
    opacity: 0;
    transform: translateY(-22px) scaleY(0.2) rotateX(72deg);
    filter: blur(4px);
  }
  58% {
    opacity: 1;
    transform: translateY(0) scaleY(1.045) rotateX(-4deg);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1) rotateX(0deg);
    filter: none;
  }
}

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

@keyframes certificateSheen {
  0% {
    opacity: 0;
    transform: translateX(-38%);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(38%);
  }
}

body.a11y-reduced-motion #finalOverlay.certificate-unfolding .final-card,
body.a11y-reduced-motion #finalOverlay.certificate-unfolding #finalHeading,
body.a11y-reduced-motion #finalOverlay.certificate-unfolding #finalMessage,
body.a11y-reduced-motion #finalOverlay.certificate-unfolding .certificate-shell,
body.a11y-reduced-motion #finalOverlay.certificate-unfolding .final-actions {
  animation: none !important;
}

.certificate-date {
  margin: 0.4rem 0 0;
  color: #dcc083;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.final-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  flex-wrap: wrap;
}

.final-actions .cta-btn,
.final-actions .ghost-btn {
  min-width: 170px;
}

.hidden {
  display: none;
}

.badge-unlock-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  width: min(560px, calc(100vw - 1rem));
  z-index: 72;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, transform 240ms ease;
}

.badge-unlock-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.badge-unlock-card {
  border-radius: 14px;
  border: 1px solid rgba(237, 201, 119, 0.55);
  background: linear-gradient(180deg, rgba(22, 30, 43, 0.98), rgba(10, 16, 25, 0.98));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  padding: 0.72rem 0.86rem 0.76rem;
  text-align: center;
  pointer-events: auto;
}

.badge-unlock-kicker {
  margin: 0;
  color: #f1d495;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.badge-unlock-name {
  margin: 0.3rem 0 0;
  color: #fff2d2;
  font-size: clamp(1rem, 2.7vw, 1.35rem);
  font-weight: 900;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.badge-unlock-icon {
  font-size: 1.15em;
}

.badge-unlock-sub {
  margin: 0.34rem 0 0;
  color: #f5dca9;
  font-size: clamp(0.78rem, 2.15vw, 0.94rem);
  font-weight: 700;
  line-height: 1.35;
}

.badge-unlock-actions {
  margin-top: 0.66rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.badge-unlock-actions .ghost-btn,
.badge-unlock-actions .cta-btn {
  width: 100%;
  min-height: 42px;
}

body.performance-lite .badge-unlock-card {
  box-shadow: none;
}

@keyframes badgeCeremonyPulse {
  0%, 100% {
    transform: scale(1.03);
    filter: saturate(1);
  }
  50% {
    transform: scale(1.06);
    filter: saturate(1.12);
  }
}

@keyframes badgeBoardReveal {
  from {
    transform: translateY(8px) scale(0.985);
    opacity: 0.4;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.fact {
  margin: 0.45rem 0 0.9rem;
  color: #ffe7bb;
}

.source-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 0.9rem;
}

.source-ref {
  margin: 0;
  font-size: 0.86rem;
  color: #f2d8a4;
}

.quiz-options,
.order-list {
  display: grid;
  gap: 0.55rem;
}

.challenge-hint {
  margin: 0.1rem 0 0.55rem;
  color: #f1d49a;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.skill-status {
  margin: 0.15rem 0 0.75rem;
  padding: 0.62rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 233, 203, 0.2);
  background: linear-gradient(180deg, rgba(245, 233, 203, 0.08), rgba(245, 233, 203, 0.03));
  color: #f8dfb4;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.option-btn {
  text-align: left;
  padding: 0.7rem;
  background: rgba(245, 233, 203, 0.12);
  color: var(--paper);
  border: 1px solid rgba(245, 233, 203, 0.25);
}

.answer-input {
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  border: 1px solid rgba(245, 233, 203, 0.35);
  background: rgba(245, 233, 203, 0.08);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  padding: 0.68rem 0.78rem;
}

.answer-input:focus {
  outline: 2px solid rgba(213, 169, 72, 0.65);
  outline-offset: 1px;
}

.option-btn.selected {
  border-color: var(--accent-gold);
  background: rgba(213, 169, 72, 0.23);
}

.option-btn.correct {
  background: rgba(47, 125, 65, 0.34);
  border-color: #74cb8a;
}

.option-btn.wrong {
  background: rgba(140, 43, 36, 0.4);
  border-color: #da7e75;
}

.order-item {
  background: rgba(245, 233, 203, 0.12);
  border: 1px solid rgba(245, 233, 203, 0.2);
  border-radius: 10px;
  padding: 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.order-item.selected {
  border-color: rgba(237, 201, 119, 0.58);
  background: rgba(213, 169, 72, 0.18);
  transform: translateY(-1px);
}

.order-controls {
  display: flex;
  gap: 0.35rem;
}

.tiny-btn {
  border: 1px solid rgba(245, 233, 203, 0.4);
  background: transparent;
  color: var(--paper);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.feedback {
  margin-top: 0.7rem;
  font-weight: 800;
}

.feedback.ok {
  color: #9be8b0;
}

.feedback.warn {
  color: #f7b2a8;
}

canvas {
  width: 100%;
  max-width: 540px;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(245, 233, 203, 0.25);
  background: linear-gradient(180deg, #232f42, #1a2028);
  display: block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 16px 30px rgba(3, 7, 11, 0.24);
}

.skill-canvas {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

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

@keyframes creditsCrawl {
  from {
    transform: translateY(110%);
  }
  to {
    transform: translateY(-185%);
  }
}
@media (min-width: 820px) {
  .app {
    max-width: 1180px;
    width: 100%;
    padding: 2rem clamp(1.5rem, 2.8vw, 2rem) 3.5rem;
  }

  .hero {
    grid-template-columns: 140px 1fr;
    gap: 1.35rem;
  }

  .logo {
    width: 140px;
    height: 140px;
  }

  .hud-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .story-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .activity-shell {
    width: min(980px, 92vw);
  }

  .cutscene-media {
    min-height: 230px;
  }
}

@media (min-width: 1180px) {
  .app {
    max-width: 1260px;
  }

  .stage-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 820px) and (max-width: 1180px) and (orientation: portrait) {
  .app {
    max-width: 100%;
    padding: 1rem 0.8rem 2rem;
    gap: 0.8rem;
  }

  .hero {
    grid-template-columns: 80px 1fr;
    gap: 0.75rem;
    align-items: start;
  }

  .logo {
    width: 80px;
    height: 80px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  h1 {
    font-size: clamp(1.75rem, 5vw, 2.45rem);
  }

  .mission,
  .subtitle {
    max-width: 100%;
    font-size: 0.96rem;
    line-height: 1.32;
  }

  .progress-wrap {
    margin-top: 1rem;
    padding: 0.78rem;
  }

  .daily-word-card,
  .feature-card,
  .era-section {
    padding: 0.78rem;
  }

  .daily-word-card,
  .feature-card,
  .feature-grid,
  .stage-list {
    margin-top: 0.8rem;
  }

  .hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .stage-grid,
  .story-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .activity-shell,
  .theater-card {
    width: min(900px, 97vw);
    max-height: 95vh;
  }

  .story-theater-video.still-preview {
    height: min(38vh, 360px);
  }
}

@media (max-height: 900px) {
  .activity-overlay,
  .welcome-overlay {
    align-items: start;
  }

  .activity-overlay {
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .activity-shell,
  .theater-card {
    max-height: 96vh;
  }

  .activity-shell {
    padding: 0.75rem;
  }

  .activity-panel {
    padding: 0.82rem;
  }

  .story-theater-video.still-preview {
    height: min(40vh, 320px);
  }
}

@media (max-width: 380px) {
  .app {
    padding: 0.9rem 0.52rem 1.8rem;
  }

  h1 {
    font-size: clamp(1.35rem, 7.4vw, 1.85rem);
    letter-spacing: 0.01em;
  }

  .mission {
    font-size: 0.89rem;
    max-width: 100%;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 0.86rem;
    max-width: 100%;
    line-height: 1.3;
  }

  .hero {
    gap: 0.58rem;
  }
}

@media (max-width: 720px) {
  body {
    width: 100vw;
    max-width: 100vw;
  }

  .app {
    padding: 0.95rem 0.56rem 1.8rem;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.68rem;
    padding: 1.1rem 0.95rem;
  }

  .logo {
    margin: 0 auto;
    width: 104px;
    height: 104px;
  }

  .hero > div {
    width: 100%;
    max-width: 100%;
  }

  .hero-rail,
  .hero-links,
  .hero-actions {
    justify-content: center;
  }

  .premium-band {
    grid-template-columns: 1fr;
    padding: 0.95rem;
  }

  .premium-band-copy h2 {
    max-width: 100%;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(1.55rem, 7.2vw, 2rem);
    line-height: 1.06;
    letter-spacing: 0.01em;
  }

  .mission,
  .subtitle {
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.32;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .progress-label-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.82rem 0.9rem;
  }

  .site-topbar-links {
    justify-content: flex-start;
  }

  .hud-grid {
    grid-template-columns: 1fr 1fr;
  }

  .difficulty-picker {
    grid-template-columns: 1fr;
  }

  .shield-card {
    width: 100%;
  }

  .badge-shield-shell {
    max-height: none;
  }

  .badge-shield-grid {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .activity-overlay,
  .welcome-overlay {
    align-items: start;
  }

  .activity-shell,
  .theater-card {
    width: 100%;
    max-height: none;
  }

  .story-preview-grid {
    grid-template-columns: 1fr;
  }

  .theater-card {
    padding: 0.95rem;
  }

  .story-theater-video.still-preview {
    height: min(34vh, 250px);
  }

  .welcome-card {
    padding: 1rem;
  }

  .era-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .feature-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .share-actions {
    grid-template-columns: 1fr;
  }

  .final-actions {
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
  }

  .site-footer-brand {
    align-items: flex-start;
  }
}

@media (max-width: 430px) {
  .app {
    padding: 0.92rem 0.5rem 1.65rem;
  }

  .hud-grid {
    grid-template-columns: 1fr;
  }

  .progress-wrap,
  .feature-card,
  .era-section,
  .daily-word-card,
  .activity-panel {
    padding: 0.78rem;
  }

  h1 {
    font-size: clamp(1.4rem, 8.4vw, 1.95rem);
  }

  .mission,
  .subtitle {
    font-size: 0.9rem;
  }
}

body.phone-tight .hud-grid {
  grid-template-columns: 1fr !important;
}

body.phone-tight .difficulty-picker {
  grid-template-columns: 1fr !important;
}

/* HQ cutscene visual polish */
.cutscene-art {
  filter: saturate(1.18) contrast(1.08);
  transform-origin: center center;
  animation: cutsceneArtDrift 14s ease-in-out infinite alternate;
}

.cutscene-media.has-video .cutscene-art {
  animation: none;
}

.cutscene-label {
  z-index: 2;
}

.cutscene-script {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 2.05rem;
  margin: 0;
  padding: 0.38rem 0.56rem;
  border-radius: 10px;
  border: 1px solid rgba(237, 201, 119, 0.34);
  background: linear-gradient(180deg, rgba(6, 10, 17, 0.76), rgba(6, 10, 17, 0.48));
  color: #f9e8c6;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.32;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  z-index: 2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.performance-lite .cutscene-art {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .cutscene-art {
    animation: none !important;
  }
}

@keyframes cutsceneArtDrift {
  from {
    transform: scale(1.02) translateY(0);
  }
  to {
    transform: scale(1.08) translateY(-2%);
  }
}
