:root {
  color-scheme: dark;
  --ink: #fff9ea;
  --soft: #d6deca;
  --muted: #91a6a9;
  --coal: #101317;
  --night: #172026;
  --panel: rgba(21, 28, 32, 0.82);
  --panel-solid: #192228;
  --line: rgba(255, 255, 255, 0.14);
  --gold: #ffd36a;
  --amber: #f7a93b;
  --teal: #54d6c6;
  --blue: #73b7ff;
  --rose: #ff7c77;
  --green: #94df72;
  --violet: #bd9cff;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(84, 214, 198, 0.20), transparent 26rem),
    radial-gradient(circle at 82% 6%, rgba(255, 211, 106, 0.18), transparent 30rem),
    linear-gradient(140deg, #141816 0%, #17252a 45%, #3d2b25 100%);
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  width: min(1460px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 14px 0;
}

.game-panel,
.side-panel > section {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 32%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.game-panel {
  overflow: hidden;
  border-radius: 8px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 14px;
}

.brand-block,
.top-actions,
.section-heading,
.start-actions,
.end-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-card .start-actions,
.end-card .end-actions {
  position: sticky;
  bottom: -1px;
  margin: 0 -2px -4px;
  padding-top: 10px;
  background: linear-gradient(to top, rgba(21, 29, 34, 0.98), rgba(21, 29, 34, 0));
}

.brand-block {
  min-width: 0;
}

.mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 211, 106, 0.54);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 211, 106, 0.36), transparent 52%),
    #202725;
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 950;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 2.7vw, 2.7rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 10px;
  line-height: 1.08;
}

.season-pill,
.level-pill,
.key-hint {
  border: 1px solid rgba(255, 211, 106, 0.25);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 211, 106, 0.08);
  color: #ffe9a8;
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.level-pill {
  border-color: rgba(115, 183, 255, 0.28);
  background: rgba(115, 183, 255, 0.10);
  color: #cce4ff;
}

.key-hint {
  border-color: rgba(84, 214, 198, 0.28);
  background: rgba(84, 214, 198, 0.08);
  color: var(--soft);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202b31;
  color: var(--gold);
  font-size: 1.2rem;
}

.icon-button.is-muted {
  color: var(--muted);
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
}

.hud > div {
  min-width: 0;
  padding: 10px 14px;
  background: rgba(10, 15, 18, 0.54);
}

.hud-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1.12rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #101820;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.active-effects {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}

.active-effects span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(12, 18, 22, 0.66);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(circle at 54% 18%, rgba(255, 211, 106, 0.12), transparent 20rem),
    rgba(8, 12, 14, 0.58);
}

.screen.active {
  display: flex;
}

.screen-card {
  width: min(590px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: clamp(20px, 3vw, 34px);
  background:
    linear-gradient(150deg, rgba(255, 211, 106, 0.10), transparent 34%),
    rgba(21, 29, 34, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.hero-card h2,
.end-card h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0;
}

.screen-card.compact {
  width: min(380px, 100%);
}

.crest {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 211, 106, 0.48);
  border-radius: 50%;
  background: rgba(255, 211, 106, 0.08);
  color: var(--gold);
  font-size: 1.9rem;
}

.crest.small {
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
}

blockquote {
  margin: 18px 0;
  border-left: 4px solid var(--gold);
  padding: 2px 0 2px 14px;
  color: #fff3c6;
}

cite,
#focusRef {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.text-button,
.upgrade,
.mobile-controls button {
  min-height: 44px;
  border-radius: 8px;
}

.primary-button,
.secondary-button {
  padding: 12px 18px;
  font-weight: 950;
}

.primary-button {
  background: linear-gradient(135deg, #ffe08b, #f7a93b);
  color: #211403;
  box-shadow: 0 12px 26px rgba(247, 169, 59, 0.28);
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.upgrade:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.mobile-controls {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: rgba(10, 15, 18, 0.78);
}

.mobile-controls button {
  background: #253139;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.side-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.side-panel > section {
  border-radius: 8px;
  padding: 16px;
}

.profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(4, 8, 10, 0.42);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
}

input:focus {
  border-color: rgba(255, 211, 106, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 211, 106, 0.12);
}

.mini-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(135deg, #ffe08b, #f7a93b);
  color: #211403;
  font-weight: 950;
}

.microcopy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.level-track {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.level-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.level-option:hover {
  transform: translateY(-1px);
}

.level-option.is-active {
  border-color: rgba(255, 211, 106, 0.62);
  background: rgba(255, 211, 106, 0.10);
}

.level-option.is-locked {
  cursor: default;
  opacity: 0.58;
}

.level-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 211, 106, 0.12);
  color: var(--gold);
  font-weight: 950;
}

.level-option strong,
.level-option span,
.glossary-item strong,
.glossary-item span {
  display: block;
}

.level-option span,
.glossary-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.verse-card {
  background:
    linear-gradient(145deg, rgba(255, 211, 106, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(84, 214, 198, 0.13), transparent 42%),
    rgba(21, 28, 32, 0.86) !important;
}

.verse-card p:not(.eyebrow) {
  color: #fff1c8;
  font-size: 1.04rem;
  line-height: 1.45;
}

.section-heading {
  justify-content: space-between;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading span {
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 900;
}

.blessing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.blessing-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.06);
}

.blessing-grid div.is-active {
  border-color: rgba(255, 211, 106, 0.55);
  background: rgba(255, 211, 106, 0.13);
}

.blessing-grid b,
.blessing-grid span {
  display: block;
}

.blessing-grid span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.glossary-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.glossary-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.glossary-item.good {
  border-color: rgba(84, 214, 198, 0.22);
}

.glossary-item.bad {
  border-color: rgba(255, 124, 119, 0.22);
}

.glossary-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 950;
}

.lesson-tabs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.lesson-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.lesson-tab.is-active {
  border-color: rgba(84, 214, 198, 0.55);
  background: rgba(84, 214, 198, 0.10);
}

.lesson-tab strong,
.lesson-tab span > span {
  display: block;
}

.lesson-tab span > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.lesson-tab.is-locked {
  cursor: default;
  opacity: 0.52;
}

.lesson-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(84, 214, 198, 0.12);
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 950;
}

.lesson-body {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.lesson-body h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.lesson-body h4 {
  margin: 14px 0 6px;
  color: var(--gold);
  font-size: 0.92rem;
}

.lesson-body p {
  margin-bottom: 10px;
  color: var(--soft);
  font-size: 0.93rem;
  line-height: 1.48;
}

.lesson-body ul {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.42;
}

.text-button {
  background: transparent;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 900;
}

.meter {
  overflow: hidden;
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--rose));
  transition: width 220ms ease;
}

#rankText {
  margin: 9px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.upgrades {
  display: grid;
  gap: 8px;
}

.upgrade {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
  transition: transform 160ms ease, filter 160ms ease;
}

.upgrade span {
  color: var(--muted);
  font-size: 0.88rem;
}

.upgrade em {
  color: var(--gold);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.upgrade.is-owned {
  border-color: rgba(148, 223, 114, 0.55);
  background: rgba(148, 223, 114, 0.08);
}

.quest-card ul {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.quest-card li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.quest-card li::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.quest-card li.done {
  color: var(--ink);
}

.quest-card li.done::before {
  border-color: var(--green);
  background: var(--green);
}

.quest-card b {
  color: var(--gold);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

kbd {
  min-width: 28px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 4px 7px;
  background: rgba(4, 8, 10, 0.54);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .game-panel,
  .side-panel > section {
    border-radius: 0;
  }

  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hud > div:last-child {
    grid-column: span 2;
  }

  .canvas-wrap {
    aspect-ratio: 4 / 3;
  }

  .screen {
    padding: 10px;
  }

  .screen-card {
    padding: 16px;
  }

  .hero-card h2,
  .end-card h2 {
    font-size: 1.55rem;
  }

  .hero-card .crest,
  .end-card .crest {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    font-size: 1.35rem;
  }

  .hero-card p:not(.eyebrow) {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .hero-card blockquote,
  .end-card blockquote {
    margin: 10px 0;
    font-size: 0.86rem;
    line-height: 1.36;
  }

  .start-actions,
  .end-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .key-hint {
    white-space: normal;
  }

  .mobile-controls {
    display: grid;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: 1fr repeat(2, auto);
  }
}

@media (min-width: 481px) and (max-width: 720px) {
  .top-bar {
    align-items: center;
    flex-direction: row;
  }

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

  .hud > div:last-child {
    grid-column: auto;
  }
}

@media (max-width: 720px) and (max-height: 820px) {
  .hero-card p:not(.eyebrow),
  .key-hint {
    display: none;
  }
}

/* Premium visual refinement */
:root {
  --ink: #fff7df;
  --soft: #e4dac0;
  --muted: #a7b3b3;
  --coal: #080d14;
  --night: #0d1724;
  --panel: rgba(13, 23, 36, 0.82);
  --panel-solid: #111d2b;
  --line: rgba(241, 214, 157, 0.16);
  --gold: #f4c96b;
  --gold-2: #ffe7a3;
  --amber: #d9973e;
  --teal: #6be4d2;
  --blue: #8cbcff;
  --royal: #5869d8;
  --rose: #ef8076;
  --green: #95d879;
  --violet: #b79cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.025), transparent 34%),
    linear-gradient(135deg, #07101c 0%, #0e1c2b 42%, #221b2f 72%, #271f17 100%);
  font-feature-settings: "ss01", "cv01";
}

body::before {
  opacity: 0.46;
  background-image:
    linear-gradient(rgba(244, 201, 107, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 201, 107, 0.025) 1px, transparent 1px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.025)),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035), transparent 120px);
}

.shell {
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  width: min(1500px, calc(100vw - 32px));
}

.game-panel,
.side-panel > section {
  border-color: rgba(244, 201, 107, 0.15);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.075), transparent 28%),
    linear-gradient(315deg, rgba(107, 228, 210, 0.035), transparent 42%),
    rgba(13, 23, 36, 0.86);
}

.game-panel {
  position: relative;
  border-radius: 8px;
  isolation: isolate;
}

.game-panel::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 231, 163, 0.72), transparent);
  pointer-events: none;
}

.top-bar {
  padding: 18px 20px 16px;
  background:
    linear-gradient(90deg, rgba(244, 201, 107, 0.08), transparent 42%),
    rgba(8, 13, 20, 0.46);
}

.mark {
  width: 52px;
  height: 52px;
  border-color: rgba(244, 201, 107, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 231, 163, 0.20), transparent 54%),
    linear-gradient(315deg, rgba(107, 228, 210, 0.12), transparent 54%),
    #131c24;
  box-shadow:
    0 0 0 4px rgba(244, 201, 107, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.26);
}

.eyebrow {
  color: var(--teal);
  letter-spacing: 0.12em;
}

h1 {
  color: var(--ink);
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

h2 {
  color: var(--ink);
}

.season-pill,
.level-pill,
.key-hint {
  border-color: rgba(244, 201, 107, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 231, 163, 0.10), transparent),
    rgba(8, 13, 20, 0.52);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
}

.level-pill {
  border-color: rgba(140, 188, 255, 0.34);
  color: #d8e8ff;
}

.icon-button,
.mobile-controls button,
.mini-button,
.primary-button,
.secondary-button {
  transition:
    transform 160ms ease,
    filter 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.icon-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent),
    #162230;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.hud {
  border-color: rgba(244, 201, 107, 0.14);
  background: rgba(244, 201, 107, 0.12);
}

.hud > div {
  padding: 12px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(8, 13, 20, 0.74);
}

.hud-label {
  color: #aebcbd;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.hud strong {
  color: #fff3ce;
  font-size: 1.18rem;
}

.canvas-wrap {
  background: #08121d;
}

.canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 12%, transparent 88%, rgba(255, 255, 255, 0.04)),
    linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.22));
}

.active-effects span {
  border-color: rgba(255, 231, 163, 0.28);
  background:
    linear-gradient(145deg, rgba(244, 201, 107, 0.15), transparent),
    rgba(8, 13, 20, 0.70);
  animation: effectPulse 1.6s ease-in-out infinite;
}

.screen {
  background:
    linear-gradient(180deg, rgba(8, 13, 20, 0.30), rgba(8, 13, 20, 0.70)),
    rgba(8, 13, 20, 0.42);
}

.screen-card {
  border-color: rgba(244, 201, 107, 0.24);
  background:
    linear-gradient(155deg, rgba(255, 231, 163, 0.13), transparent 34%),
    linear-gradient(335deg, rgba(107, 228, 210, 0.08), transparent 45%),
    rgba(10, 19, 30, 0.94);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.hero-card,
.end-card {
  animation: cardIn 420ms ease both;
}

.hero-card h2,
.end-card h2 {
  color: #fff7df;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.44);
}

.end-card {
  width: min(640px, 100%);
}

.end-card .end-actions {
  position: static;
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding-top: 0;
  background: none;
}

.end-card .end-actions button {
  flex: 1 1 142px;
}

.screen-card p {
  color: #efe5ca;
}

.screen.is-win .end-card {
  border-color: rgba(244, 201, 107, 0.46);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.58),
    0 0 56px rgba(244, 201, 107, 0.16);
}

.screen.is-win .end-card::before {
  content: "";
  display: block;
  height: 5px;
  margin: -18px -18px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--violet));
  animation: finishGlow 1.8s ease-in-out infinite;
}

.crest {
  border-color: rgba(244, 201, 107, 0.56);
  background:
    linear-gradient(145deg, rgba(255, 231, 163, 0.18), transparent),
    rgba(244, 201, 107, 0.06);
  box-shadow:
    0 0 0 7px rgba(244, 201, 107, 0.045),
    0 14px 30px rgba(0, 0, 0, 0.26);
}

blockquote {
  border-left-color: var(--gold);
  color: #fff0c5;
}

.primary-button {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, #fff0b8 0%, #f4c96b 46%, #d9973e 100%);
  box-shadow:
    0 16px 34px rgba(217, 151, 62, 0.30),
    0 1px 0 rgba(255, 255, 255, 0.50) inset;
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.32), transparent 42%);
  transform: translateX(-120%);
  animation: buttonSheen 3.4s ease-in-out infinite;
}

.secondary-button {
  border-color: rgba(244, 201, 107, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(255, 255, 255, 0.06);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.mini-button:hover,
.upgrade:hover,
.level-option:hover,
.lesson-tab:hover {
  border-color: rgba(244, 201, 107, 0.42);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.26),
    0 0 0 3px rgba(244, 201, 107, 0.05);
}

.side-panel {
  gap: 16px;
}

@media (min-width: 1101px) {
  .side-panel {
    position: sticky;
    top: 14px;
    max-height: calc(100svh - 28px);
    overflow: auto;
    padding-right: 4px;
  }

  .side-panel::-webkit-scrollbar,
  .lesson-tabs::-webkit-scrollbar {
    width: 8px;
  }

  .side-panel::-webkit-scrollbar-thumb,
  .lesson-tabs::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(244, 201, 107, 0.22);
  }
}

@media (max-width: 1320px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(980px, calc(100vw - 24px));
  }

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

.side-panel > section {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 34%),
    rgba(12, 21, 31, 0.86);
}

.section-heading h2 {
  font-size: 1.24rem;
}

input {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(4, 8, 10, 0.48);
}

.level-option,
.lesson-tab,
.glossary-item,
.upgrade,
.blessing-grid div {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.level-option.is-active {
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(244, 201, 107, 0.055);
}

.level-index,
.lesson-number,
.glossary-icon {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.verse-card {
  background:
    linear-gradient(145deg, rgba(244, 201, 107, 0.15), transparent 34%),
    linear-gradient(315deg, rgba(107, 228, 210, 0.12), transparent 44%),
    rgba(12, 21, 31, 0.90) !important;
}

.meter {
  height: 11px;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.28);
}

.meter-fill {
  background: linear-gradient(90deg, #6be4d2, #f4c96b 58%, #ef8076);
  box-shadow: 0 0 20px rgba(244, 201, 107, 0.32);
}

.mobile-controls {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(8, 13, 20, 0.88);
}

.mobile-controls button {
  border: 1px solid rgba(244, 201, 107, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent),
    #162230;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.mobile-controls button:active {
  transform: translateY(1px) scale(0.99);
  border-color: rgba(244, 201, 107, 0.42);
}

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

@keyframes buttonSheen {
  0%,
  45% {
    transform: translateX(-120%);
  }
  70%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes effectPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes finishGlow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28);
  }
}

.lesson-unlock {
  margin: 12px 0 0;
  border: 1px solid rgba(244, 201, 107, 0.34);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(244, 201, 107, 0.14), transparent 42%),
    linear-gradient(315deg, rgba(107, 228, 210, 0.10), transparent 55%),
    rgba(8, 13, 20, 0.62);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.24),
    0 0 34px rgba(244, 201, 107, 0.08);
  animation: cardIn 360ms ease both;
}

.lesson-unlock[hidden] {
  display: none;
}

.lesson-unlock h3 {
  margin: 0 0 6px;
  font-size: 1.04rem;
}

.lesson-unlock p {
  margin-bottom: 7px;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.38;
}

.lesson-open-button {
  margin-top: 3px;
  padding: 9px 12px;
}

.lesson-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.lesson-meta span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(244, 201, 107, 0.13);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.3;
}

.lesson-meta strong {
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-theme {
  border-left: 3px solid rgba(107, 228, 210, 0.62);
  padding-left: 10px;
  color: #fff0c5 !important;
}

.guide-art {
  position: relative;
  overflow: hidden;
  color: transparent;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 247, 223, 0.24), transparent 42%),
    rgba(8, 13, 20, 0.64);
}

.guide-art::before,
.guide-art::after,
.guide-art i,
.guide-art i::before,
.guide-art i::after {
  content: "";
  position: absolute;
  display: block;
}

.guide-art.crown i {
  left: 7px;
  top: 9px;
  width: 22px;
  height: 18px;
  background: linear-gradient(180deg, #ffe7a3, #d9973e);
  clip-path: polygon(0 100%, 10% 34%, 34% 70%, 50% 12%, 66% 70%, 90% 34%, 100% 100%);
}

.guide-art.crown i::after {
  left: 1px;
  bottom: -2px;
  width: 20px;
  height: 5px;
  border-radius: 4px;
  background: #fff0b8;
}

.guide-art.scroll i {
  left: 9px;
  top: 8px;
  width: 18px;
  height: 22px;
  border-radius: 5px;
  background: #fff7df;
  box-shadow: inset 0 0 0 2px rgba(217, 151, 62, 0.45);
}

.guide-art.scroll i::before,
.guide-art.scroll i::after {
  left: -4px;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: #d9973e;
}

.guide-art.scroll i::before {
  top: 6px;
}

.guide-art.scroll i::after {
  top: 14px;
}

.guide-art.shield i {
  left: 9px;
  top: 6px;
  width: 19px;
  height: 25px;
  background: linear-gradient(180deg, #d8e8ff, #73b7ff);
  clip-path: polygon(50% 0, 100% 17%, 86% 78%, 50% 100%, 14% 78%, 0 17%);
  box-shadow: 0 0 16px rgba(115, 183, 255, 0.42);
}

.guide-art.lamp i {
  left: 16px;
  top: 8px;
  width: 4px;
  height: 23px;
  border-radius: 999px;
  background: #f4c96b;
}

.guide-art.lamp i::before {
  left: 1px;
  top: 0;
  width: 18px;
  height: 14px;
  background: #ffe7a3;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.guide-art.lamp i::after {
  left: -6px;
  bottom: -1px;
  width: 16px;
  height: 7px;
  border-radius: 999px;
  background: #d9973e;
}

.guide-art.wings i {
  left: 6px;
  top: 12px;
  width: 24px;
  height: 14px;
}

.guide-art.wings i::before,
.guide-art.wings i::after {
  top: 0;
  width: 17px;
  height: 10px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(180deg, #fff7df, #8cbcff);
}

.guide-art.wings i::before {
  left: 0;
  transform: rotate(-24deg);
}

.guide-art.wings i::after {
  right: 0;
  transform: rotate(24deg) scaleX(-1);
}

.guide-art.water i {
  left: 11px;
  top: 6px;
  width: 16px;
  height: 25px;
  background: linear-gradient(180deg, #bffaf4, #54d6c6);
  clip-path: polygon(50% 0, 86% 42%, 76% 82%, 50% 100%, 24% 82%, 14% 42%);
}

.guide-art.weight i {
  left: 8px;
  top: 13px;
  width: 22px;
  height: 17px;
  border-radius: 5px;
  background: linear-gradient(180deg, #c7cabb, #70776f);
}

.guide-art.weight i::before {
  left: 5px;
  top: -7px;
  width: 12px;
  height: 8px;
  border: 3px solid #a8aea3;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.guide-art.snare i {
  left: 7px;
  top: 8px;
  width: 23px;
  height: 23px;
  border: 4px solid #ff7c77;
  border-radius: 50%;
}

.guide-art.snare i::after {
  left: 2px;
  top: 9px;
  width: 23px;
  height: 4px;
  border-radius: 999px;
  background: #ffb0ad;
  transform: rotate(-35deg);
}

.guide-art.thorns i {
  left: 5px;
  top: 20px;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: #5f8b54;
  transform: rotate(-8deg);
}

.guide-art.thorns i::before,
.guide-art.thorns i::after {
  top: -10px;
  width: 24px;
  height: 17px;
  background: #94df72;
  clip-path: polygon(0 100%, 16% 22%, 32% 100%, 50% 10%, 68% 100%, 84% 22%, 100% 100%);
}

.guide-art.thorns i::before {
  left: 0;
}

.guide-art.thorns i::after {
  left: 5px;
  top: -6px;
  opacity: 0.65;
}

.guide-art.dart i {
  left: 5px;
  top: 17px;
  width: 25px;
  height: 4px;
  border-radius: 999px;
  background: #ffd36a;
}

.guide-art.dart i::before {
  right: -5px;
  top: -6px;
  width: 11px;
  height: 16px;
  background: #fff7df;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.guide-art.dart i::after {
  left: -8px;
  top: -7px;
  width: 12px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: #ef8076;
  transform: rotate(34deg);
}

.guide-art.doubt i {
  left: 6px;
  top: 15px;
  width: 26px;
  height: 13px;
  border-radius: 999px;
  background: rgba(183, 156, 255, 0.88);
}

.guide-art.doubt i::before {
  left: 4px;
  top: -8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(211, 196, 255, 0.92);
  box-shadow: 10px 2px 0 rgba(183, 156, 255, 0.88);
}

.guide-art.doubt i::after {
  left: 11px;
  top: -4px;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: #211d35;
  box-shadow: 0 17px 0 -1px #211d35;
}

.guide-art.gate i {
  left: 8px;
  top: 7px;
  width: 21px;
  height: 25px;
  border: 4px solid #e78054;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: rgba(231, 128, 84, 0.16);
}

.guide-art.gate i::after {
  left: 6px;
  top: 7px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #ffd36a;
  opacity: 0.75;
}

.upgrade.is-owned {
  border-color: rgba(149, 216, 121, 0.58);
  background:
    linear-gradient(145deg, rgba(149, 216, 121, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.045);
}

.upgrade.is-full {
  border-color: rgba(244, 201, 107, 0.54);
}

@media (max-width: 1100px) {
  .shell {
    width: min(920px, calc(100vw - 20px));
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: 100%;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .hud > div {
    padding: 10px 14px;
  }

  .screen-card {
    border-color: rgba(244, 201, 107, 0.22);
  }

  .side-panel {
    gap: 10px;
  }
}

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