.map-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  margin-right: 10px;
  color: var(--ivory);
  background: #17241fe8;
  font-size: .85rem;
}
.map-button svg { width: 19px; height: 19px; color: var(--gold); }
.map-button:hover { background: #2a3e32; }
.journey-art, .adventure-canvas, .journey-content { position: absolute; inset: 0; width: 100%; height: 100%; }
.journey-art { background: #24392f center / cover no-repeat; }
.journey-stage[data-effect='red-water'] .journey-art { filter: sepia(.28) saturate(1.45) hue-rotate(-19deg); }
.journey-stage[data-effect='night'] .journey-art { filter: brightness(.46) saturate(.52) hue-rotate(14deg); }
.journey-stage[data-effect='quiet'] .journey-art { filter: brightness(.6) saturate(.57); }
.journey-stage:is([data-effect='hail'], [data-effect='swarm']) .journey-art::after {
  content: ''; position: absolute; inset: 0; opacity: .46;
  background: radial-gradient(circle at 14px 29px, #f6f4dc 2px, transparent 3px), radial-gradient(circle at 53px 62px, #f6f4dc 1px, transparent 2px);
  background-size: 70px 83px, 89px 91px;
  animation: drift-through-courtyard 1.8s linear infinite;
}
.journey-stage[data-effect='swarm'] .journey-art::after { filter: sepia(1) brightness(.48); animation-duration: 3.8s; }
@keyframes drift-through-courtyard { to { background-position: 70px 83px, 89px 182px; } }
@media (prefers-reduced-motion: reduce) { .journey-art::after { animation: none !important; } }
.adventure-canvas { display: block; z-index: 0; touch-action: none; }
.adventure-canvas:focus-visible { outline-offset: -4px; }
.journey-content {
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: auto;
  padding: clamp(20px, 4vw, 62px);
  background: linear-gradient(270deg, #101913f4, #1019138c 45%, transparent 70%), linear-gradient(0deg, #101913bf, transparent 47%);
}
.journey-content[data-layout='task'] { align-items: safe center; }
.journey-content[data-layout='moment'] { align-items: safe center; justify-content: center; background: #10191391; }
.journey-panel { width: min(47%, 520px); }
.journey-panel h2 { font-size: clamp(2.1rem, 4.9vw, 5rem); }
.journey-panel .eyebrow { margin-bottom: 13px; }
.journey-copy { color: var(--ivory); font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.48; margin: 14px 0 22px; max-width: 34ch; }
.journey-content:is([data-layout='task'], [data-layout='moment']) .journey-panel {
  width: min(100%, 635px);
  padding: clamp(18px, 2.7vw, 34px);
  border: 1px solid #ead6af6e;
  border-radius: 15px;
  background: #14241df7;
  box-shadow: 0 20px 48px #070e08a3;
}
.journey-content:is([data-layout='task'], [data-layout='moment']) h2 { font-size: clamp(1.7rem, 3.4vw, 3rem); }
.journey-content[data-layout='task'] .journey-copy { font-size: clamp(1.06rem, 1.6vw, 1.26rem); margin: 10px 0 13px; max-width: 50ch; }
.journey-earned { color: var(--gold); font-weight: 700; font-size: 1.05rem; }
.journey-options { display: grid; gap: 7px; margin-top: 13px; }
.journey-option {
  justify-content: flex-start;
  gap: 12px;
  min-height: 45px;
  padding: 6px 11px;
  font-weight: 570;
}
.journey-option kbd { flex: 0 0 28px; height: 27px; margin: 0; font-size: .92rem; }
.journey-option[data-tried] { border-color: #e3b373; }
.journey-option[data-correct] { border-color: #a0d68d; background: #354e3c; }
.journey-option:disabled:not([data-correct]) { opacity: .65; }
.journey-feedback { min-height: 1.3em; margin: 9px 0 13px; color: var(--gold); font-size: 1.04rem; line-height: 1.4; }
.discover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.discover-tile { justify-content: flex-start; gap: 8px; min-height: 46px; padding: 7px 8px; font-size: .95rem; text-align: left; }
.discover-tile[data-seen] { border-color: #dab98092; }
.discover-tile[aria-pressed='true'] { background: #39533b; border-color: var(--gold); }
.discover-icon { min-width: 1.55rem; height: 1.55rem; display: grid; place-items: center; border: 1px solid #ebce9152; border-radius: 50%; color: var(--gold); }
.discovery-detail { min-height: 92px; margin: 11px 0; padding: 10px 13px; border-left: 2px solid #e3c182a1; background: #0b191548; }
.discovery-detail strong { color: var(--gold); }
.discovery-detail p { margin: 5px 0 0; font-size: 1.08rem; line-height: 1.42; }
.timeline-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 13px 0 0; list-style: none; }
.timeline-slots li { display: flex; align-items: center; min-height: 38px; padding: 5px 9px; border: 1px dashed #f4dbaa65; border-radius: 7px; color: var(--muted); }
.timeline-slots li[data-placed] { border-style: solid; color: var(--ivory); background: #294635; }
.journey-panel button:disabled { cursor: default; }
.journey-panel .primary-button:disabled { opacity: .46; transform: none; }
.adventure-hud { position: absolute; inset: 14px 14px auto; z-index: 2; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; pointer-events: none; }
.adventure-hud-right { display: flex; align-items: flex-start; gap: 8px; }
.adventure-collectibles { position: relative; background: #13221bf0; border: 1px solid #ebdfbc55; border-radius: 10px; color: var(--gold); padding: 12px 10px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.adventure-award { position: absolute; inset: calc(100% + 8px) 4px auto auto; white-space: nowrap; font-size: 1.12rem; font-weight: 750; opacity: 0; text-shadow: 0 2px 6px #121915; }
.adventure-progress { min-width: 160px; padding: 9px 11px; background: #13221bf0; border: 1px solid #ebdfbc55; border-radius: 10px; }
.adventure-progress span { display: block; font-size: .88rem; color: var(--ivory); }
.adventure-progress progress { display: block; height: 5px; width: 100%; margin-top: 6px; border: none; border-radius: 3px; overflow: hidden; background: #fff6e444; accent-color: var(--gold); }
.adventure-progress progress::-webkit-progress-bar { background: #fff6e444; }
.adventure-progress progress::-webkit-progress-value { background: var(--gold); }
.adventure-progress progress::-moz-progress-bar { background: var(--gold); }
#adventure-action:disabled { background: #d1baa1; opacity: .75; cursor: default; }
.adventure-action-dock { position: absolute; z-index: 2; inset: auto 14px 14px auto; display: flex; gap: 8px; align-items: flex-end; }
.adventure-action-dock .paddle-button { position: static; inset: auto; }
#adventure-evade, #adventure-jump { background: #234238; border-color: #d1e5b88a; color: var(--ivory); }
#adventure-jump { background: #304954; border-color: #afcad695; }
#adventure-evade:hover { background: #365748; }
#adventure-jump:hover { background: #3e5d68; }
.adventure-action-dock .paddle-button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 8px #110e0c6b; }
.adventure-action-dock .paddle-button:disabled { opacity: .65; cursor: default; }
.journey-stage[data-mode='duel'] .adventure-progress { display: none; }
.journey-stage[data-mode='duel'] .river-hint { max-width: min(47%, 460px); }
.fight-hud { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); align-items: end; gap: 10px; padding: 9px 15px 12px; border: 1px solid #e9c7948c; border-radius: 13px; background: #241c17ed; box-shadow: 0 6px 18px #130b07a8; }
.fight-status { --fight-color: #a9e8c4; min-width: 0; display: grid; gap: 6px; font-weight: 740; color: var(--ivory); }
.fight-guard { --fight-color: #f6b777; justify-items: end; }
.fight-status progress { display: block; width: 100%; height: 13px; border: 1px solid #fff2cd58; border-radius: 4px; overflow: hidden; background: #5d342c; accent-color: var(--fight-color); }
.fight-status progress::-webkit-progress-bar { background: #5d342c; }
.fight-status progress::-webkit-progress-value { background: var(--fight-color); transition: width 150ms ease-out; }
.fight-status progress::-moz-progress-bar { background: var(--fight-color); }
.fight-guard progress { direction: rtl; }
.fight-emblem { width: 26px; color: var(--gold); filter: drop-shadow(0 2px 2px #160e09); }
.fight-banner { position: absolute; z-index: 2; inset: 31% 14px auto; width: max-content; max-width: calc(100% - 28px); margin: 0 auto; padding: 8px clamp(14px, 3vw, 31px); border: 1px solid #f8d394b8; border-radius: 7px; background: linear-gradient(135deg, #59361bf7, #211812f2); box-shadow: 0 7px 24px #170e08ad; color: #ffe8a8; font: bold clamp(1.55rem, 5vw, 4rem) / 1.12 Georgia, serif; text-align: center; text-shadow: 0 2px 3px #201108; pointer-events: none; }
.fight-banner[data-state='fight'] { animation: duel-go 720ms ease-out both; }
@keyframes duel-go { 0% { opacity: 1; transform: scale(.92); } 28%, 65% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.journey-content[data-layout='complete'] .journey-earned { width: fit-content; padding: 8px 12px; border: 1px solid #e5bf7373; border-radius: 8px; background: #172d22e6; animation: reward-in 320ms ease-out both; }
@keyframes reward-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .fight-banner[data-state='fight'] { animation-timing-function: steps(1, end); }
  .journey-content[data-layout='complete'] .journey-earned { animation: none; }
  @keyframes duel-go { 0%, 65% { opacity: 1; } 100% { opacity: 0; } }
}
.adventure-controls { color: var(--muted); font-size: .8rem; }
.adventure-controls strong { color: var(--ivory); }
.journey-dialog { width: min(calc(100% - 28px), 860px); max-height: min(88svh, 860px); padding: clamp(16px, 3vw, 32px); border: 1px solid #c5ae77a6; border-radius: 16px; background: #13251e; color: var(--ivory); box-shadow: 0 26px 85px #060d0ae0; }
.journey-dialog::backdrop { background: #0b1514c9; backdrop-filter: blur(3px); }
.journey-dialog-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.journey-dialog-heading .eyebrow { margin-bottom: 5px; }
.journey-dialog-heading .icon-button { font-size: 1.6rem; }
.map-progress { color: var(--muted); font-size: 1.04rem; line-height: 1.5; }
.journey-chapters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.journey-map-card { min-width: 0; min-height: 143px; text-align: left; position: relative; isolation: isolate; display: flex; align-items: flex-end; overflow: hidden; padding: 10px; border: 1px solid #e2c99455; border-radius: 9px; background: #223d31; color: var(--ivory); }
.journey-map-card:hover { border-color: var(--gold); }
.journey-map-art { position: absolute; inset: 0; z-index: -2; background-position: center; background-size: cover; }
.journey-map-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #13241cf7, #14241c5c 72%); }
.map-number { position: absolute; top: 8px; left: 8px; border: 1px solid #edd3a171; border-radius: 50%; padding: 5px; background: #15261ee8; color: var(--gold); font-size: .74rem; }
.map-card-text strong, .map-card-text small { display: block; }
.map-card-text small { color: #dfd9c7; margin-top: 4px; font-size: .78rem; line-height: 1.15; }
.score-dialog { width: min(calc(100% - 28px), 550px); }
.journey-scores-list { margin: 0 0 14px; padding-left: 2rem; }
.journey-scores-list li { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.journey-scores-list li strong { float: right; color: var(--gold); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .journey-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-content { padding: 16px; }
  .journey-panel { width: min(53%, 420px); }
  .journey-content[data-layout='task'] .journey-panel { width: min(100%, 560px); }
}
@media (max-width: 840px) {
  .journey-stage[data-mode='duel'] .river-hint { inset: 74px 9px auto; max-width: none; width: fit-content; }
  .journey-stage[data-mode='duel'] .adventure-action-dock { inset: auto 9px 9px; justify-content: flex-end; gap: 6px; }
  .journey-stage[data-mode='duel'] .adventure-action-dock .paddle-button { min-width: 0; }
  .fight-hud { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 6px; padding: 8px 9px; }
  .fight-banner { top: 43%; }
  .fight-emblem { width: 22px; }
  .fight-status { font-size: .82rem; }
}
@media (max-width: 560px) and (orientation: portrait) {
  .map-button { margin-right: 5px; padding: 0 8px; }
  .map-button span { display: none; }
  .map-button svg { width: 22px; height: 22px; }
  .journey-art { background-position: 32% center; }
  .journey-content { justify-content: flex-start; background: linear-gradient(0deg, #101913f5 0%, #101913b3 48%, transparent 79%); }
  .journey-panel { width: 100%; }
  .journey-copy { font-size: 1.13rem; margin: 10px 0 15px; }
  .journey-content[data-layout='task'] { align-items: safe flex-start; }
  .journey-content:is([data-layout='task'], [data-layout='moment']) .journey-panel { padding: 14px; }
  .adventure-controls { flex-wrap: wrap; }
}
