/* The Lantern Kingdom — interface layer. The world.css component contracts stay intact. */
:root {
  --cw-bg: #132422;
  --cw-ink: #f4f0e5;
  --cw-mut: #b8c4bc;
  --cw-gold: #e6c486;
  --cw-cyan: #b2d4c5;
  --cw-panel: rgba(16, 32, 32, .9);
  --cw-border: rgba(235, 221, 191, .19);
  --cw-header-h: 66px;
  --cw-gap: 16px;
  color-scheme: dark;
}
html, body { font-family: 'DM Sans', system-ui, sans-serif; }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
.cw-stage { isolation: isolate; height: 100%; height: 100dvh; outline: none; }
.cw-stage :focus-visible, .cw-fallback :focus-visible { outline: 2px solid var(--cw-gold); outline-offset: 4px; }
.cw-stage .cw-controller-focus, .cw-stage [role="dialog"] :focus, .cw-stage [role="alertdialog"] :focus { outline: 2px solid var(--cw-gold); outline-offset: 4px; }
.cw-stage button { touch-action: manipulation; }
.cw-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.cw-eyebrow { display: block; color: var(--cw-gold); font-size: 10px; font-weight: 600; letter-spacing: .18em; line-height: 1.5; text-transform: uppercase; }
.cw-lantern-mark { display: block; color: var(--cw-gold); filter: drop-shadow(0 0 18px rgba(230,196,134,.17)); }

/* An uninterrupted viewport, with two compact rows only where space requires them. */
.cw-topbar {
  z-index: 25; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) calc(var(--cw-gap) + env(safe-area-inset-right)) 10px calc(var(--cw-gap) + env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(9,22,25,.67), transparent);
}
.cw-topbar-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cw-back { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 40px; padding: 0; border: 1px solid var(--cw-border); border-radius: 11px; background: var(--cw-panel); }
.cw-topbar-title { display: grid; gap: 1px; line-height: 1.12; white-space: nowrap; }
.cw-topbar-title span { display: block; padding: 0; border: 0; background: none; border-radius: 0; backdrop-filter: none; }
.cw-topbar-title .cw-brand-name { font-family: 'DM Sans', sans-serif; font-size: 9px; font-weight: 600; letter-spacing: .19em; text-transform: uppercase; color: #e3eadf; }
.cw-topbar-title .cw-wordmark { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 400; letter-spacing: .025em; color: var(--cw-ink); }
.cw-wordmark b { font-weight: 400; background: none; color: var(--cw-gold); }
.cw-world-nav, .cw-topbar-actions { display: flex; align-items: center; gap: 5px; }
.cw-topbar-actions { justify-self: end; }
.cw-navbtn, .cw-iconbtn.cw-toolbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px;
  border: 1px solid var(--cw-border); border-radius: 10px; background: var(--cw-panel);
  color: var(--cw-ink); font-size: 12px; font-weight: 500; cursor: pointer; backdrop-filter: blur(12px);
}
.cw-navbtn { padding: 0 11px; }
.cw-iconbtn.cw-toolbtn { width: auto; height: 42px; padding: 0 10px; }
.cw-navbtn svg, .cw-toolbtn svg { flex-shrink: 0; color: var(--cw-gold); }
.cw-navbtn kbd, .cw-photo-exit kbd { margin-left: 1px; padding: 2px 4px; border: 1px solid rgba(255,255,255,.16); border-radius: 4px; color: var(--cw-mut); font-family: inherit; font-size: 9px; font-weight: 400; }
.cw-navbtn[aria-pressed="true"] { background: #e1c18a; border-color: #e1c18a; color: #152925; }
.cw-navbtn[aria-pressed="true"] svg, .cw-navbtn[aria-pressed="true"] kbd { color: inherit; }
@media (hover: hover) {
  .cw-navbtn:hover, .cw-toolbtn:hover, .cw-back:hover { background: #2a403a; border-color: rgba(230,196,134,.55); }
  .cw-textbtn:hover, .cw-pause-footer a:hover { color: #fff4d7; }
}

/* Objective, compass and legacy counters occupy separate slots. */
.cw-expedition-hud {
  position: absolute; top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); left: calc(var(--cw-gap) + env(safe-area-inset-left));
  z-index: 20; width: 310px; max-width: calc(100% - 142px - env(safe-area-inset-left) - env(safe-area-inset-right));
  padding: 12px 13px 11px; border: 1px solid var(--cw-border); border-radius: 13px;
  background: var(--cw-panel); backdrop-filter: blur(14px); box-shadow: 0 8px 28px rgba(6,16,19,.09);
}
.cw-expedition-district { display: flex; align-items: center; gap: 6px; color: var(--cw-mut); font-size: 10px; line-height: 1.4; }
#cw-district { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-location-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--cw-gold); flex-shrink: 0; }
.cw-save-state { margin-left: auto; white-space: nowrap; color: #b4ccba; font-size: 9px; }
.cw-save-state.is-unsaved { color: #ebc989; }
.cw-objective-heading { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; font-size: 13px; line-height: 1.5; font-weight: 600; }
#cw-objective-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-objective-count { flex-shrink: 0; margin-left: auto; color: var(--cw-gold); font-size: 11px; font-weight: 500; white-space: nowrap; }
.cw-expedition-hud p { margin: 5px 0 0; color: var(--cw-mut); font-size: 11px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-objective-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.cw-compass { display: inline-flex; align-items: center; gap: 5px; color: var(--cw-gold); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-compass svg { transform: rotate(var(--cw-bearing-angle, 0deg)); transform-origin: center; }
#cw-distance { color: var(--cw-mut); }
.cw-textbtn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; padding: 0; background: none; color: var(--cw-gold); font-size: 11px; font-weight: 500; cursor: pointer; text-decoration: none; }
.cw-objective-footer .cw-textbtn { min-height: 24px; margin: -4px 0; font-size: 10px; }
.cw-trail-progress { position: absolute; left: 13px; right: 13px; bottom: 0; height: 2px; overflow: hidden; background: rgba(230,196,134,.12); }
.cw-trail-progress i { display: block; height: 100%; width: 0; background: var(--cw-gold); transition: width .4s ease; }
.cw-level { top: calc(var(--cw-header-h) + 152px + env(safe-area-inset-top)); left: calc(var(--cw-gap) + env(safe-area-inset-left)); z-index: 20; min-height: 34px; gap: 8px; padding: 6px 10px; border-color: var(--cw-border); border-radius: 9px; font-size: 11px; }
.cw-level-n { font-family: inherit; font-size: 11px; font-weight: 600; }
.cw-level-bar { width: 42px; height: 3px; }
.cw-level-bar i { background: var(--cw-gold); }
.cw-level-streak { font-size: 10px; }
.cw-coinhud { top: calc(var(--cw-header-h) + 152px + env(safe-area-inset-top)); left: calc(var(--cw-gap) + 152px + env(safe-area-inset-left)); min-height: 34px; padding: 7px 10px; border: 1px solid var(--cw-border); border-radius: 9px; color: var(--cw-ink); font-size: 11px; font-weight: 500; }
.cw-coin-ico { display: inline-block; width: 12px; height: 12px; margin-right: 3px; overflow: hidden; border: 1px solid var(--cw-gold); border-radius: 50%; background: rgba(230,196,134,.15); color: transparent; font-size: 0; vertical-align: -2px; box-shadow: inset 0 0 0 2px var(--cw-panel); }
.cw-minimap { top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); right: calc(var(--cw-gap) + env(safe-area-inset-right)); width: 96px; height: 96px; opacity: .9; }
.cw-sprint, .cw-minihud { width: max-content; max-width: min(380px, calc(100% - 32px)); padding: 9px 13px; border: 1px solid var(--cw-border); border-radius: 10px; background: var(--cw-panel); font-family: inherit; font-size: 12px; line-height: 1.45; text-align: center; overflow-wrap: anywhere; }
.cw-sprint { top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); }
.cw-minihud { top: calc(var(--cw-header-h) + 56px + env(safe-area-inset-top)); }
.cw-toast { top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); width: max-content; max-width: min(440px, calc(100% - 32px)); border-color: rgba(230,196,134,.42); border-radius: 10px; padding: 10px 15px; font-size: 12px; line-height: 1.45; text-align: center; }
.cw-prompt { z-index: 22; bottom: calc(112px + env(safe-area-inset-bottom)); width: max-content; max-width: min(440px, calc(100% - 32px)); border: 1px solid var(--cw-border); font-size: 12px; line-height: 1.4; }
.cw-prompt kbd { flex-shrink: 0; border-color: var(--cw-border); background: rgba(230,196,134,.1); color: var(--cw-gold); }
.cw-hint { z-index: 19; padding: 9px 14px; gap: 4px; border-color: var(--cw-border); border-radius: 11px; max-width: min(580px, calc(100% - 140px)); }
.cw-hint strong { font-family: inherit; font-size: 11px; font-weight: 600; }
.cw-hint small { font-size: 10px; line-height: 1.5; }
.cw-hint em { display: none; }
.cw-help-trigger { position: absolute; z-index: 24; bottom: calc(18px + env(safe-area-inset-bottom)); right: calc(var(--cw-gap) + env(safe-area-inset-right)); display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 40px; padding: 8px 11px; border: 1px solid var(--cw-border); border-radius: 10px; background: var(--cw-panel); color: var(--cw-ink); font-size: 11px; cursor: pointer; backdrop-filter: blur(12px); }
.cw-help-trigger > span:first-child { color: var(--cw-gold); font-family: Georgia, serif; font-size: 18px; }
.cw-stage:has(.cw-toast.is-in) .cw-hint, .cw-stage:has(.cw-toast.is-in) .cw-prompt { visibility: hidden; }
.cw-stage:has(.cw-sprint:not([hidden])) .cw-hint, .cw-stage:has(.cw-minihud:not([hidden])) .cw-hint { visibility: hidden; }

/* Touch controls remain named, generous targets and leave the centre of the world clear. */
.cw-stick { width: 108px; height: 108px; left: calc(16px + env(safe-area-inset-left)); bottom: calc(20px + env(safe-area-inset-bottom)); }
.cw-stick-base { background: rgba(19,38,35,.3); border-color: rgba(237,226,204,.25); box-shadow: inset 0 0 0 10px rgba(245,229,195,.025); backdrop-filter: blur(2px); }
.cw-stick-knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; border-color: rgba(237,226,204,.6); background: rgba(239,223,192,.23); }
.cw-interact, .cw-jump, .cw-emote { justify-items: center; align-content: center; gap: 3px; border-width: 1px; background: rgba(16,32,32,.79); color: var(--cw-ink); border-color: rgba(230,196,134,.5); backdrop-filter: blur(6px); font-family: inherit; box-shadow: 0 3px 16px rgba(7,16,18,.12); }
.cw-interact { display: grid; right: calc(20px + env(safe-area-inset-right)); bottom: calc(30px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-color: var(--cw-gold); color: var(--cw-gold); }
.cw-interact span, .cw-jump span, .cw-emote span { font-size: 9px; line-height: 1.2; font-weight: 500; }
.is-touch .cw-jump, .is-touch .cw-emote { display: grid; }
.cw-jump { right: calc(90px + env(safe-area-inset-right)); bottom: calc(23px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
.cw-emote { right: calc(22px + env(safe-area-inset-right)); bottom: calc(102px + env(safe-area-inset-bottom)); width: 48px; height: 48px; }
.is-touch .cw-hint { bottom: calc(158px + env(safe-area-inset-bottom)); max-width: min(410px, calc(100% - 32px)); }
.is-touch .cw-prompt { bottom: calc(218px + env(safe-area-inset-bottom)); }
.is-touch .cw-toast { bottom: calc(174px + env(safe-area-inset-bottom)); }
.is-touch .cw-help-trigger { top: calc(var(--cw-header-h) + 115px + env(safe-area-inset-top)); bottom: auto; right: calc(var(--cw-gap) + 24px + env(safe-area-inset-right)); width: 44px; padding: 8px; }
.is-touch .cw-help-label { display: none; }

/* One dialog surface for welcome, pause, help and a scoped restart confirmation. */
.cw-dialog-shade { position: absolute; inset: 0; z-index: 55; display: grid; place-items: center; padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); background: rgba(7,20,24,.38); backdrop-filter: blur(5px); outline: none; }
.cw-dialog-card { width: min(100%, 720px); max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow: auto; overscroll-behavior: contain; padding: 26px; border: 1px solid rgba(230,211,173,.24); border-radius: 20px; background: #172c2a; background: linear-gradient(135deg, rgba(31,51,44,.98), rgba(13,31,36,.98)); box-shadow: 0 24px 100px rgba(4,14,18,.35); scrollbar-color: #6e7966 transparent; scrollbar-width: thin; }
.cw-dialog-card h2 { margin: 8px 0 14px; color: var(--cw-ink); font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 30px; line-height: 1.14; letter-spacing: -.035em; }
.cw-dialog-card p { color: var(--cw-mut); font-size: 12px; line-height: 1.7; }
.cw-dialog-card .cw-primarybtn, .cw-dialog-card .cw-secondarybtn, .cw-primarybtn, .cw-secondarybtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; margin: 0; padding: 11px 17px; border: 1px solid var(--cw-gold); border-radius: 10px; background: var(--cw-gold); color: #172b27; font: 600 12px/1.4 'DM Sans', sans-serif; text-decoration: none; cursor: pointer; }
.cw-dialog-card .cw-secondarybtn, .cw-secondarybtn { color: var(--cw-ink); border-color: var(--cw-border); background: rgba(240,225,192,.045); font-weight: 500; }
.cw-dialog-card .cw-primarybtn:hover { background: #efd4a4; }
.cw-dialog-card .cw-secondarybtn:hover { background: rgba(240,225,192,.1); }
.cw-dialog-card button:disabled { opacity: .55; cursor: wait; }
.cw-welcome-card { display: grid; grid-template-columns: 1.27fr 1fr; gap: 0; padding: 0; width: min(100%, 740px); }
.cw-welcome-main { padding: 34px 31px 25px; }
.cw-welcome-main h2 { margin: 17px 0 17px; font-size: clamp(35px, 4.6vw, 49px); line-height: 1.04; letter-spacing: -.05em; }
.cw-welcome-main .cw-welcome-lead { margin: 0 0 10px; color: #efe7d7; font-size: 13px; }
.cw-welcome-main .cw-welcome-copy { margin: 0; font-size: 12px; line-height: 1.8; }
.cw-welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 25px; }
.cw-welcome-main .cw-welcome-save { margin: 12px 0 0; color: #a4b9ad; font-size: 10px; line-height: 1.5; }
.cw-welcome-route { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 30px 25px; border-left: 1px solid rgba(230,211,173,.13); background: radial-gradient(ellipse at 25% 10%, rgba(203,160,80,.10), transparent 75%); }
.cw-welcome-route .cw-lantern-mark { margin: 0 0 19px; }
.cw-route-steps { display: grid; gap: 19px; margin: 17px 0 0; padding: 0; list-style: none; }
.cw-route-steps li { display: flex; gap: 12px; }
.cw-route-steps li > span { padding-top: 3px; color: #b39d73; font-size: 9px; font-variant-numeric: tabular-nums; }
.cw-route-steps strong { display: block; color: #eee8d8; font-size: 12px; font-weight: 500; line-height: 1.5; }
.cw-route-steps p { margin: 4px 0 0; font-size: 11px; line-height: 1.6; }
.cw-welcome-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 30px; border-top: 1px solid rgba(230,211,173,.13); font-size: 10px; color: var(--cw-mut); }
.cw-welcome-footer .cw-textbtn { min-height: 26px; font-size: 10px; }
.cw-dialog-heading { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.cw-dialog-heading h2 { margin-bottom: 0; }
.cw-closebtn { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 1px solid var(--cw-border); border-radius: 10px; background: rgba(240,225,192,.04); color: var(--cw-ink); font-family: inherit; font-size: 23px; cursor: pointer; }
.cw-controls-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cw-controls-grid h3 { margin: 5px 0 13px; color: var(--cw-gold); font-size: 12px; font-weight: 500; }
.cw-controls-grid dl { margin: 0; }
.cw-controls-grid dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; padding: 8px 0; border-top: 1px solid rgba(232,221,196,.09); font-size: 10px; line-height: 1.4; }
.cw-controls-grid dt { color: var(--cw-mut); }
.cw-controls-grid dd { margin: 0; color: var(--cw-ink); }
.cw-controls-grid .cw-help-note { font-size: 10px; line-height: 1.6; }
.cw-help-comfort { margin: 18px 0; padding-top: 16px; border-top: 1px solid var(--cw-border); }
.cw-help-comfort strong { color: #e4d6b8; font-weight: 500; }
.cw-help-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cw-dialog-card.cw-pause-card { width: min(100%, 390px); min-width: 0; padding: 29px; text-align: left; }
.cw-pause-card h2 { margin-top: 12px; font-size: 34px; }
.cw-pause-card > p { margin: 0 0 22px; font-size: 12px; }
.cw-pause-card > .cw-primarybtn { width: 100%; }
.cw-pause-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cw-pause-options .cw-secondarybtn { padding: 10px 8px; font-size: 11px; }
.cw-pause-options #cw-pause-return { grid-column: 1 / -1; }
.cw-time-options { margin: 23px 0 0; padding: 0; border: 0; }
.cw-time-options legend { padding: 0; color: var(--cw-mut); font-size: 10px; }
.cw-time-options > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.cw-time-options button { min-height: 40px; margin: 0; padding: 8px 6px; border: 1px solid var(--cw-border); border-radius: 8px; background: rgba(240,225,192,.035); color: var(--cw-ink); font-size: 11px; font-weight: 400; }
.cw-time-options button[aria-pressed="true"] { border-color: #d1ae73; color: var(--cw-gold); background: rgba(220,184,121,.1); }
.cw-pause-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 13px; border-top: 1px solid var(--cw-border); }
.cw-pause-footer .cw-textbtn, .cw-pause-footer a { min-height: 32px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--cw-mut); font-family: inherit; font-size: 10px; font-weight: 400; text-decoration: none; }
.cw-reset-card { width: min(100%, 410px); }
.cw-reset-card h2 { font-size: 32px; }
.cw-reset-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.cw-reset-error { color: #efc38e !important; }

/* Bring existing world activities into the same compact, scrollable surfaces. */
.cw-world-scrim { position: absolute; inset: 0; z-index: 34; background: rgba(6,17,20,.38); }
.cw-panel, .cw-settings, .cw-quests, .cw-shop, .cw-travel, .cw-journal { border-color: var(--cw-border); border-radius: 15px; background: var(--cw-panel); box-shadow: 0 14px 50px rgba(6,16,19,.23); backdrop-filter: blur(16px); scrollbar-color: #6e7966 transparent; scrollbar-width: thin; overscroll-behavior: contain; }
.cw-panel, .cw-shop, .cw-settings { z-index: 38; }
.cw-panel { max-height: calc(100vh - var(--cw-header-h) - 34px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - var(--cw-header-h) - 34px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; }
.cw-panel-media { height: 130px; background: #1c332e; }
.cw-panel-title { font-family: Georgia, serif; font-size: 24px; font-weight: 400; letter-spacing: -.025em; }
.cw-panel-cat { color: var(--cw-cyan); font-size: 10px; font-weight: 500; letter-spacing: .05em; }
.cw-panel-pitch { font-size: 12px; line-height: 1.6; }
.cw-panel-meta { font-size: 10px; line-height: 1.6; white-space: normal; }
.cw-panel-body { padding: 16px 17px 18px; }
.cw-play { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; border-radius: 9px; background: var(--cw-gold); color: #1c3029; font-size: 12px; font-weight: 600; }
.cw-panel-close, .cw-shop-close { width: 40px; height: 40px; border: 1px solid var(--cw-border); border-radius: 10px; background: rgba(16,32,32,.92); font-size: 22px; }
.cw-settings { top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); width: min(300px, calc(100% - 32px)); max-height: calc(100vh - var(--cw-header-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - var(--cw-header-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 20px; gap: 18px; }
.cw-settings h3, .cw-quests h3, .cw-shop-head h3, .cw-travel h3, .cw-journal h2, .cw-journal h3 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 24px; font-weight: 400; letter-spacing: -.025em; color: var(--cw-ink); }
.cw-settings select { min-height: 42px; padding: 8px 10px; border-color: var(--cw-border); border-radius: 8px; background: #1b3432; }
.cw-settings input { accent-color: var(--cw-gold); }
.cw-settings input[type="range"] { min-height: 32px; }
.cw-settings button { min-height: 42px; border-radius: 9px; color: #1b302b; }
.cw-quests { top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); z-index: 36; width: min(340px, calc(100% - 32px)); max-height: calc(100vh - var(--cw-header-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - var(--cw-header-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 20px; }
.cw-quest { padding: 9px 0; }
.cw-quest-text { font-size: 12px; }
.cw-quest-text i { margin-top: 4px; font-size: 10px; }
.cw-quests .cw-achv-h { margin-top: 22px; font-size: 20px; text-transform: none; letter-spacing: -.025em; }
.cw-shop { width: min(440px, calc(100% - 32px)); max-height: calc(100vh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 22px; }
.cw-shop-head { align-items: flex-start; }
.cw-shop-head h3 { padding-top: 5px; }
.cw-shop-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.cw-shop-item { min-width: 0; padding: 11px 6px; border-color: var(--cw-border); border-radius: 10px; }
.cw-shop-item span { font-size: 10px; line-height: 1.4; }
.cw-shop-item.is-on { background: rgba(230,196,134,.08); }
.cw-shop h4 { font-family: inherit; font-size: 10px; font-weight: 500; letter-spacing: .08em; }
.cw-travel { width: min(400px, calc(100% - 32px)); max-height: calc(100vh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 22px; z-index: 38; }
.cw-travel button { min-height: 44px; border-color: var(--cw-border); font-size: 12px; font-weight: 400; line-height: 1.5; }
.cw-map-intro { margin: 0 0 7px; color: var(--cw-mut); font-size: 11px; line-height: 1.6; }
.cw-directory-map { display: block; width: 100%; height: auto; margin: 3px 0 8px; border: 1px solid var(--cw-border); border-radius: 11px; background: rgba(9,24,24,.36); }
.cw-journal { position: absolute; top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); right: calc(var(--cw-gap) + env(safe-area-inset-right)); z-index: 38; width: min(410px, calc(100% - 32px)); max-height: calc(100vh - var(--cw-header-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - var(--cw-header-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 23px; }
.cw-journal p { color: var(--cw-mut); font-size: 12px; line-height: 1.6; }
.cw-journal button { min-height: 42px; padding: 9px 12px; border: 1px solid var(--cw-border); border-radius: 8px; background: rgba(240,225,192,.045); color: var(--cw-ink); font-size: 11px; cursor: pointer; }
.cw-journal button:disabled { opacity: .45; cursor: default; }
.cw-journal ol, .cw-journal ul { margin: 16px 0; padding-left: 20px; color: var(--cw-gold); }
.cw-journal li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--cw-border); font-size: 12px; line-height: 1.6; }
.cw-journal li strong { color: var(--cw-ink); font-weight: 500; }
.cw-journal li p { margin: 3px 0; font-size: 11px; }
.cw-journal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cw-journal-head h2 { padding-top: 5px; margin-bottom: 0; }
.cw-journal-head button { flex-shrink: 0; min-height: 36px; padding: 8px 10px; }
.cw-journal-summary { margin: 12px 0 18px; }
.cw-journal-row { margin: 11px 0; padding: 14px; border: 1px solid var(--cw-border); border-radius: 11px; background: rgba(232,212,174,.025); }
.cw-journal-row.is-selected { border-color: rgba(230,196,134,.5); background: rgba(230,196,134,.055); }
.cw-journal-row.is-complete { border-color: rgba(171,206,183,.24); }
.cw-journal-row h3 { margin: 0 0 5px; font-size: 18px; line-height: 1.3; }
.cw-journal-row small { display: block; color: var(--cw-gold); font-size: 9px; letter-spacing: .04em; }
.cw-journal-row p { margin: 9px 0; font-size: 11px; }
.cw-journal-row .cw-journal-activity { padding-left: 10px; border-left: 2px solid rgba(230,196,134,.4); color: #d5c8ac; font-size: 10px; }
.cw-journal-row button { width: 100%; margin-top: 3px; min-height: 40px; }
.cw-journal-row ~ h3 { margin: 22px 0 10px; font-size: 18px; }
.cw-journal .cw-journal-save { padding-top: 12px; border-top: 1px solid var(--cw-border); font-size: 10px; }

/* Photo mode always retains an exit target, including on a touch-only device. */
.cw-photo-exit { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: calc(16px + env(safe-area-inset-right)); z-index: 54; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--cw-border); border-radius: 10px; background: rgba(16,32,32,.88); color: var(--cw-ink); font: 500 12px 'DM Sans', sans-serif; cursor: pointer; backdrop-filter: blur(10px); }
.is-photo .cw-expedition-hud, .is-photo .cw-help-trigger, .is-photo .cw-panel, .is-photo .cw-shop, .is-photo .cw-travel, .is-photo .cw-settings, .is-photo .cw-journal, .is-photo .cw-toast { display: none !important; }
.is-photo #cw-photo-exit:not([hidden]) { display: inline-flex !important; }

.cw-load { background: radial-gradient(ellipse at 50% 25%, #2b4237, #112527 65%); }
.cw-load-inner { width: min(100%, 540px); padding: 28px; }
.cw-load-glyph { margin: 0 auto 24px; }
.cw-load .cw-eyebrow { margin-bottom: 12px; }
.cw-load h1 { margin-bottom: 13px; font-family: Georgia, serif; font-size: clamp(27px, 5vw, 39px); font-weight: 400; line-height: 1.15; letter-spacing: -.035em; }
.cw-load p { font-size: 12px; }
.cw-load-bar { width: min(260px, 70vw); height: 2px; margin-top: 24px; }
.cw-load-bar > div { background: var(--cw-gold); }
.cw-load-skip { margin-top: 28px; font-size: 11px; text-underline-offset: 4px; }
.cw-fallback { background: radial-gradient(ellipse at 50% 20%, #273d34, #112527 70%); }
.cw-fb-card { border-color: var(--cw-border); }
.cw-fb-card h2 { margin: 17px 0 14px; font: 400 30px/1.2 Georgia, serif; letter-spacing: -.035em; }
.cw-fb-card p { font-size: 13px; line-height: 1.6; }
.cw-fb-cta { min-height: 44px; border-radius: 9px; background: var(--cw-gold); color: #19302a; font-size: 12px; }

@media (max-width: 1100px) {
  .cw-iconbtn.cw-toolbtn { width: 40px; padding: 0; }
  .cw-toolbtn > span { display: none; }
}
@media (max-width: 900px) {
  :root { --cw-header-h: 110px; }
  .cw-topbar { grid-template-areas: 'identity tools' 'navigation navigation'; grid-template-columns: 1fr auto; gap: 7px 10px; }
  .cw-topbar-identity { grid-area: identity; }
  .cw-world-nav { grid-area: navigation; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 560px); justify-self: center; }
  .cw-topbar-actions { grid-area: tools; }
  .cw-navbtn { min-width: 0; min-height: 38px; }
  .cw-sprint { top: calc(var(--cw-header-h) + 204px + env(safe-area-inset-top)); }
  .cw-minihud { top: calc(var(--cw-header-h) + 250px + env(safe-area-inset-top)); }
}
@media (max-width: 600px) {
  :root { --cw-gap: 12px; }
  .cw-dialog-card h2 { font-size: 28px; }
  .cw-topbar { column-gap: 8px; }
  .cw-topbar-identity { gap: 9px; }
  .cw-topbar-title { display: grid; }
  .cw-topbar-title .cw-wordmark { font-size: 18px; }
  .cw-topbar-title .cw-brand-name { font-size: 8px; }
  .cw-back { flex-basis: 34px; width: 34px; }
  .cw-world-nav { width: 100%; }
  .cw-navbtn { gap: 5px; padding: 0 7px; font-size: 12px; }
  .cw-navbtn kbd { display: none; }
  .cw-expedition-hud { max-width: calc(100% - 118px - env(safe-area-inset-left) - env(safe-area-inset-right)); padding: 10px 11px; }
  .cw-expedition-hud p { display: none; }
  .cw-save-state { display: none; }
  .cw-objective-heading { gap: 6px; margin-top: 5px; font-size: 12px; }
  .cw-objective-count { font-size: 10px; }
  .cw-expedition-district { font-size: 9px; }
  .cw-objective-footer { margin-top: 7px; gap: 3px; }
  .cw-objective-footer .cw-textbtn { font-size: 9px; }
  .cw-compass { font-size: 9px; gap: 4px; }
  .cw-trail-progress { left: 11px; right: 11px; }
  .cw-minimap { width: 84px; height: 84px; }
  .cw-level, .cw-coinhud { top: calc(var(--cw-header-h) + 104px + env(safe-area-inset-top)); }
  .cw-level { min-height: 32px; }
  .cw-coinhud { left: calc(var(--cw-gap) + 147px + env(safe-area-inset-left)); min-height: 32px; }
  .cw-sprint { top: calc(var(--cw-header-h) + 150px + env(safe-area-inset-top)); }
  .cw-minihud { top: calc(var(--cw-header-h) + 196px + env(safe-area-inset-top)); }
  .cw-sprint, .cw-minihud { max-width: calc(100% - 32px); padding: 7px 10px; font-size: 11px; }
  .is-touch .cw-stage:has(.cw-sprint:not([hidden])) .cw-prompt, .is-touch .cw-stage:has(.cw-minihud:not([hidden])) .cw-prompt { bottom: calc(154px + env(safe-area-inset-bottom)); }
  .is-touch .cw-help-trigger { top: calc(var(--cw-header-h) + 103px + env(safe-area-inset-top)); right: calc(var(--cw-gap) + 21px + env(safe-area-inset-right)); min-height: 34px; height: 34px; }
  .cw-hint { max-width: calc(100% - 82px); }
  .cw-dialog-card { padding: 21px; border-radius: 16px; }
  .cw-welcome-card { grid-template-columns: 1fr; padding: 0; width: min(100%, 420px); }
  .cw-welcome-main { padding: 25px 24px 20px; }
  .cw-welcome-main h2 { margin: 12px 0; font-size: 38px; }
  .cw-title-break { display: none; }
  .cw-welcome-main .cw-welcome-copy { font-size: 11px; line-height: 1.7; }
  .cw-welcome-actions { margin-top: 20px; }
  .cw-welcome-actions .cw-primarybtn { flex: 1; }
  .cw-welcome-actions .cw-secondarybtn { padding: 11px 12px; }
  .cw-welcome-route { display: block; padding: 19px 24px; border-left: 0; border-top: 1px solid rgba(230,211,173,.13); }
  .cw-welcome-route > .cw-lantern-mark, .cw-welcome-route > .cw-eyebrow { display: none; }
  .cw-route-steps { gap: 12px; margin: 0; }
  .cw-route-steps li { gap: 10px; }
  .cw-route-steps strong { font-size: 11px; }
  .cw-route-steps p { margin-top: 2px; font-size: 10px; }
  .cw-welcome-footer { padding: 11px 24px; font-size: 9px; }
  .cw-welcome-footer .cw-textbtn { font-size: 9px; }
  .cw-controls-grid { grid-template-columns: 1fr; gap: 16px; }
  .cw-controls-grid h3 { margin-top: 0; }
  .cw-controls-grid dl > div { font-size: 11px; }
  .cw-controls-grid .cw-help-note { font-size: 11px; }
  .cw-dialog-card.cw-pause-card { padding: 25px; }
  .cw-pause-card h2 { font-size: 32px; }
  .cw-shop { padding: 18px; }
  .cw-shop-head h3 { font-size: 22px; }
  .cw-panel { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
  .cw-panel-media { height: 112px; }
  .cw-panel-title { font-size: 22px; }
  .cw-journal { right: 12px; width: calc(100% - 24px); padding: 20px; }
}
@media (max-width: 380px) {
  :root { --cw-gap: 10px; }
  .cw-topbar-title .cw-wordmark { font-size: 16px; }
  .cw-topbar-identity { gap: 7px; }
  .cw-topbar-actions { gap: 4px; }
  .cw-iconbtn.cw-toolbtn { width: 36px; }
  .cw-navbtn svg { display: none; }
  .cw-expedition-hud { max-width: calc(100% - 100px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  .cw-minimap { width: 74px; height: 74px; }
  .cw-objective-footer .cw-textbtn { font-size: 0; min-width: 28px; min-height: 28px; }
  .cw-objective-footer .cw-textbtn span { font-size: 15px; }
  .cw-expedition-district { font-size: 8px; }
  .cw-level { gap: 6px; font-size: 10px; }
  .cw-level-streak { font-size: 9px; }
  .cw-coinhud { left: calc(var(--cw-gap) + 139px + env(safe-area-inset-left)); padding-inline: 8px; font-size: 10px; }
  .is-touch .cw-help-trigger { right: calc(var(--cw-gap) + 14px + env(safe-area-inset-right)); }
  .cw-welcome-main { padding: 23px 21px 18px; }
  .cw-welcome-main h2 { font-size: 34px; }
  .cw-welcome-main .cw-welcome-lead { font-size: 12px; }
  .cw-welcome-route { padding: 16px 21px; }
  .cw-route-steps { gap: 10px; }
  .cw-welcome-footer { padding-inline: 21px; flex-wrap: wrap; gap: 3px; }
  .cw-primarybtn, .cw-secondarybtn, .cw-dialog-card .cw-primarybtn, .cw-dialog-card .cw-secondarybtn { padding-inline: 12px; font-size: 11px; }
}
@media (max-height: 480px) and (min-width: 600px) {
  :root { --cw-header-h: 60px; --cw-gap: 12px; }
  .cw-topbar { grid-template-areas: 'identity navigation tools'; grid-template-columns: 1fr auto auto; column-gap: 12px; }
  .cw-world-nav { display: flex; width: auto; }
  .cw-navbtn { min-height: 38px; padding: 0 12px; font-size: 11px; }
  .cw-navbtn svg, .cw-navbtn kbd { display: none; }
  .cw-iconbtn.cw-toolbtn { width: 36px; height: 38px; min-height: 38px; }
  .cw-topbar-title .cw-wordmark { font-size: 17px; }
  .cw-topbar-title .cw-brand-name { font-size: 8px; }
  .cw-back { height: 38px; }
  .cw-expedition-hud { width: 244px; max-width: 36%; padding: 9px 11px; }
  .cw-expedition-hud p, .cw-save-state { display: none; }
  .cw-expedition-district { font-size: 9px; }
  .cw-objective-heading { margin-top: 4px; font-size: 11px; }
  .cw-objective-footer { margin-top: 5px; }
  .cw-minimap { width: 76px; height: 76px; }
  .cw-level, .cw-coinhud { top: calc(var(--cw-header-h) + 105px + env(safe-area-inset-top)); min-height: 30px; }
  .cw-sprint { top: calc(var(--cw-header-h) + 10px + env(safe-area-inset-top)); max-width: 35%; }
  .cw-minihud { top: calc(var(--cw-header-h) + 60px + env(safe-area-inset-top)); max-width: 35%; }
  .cw-hint, .is-touch .cw-hint { bottom: calc(15px + env(safe-area-inset-bottom)); max-width: calc(100% - 380px); padding: 8px 12px; }
  .cw-hint strong { display: none; }
  .cw-prompt, .is-touch .cw-prompt { bottom: calc(77px + env(safe-area-inset-bottom)); max-width: 45%; }
  .cw-toast, .is-touch .cw-toast { bottom: calc(128px + env(safe-area-inset-bottom)); max-width: 44%; }
  .cw-stick { width: 94px; height: 94px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .cw-stick-knob { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .cw-interact { bottom: calc(15px + env(safe-area-inset-bottom)); width: 54px; height: 54px; }
  .cw-jump { bottom: calc(15px + env(safe-area-inset-bottom)); }
  .cw-emote { bottom: calc(84px + env(safe-area-inset-bottom)); width: 44px; height: 44px; }
  .is-touch .cw-help-trigger { top: calc(var(--cw-header-h) + 102px + env(safe-area-inset-top)); right: calc(var(--cw-gap) + 16px + env(safe-area-inset-right)); height: 34px; min-height: 34px; }
  .cw-dialog-card { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .cw-dialog-shade { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .cw-welcome-card { width: min(740px, 100%); }
  .cw-welcome-main { padding: 23px 27px 18px; }
  .cw-welcome-main h2 { margin: 10px 0; font-size: 33px; }
  .cw-title-break { display: none; }
  .cw-welcome-main .cw-welcome-copy { font-size: 11px; }
  .cw-welcome-main .cw-welcome-lead { font-size: 12px; }
  .cw-welcome-actions { margin-top: 15px; }
  .cw-welcome-route { padding: 20px 24px; }
  .cw-welcome-route .cw-lantern-mark { width: 27px; height: 38px; margin-bottom: 9px; }
  .cw-route-steps { gap: 10px; margin-top: 11px; }
  .cw-route-steps p { font-size: 10px; }
  .cw-welcome-footer { padding-top: 9px; padding-bottom: 9px; }
  .cw-panel { width: min(330px, 46%); }
  .cw-panel-media { height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .cw-trail-progress i, .cw-panel, .cw-load, .cw-load-bar > div, .cw-toast, .cw-stick { transition: none !important; }
  .cw-iconbtn:active { transform: none; }
}
[hidden] { display: none !important; }
