:root {
  color-scheme: dark;
  --ink: #131828;
  --panel: #1d2436;
  --stroke: #344057;
  --paper: #f7f3e3;
  --muted: #adb9ce;
  --gold: #ffc861;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--paper);
  background: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: radial-gradient(ellipse at 40% 0%, #273149, var(--ink) 65%); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #fdd46c; outline-offset: 4px; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 42px; }
h1, h2, p, dl { margin: 0; }
.site-header { border-bottom: 1px solid #364056; padding: 0 clamp(16px, 3.45vw, 56px); height: 76px; background: #151b2bd9; display: flex; align-items: center; justify-content: space-between; }
.brand, .header-actions, .footer a { display: flex; align-items: center; gap: 13px; }
.crest { display: grid; place-items: center; width: 40px; height: 44px; font: 29px Georgia, serif; color: #ffd775; background: #4a3827; clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); box-shadow: inset 0 0 0 1px #b98c44; padding-bottom: 6px; }
h1 { font: 800 32px/.95 Georgia, serif; letter-spacing: .105em; user-select: none; }
.header-actions { gap: 8px; }
.secondary, .icon-button { background: #262f45; border: 1px solid #414d65; border-radius: 8px; padding: 8px 14px; font-weight: 650; }
.secondary:hover, .icon-button:hover { background: #35415d; }
.secondary span { margin-right: 4px; color: #ecd29b; }
.icon-button { width: 43px; padding: 9px; display: grid; place-content: center; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.layout { width: min(1490px, 100%); margin: 0 auto; padding: 24px clamp(16px, 3.45vw, 56px) 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(274px, 302px); gap: 18px; align-items: start; }
.play { min-width: 0; border: 1px solid var(--stroke); border-radius: 15px; background: #1a2132; overflow: hidden; box-shadow: 0 18px 30px #0a10194d; }
.field { position: relative; min-height: 455px; height: min(65vh, 690px); isolation: isolate; overflow: hidden; background: #285b49; }
.field::after { position: absolute; content: ""; inset: 0; pointer-events: none; box-shadow: inset 0 0 25px #111e294d; z-index: 1; }
#world { width: 100%; height: 100%; display: block; touch-action: none; }
.field-top { position: absolute; inset: 17px 17px auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; z-index: 2; }
.field-top button { pointer-events: auto; }
.location { display: flex; align-items: center; gap: 11px; background: #161d2be8; border: 1px solid #e0c59051; border-radius: 10px; padding: 9px 14px 10px 10px; box-shadow: 0 5px 19px #18202948; }
.location, .location > div { min-width: 0; }
.location .pin { flex: none; }
.pin { display: grid; place-items: center; color: #ffe09b; width: 30px; height: 30px; border: 1px solid #a5814c; background: #483c32; border-radius: 50%; font-size: 12px; }
.eyebrow { color: #cec1ab; font-size: .71rem; font-weight: 760; letter-spacing: .105em; }
.location h2 { font: 700 clamp(19px, 2.2vw, 27px)/1.05 Georgia, serif; }
.map-button { background: #182339ea; border-color: #8692ab77; white-space: nowrap; }
.map-button span { font-size: 1.12em; }
.meters { position: absolute; z-index: 2; top: 93px; left: 18px; display: grid; gap: 4px; background: #121a26e8; border: 1px solid #6b778877; border-radius: 8px; padding: 6px 10px; }
.meter { display: flex; align-items: center; gap: 6px; }
.meter span { width: 15px; color: #ffaba3; text-align: center; font-size: .84rem; }
.meter:nth-child(2) span { color: #ffd16f; }
progress { appearance: none; background: #101624; height: 7px; border: 0; border-radius: 8px; overflow: hidden; width: 100%; color: var(--bar, #ffbd53); }
progress::-webkit-progress-bar { background: #111725; border-radius: 8px; }
progress::-webkit-progress-value { background: var(--bar, #ffbd53); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--bar, #ffbd53); border-radius: 8px; }
.meter progress { width: 86px; }
#health { --bar: #f48380; }
.field-bottom { position: absolute; display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; bottom: 16px; left: 17px; right: 17px; z-index: 2; pointer-events: none; }
.field-bottom button { pointer-events: auto; }
.objective { display: flex; align-items: center; gap: 11px; min-height: 54px; background: #141e2cea; border: 1px solid #af987164; padding: 8px 12px; border-radius: 9px; box-shadow: 0 5px 18px #14213455; }
.objective-icon { display: grid; place-items: center; border-radius: 7px; width: 31px; height: 31px; flex: none; background: #473a2c; color: #ffca65; }
.objective strong { display: block; font-size: .95rem; margin-top: 2px; }
.objective { max-width: 100%; min-width: 0; }
.objective > div { min-width: 0; }
.objective strong { overflow-wrap: anywhere; line-height: 1.25; }
.tip-close { display: grid; place-items: center; border: 1px solid #9f927871; border-radius: 8px; background: #243045; color: #fff1d0; font-size: 1.45rem; line-height: 1; padding: 0; width: 44px; min-height: 44px; flex: none; }
.tip-close:hover { background: #3d485e; }
.show-tips { background: #182339ea; font-size: .87rem; min-height: 44px; }
.primary { background: linear-gradient(#ffdc83, #ffbd50); color: #272014; border: 1px solid #ffe6a6; border-radius: 8px; font-weight: 780; min-height: 43px; padding: 8px 14px; box-shadow: 0 3px 0 #976a2b, 0 7px 18px #1b1a1655; }
.primary:hover { background: #ffe297; }
#start { white-space: nowrap; padding: 0 14px; }
#start span { font-size: 1.35em; padding-left: 4px; }
.notification { position: absolute; display: flex; align-items: center; gap: 8px; max-width: min(100%, 390px); width: max-content; bottom: calc(100% + 8px); left: 0; background: #1a2437; padding: 4px 5px 4px 11px; border: 1px solid #c9a263; border-radius: 8px; box-shadow: 0 6px 20px #10172380; color: #ffe4a1; font-size: .88rem; font-weight: 650; }
.notification > span { overflow-wrap: anywhere; }
.navigation { position: absolute; right: 20px; top: 75px; border: 1px solid #face7e8f; background: #20293be0; color: #ffd981; font-size: 22px; border-radius: 50%; width: 38px; height: 38px; place-items: center; display: grid; pointer-events: none; }
#bearing { display: block; line-height: 1; }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px clamp(8px, 1.23vw, 19px); padding: 11px 15px; min-height: 54px; border-top: 1px solid #45516a; color: #d2daea; font-size: .81rem; }
.controls > span { white-space: nowrap; }
kbd { display: inline-block; background: #282f45; border: 1px solid #46516a; border-bottom: 2px solid #46516a; border-radius: 4px; margin-right: 3px; padding: 1px 4px; min-width: 18px; text-align: center; color: #fff3d7; font: 640 11px "Segoe UI", sans-serif; }
.journal { display: grid; gap: 14px; }
.card { background: linear-gradient(155deg, #252f46, #1c2435 70%); border: 1px solid var(--stroke); border-radius: 13px; padding: 15px; box-shadow: 0 8px 20px #0d14214d; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-heading h2 { font: 700 23px Georgia, serif; }
.rank-badge, .party-count { border: 1px solid #8f704d; border-radius: 6px; padding: 4px 7px; background: #45392f; color: #ffda8c; font-size: .73rem; font-weight: 760; white-space: nowrap; }
.party-count { background: #273249; border-color: #435371; color: #c5d0e6; }
.portrait-block { position: relative; isolation: isolate; min-height: 99px; background: radial-gradient(ellipse at 22% 49%, #5269a0, transparent 50%), linear-gradient(105deg, #303c64, #242d47); border-radius: 9px; margin: 12px 0; display: flex; align-items: center; gap: 9px; border: 1px solid #526181; overflow: hidden; }
.portrait-block::before { content: ""; position: absolute; z-index: -1; width: 88px; height: 88px; left: 6px; border: 1px solid #a7bbff48; border-radius: 50%; }
#portrait { width: 98px; height: 93px; object-fit: contain; margin-left: 3px; }
#hero-name { font: 700 19px Georgia, serif; overflow-wrap: anywhere; }
.palette { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.swatch { background: var(--swatch); border: 2px solid #18233a; border-radius: 50%; padding: 0; width: 23px; min-height: 23px; height: 23px; box-shadow: 0 0 0 1px #6e7c9d; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #ffdd92; }
.tabs { display: flex; background: #141d2d; padding: 3px; border: 1px solid #34425a; border-radius: 8px; }
.tabs button { flex: 1; min-height: 32px; background: transparent; border: none; border-radius: 5px; font-size: .86rem; color: #afbed8; font-weight: 700; }
.tabs button[aria-pressed="true"] { background: #34415d; color: #fff1d0; }
.skill-panel { display: grid; margin-top: 6px; }
.skill-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; padding: 10px 0 8px; }
.skill-row + .skill-row { border-top: 1px solid #35425a; }
.skill-icon { display: grid; place-items: center; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--bar) 46%, #3a4260); background: color-mix(in srgb, var(--bar) 18%, #242e41); width: 33px; height: 33px; font: 19px "Segoe UI Symbol", sans-serif; color: var(--bar); }
.skill-title { display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: .91rem; font-weight: 730; }
.skill-level { color: var(--bar); font-size: .72rem; white-space: nowrap; }
.skill-row progress { display: block; height: 5px; margin-top: 5px; }
.skill-effect { margin-top: 4px; color: #bbc7db; font-size: .75rem; line-height: 1.3; }
.records-panel { margin-top: 5px; min-height: 189px; }
.records-panel div { border-bottom: 1px solid #35425a; display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-size: .88rem; }
.records-panel div:last-child { border-bottom: 0; }
.records-panel dd { margin: 0; color: #ffe2a2; font-weight: 760; white-space: nowrap; }
.party-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 11px; }
.party-slot { border: 1px dashed #51607c; border-radius: 8px; background: #182132; min-width: 0; height: 50px; display: grid; place-items: center; color: #8393b2; font-size: 1.38rem; }
.party-slot.joined { border: 1px solid #7a794e; background: #33434b; }
.party-slot canvas { max-width: 100%; height: 47px; object-fit: contain; }
.party p { margin-top: 9px; color: #b6c2d7; font-size: .78rem; }
.expedition progress { margin-top: 12px; --bar: #8fe5d6; }
.expedition h3 { font: 700 17px Georgia, serif; margin: 10px 0 5px; color: #ffe3a5; }
.expedition p { color: #c4d0e4; font-size: .79rem; line-height: 1.4; }
.expedition .journey-time { margin-top: 5px; color: #aebdd3; font-size: .73rem; }
.expedition .journey-hint { margin-top: 9px; padding-top: 9px; border-top: 1px solid #41506d; color: #9fe9dc; }
.footer { width: min(1490px, 100%); margin: 0 auto; padding: 12px clamp(16px, 3.45vw, 56px) 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .79rem; color: var(--muted); }
.footer a { color: #dae0eb; text-decoration: none; gap: 7px; }
.footer a:hover { color: #ffdc88; }
.footer img { width: 22px; height: 22px; object-fit: contain; }
.footer a span { color: #c4ab78; }
dialog { color: var(--paper); border: 1px solid #667694; border-radius: 15px; padding: 0; background: #1e283b; box-shadow: 0 20px 80px #060b16; }
dialog::backdrop { background: #0b1020b9; }
.publisher { text-align: center; width: min(360px, 90vw); padding: 30px; }
.publisher img { display: block; margin: 0 auto 12px; width: 94px; height: 94px; object-fit: contain; }
.publisher strong { font: 700 26px Georgia, serif; display: block; }
.publisher span { display: block; margin: 4px 0 16px; color: var(--muted); }
.overlay { width: min(470px, calc(100% - 24px)); max-height: 90dvh; }
.overlay.map-overlay { width: min(660px, calc(100% - 24px)); }
.dialog-art { height: 148px; background: linear-gradient(0deg, #1e283b, transparent 58%), url("assets/wildlands.webp") 50% 48% / cover; }
.dialog-body { padding: 18px 22px 22px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-heading h2 { font: 700 29px Georgia, serif; }
.dialog-heading button { padding: 4px 11px; min-height: 38px; font-size: 1.22rem; }
.dialog-body p { color: #c9d3e7; margin-top: 8px; line-height: 1.45; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.dialog-body a { color: #ffe1a0; }
.dialog-options { display: grid; gap: 10px; margin: 15px 0; }
.dialog-options label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-options input:not([type="checkbox"]), .dialog-options select { max-width: 62%; }
.dialog-options select, .dialog-options input:not([type="checkbox"]) { background: #131d30; border: 1px solid #607294; border-radius: 5px; padding: 5px; }
.route { list-style: none; padding: 0; margin: 15px 0 0; display: grid; gap: 7px; }
.route li { border: 1px solid #495873; border-radius: 8px; background: #192336; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route li span { color: #c3cfe3; font-size: .8rem; text-align: right; }
.route li.current { border-color: #d6ac66; }
.chapter { margin-top: 12px; background: #152034; border: 1px solid #455574; border-radius: 9px; padding: 11px 12px; }
.chapter summary { cursor: pointer; font-weight: 730; min-height: 25px; color: #ffe1a1; }
.chapter .route { margin-top: 10px; }
.chapter .route li { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 4px 10px; }
.chapter .route strong { font-size: .9rem; }
.chapter .route p { grid-column: 1 / -1; font-size: .79rem; line-height: 1.35; margin-top: 1px; }
.chapter .route .route-hint { color: #9de8da; margin-top: 5px; }
.chapter .route li.done { border-color: #426d70; }
.chapter .route li.done > span { color: #a5e7d6; }
.chapter .chapter-friend { color: #aebdd5; font-size: .78rem; margin-top: 11px; }
.dialog-body .setting-help { font-size: .84rem; color: #adbfd8; }
.touch-controls { position: absolute; inset: auto 14px 11px; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
.touch-controls:not([hidden]) + .field-bottom { bottom: 118px; }
.touch-controls > * { pointer-events: auto; }
.stick { position: relative; width: 88px; height: 88px; background: #182738a8; border-radius: 50%; border: 2px solid #dabd858c; touch-action: none; }
.stick span { position: absolute; left: 50%; top: 50%; display: block; border-radius: 50%; background: #ffe1a4c4; width: 39px; height: 39px; translate: -50% -50%; }
.touch-actions { display: grid; grid-template-columns: repeat(2, 60px); gap: 6px; }
.touch-actions button { touch-action: none; border: 1px solid #d8c795a3; border-radius: 8px; font-size: .8rem; padding: 0; background: #26364ce8; }
.touch-actions button.primary { background: #ffd079; }
#touch-run[aria-pressed="true"], #touch-guard.active { box-shadow: inset 0 0 0 2px #ffd079; color: #ffe3a7; }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr) 245px; gap: 12px; }
  .card { padding: 12px; }
  .controls { gap: 8px; }
  .controls .eyebrow { display: none; }
}
@media (max-width: 680px) {
  .site-header { height: 58px; }
  .brand { gap: 8px; }
  .crest { width: 31px; height: 34px; font-size: 22px; }
  h1 { font-size: 25px; }
  .layout { grid-template-columns: 1fr; padding: 11px 10px 0; }
  .field { height: min(68dvh, 580px); min-height: 390px; }
  .field-top { inset: 10px 10px auto; }
  .location { gap: 7px; padding-inline: 8px; }
  .location .eyebrow { font-size: .57rem; letter-spacing: .06em; }
  .location h2 { font-size: 19px; }
  .map-button { padding-inline: 10px; font-size: .8rem; }
  .meters { top: 77px; left: 10px; }
  .navigation { right: 10px; top: 60px; }
  .field-bottom { left: 10px; right: 10px; bottom: 11px; }
  .objective { padding: 6px 8px; gap: 6px; }
  .objective strong { font-size: .82rem; }
  .objective-icon { width: 25px; height: 28px; }
  .objective { max-width: calc(100% - 3px); }
  .field-bottom:has(#start:not([hidden])) .objective { max-width: calc(100% - 106px); }
  .chapter .route li { grid-template-columns: 1fr; }
  .chapter .route li span { text-align: left; }
  .touch-controls { inset-inline: 10px; }
  #start { white-space: normal; min-width: 90px; }
  #start span { display: none; }
}
@media (pointer: coarse), (any-pointer: coarse) {
  .swatch { width: 29px; height: 29px; min-height: 29px; }
  .controls { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
  .field { height: 75dvh; min-height: 280px; }
}
