.back-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  min-width: 44%;
  padding: 12px 18px !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  border-radius: 16px !important;
  background: #ffc85a !important;
  color: #5a3724 !important;
  border: 3px solid #e08a20 !important;
  box-shadow: 0 5px 0 #c86e12 !important;
}
.back-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c86e12 !important;
}

.word-audio {
  width: 100%;
  min-height: 64px;
  margin: 8px 0;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  background: #ef7a32;
  color: #fff;
  box-shadow: 0 5px 0 #c85c1e;
}

body.theme-home {
  background: radial-gradient(800px 400px at 10% 0%, #ffd7b5, transparent 55%), #fff4e6 !important;
}
body.theme-read {
  background: radial-gradient(800px 400px at 10% 0%, #ffc085, transparent 55%), #ffe8c8 !important;
}
body.theme-listen {
  background: radial-gradient(800px 400px at 10% 0%, #d7b8ff, transparent 55%), #ead9ff !important;
}
body.theme-spell {
  background: radial-gradient(800px 400px at 10% 0%, #ffe08a, transparent 55%), #fff0c8 !important;
}
body.theme-match {
  background: radial-gradient(800px 400px at 10% 0%, #ffc0d8, transparent 55%), #ffd6e8 !important;
}
body.theme-done {
  background: radial-gradient(800px 400px at 10% 0%, #ffd7b5, transparent 55%), #fff1dc !important;
}

body.theme-read .card { background: #fff6ea !important; border-color: #ef7a32 !important; }
body.theme-listen .card { background: #f7f0ff !important; border-color: #b57de8 !important; }
body.theme-spell .card { background: #fff8e0 !important; border-color: #e0b030 !important; }
body.theme-match .card { background: #fff0f5 !important; border-color: #e89ab8 !important; }
body.theme-done .card { background: #fffaf4 !important; border-color: #f0c48a !important; }

body.theme-read .primary { background: #ef7a32 !important; }
body.theme-listen .primary { background: #b57de8 !important; }
body.theme-spell .primary { background: #e0a020 !important; }
body.theme-match .primary { background: #e07aa0 !important; }
body.theme-listen .word-audio { background: #b57de8; box-shadow: 0 5px 0 #8c56c4; }
body.theme-read .word-audio { background: #ef7a32; box-shadow: 0 5px 0 #c85c1e; }
body.theme-spell .word-audio { background: #e0a020; box-shadow: 0 5px 0 #b07a10; }
body.theme-match .word-audio { background: #e07aa0; box-shadow: 0 5px 0 #b85a78; }

.mode[data-mode="read"] { background: #ffe8c8 !important; border-color: #ef7a32 !important; }
.mode[data-mode="listen"] { background: #ead9ff !important; border-color: #b57de8 !important; }
.mode[data-mode="spell"] { background: #ffe9a8 !important; border-color: #e0b030 !important; }
.mode[data-mode="match"] { background: #ffd6e8 !important; border-color: #e89ab8 !important; }
.resume-tag {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #8b6848;
}

.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar .back-btn { flex: 1; min-width: 48%; }

html.halloween body.theme-home {
  background: radial-gradient(800px 400px at 10% 0%, #ffd7b5, transparent 55%), #fff4e6 !important;
}
html.halloween body.theme-read {
  background: radial-gradient(800px 400px at 10% 0%, #ffc085, transparent 55%), #ffe8c8 !important;
}
html.halloween body.theme-listen {
  background: radial-gradient(800px 400px at 10% 0%, #d7b8ff, transparent 55%), #ead9ff !important;
}
html.halloween body.theme-spell {
  background: radial-gradient(800px 400px at 10% 0%, #ffe08a, transparent 55%), #fff0c8 !important;
}
html.halloween body.theme-match {
  background: radial-gradient(800px 400px at 10% 0%, #ffc0d8, transparent 55%), #ffd6e8 !important;
}
html.halloween body.theme-done {
  background: radial-gradient(800px 400px at 10% 0%, #ffd7b5, transparent 55%), #fff1dc !important;
}
html.halloween body.theme-read .card { background: #fff6ea !important; border-color: #ef7a32 !important; }
html.halloween body.theme-listen .card { background: #f7f0ff !important; border-color: #b57de8 !important; }
html.halloween body.theme-spell .card { background: #fff8e0 !important; border-color: #e0b030 !important; }
html.halloween body.theme-match .card { background: #fff0f5 !important; border-color: #e89ab8 !important; }
html.halloween body.theme-done .card { background: #fffaf4 !important; border-color: #f0c48a !important; }
html.halloween .mode[data-mode="read"] { background: #ffe8c8 !important; border-color: #ef7a32 !important; }
html.halloween .mode[data-mode="listen"] { background: #ead9ff !important; border-color: #b57de8 !important; }
html.halloween .mode[data-mode="spell"] { background: #ffe9a8 !important; border-color: #e0b030 !important; }
html.halloween .mode[data-mode="match"] { background: #ffd6e8 !important; border-color: #e89ab8 !important; }
html.halloween body.theme-read .primary { background: #ef7a32 !important; }
html.halloween body.theme-listen .primary { background: #b57de8 !important; }
html.halloween body.theme-spell .primary { background: #e0a020 !important; }
html.halloween body.theme-match .primary { background: #e07aa0 !important; }

.quest-hud {
  margin: 0 0 12px;
  padding: 10px 12px 8px;
  border-radius: 18px;
  background: #ffe8c8;
  border: 2px solid #f0c48a;
}
.quest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}
.quest-title { font-size: 18px; }
.quest-hp { color: #e24b4b; letter-spacing: 2px; font-size: 20px; }
.quest-streak { color: #c85c1e; font-size: 16px; }
.quest-bar {
  height: 10px;
  margin: 8px 0 4px;
  border-radius: 999px;
  background: #f7e0c4;
  overflow: hidden;
}
.quest-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffc85a, #ef7a32);
  border-radius: 999px;
}
.quest-level {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #8b6848;
}

.letter-slots, .letter-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}
.letter-slot, .letter-tile {
  width: 44px;
  height: 52px;
  border-radius: 12px;
  font: inherit;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}
.letter-slot {
  background: #fff;
  border: 3px dashed #f0c48a;
  color: #5a3724;
}
.letter-slot.on { border-style: solid; background: #fff1dc; }
.letter-slot.pat,
html.halloween .letter-slot.pat,
.letter-slot.pat.on,
html.halloween .letter-slot.pat.on {
  color: #ef7a32 !important;
  box-shadow: none;
}
.letter-slot.gift { background: #ffe8c8; border-color: #ef7a32; }
.phon-word mark {
  background: transparent;
  color: #ef7a32;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.word-audio mark {
  background: transparent;
  color: #5a3724;
  padding: 0;
  box-shadow: none;
}
.sound-only {
  margin: 4px 0 8px;
  color: #ef7a32;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.1;
}
.letter-slot.win { border-color: #5aaa3a; background: #e7f6ee; color: #3d7a32; }
.letter-tile {
  background: #ef7a32;
  color: #fff;
  border: 0;
  box-shadow: 0 4px 0 #c85c1e;
}
.letter-tile.used { opacity: 0.22; box-shadow: none; }
.letter-bank .letter-tile:active { transform: translateY(2px); box-shadow: 0 2px 0 #c85c1e; }
.shake { animation: lumos-shake 0.4s ease; }
@keyframes lumos-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.story-path {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  position: relative;
}
.path-stars {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #8b6848;
}
.path-node {
  display: grid;
  grid-template-columns: 42px 40px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 8px;
  text-align: left;
  background: #fffaf4;
  border: 3px solid #f0c48a;
  border-radius: 20px;
  padding: 12px 12px 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.path-num {
  grid-row: 1 / span 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffc85a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.path-emoji { font-size: 26px; grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: center; }
.path-node b { grid-column: 3; font-size: 22px; }
.path-hint { grid-column: 3; font-size: 14px; color: #8b6848; font-weight: 700; }
.path-node .resume-tag { grid-column: 3; margin-top: 2px; }
.path-node.locked { opacity: 0.45; cursor: not-allowed; }
.path-node.cleared { border-color: #ef7a32; background: #ffe8c8; }
.path-hook.open { background: #ffe8c8; border-color: #ef7a32; }
.path-hear.open { background: #ead9ff; border-color: #b57de8; }
.path-match.open { background: #ffd6e8; border-color: #e89ab8; }
.path-spell.open, .path-build.open { background: #ffe9a8; border-color: #e0b030; }
.path-echo.open { background: #fff1dc; border-color: #f0a05a; }
.path-mix.open { background: #ead9ff; border-color: #c9a6f0; }
.path-boss.open { background: #ffd7b5; border-color: #ef7a32; }
.path-chest.open { background: #ffe9a8; border-color: #e0b030; }

.echo-row { margin-top: 10px; }
.turn-chip {
  background: #fff1dc;
  border: 2px solid #f0c48a;
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 10px;
}
.turn-chip.go {
  background: #ffe8c8;
  border-color: #ef7a32;
}

.choice, .node, .letter-tile, .letter-slot, .path-node, .word-audio {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(239, 122, 50, 0.25);
}
.choice img, .choice span, .node img {
  pointer-events: none;
}
.choices { position: relative; z-index: 2; }
