:root{--caption:.9375rem;--label:1.0625rem;--body:1.125rem}
*{box-sizing:border-box}html,body,#game{width:100%;height:100%;margin:0;overflow:hidden}body{font:var(--body)/1.5 system-ui,"Leelawadee UI",sans-serif;color:#27382e;background:#b4c7cc}button,select,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #b08742;outline-offset:2px}#game{position:relative;isolation:isolate;--edge:clamp(12px,2.5vw,42px);--bottom:max(16px,env(safe-area-inset-bottom),2.8vh)}#sky{position:absolute;inset:-8%;z-index:-1;filter:blur(35px);background-position:center;background-size:cover;opacity:.66}#stage{position:absolute;inset:0;width:100%;height:100%;touch-action:none;outline:0;cursor:crosshair}
.glass,.ivory,#toast{color:#f8eed2;background:linear-gradient(115deg,#24382ff5,#28372cf5);border:1px solid #c9ad79cc;box-shadow:0 3px 14px #13291e39;border-radius:6px}.ivory{color:#23392c;background:linear-gradient(120deg,#fff3cd,#dece9f)}button:hover{filter:brightness(1.09)}.location{position:absolute;left:var(--edge);top:clamp(14px,2.6vh,36px);pointer-events:none;color:#263c32;text-shadow:0 0 6px #ffffeb,0 0 14px #fff8dc,0 1px 2px #fffbeb}.location>span{font:700 .8125rem Georgia,serif;letter-spacing:.35em}.location h1{font:500 clamp(2rem,3.7vw,3.5rem)/1.05 Georgia,"Leelawadee UI",serif;letter-spacing:-.045em;margin:4px 0}.top-tools{position:absolute;right:var(--edge);top:clamp(14px,2.6vh,36px);display:flex;gap:6px}.top-tools button{min-width:42px;min-height:42px;padding:0 12px;font-size:1.25rem}.top-tools b{font-size:12px}
#quest{position:absolute;right:var(--edge);top:calc(clamp(14px,2.6vh,36px) + 50px);display:flex;gap:8px;align-items:center;text-align:left;padding:6px 12px;max-width:min(350px,40vw)}.quest-icon{font:27px Georgia;color:#dfbe80}#quest small{display:block;font-size:var(--caption);color:#e4c990}#quest strong{font-size:1.1875rem;line-height:1.45;display:block}#toast{position:absolute;left:50%;top:18%;transform:translateX(-50%);padding:7px 16px;text-align:center;border-radius:20px;pointer-events:none;font-size:var(--body);max-width:min(90%,480px)}#toast:empty{display:none}
#identity,#camera,#actions{position:absolute;bottom:var(--bottom);display:flex;align-items:center}#identity{left:var(--edge);padding:3px 13px 3px 3px;text-align:left;gap:10px}#identity img{width:49px;height:49px;object-fit:contain;border-radius:4px;background:radial-gradient(#dfd3ac,#8c7758)}#identity>span{min-width:115px;display:grid;gap:3px}#hero-name{font:600 1.375rem/1.15 Georgia,serif;overflow-wrap:anywhere}#stats{font:600 var(--caption)/1.35 system-ui;color:#f1e3bb}.hp-track{height:5px;background:#15271e;border-radius:4px;overflow:hidden}.hp-track i{height:100%;display:block;background:linear-gradient(90deg,#91ad6a,#d6d18c);transition:width .18s}#camera{left:50%;transform:translateX(-50%);padding:3px;border-radius:25px;gap:1px}#camera button{color:#f5e5bf;background:transparent;border:0;min-width:32px;min-height:36px;border-radius:16px;text-align:center}#camera button{font:1.5rem Georgia,serif}#camera #fit{font:600 var(--caption)/36px system-ui}#camera button:hover{background:#4b5e49}#actions{right:var(--edge);gap:4px}#actions button{padding:6px 12px;min-height:44px;font-size:var(--body);font-weight:600}#run[aria-pressed=true]{background:#536b42}#loading{position:absolute;inset:0;background:#233b31;display:grid;align-content:center;justify-items:center;gap:12px;color:#f9e9c6}#loading span{font:var(--caption) Georgia;letter-spacing:.32em}#loading strong{font-size:1.375rem;font-weight:600}#loading[hidden]{display:none}
#book{width:min(880px,94vw);max-height:87dvh;overflow:auto;overscroll-behavior:contain;background:#f4efdf;color:#273b31;border:1px solid #ac9163;border-radius:10px;padding:0;box-shadow:0 12px 55px #12251e80}#book::backdrop{background:#10231d80}.book-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:10px 18px;border-bottom:1px solid #cbbea3;background:#f4efdf}.book-head h2{font-size:1.625rem;margin:0}.book-head button{font-size:23px;background:transparent;border:0;color:#35493b}#book-body{padding:15px 18px 19px}.button-grid,.hero-strip,.specimens{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:6px}.button-grid button,.hero-strip button,.specimens button,#book .tool{border:1px solid #cab995;border-radius:5px;background:#fff9e8;color:#304337;padding:8px}.button-grid button:hover,.hero-strip button:hover,.specimens button:hover,#book .tool:hover{background:#eee0ba}.hero-strip{grid-template-columns:repeat(4,minmax(0,1fr))}.hero-strip button{display:flex;align-items:center;gap:7px;text-align:left;font:600 var(--body)/1.25 Georgia,serif;min-width:0;overflow-wrap:anywhere}.hero-strip img{width:36px;height:39px;object-fit:contain;background:#dcd0b6;border-radius:3px}.hero-strip .active,#book .tool.active{outline:2px solid #527151;background:#e2e8d2}.preview-actor{background:radial-gradient(ellipse at 50% 72%,#ded9bd,#ede9d7 70%);border:1px solid #c6bfa5;border-radius:5px}.preview-actor{height:245px;width:100%;display:block}.book-tools{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:9px 0 15px}#book .tool{font-size:var(--label);padding:5px 11px}.book-tools strong{margin-right:auto}.hero-choice,#book button.hero-choice{color:#f9f3dd;background:#304c3b;border:0;border-radius:5px;padding:8px 15px}.
.specimens{grid-template-columns:repeat(auto-fill,minmax(min(130px,100%),1fr));max-height:55dvh;overflow:auto;overscroll-behavior:contain;padding:4px;align-items:stretch}
.specimens .scenery-card{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;padding:10px 6px;font-size:var(--label);line-height:1.35}
.scenery-card img,.scenery-card canvas{display:block;width:100%;height:82px;object-fit:contain;user-select:none}
#book:has(.quest-risk){width:min(440px,94vw)}
.quest-risk strong{display:block;font-size:1.13rem}.quest-risk p{margin:.3rem 0 1rem}
.quest-risk .book-tools{justify-content:flex-end;margin-bottom:0}
#scenery-preview{width:96vw;height:94dvh;max-width:100vw;max-height:100dvh;overflow:hidden;padding:0;border:1px solid #ac9163;border-radius:10px;background:#f4efdf;color:#273b31;box-shadow:0 12px 55px #12251e80}
#scenery-preview[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
#scenery-preview::backdrop{background:#10231dc9}
.scenery-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 14px 6px 20px;border-bottom:1px solid #cbbea3}
.scenery-heading h2{margin:0;font-size:clamp(1.1rem,3vw,1.5rem);line-height:1.3}
.scenery-heading button,#scenery-views button{min-width:44px;min-height:44px;color:#304337}
.scenery-heading button{border:0;background:transparent;font-size:1.75rem;line-height:1}
.scenery-stage{display:grid;grid-template:minmax(0,1fr)/minmax(0,1fr);padding:clamp(6px,1.3vmin,18px);background:radial-gradient(ellipse at 50% 74%,#e3d8b9,#f5f0df 74%)}
.scenery-stage img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;user-select:none;-webkit-user-drag:none}
#scenery-views:not([hidden]){display:flex;flex-wrap:wrap;justify-content:center;gap:6px;padding:6px 12px;border-top:1px solid #cbbea3}
#scenery-views button{padding:2px 12px;border:1px solid #cab995;border-radius:5px;background:#fff9e8;font-size:var(--label)}
#scenery-views button[aria-pressed=true]{background:#36513f;color:#fff9e8;border-color:#36513f}
@media(max-width:680px),(max-height:520px){
  #scenery-preview{width:100vw;height:100dvh;border:0;border-radius:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
}
book-help{line-height:1.8;margin:0}.classic-link{display:inline-block;margin-top:14px;color:#405d46}
@media(max-width:1060px){
  #identity{bottom:calc(var(--bottom) + 52px)}
  #camera{left:var(--edge);transform:none}
  #quest{max-width:43vw}
  .hero-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:640px){
  .location{width:45%}
  .location h1{font-size:2rem;overflow-wrap:anywhere}
  #quest{max-width:46%;padding:5px 8px;gap:4px}
  #quest strong{font-size:var(--label)}
  .quest-icon{font-size:22px}
  #identity{max-width:calc(100% - 2 * var(--edge) - 174px);gap:5px;padding:4px 6px}
  #identity img{width:31px;height:34px}
  #identity>span{min-width:0;gap:2px}
  #hero-name{font-size:1.125rem}
  #stats{font-size:.875rem}
  #camera{left:auto;right:var(--edge);bottom:calc(var(--bottom) + 52px);gap:0}
  #camera button{min-width:24px;padding:0 2px}
  #actions{left:var(--edge);display:grid;grid-template-columns:repeat(5,auto)}
  #actions button{padding:4px 2px;font-size:var(--label);white-space:nowrap}
  .hero-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hero-strip button{font-size:var(--label)}
  .preview-actor{height:180px}
  #book-body{padding:10px}
  #toast{top:27%;width:max-content}
  .book-head{padding:8px 12px}
}
@media(max-height:520px){
  .location h1{font-size:2rem}
  .preview-actor{height:130px}
  #game{--bottom:max(8px,env(safe-area-inset-bottom))}
}
#terrain{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.top-tools #world-time{font:600 .9375rem/1 system-ui;font-variant-numeric:tabular-nums;white-space:nowrap;padding:0 .65em}
.top-tools #sound-toggle{display:grid;place-items:center;width:44px;height:44px;padding:0}
#sound-toggle[aria-pressed=true]{color:#ffe1a2;border-color:#e4bc73}
#sound-toggle .sound-cross,#sound-toggle[aria-pressed=true] .sound-waves{display:none}
#sound-toggle[aria-pressed=true] .sound-cross{display:inline}
.top-tools #auto-farm{min-width:6.5em;min-height:44px;padding:0 .7em;font-size:1rem;font-weight:650;white-space:nowrap}
#auto-farm[aria-pressed=true]{background:#f3e4b5;color:#213e2f;border-color:#e6c778}
@media (max-width:720px) and (orientation:portrait){
  .top-tools{display:grid;grid-template-columns:repeat(3,auto)}
  .top-tools #auto-farm{grid-row:2;grid-column:1/-1;justify-self:end}
  #quest{top:calc(clamp(14px,2.6vh,36px) + 100px)}
}
#job-skill{--rune:#f1ce7e;position:absolute;right:var(--edge);bottom:calc(var(--bottom) + 54px);display:flex;align-items:center;gap:8px;min-height:44px;padding:5px 12px 6px 7px;overflow:hidden;border-color:var(--rune);font-weight:650}
#job-skill[data-style=shadow]{--rune:#ddaff7}#job-skill[data-style=bow]{--rune:#a5ddb2}#job-skill[data-style=arcane]{--rune:#9adeff}#job-skill[data-style=light]{--rune:#ffe2a0}
#job-skill kbd{color:var(--rune);border:1px solid currentColor;border-radius:4px;padding:1px 6px;font:600 .875rem/1.5 system-ui}
#job-skill small{color:var(--rune);font-variant-numeric:tabular-nums}#skill-time:empty{display:none}
#job-skill::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:3px;background:var(--rune);transform-origin:left;transform:scaleX(var(--charge,1))}
#job-skill[aria-disabled=true]{color:#dadccd}
.job-skill-info{margin:8px 0 14px;padding:9px 12px;border-left:3px solid #b58d42;background:#ebe5d1}.job-skill-info p{margin:2px 0 0}
@media(max-width:640px){#job-skill{bottom:calc(var(--bottom) + 108px);font-size:var(--label)}}
#strike{touch-action:none}
#actions :is(#dash,#strike){display:flex;align-items:center;justify-content:center;gap:4px}
.action-glyph{display:block;width:26px;height:26px;object-fit:contain;pointer-events:none;user-select:none;filter:drop-shadow(0 1px 1px #142521a8)}
.audio-settings{display:grid;gap:20px;margin:5px 0 22px;max-width:36rem}
.audio-settings label{display:grid;grid-template-columns:1fr auto;gap:3px 12px;align-items:center;font-weight:600}
.audio-settings output{font-variant-numeric:tabular-nums;color:#596747}
.audio-settings input{grid-column:1/-1;width:100%;min-height:32px;accent-color:#466949}
#dash{position:relative;overflow:hidden;touch-action:manipulation}
#dash[aria-disabled=true]{color:#c4cbbd;background:#273a32}
#dash[aria-disabled=true]::after{content:"";position:absolute;bottom:3px;left:8%;width:84%;height:3px;border-radius:2px;background:linear-gradient(90deg,#7bd4be,#f6dd92);transform-origin:left;transform:scaleX(var(--recharge,0))}
/* The native pointer keeps its exact hotspot while the camera and painted targets move. */
@media(any-pointer:fine) and (forced-colors:none){
  #stage{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M2 2 26 13 16.5 16.2 12.3 26.2Z' fill='%23204241' stroke='%23152227' stroke-width='2.5' stroke-linejoin='round'/%3E%3Cpath d='m3 3 21 10-9.3 2.1L12 24Z' fill='%23519d98' stroke='%23f7d88c' stroke-width='1.35'/%3E%3Cpath d='M4 4 15 14.8 12 23Z' fill='%2397e2cf'/%3E%3Cpath d='m15 15 7.5 6.8' stroke='%23382b28' stroke-width='5'/%3E%3Cpath d='m15 15 7.5 6.8' stroke='%23d9a957' stroke-width='2.6'/%3E%3Cpath d='m23 19 3.8 3.6-3.4 3.6-3.7-3.6Z' fill='%2385d8c5' stroke='%23453528' stroke-width='1.5'/%3E%3C/svg%3E") 2 2,default}
  #stage[data-cursor=battle]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Ccircle cx='16' cy='16' r='9.5' stroke='%233b2023' stroke-width='4'/%3E%3Ccircle cx='16' cy='16' r='9.5' stroke='%23edaa70' stroke-width='1.8'/%3E%3C/g%3E%3Cg fill='%23d86548' stroke='%23362327' stroke-width='1.2'%3E%3Cpath id='p' d='m16 1 2.8 4.5-2.8 5-2.8-5Z'/%3E%3Cpath d='m31 16-4.5 2.8-5-2.8 5-2.8Zm-15 15-2.8-4.5 2.8-5 2.8 5ZM1 16l4.5-2.8 5 2.8-5 2.8Z'/%3E%3C/g%3E%3Cpath d='m16 13 3 3-3 3-3-3Z' fill='%23fff2c7' stroke='%23552d27'/%3E%3C/svg%3E") 16 16,crosshair}
  #stage[data-cursor=interact]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='m3 3 17.5 7.3-7.4 2.8-2.7 7.3Z' fill='%23f8d98b' stroke='%23332924' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m5 5 7.8 7.5-2.2 5.3Z' fill='%23fff8dc'/%3E%3Cpath d='M17.5 17v-2a3.6 3.6 0 0 1 7.2 0v2' fill='none' stroke='%23463224' stroke-width='2'/%3E%3Cpath d='m15.4 18 5.6-3 5.8 3-1.8 8.2-4 2.4-4-2.4Z' fill='%23be8044' stroke='%23352b25' stroke-width='1.7'/%3E%3Cpath d='m18.1 19 2.9 1.1 3.3-1.1-1.5 5.4-1.8 1.2-1.6-1.2Z' fill='%23fff1a1'/%3E%3C/svg%3E") 3 3,pointer}
}
#sky{inset:0;filter:none;opacity:1;background-size:cover;background-position:center bottom}
.location #world-map{pointer-events:auto;display:block;width:155px;max-width:100%;margin-top:7px;padding:4px 4px 0;text-align:center;overflow:hidden;color:#fff3d4;background:#253d36ed}
.map-surface{display:block;position:relative;background:#344c4a;border-radius:3px;overflow:hidden}
#locator{width:100%;height:auto;display:block}
#player-pin{position:absolute;left:50%;top:50%;width:9px;height:9px;transform:translate(-50%,-50%);background:#ffe093;border:2px solid #fff9d9;border-radius:50%;box-shadow:0 0 0 2px #613b26,0 0 6px 3px #e6b05a93;pointer-events:none}
#district-name{display:block;padding:4px 3px 5px;font:600 var(--label)/1.45 system-ui,"Leelawadee UI",sans-serif;text-shadow:none;overflow-wrap:anywhere}
@media(max-width:640px){.location #world-map{width:126px;margin-top:4px}#district-name{font-size:var(--caption)}}
@media(max-height:520px){.location #world-map{width:110px;margin-top:2px}#district-name{font-size:var(--caption);padding:2px}}
.field-tools{display:contents}
#walk-pad{display:none}
.button-grid button[aria-pressed=true]{outline:2px solid #527151;background:#e2e8d2}
.touch-hud #game{
  --hud-left:max(var(--edge),env(safe-area-inset-left));--hud-right:max(var(--edge),env(safe-area-inset-right));
  --pad-size:clamp(140px,22vmin,166px);--attack-size:clamp(72px,12vmin,88px);
}
.touch-hud #walk-pad{
  position:absolute;left:var(--hud-left);bottom:var(--bottom);display:grid;width:var(--pad-size);height:var(--pad-size);
  grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);grid-template-areas:". up ." "left . right" ". down .";
  border-radius:50%;border:2px solid #ede2b79c;box-shadow:inset 0 0 0 3px #3b514967,inset 0 0 14px #112c35a3,0 2px 9px #15282966;
  background:radial-gradient(circle,#d8ded026 0 27%,#263e494d 28% 48%,#172f3c84 50% 69%,#d5d8b637 70%);
}
.touch-hud #walk-pad,.touch-hud #walk-pad *,.touch-hud #strike{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.touch-hud #walk-pad button{display:grid;place-items:center;margin:0;min-width:0;min-height:0;border:0;border-radius:50%;padding:0;color:#fff3ce;background:transparent;filter:drop-shadow(0 1px 2px #223936)}
.touch-hud #walk-pad button::before{content:"";width:11px;height:11px;border:solid currentColor;border-width:3px 3px 0 0;transform:rotate(var(--angle));border-radius:2px}
[data-walk=up]{grid-area:up;--angle:-45deg}[data-walk=right]{grid-area:right;--angle:45deg}
[data-walk=down]{grid-area:down;--angle:135deg}[data-walk=left]{grid-area:left;--angle:-135deg}
.touch-hud #walk-pad .is-held{color:white;background:#d2e3cb45}
.stick-knob{position:absolute;pointer-events:none;left:50%;top:50%;width:36%;height:36%;border:2px solid #ecddad;border-radius:50%;
  display:grid;place-items:center;background:radial-gradient(ellipse at 36% 25%,#657f81e8,#2a454fe6 65%,#1b353ce8);box-shadow:inset 0 0 0 3px #b8c1a351,0 2px 6px #17282594;
  transform:translate(calc(-50% + var(--stick-x,0px)),calc(-50% + var(--stick-y,0px)));transition:transform .12s ease-out}
.engaged .stick-knob{transition:none}
.stick-knob::before,.stick-knob::after{content:"";grid-area:1/1;width:12px;height:18px;border:1px solid #ffeab4;transform:rotate(30deg) skewY(30deg);border-radius:2px}
.stick-knob::after{width:4px;height:6px;background:#ffeab4}
.touch-hud #actions{display:contents}
.touch-hud #actions button{position:absolute;min-width:44px;min-height:44px;line-height:1.2;padding:3px 6px;touch-action:manipulation}
.touch-hud #actions #strike,.touch-hud #actions #dash,.touch-hud #job-skill{
  --rim:#e7bf77;--core:#76572e;position:absolute;border:2px solid var(--rim);border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:#fff5d7;background:radial-gradient(ellipse at 38% 30%,var(--core),#223333 78%);box-shadow:inset 0 0 0 2px #182c30,inset 0 0 0 3px #d7c08491,0 2px 7px #14292399;
  gap:0;padding:2px;overflow:hidden;text-shadow:0 1px 3px #152020;font-weight:700;
}
.touch-hud #actions #strike{width:var(--attack-size);height:var(--attack-size);right:var(--hud-right);bottom:var(--bottom);font-size:1rem;touch-action:none}
.touch-hud #actions #dash{--core:#456963;--rim:#c3ceb0;width:54px;height:54px;right:calc(var(--hud-right) + var(--attack-size) + 10px);bottom:var(--bottom);font-size:.76rem}
.touch-hud #job-skill{--core:#4c586a;--rim:var(--rune);width:61px;height:61px;right:calc(var(--hud-right) + var(--attack-size) * .61);bottom:calc(var(--bottom) + var(--attack-size) + 8px)}
.touch-hud .action-glyph{width:76%;height:61%;flex:none}
.touch-hud #job-skill kbd{display:none}
.touch-hud #job-skill::after{content:"สกิล";position:static;width:auto;height:auto;background:none;transform:none;font-size:.8rem;line-height:1.1}
.touch-hud #job-skill[aria-disabled=true]::after{visibility:hidden}
.touch-hud #skill-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.touch-hud #skill-time:not(:empty){position:absolute;bottom:4px;left:0;right:0;text-align:center;color:#fff1cb;font-size:.79rem;font-weight:750;line-height:1.1}
.touch-hud #actions #strike.is-held,.touch-hud #job-skill:active,.touch-hud #dash:active{filter:brightness(1.32);box-shadow:inset 0 0 0 2px #fff1bb,0 0 8px #e2c780}
.touch-hud :is(#interact,#bag,#run){bottom:calc(var(--bottom) + var(--pad-size) + 14px);font-size:.9rem}
.touch-hud #bag{right:var(--hud-right)}
.touch-hud #run{right:calc(var(--hud-right) + 65px)}
.touch-hud #interact{right:calc(var(--hud-right) + 114px)}
.touch-hud #identity{left:var(--hud-left);bottom:calc(var(--bottom) + var(--pad-size) + 69px);max-width:calc(100% - 2 * var(--edge))}
.touch-hud .field-tools{display:flex;flex-direction:column;align-items:flex-start;gap:5px;position:absolute;left:var(--hud-left);top:max(8px,env(safe-area-inset-top));max-width:49%;pointer-events:none}
.touch-hud .field-tools .location{position:static;width:auto;max-width:100%}
.touch-hud .field-tools #camera{position:static;transform:none;max-width:100%;gap:0;pointer-events:auto}
.touch-hud #camera button{min-width:22px;padding:0 2px}
@media (orientation:landscape) and (max-height:600px){
  .touch-hud .location>span{display:none}.touch-hud .location h1{font-size:1.35rem;margin:0 0 3px}
  .touch-hud .location #world-map{width:88px}
  .touch-hud .field-tools{gap:2px}
  .touch-hud #identity{left:calc(var(--hud-left) + 106px);top:max(8px,env(safe-area-inset-top));bottom:auto;max-width:32%;padding:3px 7px 3px 3px;gap:5px}
  .touch-hud #identity img{width:32px;height:35px}.touch-hud #identity>span{min-width:0}
  .touch-hud #hero-name{font-size:1.03rem}.touch-hud #stats{font-size:.8rem}
  .touch-hud :is(#interact,#bag,#run){bottom:var(--bottom);right:auto}
  .touch-hud #interact{left:calc(50% - 83px)}.touch-hud #run{left:calc(50% - 19px)}.touch-hud #bag{left:calc(50% + 30px)}
}
@media (max-height:385px) and (orientation:landscape){
  .touch-hud .field-tools #camera{position:fixed;left:calc(var(--hud-left) + 106px);top:max(66px,calc(env(safe-area-inset-top) + 58px));bottom:auto;right:auto}
}

#book.first-hero{width:min(920px,95vw);max-height:94dvh;border-color:#aa9168;background:#f7f1e1}
.first-hero::backdrop{background:#192c27d9}
.first-hero .book-head{background:#2a4038;color:#fff2d4;border-bottom:2px solid #bc9c66}
#book.first-hero #book-body{padding:0}
.creation-layout{display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.25fr)}
.creation-figure{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;min-width:0;margin:0;padding:25px 12px 85px;overflow:hidden;background:radial-gradient(ellipse at 53% 45%,#fff7dd 0%,#e4d9b8 58%,#ccbb91 100%);border-right:1px solid #cdbb94}
.creation-figure::before{content:'';position:absolute;z-index:-1;width:75%;aspect-ratio:1;border:1px solid #b79e6766;border-radius:50%;box-shadow:0 0 0 6px #e4d6ae,0 0 0 7px #baa47470}
.creation-figure>img{display:block;width:100%;height:clamp(230px,46dvh,410px);object-fit:contain;filter:drop-shadow(0 7px 6px #50412d36)}
.creation-figure figcaption{position:absolute;bottom:20px;left:1rem;right:1rem;display:grid;text-align:center;color:#324437}
.creation-figure figcaption strong{font:600 clamp(25px,3.4vw,46px)/1.1 Georgia,serif}
.creation-figure figcaption span{font:small-caps 14px/1.6 Georgia,serif;letter-spacing:.06em;color:#655534}
.creation-settings{padding:18px 22px;display:flex;flex-direction:column;min-width:0}
.creation-settings h3{margin:0 0 5px;font-size:1rem}
.appearance-toggle{display:inline-flex;align-self:flex-start;gap:3px;padding:3px;border:1px solid #b7a47d;border-radius:8px;background:#e5dfcb}
.appearance-toggle button{min-width:56px;border:0;border-radius:5px;background:transparent;color:#33463a;padding:6px 13px;font:inherit}
.appearance-toggle button[aria-pressed=true]{background:#385342;color:#fff6df}
.creation-settings .appearance-toggle{margin-bottom:12px}
.creation-jobs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.creation-job{border:1px solid #cfbf9c;border-radius:6px;background:#fcf7e8;color:#37483c;display:grid;justify-items:center;align-content:center;gap:2px;padding:3px 1px;font:600 13px/1.05 Georgia,serif;min-width:0}
.creation-job img{width:36px;height:36px;object-fit:contain}
.creation-job span{min-width:0;max-width:100%;overflow-wrap:anywhere}
.creation-job[aria-pressed=true]{outline:2px solid #497353;outline-offset:-2px;background:#e3e9d2}
.creation-job:hover{background:#efe7cd}
.creation-skill{margin:10px 0 8px;color:#455746;font-size:.95rem}
.creation-error{margin:0;color:#923e2d}.creation-error:empty{display:none}
.creation-play{background:#324c3b;color:#fff4d6;border:1px solid #273e30;border-radius:7px;padding:9px 18px;font-family:inherit;font-size:1.1rem;font-weight:bold;line-height:1.3;min-height:44px}
.creation-play:disabled{opacity:.65}.first-hero :focus-visible{outline:3px solid #9c692f;outline-offset:2px}
@media(max-width:620px) and (orientation:portrait){
  #book.first-hero{width:95vw;max-height:96dvh}
  .creation-layout{grid-template-columns:1fr}
  .creation-figure{min-height:120px;padding:5px 9px;border:0;border-bottom:1px solid #cdbb94;display:grid;grid-template-columns:1fr 1fr}
  .creation-figure::before{width:min(35%,140px);left:8%}
  .creation-figure>img{height:clamp(110px,22dvh,190px)}
  .creation-figure figcaption{position:static;text-align:left;padding-right:8px}
  .creation-figure figcaption strong{font-size:clamp(22px,6vw,30px)}
  .creation-settings{padding:10px 12px}
  .creation-settings .appearance-toggle{margin-bottom:6px}
  .creation-job img{height:28px;width:28px}#book .creation-job{min-height:46px;font:600 clamp(11px,3.15vw,14px)/1.12 Georgia,serif}
}
@media(max-height:560px) and (orientation:landscape){
  .creation-figure{position:sticky;top:0;align-self:start}.creation-figure>img{height:48dvh}
  .creation-settings{padding:10px 14px}.creation-job img{width:24px;height:24px}
}
.career-steps{padding:0;list-style:none;margin:3px 0 12px;display:grid;gap:7px}
.career-steps li{display:grid;grid-template-columns:4.1em 1fr;gap:8px;align-items:baseline}
.career-steps b{color:#486137}
.career-status{background:#ede8d5;border:1px solid #cbbd92;border-radius:6px;padding:10px 13px;margin-bottom:10px}
.career-status p{margin:3px 0}.career-status .book-tools{margin-bottom:0}
.promotion-bonus{display:flex;align-items:baseline;flex-wrap:wrap;gap:.3em .85em;margin:8px 0;padding:7px 11px;border-left:3px solid #ad8042;background:#ede8d5;color:#334339}
#book .hero-choice:disabled{opacity:.55;cursor:default}
#job-available{color:#ffde80;font-weight:bold}
#estate-marker{position:absolute;left:0;top:0;display:grid;justify-items:center;gap:0;border:0;padding:0;overflow:visible;background:transparent;touch-action:manipulation;cursor:pointer;transform-origin:bottom center}
#estate-marker img{width:100%;display:block;filter:drop-shadow(0 1px 2px #322b1b) drop-shadow(0 0 3px #ffe5a7);pointer-events:none}
#estate-marker span{display:block;width:max-content;max-width:125px;margin-top:-4px;background:#344832;border:1px solid #e5c376;border-radius:12px;padding:0 7px;color:#fff4d3;font:700 13px/1.55 system-ui;box-shadow:0 2px 3px #1b291e80}
#estate-marker:after{content:'';border:4px solid transparent;border-top-color:#e5c376;border-bottom:0}
#estate-marker[hidden],#auto-farm[hidden],#leave-estate[hidden]{display:none}
.top-tools #leave-estate{font-size:1rem;font-weight:650}
#game.at-estate{background:#485143}
#game.at-estate #sky{z-index:0;inset:-30px;filter:blur(22px);opacity:.36}
#game.at-estate #quest{display:none}

.location #world-map{width:clamp(190px,18vw,232px);padding:5px 5px 0;border:1px solid #e6c888;background:#253a35;box-shadow:0 2px 12px #15291b66}
.map-surface{box-shadow:inset 0 0 0 1px #d4bd86;aspect-ratio:460/224}
@media(min-width:720px) and (any-pointer:fine){
  html:not(.touch-hud) .location #world-map{width:min(clamp(320px,30vw,460px),66vh)}
  html:not(.touch-hud) #world-map #district-name{font-size:clamp(.95rem,1.15vw,1.15rem)}
  html:not(.touch-hud) #player-pin{width:13px;height:13px}
}
#quest-strip{position:absolute;right:var(--edge);top:calc(clamp(14px,2.6vh,36px) + 50px);display:flex;max-width:min(385px,45vw);border:1px solid #e3bf82;border-radius:6px;background:linear-gradient(105deg,#523640,#302b36);box-shadow:0 3px 14px #20122659;overflow:hidden}
#quest-strip #quest,#journal-open{position:static;max-width:none;background:transparent;border:0;color:#fff4da;min-height:44px;text-align:left}
#quest-strip #quest{padding:7px 11px;min-width:0;flex:1}
#quest-strip #quest small{font-size:.77rem;color:#edcf9b}
#quest-strip #quest strong{font-size:1rem}
#quest-strip #quest[aria-pressed=true]{background:#6b424e}
#journal-open{border-left:1px solid #a47b72;padding:3px 9px;text-align:center;font-size:.76rem}
#journal-open span{display:block;color:#f0c882}
#game.at-estate #quest-strip{display:none}
#battle-reward{position:absolute;left:50%;top:10%;transform:translateX(-50%);display:flex;gap:11px;align-items:center;max-width:min(88vw,365px);padding:10px 24px 10px 15px;pointer-events:none;color:#fff1d1;background:linear-gradient(115deg,#352638f5,#54405cf5 67%,#332d49f5);border-block:1px solid #efca7e;clip-path:polygon(8px 0,100% 0,calc(100% - 8px) 50%,100% 100%,8px 100%,0 50%);line-height:1.25}
#battle-reward[hidden]{display:none}
.victory-seal{display:grid;place-items:center;flex:none;width:33px;height:33px;border:3px double #e6be75;border-radius:50%;font:22px Georgia;color:#f4d18c}
#battle-reward small{display:block;font-size:.73rem;color:#f2ce9e}
#reward-name{display:block;font:650 1rem/1.4 system-ui}
.reward-purse{display:flex;gap:13px;font:650 .85rem/1.3 system-ui}.reward-purse b:first-child{color:#ffd780}.reward-purse b:last-child{color:#cfc5ff}
#battle-reward:not([hidden])~#toast,body:has(#battle-reward:not([hidden])) #toast{top:calc(10% + 92px)}
#identity .vital{display:grid;align-items:center;grid-template-columns:25px minmax(30px,1fr) minmax(44px,auto);gap:4px}
.vital b,.vital em{font:600 .67rem/1.1 system-ui;color:#fcf4da}.vital em{text-align:right;font-variant-numeric:tabular-nums}
.vital .hp-track{height:6px;outline:1px solid #d6cbaa40}.hp-track #mp{background:linear-gradient(90deg,#4c9ec8,#bceaff)}.hp-track #exp{background:linear-gradient(90deg,#cf8e48,#ffdd8a)}
#identity>span{min-width:144px}#stats{font-variant-numeric:tabular-nums}
.language-choice{display:flex;align-items:center;justify-content:space-between;gap:14px;font:650 .94rem/1.45 system-ui}
.game-language{background:#faf4e5;color:#263c37;border:1px solid #a99872;border-radius:5px;padding:7px;font:inherit}
.game-preferences{border-top:1px solid #c0ad87;margin-top:16px;padding-top:12px}.game-preferences h3{margin:0 0 8px}.game-preferences p{margin:8px 0}
#account-gate{padding:0;width:min(660px,94vw);max-height:92dvh;border:1px solid #c0ab7d;border-radius:10px;background:#f7efda;color:#283a33;box-shadow:0 24px 100px #13231dcc}
#account-gate[open]{display:grid;grid-template-columns:39% 1fr}#account-gate::backdrop{background:#162c29d9}
.entry-art{background-color:#345b5e;background-position:44% center;background-size:cover;min-height:270px}
#account-gate section{padding:clamp(16px,3vw,32px)}#account-gate h2{font:500 clamp(2.4rem,4.7vw,3.7rem)/1.12 Georgia,serif;margin:18px 0 8px;letter-spacing:-.045em}
#account-gate h3{font:600 1.1rem/1.55 system-ui;margin:0 0 14px}
#account-gate button{display:block;width:100%;padding:10px;border-radius:5px;border:1px solid #8d967d;background:#2d4a40;color:#fff5d8;font:600 1rem/1.5 system-ui}
#account-gate #guest-start,#account-gate #fresh-player{background:#fff8e7;color:#32483f}
#account-gate p{font:400 .9rem/1.4 system-ui;margin:5px 0 15px}
#account-gate small{display:block;color:#6e5038;font-size:.8rem}#account-gate [hidden]{display:none}
@media(max-width:720px) and (orientation:portrait){
  #quest-strip{top:calc(clamp(14px,2.6vh,36px) + 100px);max-width:45vw}
  #quest-strip #quest{padding:5px}#quest-strip #quest strong{font-size:.89rem}#journal-open{padding:2px 5px}
  .location #world-map{width:clamp(138px,40vw,180px)}
  #battle-reward{top:30%}body:has(#battle-reward:not([hidden])) #toast{top:calc(30% + 85px)}
  #account-gate[open]{grid-template-columns:1fr}.entry-art{min-height:70px;max-height:100px;background-position:45% 48%}
}
@media(orientation:landscape) and (max-height:600px){
  .touch-hud .location #world-map{width:118px}.touch-hud #identity{left:calc(var(--hud-left) + 125px)}
  .touch-hud .field-tools #camera{position:static}
  #battle-reward{top:22%}body:has(#battle-reward:not([hidden])) #toast{top:calc(22% + 79px)}
}
html[lang=en].touch-hud #job-skill::after{content:"Skill"}

#stat-points{color:#f5d78b;font:650 .8rem/1.3 system-ui}
.stat-sheet{margin:8px 0 15px;padding:clamp(10px,2vw,18px);border:1px solid #c1b18a;border-radius:6px;background:#faf5e7;color:#334339}
.stat-sheet header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 12px}
.stat-sheet h3{margin:0;font:650 1.2rem/1.5 Georgia,serif}.stat-sheet header strong{color:#715626;font-size:.94rem}
.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stat-row{display:grid;align-items:center;grid-template-columns:auto 1fr 40px;gap:2px 6px;padding:6px 8px;background:#fffaf0;border:1px solid #d8ccb0;border-radius:4px}
.stat-row b{font:700 .83rem Georgia,serif;letter-spacing:.06em}.stat-row strong{text-align:right;font-variant-numeric:tabular-nums}
.stat-row button.tool{min-width:36px;min-height:36px;border:1px solid #8c805e;background:#354e43;color:#fff7d9;font-size:1.2rem;padding:0}
.stat-row button.tool:disabled{opacity:.45}.stat-row small{grid-column:1/-1;color:#556454;line-height:1.3}
.stat-sheet p{margin:9px 0 0;font-size:.84rem}
.combat-values{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:6px 14px;margin:12px 0;padding:10px 0 0;border-top:1px solid #d5c7a8;color:#334339}
.combat-values dt{font-size:.78rem;color:#526253}.combat-values dd{margin:1px 0 0;font-weight:700;font-variant-numeric:tabular-nums}
.combat-values>div:has([data-combat="movementSpeed"]){grid-column:1/-1}
@media(max-width:600px){.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-row{padding:4px 6px}.stat-row button.tool{min-height:40px}}
.character-name{display:grid;gap:3px;margin:10px 0;font-weight:650}
.character-name input,.character-name output{min-width:0;box-sizing:border-box;width:100%;padding:7px 10px;border:1px solid #b5a57f;border-radius:5px;color:#293d33;background:#fffaf0;font:500 1rem/1.4 system-ui}
.character-name output{background:#eee5cf;border-style:dashed}
#hero-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:min(200px,40vw)}
#account-gate #google-start:disabled{background:#e5dfce;color:#625e52;border-color:#b4ac97;cursor:default;filter:none}
#account-message:not(:empty){margin:5px 0 15px}
@media(min-width:900px) and (min-height:540px) and (any-pointer:fine){
  #account-gate{width:min(1060px,88vw)}
  #account-gate[open]{grid-template-columns:43% minmax(0,1fr)}
  #account-gate section{padding:clamp(28px,3.3vw,56px)}
  #account-gate h2{font-size:clamp(4rem,5.3vw,5.6rem);margin:22px 0 12px}
  #account-gate h3{font-size:1.4rem}
  #account-gate .language-choice,#account-gate p{font-size:1.1rem}
  #account-gate button{min-height:56px;font-size:1.25rem}
  #account-gate small{font-size:1rem}
  html:not(.touch-hud) #identity{gap:14px;padding:9px 16px 9px 9px;max-width:35vw}
  html:not(.touch-hud) #identity img{width:clamp(66px,5.5vw,94px);height:auto;aspect-ratio:1}
  html:not(.touch-hud) #identity>span{min-width:0;width:clamp(190px,16vw,270px);gap:5px}
  html:not(.touch-hud) #hero-name{font-size:clamp(1.75rem,2.25vw,2.4rem);max-width:100%}
  html:not(.touch-hud) #identity .vital{grid-template-columns:32px minmax(28px,1fr) auto;column-gap:8px}
  html:not(.touch-hud) #identity .vital b,html:not(.touch-hud) #identity .vital em{font-size:.98rem}
  html:not(.touch-hud) #identity .vital .hp-track{height:10px}
  html:not(.touch-hud) #stats{font-size:1.1rem}
  html:not(.touch-hud) #stat-points,html:not(.touch-hud) #job-available{font-size:1rem}
}
.field-actions{display:contents}
#bag{order:1}
.hero-caption{display:block;min-width:0}
#hud-level{display:none}
#camera button:disabled,.menu-camera button:disabled{opacity:.45;cursor:default}
.current-hero-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;overflow-wrap:anywhere;color:#485b48}
.current-hero-line strong{font:650 1.15rem Georgia,serif;color:#273d30}

#book:has(.field-menu){width:min(880px,94vw);border-color:#b9a276;background:#f6f0df}
#book:has(.field-menu) .book-head{position:sticky;isolation:isolate;min-height:104px;background:#203d36;color:#fff4d8;border-bottom:2px solid #ad8751;padding:16px 22px}
#book:has(.field-menu) .book-head::before{content:"";position:absolute;z-index:-1;inset:0;background-image:linear-gradient(92deg,#152f2df5 5%,#233d32c9 35%,#3b493023 70%,#172e3080),var(--menu-panorama);background-size:cover;background-position:center 52%}
#book:has(.field-menu) .book-head h2{font:600 2.2rem/1.12 Georgia,serif;letter-spacing:-.025em;text-shadow:0 1px 5px #172620}
.menu-location{display:block;margin-top:5px;color:#f2d899;font:600 .91rem/1.5 system-ui;letter-spacing:0}
#book:has(.field-menu) #book-close{align-self:flex-start;width:44px;height:44px;border:1px solid #dacaa3aa;border-radius:50%;color:#fff0cf;background:#1b302bd6;cursor:pointer}
.field-menu{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(240px,1fr);align-items:start;gap:20px}
.field-navigation,.field-options{display:grid;min-width:0;gap:16px}
.field-menu-group h3{display:flex;align-items:center;gap:9px;margin:0 0 8px;color:#66543b;font:650 1.03rem/1.4 Georgia,system-ui,serif}
.field-menu-group h3::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,#c9b693,transparent)}
.field-menu-grid,.field-setting-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.field-link{display:flex;align-items:center;text-align:start;gap:9px;min-width:0;min-height:61px;padding:6px;color:#273d30;font:650 .95rem/1.35 system-ui;background:linear-gradient(120deg,#fffdf4,#f1e9d7);border:1px solid #d1c4a7;border-radius:8px;cursor:pointer}
.field-link img{width:43px;height:43px;flex:none;object-fit:contain;padding:3px;border:1px solid #d7c9a8;border-radius:8px;background:radial-gradient(ellipse at top,#fff7d7,#e5d6b4)}
.field-link:hover{border-color:#918154;background:#fff9e8}
.field-link:active{background:#e3d9b9}
.field-settings{border:1px solid #ccbea2;border-radius:8px;padding:0 12px;background:#fff9e9}
.field-settings summary{min-height:44px;cursor:pointer;padding:11px 2px;font:650 1rem/1.4 system-ui;color:#314b3b}
.field-settings[open] summary{margin-bottom:8px;border-bottom:1px solid #dfd3bb}
.field-settings[open]{padding-bottom:12px}
.menu-farm{padding:15px 16px;background:linear-gradient(144deg,#25433c,#172f30);color:#faf1da;border:1px solid #897c54;border-radius:11px;text-align:start}
.menu-farm h3{color:#f5db9c;font:650 1.32rem/1.35 Georgia,system-ui,serif;margin:0}
.menu-farm .farm-status{margin:5px 0 13px;color:#e1e5d4;font:500 .9rem/1.45 system-ui}
.menu-farm fieldset{padding:0;margin:0;border:0;min-width:0}
.menu-farm legend{padding:0;margin:0 0 4px;color:#fff5dd;font:650 .91rem/1.4 system-ui}
.farm-distances{display:flex;background:#132b28;border:1px solid #798572;border-radius:7px;padding:2px;gap:2px}
.farm-distance,.farm-toggle{min-height:40px;cursor:pointer;border:0;font:650 .94rem/1.25 system-ui}
.farm-distance{flex:1;border-radius:4px;background:transparent;color:#f3e8ce}
.farm-distance[aria-pressed=true],.farm-toggle{color:#2a332c;background:#efd69a}
.farm-option{display:flex;align-items:center;gap:8px;min-height:42px;font:550 .9rem/1.4 system-ui;cursor:pointer}
.farm-option input{width:17px;height:17px;margin:0;accent-color:#e8c981}
.farm-toggle{width:100%;border-radius:6px;border:1px solid #f3d697}
.farm-potions{display:grid;gap:10px;margin:10px 0 14px;padding-top:12px;border-top:1px solid #617264}
.farm-potions h4{font:650 1rem/1.4 system-ui;color:#f5db9c;margin:0}
.menu-farm .farm-potion{min-width:0;padding:9px 11px 11px;border:1px solid #647c70;border-radius:8px;background:#102c28}
.menu-farm .farm-potion.mp{background:#172c35;border-color:#617c8b}
.menu-farm .farm-potion legend{padding:0 5px;margin:0;font-size:.94rem;color:#d1e8b3}
.menu-farm .farm-potion.mp legend{color:#bae7f5}
.farm-potion-choice{display:flex;gap:8px;align-items:center;min-width:0}
.farm-potion-choice img{width:37px;height:44px;object-fit:contain;flex:none}
.farm-potion-choice label{display:grid;gap:3px;flex:1;min-width:0;font:500 .875rem/1.4 system-ui;color:#d3dfd3}
.farm-potion-choice select{width:100%;min-width:0;min-height:44px;padding:8px 24px 8px 7px;border:1px solid #829786;border-radius:5px;background:#213a34;color:#fff5dc;font:500 .875rem/1.3 system-ui;text-overflow:ellipsis;cursor:pointer}
.farm-potion-choice option{background:#213a34;color:#fff5dc}
.farm-potion-threshold{display:grid;gap:3px;margin:10px 0 3px;font:500 .875rem/1.4 system-ui;color:#d3dfd3}
.farm-potion-threshold>span{display:flex;align-items:center;justify-content:space-between;gap:8px}
.farm-potion-threshold output{font-weight:750;font-size:1.1rem;color:#f9da91;font-variant-numeric:tabular-nums}
.farm-potion-threshold input{width:100%;height:30px;margin:0;accent-color:#d9bd7b;cursor:pointer;touch-action:pan-y}
.farm-potion-threshold:has(input:disabled){opacity:.45}
.farm-potion-stock{display:block;font:500 .875rem/1.4 system-ui;color:#c4d8c2}
.farm-potion-stock.empty{color:#ffce9f}
.farm-potions .farm-potion-note{margin:0;color:#cbd9d1;font:400 .875rem/1.45 system-ui}
.farm-potions select:focus-visible,.farm-potions input:focus-visible{outline:3px solid #e6bd6b;outline-offset:2px}
.farm-presets{display:flex;gap:5px;margin:1px 0 9px}
.farm-preset{flex:1;min-height:38px;background:#213d37;color:#ebeddb;border:1px solid #6f8877;border-radius:5px;font:600 .875rem/1.4 system-ui;cursor:pointer}
.farm-preset[aria-pressed=true]{background:#e6ca87;color:#263e32;border-color:#ffe2a1}
.farm-preset:disabled{opacity:.4;cursor:default}
.farm-safety{display:grid;gap:7px;margin:0 0 14px;padding-top:12px;border-top:1px solid #617264}
.farm-safety h4{margin:0;color:#f5db9c;font:650 1rem/1.4 system-ui}
.farm-safety .farm-option{align-items:flex-start;line-height:1.6}
.farm-safety input{flex:none;margin-top:4px}
.farm-safety .farm-potion-note{font:400 .875rem/1.45 system-ui;color:#d5decc;margin:0}
.field-menu button:focus-visible,.farm-option input:focus-visible{outline:3px solid #cc9442;outline-offset:2px}
@media(max-width:700px){
  .field-menu{grid-template-columns:1fr;gap:12px}
  .field-navigation,.field-options{gap:10px}
  #book:has(.field-menu) .book-head{min-height:70px;padding:10px 14px}
  #book:has(.field-menu) .book-head h2{font-size:1.55rem}
  .menu-location{margin-top:1px;font-size:.8rem}
  .menu-farm{padding:11px 13px}
  .menu-farm .farm-status{margin-bottom:7px}
}
.field-settings-body{display:grid;gap:10px}
.field-settings .language-choice,.menu-camera,.menu-session{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.95rem}
.menu-camera{display:none}
.menu-camera>div{display:flex;gap:4px}
.field-settings .tool,.field-settings select{min-height:44px}
.field-setting-links .tool[aria-pressed=true]{outline:2px solid #527151;background:#e2e8d2}
.menu-session{border-top:1px solid #d6c9ae;padding-top:8px}.menu-session p{margin:0}
.field-settings .classic-link{margin:0;font-size:.9rem}
.menu-clock{display:block;font:550 .77rem/1.4 system-ui;color:#675735}
#rebirth{inset:auto 0 max(5dvh,env(safe-area-inset-bottom),10px);margin:0 auto;width:min(300px,88vw);padding:13px 22px 12px;text-align:center;overflow:hidden;color:#f9ebd3;background:linear-gradient(135deg,#242333f7,#333349f5 58%,#252735f7);border:1px solid #b99569;border-radius:12px;box-shadow:0 8px 30px #11151f66}
#rebirth::backdrop{background:radial-gradient(ellipse at 50% 55%,#25263c09 5%,#1d203a36 42%,#1517219e 100%)}
#rebirth h2{margin:0;font:600 clamp(19px,3vmin,25px)/1.25 Georgia,serif;color:#ffeccc}
#rebirth p{margin:3px 0 0;font:500 .88rem/1.45 system-ui}
#rebirth .rebirth-time{color:#ffdda0}#rebirth-seconds{font:650 1.5rem/1.15 system-ui;font-variant-numeric:tabular-nums}
#rebirth-progress{display:block;appearance:none;margin:8px 0 0;width:100%;height:4px;border:0;border-radius:6px;overflow:hidden;background:#171924;color:#edc789}
#rebirth-progress::-webkit-progress-bar{background:#171924}#rebirth-progress::-webkit-progress-value{background:linear-gradient(90deg,#ab85af,#f4d496)}#rebirth-progress::-moz-progress-bar{background:#edc789}
#game:has(#rebirth[open]) :is(#walk-pad,#actions,#job-skill,#quest-strip,#battle-reward,#toast){visibility:hidden}
@media (max-height:410px){#rebirth{padding:6px 16px;bottom:max(6px,env(safe-area-inset-bottom))}#rebirth-caption,#rebirth .rebirth-time{display:inline-block;margin:2px}}

@media(max-width:899px),(pointer:coarse){
  .touch-hud #game{
    --hud-left:max(8px,env(safe-area-inset-left));--hud-right:max(8px,env(safe-area-inset-right));
    --hud-top:max(8px,env(safe-area-inset-top));--bottom:max(12px,env(safe-area-inset-bottom));
    --pad-size:clamp(108px,30vmin,140px);--attack-size:clamp(60px,16vmin,74px);
  }
  .touch-hud #identity{
    top:var(--hud-top);bottom:auto;left:var(--hud-left);width:clamp(157px,48vw,198px);height:76px;max-width:none;
    padding:5px 7px 5px 5px;gap:6px;border-radius:10px;background:linear-gradient(115deg,#1b302bfa,#284537f2);
  }
  .touch-hud #identity img{width:clamp(31px,9vw,39px);height:44px;flex:none;border-radius:6px;object-fit:cover}
  .touch-hud #identity>span{min-width:0;flex:1;gap:3px}
  .touch-hud .hero-caption{display:flex;gap:4px;align-items:baseline;justify-content:space-between}
  .touch-hud #hero-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:650 clamp(14px,4vw,18px)/1.2 Georgia,serif}
  .touch-hud #hud-level{display:block;flex:none;color:#efd697;font:650 10px/1 system-ui}
  .touch-hud #identity .vital{grid-template-columns:21px minmax(12px,1fr) auto;gap:3px}
  .touch-hud #identity .vital b,.touch-hud #identity .vital em{font:650 10px/1 system-ui;font-variant-numeric:tabular-nums}
  .touch-hud #identity .hp-track{height:5px}
  .touch-hud #identity #stats{display:none}
  .touch-hud #stat-points:not([hidden]),.touch-hud #job-available:not([hidden]){position:absolute;left:4px;bottom:3px;display:grid;place-items:center;min-width:31px;height:15px;background:#f3d595;color:#2a3a2c;border-radius:7px;font-size:0}
  .touch-hud #stat-points::after{content:attr(data-short);font:750 10px/1 system-ui}
  .touch-hud #job-available::after{content:'↑';font:750 12px/1 system-ui}
  .touch-hud #identity:has(#stat-points:not([hidden])) #job-available:not([hidden]){top:2px;bottom:auto}
  .touch-hud .field-tools{top:var(--hud-top);left:auto;right:calc(var(--hud-right) + 50px);max-width:none}
  .touch-hud .field-tools .location>span,.touch-hud .field-tools .location h1,.touch-hud .field-tools #camera{display:none}
  .touch-hud .location #world-map{margin:0;padding:3px;width:clamp(80px,26vw,108px);border-radius:8px}
  .touch-hud #district-name{font:650 11px/1.3 system-ui;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:2px 1px}
  .touch-hud .top-tools{display:contents}
  .touch-hud .top-tools #menu{position:absolute;top:var(--hud-top);right:var(--hud-right);width:44px;height:44px;padding:0;border-radius:12px}
  .touch-hud .top-tools #sound-toggle{position:absolute;top:calc(var(--hud-top) + 48px);right:var(--hud-right);border-radius:12px}
  .touch-hud .top-tools #world-time{display:none}
  .touch-hud .top-tools :is(#auto-farm,#leave-estate){position:absolute;top:calc(var(--hud-top) + 96px);right:var(--hud-right);min-width:74px;min-height:44px;font-size:.78rem;border-radius:9px}
  .touch-hud #quest-strip{top:calc(var(--hud-top) + 82px);left:var(--hud-left);right:auto;width:min(63vw,258px);max-width:none;border-radius:9px}
  .touch-hud #quest-strip #quest{padding:3px 8px;min-height:44px}
  .touch-hud #quest-strip #quest>span{min-width:0}
  .touch-hud #quest-strip #quest-mode{font-weight:600;font-size:10px;line-height:1.3}
  .touch-hud #quest-strip #objective{font-size:12px;line-height:1.35;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .touch-hud #journal-open{min-width:44px;padding:2px 4px;font-size:10px;line-height:1.1}
  .touch-hud #journal-open span{line-height:1.4}
  .touch-hud #walk-pad{border-width:1px;opacity:.91}
  .touch-hud #actions #dash{width:48px;height:48px;right:calc(var(--hud-right) + var(--attack-size) + 6px)}
  .touch-hud #job-skill{width:51px;height:51px;bottom:calc(var(--bottom) + var(--attack-size) + 5px)}
  .touch-hud #actions #strike{font-size:.84rem}
  .touch-hud #actions #dash,.touch-hud #job-skill::after{font-size:.66rem}
  .touch-hud .field-actions{display:flex;position:absolute;left:var(--hud-left);bottom:calc(var(--bottom) + max(var(--pad-size),120px) + 6px);align-items:center;gap:3px}
  .touch-hud #actions .field-actions button{position:static;font:650 .75rem/1.2 system-ui;min-height:44px;min-width:44px;padding:4px 7px;border-radius:8px}
  .touch-hud #actions #run[aria-pressed=true]{background:#f0dfad;color:#284932}
  .touch-hud .menu-camera{display:flex}
  .touch-hud .menu-camera button{min-width:44px}
  .touch-hud .field-setting-links .tool{font-size:.86rem}
  .touch-hud #book:has(.field-menu){width:min(460px,calc(100% - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border-radius:14px}
  .touch-hud #book:has(.field-menu) .book-head{padding:6px 12px}
  .touch-hud #book:has(.field-menu) #book-body{padding:10px 12px}
  .touch-hud .field-menu{grid-template-columns:minmax(0,1fr);gap:10px}
  .touch-hud #book:has(.field-menu) .book-head{min-height:66px}
  .touch-hud .farm-distance,.touch-hud .farm-toggle,.touch-hud .farm-option{min-height:44px}
  .touch-hud .field-menu .field-link{font-size:.84rem;min-height:50px;gap:6px;padding:4px}
  .touch-hud .field-link img{width:34px;height:34px}
  .touch-hud #battle-reward{top:calc(var(--hud-top) + 136px);padding:5px 14px;gap:6px}
  .touch-hud #toast{top:calc(var(--hud-top) + 137px);font-size:.85rem}
  html.touch-hud body:has(#battle-reward:not([hidden])) #toast{top:calc(var(--hud-top) + 204px)}
}
@media(orientation:landscape) and (max-height:600px) and (min-width:530px){
  .touch-hud #game{--pad-size:clamp(96px,28vmin,120px);--attack-size:60px}
  .touch-hud #identity{width:160px}
  .touch-hud #quest-strip{top:var(--hud-top);left:50%;transform:translateX(-50%);width:clamp(140px,25vw,220px)}
  .touch-hud .field-actions{bottom:var(--bottom);left:calc(var(--hud-left) + var(--pad-size) + 8px)}
  .touch-hud #battle-reward,.touch-hud #toast{top:calc(var(--hud-top) + 52px)}
  html.touch-hud body:has(#battle-reward:not([hidden])) #toast{top:calc(var(--hud-top) + 119px)}
}
.party-panel{display:grid;gap:14px;max-width:600px;margin:auto}
.town-party-tools{display:flex;align-items:center;gap:4px}
.top-tools #town-npcs:not([hidden]){display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:4px 10px 4px 5px;color:#ffedbd;font:650 .9rem/1.15 system-ui}
#town-npcs img{width:27px;height:30px;object-fit:contain}
.top-tools #party-open{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;font:650 .9rem/1.15 system-ui}
#party-open svg{flex:none;color:#f3d9a3}
#party-size:not([hidden]){font:700 .75rem/1 system-ui;font-variant-numeric:tabular-nums;color:#ffdf96}
@media(max-width:899px),(pointer:coarse){
  .touch-hud .town-party-tools{position:absolute;top:calc(var(--hud-top) + 132px);left:var(--hud-left)}
  .touch-hud .top-tools #party-open,.touch-hud .top-tools #town-npcs{border-radius:10px;font-size:.8rem}
  .touch-hud .top-tools #party-open{padding:0 10px}
}
@media(orientation:landscape) and (max-height:600px) and (min-width:530px){
  .touch-hud .town-party-tools{top:calc(var(--hud-top) + 81px)}
}
.party-heading,.party-controls,.party-sharing,.party-room{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.party-heading,.party-room{justify-content:space-between}
.party-heading h3,.party-room p{margin:0}
.party-controls,.party-sharing{padding:12px;background:#e9e3d2;border-radius:9px}
.party-controls label{display:flex;gap:6px;align-items:center}
.party-sharing input{min-width:7ch;width:10ch;flex:1 1 8ch;max-width:16ch;padding:9px;color:#26382e;background:#fffbed;border:1px solid #a99c76;border-radius:6px;font:600 1rem ui-monospace,monospace;text-transform:uppercase;letter-spacing:.12em}
.party-panel button{min-height:44px}
.party-panel [data-part=list]{display:grid;gap:8px}
.party-member,.party-room{background:#fbf7e9;padding:10px 14px;border:1px solid #c9ba98;border-radius:8px}
.party-member{display:grid;gap:4px}
.party-member>div{display:flex;justify-content:space-between;align-items:center;gap:8px}
.party-member small{color:#526a54}
.party-member>div>b{margin-right:auto}
.party-slot{--pin:#7de3dc;display:inline-grid;place-items:center;flex:none;background:var(--pin);color:#172c32;border:1px solid #133439;border-radius:50%;font:700 11px/1 system-ui;width:17px;height:17px}
.party-slot[data-slot="2"]{--pin:#a1ceff}.party-slot[data-slot="3"]{--pin:#e5b4fe}.party-slot[data-slot="4"]{--pin:#a2e6a0}.party-slot[data-slot="5"]{--pin:#ffb6ac}.party-slot[data-slot="6"]{--pin:#f6d477}
.party-map-pin{box-sizing:border-box;position:absolute;transform:translate(-50%,-50%);width:14px;height:14px;font-size:9px;box-shadow:0 0 0 1px #fff9;pointer-events:auto}
.party-map-pin.off-map::after{content:"";position:absolute;left:50%;top:50%;width:4px;height:5px;background:var(--pin);clip-path:polygon(0 0,100% 50%,0 100%);transform:translate(-50%,-50%) rotate(var(--bearing)) translateX(8px)}
.party-member progress{width:100%;height:8px;accent-color:#508166}
.party-panel [role=status]:empty{display:none}
.party-panel [aria-busy=true]{cursor:progress}

#action-dock{display:contents}
.dock-key{display:none}

html:not(.touch-hud) #action-dock{
  --seal:52px;
  position:absolute;right:var(--edge);bottom:var(--bottom);
  display:grid;grid-template-columns:1fr 1fr 1.34fr;gap:5px;
  width:clamp(344px,28vw,400px);padding:5px 7px 7px;
  color:#f8eed8;border:1px solid #c7a873;border-radius:12px;
  background:linear-gradient(170deg,#293a35fa,#121f21fa 68%);
  box-shadow:inset 0 0 0 2px #142322,inset 0 0 0 3px #ac92644a,0 4px 12px #10191163;
}
html:not(.touch-hud) #action-dock::before,html:not(.touch-hud) #action-dock::after{
  content:"";pointer-events:none;position:absolute;top:50%;width:5px;height:5px;
  background:linear-gradient(135deg,#fff1ba,#b18c50 60%,#665232);
  border:1px solid #514532;transform:rotate(45deg);
}
html:not(.touch-hud) #action-dock::before{left:-3px}
html:not(.touch-hud) #action-dock::after{right:-3px}
html:not(.touch-hud) #actions{display:contents}
html:not(.touch-hud) .field-actions{
  display:grid;grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;
}
html:not(.touch-hud) #actions .field-actions button{
  display:flex;justify-content:center;align-items:center;gap:6px;min-height:32px;
  padding:3px 5px;border:1px solid transparent;border-radius:5px;background:transparent;
  color:#efe5d0;box-shadow:none;font-size:.87rem;line-height:1.3;
}
html:not(.touch-hud) #actions .field-actions button:hover{background:#42524a;border-color:#738072}
html:not(.touch-hud) #actions #run[aria-pressed=true]{background:#354d42;border-color:#87a788;color:#e1ffcb}
html:not(.touch-hud) #action-dock kbd{
  display:inline-grid;place-items:center;min-width:19px;height:18px;padding:0 4px;
  border:1px solid #9f906e;border-radius:4px;color:#f8ebcb;
  background:linear-gradient(#34403d,#202a29);box-shadow:0 1px 0 #0d191a;
  font:650 11px/1 system-ui,sans-serif;letter-spacing:.015em;
}
html:not(.touch-hud) #action-dock .combat-slot{
  --ink:#8ed2bd;--well:#304f48;
  position:relative;isolation:isolate;inset:auto;display:flex;flex-direction:column;
  justify-content:flex-start;align-items:center;gap:3px;min-width:0;
  min-height:98px;padding:13px 5px 7px;overflow:hidden;
  border:1px solid color-mix(in srgb,var(--ink) 53%,#25312f);
  border-radius:7px;color:#fff4db;text-shadow:0 1px 2px #0e1514;
  background:radial-gradient(ellipse at 50% 25%,var(--well),transparent 80%),linear-gradient(#283632,#172326);
  box-shadow:inset 0 0 0 2px #101c2075,inset 0 1px 0 #ffffff20;
}
html:not(.touch-hud) #action-dock #strike{--ink:#f9ca76;--well:#77582e}
html:not(.touch-hud) #action-dock #job-skill{
  --ink:var(--rune);--well:color-mix(in srgb,var(--rune) 26%,#232a37);
}
html:not(.touch-hud) #action-dock .combat-slot::before{
  content:"";position:absolute;z-index:-1;pointer-events:none;top:14px;left:50%;transform:translateX(-50%);
  width:var(--seal);height:var(--seal);border-radius:50%;
  border:1px solid color-mix(in srgb,var(--ink) 62%,transparent);
  background:radial-gradient(circle,transparent 59%,#142021 61% 65%,transparent 67%),
    conic-gradient(from 45deg,transparent 0 23%,#e8dbb84d 24% 25%,transparent 26% 48%,#e8dbb84d 49% 50%,transparent 51% 73%,#e8dbb84d 74% 75%,transparent 76%),
    radial-gradient(ellipse at 40% 30%,var(--well),#152225 82%);
  box-shadow:0 0 0 2px #141e2099,0 0 9px color-mix(in srgb,var(--ink) 18%,transparent);
}
html:not(.touch-hud) #action-dock .action-glyph{
  width:calc(var(--seal) + 1px);height:calc(var(--seal) + 1px);flex:none;
  filter:drop-shadow(0 2px 2px #111b1dc9);
}
html:not(.touch-hud) #action-dock #dash::before{left:calc(50% + 6px)}
html:not(.touch-hud) #action-dock #dash .action-glyph{margin-left:12px}
html:not(.touch-hud) #action-dock .slot-label{
  margin-block:auto;text-align:center;text-wrap:balance;line-height:1.25;font-size:clamp(.9rem,1.05vw,1rem);font-weight:650;
}
html:not(.touch-hud) #action-dock .combat-slot kbd{position:absolute;top:5px;left:5px}
html:not(.touch-hud) #action-dock #skill-time:not(:empty){
  position:absolute;top:5px;right:4px;padding:1px 4px;background:#182321f2;border-radius:4px;
  color:#fff2c7;font:700 .75rem/1.3 system-ui;
}
html:not(.touch-hud) #action-dock #job-skill::after{left:7%;width:86%;height:2px;bottom:3px;border-radius:2px}
html:not(.touch-hud) #action-dock .combat-slot[aria-disabled=true] .action-glyph{filter:grayscale(.8) brightness(.7)}
html:not(.touch-hud) #action-dock .combat-slot:is(:hover,:focus-visible):not([aria-disabled=true]){
  border-color:var(--ink);box-shadow:inset 0 0 14px color-mix(in srgb,var(--ink) 19%,transparent);
}
html:not(.touch-hud) #action-dock .combat-slot:is(:active,.is-held):not([aria-disabled=true]){
  background:radial-gradient(ellipse at 50% 35%,var(--well),#152322);filter:brightness(1.22);
}
html:not(.touch-hud) #game:has(#rebirth[open]) #action-dock{visibility:hidden}

/* A compact field guide: real milestones, one lesson at a time. */
#book:has(.beginner-guide){width:min(800px,94vw)}
.beginner-guide{font-size:15px;line-height:1.55;color:#30473c}
.beginner-guide h3,.beginner-guide p{margin:0}
.beginner-intro{display:flex;align-items:center;gap:16px;padding:0 2px 13px}
.beginner-intro>img{flex:none;width:64px;height:72px;object-fit:contain;filter:drop-shadow(0 3px 2px #5a4c3926)}
.beginner-intro h3{font-size:23px;line-height:1.3;color:#284335;margin-bottom:5px}
.beginner-intro p{color:#68725e;font-size:14px}
.beginner-progress{display:flex;align-items:center;gap:16px;font-size:12px;font-weight:700;color:#737152;margin-bottom:16px}
.beginner-progress span{white-space:nowrap}
.beginner-progress progress{appearance:none;border:0;width:100%;height:6px;border-radius:5px;overflow:hidden;background:#dce0ce;accent-color:#65805b}
.beginner-progress progress::-webkit-progress-bar{background:#dce0ce}
.beginner-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#62816a,#b4bc72);border-radius:5px}
.beginner-progress progress::-moz-progress-bar{background:#748d62}
.beginner-layout{display:grid;grid-template-columns:185px minmax(0,1fr);gap:16px}
.beginner-steps{display:grid;align-content:start;gap:6px}
#book .beginner-step{display:flex;align-items:center;gap:9px;min-height:46px;width:100%;text-align:left;padding:5px 10px;border:1px solid #d5c9ab;border-radius:9px;background:#fbf6e6;color:#445441;font:600 14px/1.3 system-ui,sans-serif}
.beginner-step>img{width:30px;height:34px;flex:none;object-fit:contain}
#book .beginner-step[aria-pressed=true]{background:#304b3d;color:#fff0c9;border-color:#aa8d50;box-shadow:inset 3px 0 #d0b470}
#book .beginner-step:hover{border-color:#7a9270}
#book .beginner-step:focus-visible{outline:3px solid #b48d42;outline-offset:2px}
.beginner-check{margin-left:auto;color:#6b914b;font-size:17px}
.beginner-step[aria-pressed=true] .beginner-check{color:#c7dd9d}
.beginner-lesson{display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:18px 21px;border:1px solid #cbb98d;border-radius:12px;background:linear-gradient(135deg,#fffbed,#f5eed8);box-shadow:0 2px 6px #65502c09}
.beginner-devices{display:flex;gap:5px;margin-bottom:13px}
#book .beginner-devices .tool{font-size:12px;min-height:34px;padding:4px 12px;border-radius:18px;background:transparent}
#book .beginner-devices .tool[aria-pressed=true]{background:#e5e9d4;border-color:#7b9067;color:#314c38}
.beginner-lesson h3{font-size:23px;line-height:1.4;margin-bottom:10px}
.beginner-lesson p+p{margin-top:10px}
.beginner-actions{display:flex;flex-wrap:wrap;gap:8px;padding-top:20px;margin-top:auto;width:100%}
#book .beginner-actions button{min-height:44px;padding:9px 16px;font-size:14px;border-radius:7px}
.beginner-recovery{display:flex;align-items:center;gap:12px;padding:13px 16px;margin-top:16px;border:1px solid #d6c2a0;border-radius:9px;background:#eee4cf}
.beginner-recovery>img{width:35px;height:45px;object-fit:contain;flex:none}
.beginner-recovery strong{color:#785739;font-size:14px}
.beginner-recovery p{font-size:12px;color:#6d6957;margin-top:3px;line-height:1.6}
#book .beginner-recovery .tool{min-height:44px;flex:none;font-size:13px;border-radius:7px}
.beginner-more{margin-top:13px;padding-bottom:10px;border-bottom:1px solid #d8ceb3;font-size:13px}
.beginner-more summary{cursor:pointer;min-height:34px;align-content:center;font-weight:650;color:#536749}
.beginner-more p{margin:7px 0 9px}
.beginner-save{margin-top:10px!important;font-size:12px;color:#817354}
.beginner-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.beginner-footer small{font-size:12px;color:#717968}
#book .beginner-footer .tool{min-height:40px;font-size:12px;flex:none}
@media(max-width:600px){
  #book:has(.beginner-guide){width:calc(100vw - 20px);max-height:calc(100dvh - 24px)}
  #book:has(.beginner-guide) #book-body{padding:12px}
  .beginner-intro{gap:10px;padding-bottom:10px}
  .beginner-intro>img{width:46px;height:60px}
  .beginner-intro h3{font-size:19px}
  .beginner-intro p{font-size:12px}
  .beginner-progress{gap:10px;font-size:11px;margin-bottom:12px}
  .beginner-layout{grid-template-columns:minmax(0,1fr);gap:12px}
  .beginner-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  #book .beginner-step{position:relative;flex-direction:column;justify-content:center;gap:3px;text-align:center;font-size:12px;min-height:64px;padding:5px 3px}
  #book .beginner-step[aria-pressed=true]{box-shadow:inset 0 -2px #d0b470}
  .beginner-step>img{width:25px;height:28px}
  .beginner-check{position:absolute;top:1px;right:5px;font-size:13px}
  .beginner-lesson{padding:14px 16px;font-size:14px;line-height:1.6}
  .beginner-lesson h3{font-size:20px;margin-bottom:7px}
  .beginner-devices{margin-bottom:9px}
  #book .beginner-devices .tool{min-height:40px}
  .beginner-actions{padding-top:14px}
  #book .beginner-actions button{flex:1}
  .beginner-recovery{display:grid;grid-template-columns:28px minmax(0,1fr);gap:7px 10px;padding:11px 12px;margin-top:12px}
  .beginner-recovery>img{width:28px;height:40px}
  #book .beginner-recovery .tool{grid-column:2;justify-self:start}
  .beginner-footer{align-items:flex-start;flex-wrap:wrap;gap:6px}
}

/* Quick recovery stays beside the movement controls on touch screens. */
#recovery-controls{position:absolute;left:var(--edge);bottom:calc(var(--bottom) + 205px);display:flex;gap:6px;z-index:3}
#recovery-controls button{display:flex;align-items:center;gap:6px;min-height:44px;padding:6px 10px;border-radius:12px;font:600 13px/1.2 system-ui}
#recovery-controls img{width:25px;height:30px;object-fit:contain}#recovery-controls b{font-size:24px;color:#b7e4b0}
#recovery-controls small{padding:3px 5px;border:1px solid #d6c49a66;border-radius:4px}#rest[aria-pressed=true]{background:#4c6341}
#quick-potion[aria-disabled=true],#quick-mana[aria-disabled=true]{opacity:.65}#recovery-status{position:absolute;left:50%;bottom:calc(var(--bottom) + 65px);transform:translateX(-50%);max-width:min(360px,75vw);padding:9px 14px;border-radius:20px;font:600 13px/1.5 system-ui;text-align:center;pointer-events:none;z-index:4}
#fps-counter{position:absolute;left:50%;top:8px;transform:translateX(-50%);padding:5px 10px;border-radius:8px;font:600 12px/1.3 monospace;pointer-events:none;z-index:3}
#loading{z-index:20;text-align:center;padding:24px}#loading progress{width:min(360px,80vw);height:12px;accent-color:#d5ba78}#loading p{max-width:400px;color:#dad5b7;font-size:14px;line-height:1.7}
.creation-loading{font-size:14px;line-height:1.6;color:#586444}.creation-settings progress{width:100%;accent-color:#52735a}
.actor-viewer{position:relative}.actor-viewer>img{position:absolute;inset:6% 0 auto;width:100%;height:88%;object-fit:contain;pointer-events:none}.actor-load-status{position:absolute;top:8px;left:10px;background:#f4efdfde;border-radius:5px;padding:4px 8px;font-size:13px}.actor-viewer [hidden]{display:none}
.information-links{display:flex;gap:20px;padding:16px 2px 4px;justify-content:center}.information-links a{color:inherit;text-underline-offset:4px;font-size:14px}
.touch-hud #recovery-controls{left:var(--hud-left);bottom:calc(var(--bottom) + max(var(--pad-size),120px) + 56px);gap:5px}
.touch-hud #recovery-controls button{padding:4px 7px;font-size:11px;min-width:74px;gap:4px}.touch-hud #recovery-controls small{display:none}
.touch-hud #recovery-status{bottom:calc(var(--bottom) + 210px);font-size:11px;max-width:200px}
@media(orientation:landscape) and (max-height:600px){.touch-hud #recovery-controls{left:calc(var(--hud-left) + var(--pad-size) + 12px);bottom:var(--bottom)}.touch-hud #recovery-status{bottom:66px}}
#game:has(#rebirth[open]) #recovery-controls{visibility:hidden}
#zone-level{display:table;margin:2px 0 7px;padding:4px 9px;border:1px solid #b6c6a1;border-radius:6px;color:#eff8dd;background:#294a35ed;font:650 13px/1.4 system-ui;letter-spacing:normal;text-shadow:none}
#zone-level small{margin-left:6px;font:inherit}
#zone-level[data-difficulty=hard]{background:#633431ed;border-color:#e9b2a4;color:#ffe3da}
#zone-level[data-difficulty=easy]{background:#414b4bed;border-color:#a6b6b1;color:#e8ece9}
#zone-level[data-difficulty=safe]{background:#294b51ed;border-color:#9cced0;color:#dffafb}
.touch-hud .field-tools .location #zone-level{display:block;position:absolute;top:6px;left:6px;z-index:2;font:650 9px/1.4 system-ui;padding:1px 4px;margin:0;max-width:80px}
.touch-hud #zone-level small{display:none}
/* The game is a fixed viewport. Focus restoration must not scroll its HUD. */
html,body,#game{overflow:clip}
.career-paths{margin:18px 0;padding:15px;border:1px solid #c8b78f;border-radius:12px;background:#ece7d7}
.career-paths>h3{margin:0}.career-paths>p{font-size:13px;color:#65563b;margin:5px 0 13px}
.career-path{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:8px}
#book .career-node{position:relative;display:flex;align-items:center;gap:8px;min-width:0;min-height:62px;padding:8px;text-align:left;background:#fff9e9;border:1px solid #ccbb92;border-radius:8px;color:#2e4439}
#book .career-node:not(:last-child):after{content:'›';position:absolute;right:-10px;font-size:21px;color:#92703d}
#book .career-node[aria-pressed=true]{background:#dce6d5;border:2px solid #6b8261}
.career-node img{width:36px;height:40px;object-fit:contain}.career-node span{display:grid;min-width:0;gap:3px}.career-node b{font-size:13px;overflow-wrap:anywhere}.career-node small{font-size:11px;color:#79623d}
.promotion-equipment{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}
.promotion-equipment>div{display:grid;grid-template-columns:60px 1fr;gap:5px 12px;padding:14px;background:#fff8e7;border:1px solid #cdbb93;border-radius:10px;align-items:center}
.promotion-equipment img{width:60px;height:66px;object-fit:contain;grid-row:span 2}.promotion-equipment strong{overflow-wrap:anywhere}.promotion-equipment small{color:#79623d}
.promotion-confirm{max-width:780px;margin:auto;padding:12px 0}.promotion-confirm>img{float:left;width:72px;height:80px;object-fit:contain;margin:0 18px 10px 0}.promotion-confirm>h3{font:700 24px Georgia,serif;color:#29483b}.promotion-confirm>p{line-height:1.65}.promotion-confirm>h4{clear:both;margin-top:24px}
.promotion-confirm .book-tools{justify-content:flex-end;margin-top:20px}.farm-area-heading{font-weight:700;color:#315848}.farm-summary-open{width:100%;margin-top:8px;min-height:44px}
#quest-location{display:block;max-width:290px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;opacity:.85;margin-top:3px}
@media(max-width:600px){.career-paths{padding:10px}.career-path{gap:8px}#book .career-node{display:grid;justify-items:center;text-align:center;padding:7px 4px}.career-node b{font-size:11px}.career-node img{width:30px;height:34px}.promotion-equipment{grid-template-columns:1fr}.promotion-confirm>h3{font-size:21px}.touch-hud #quest-location{font-size:10px;max-width:170px}}
.boss-challenge{display:flex;align-items:center;gap:10px;border:1px solid #c49149!important;background:linear-gradient(135deg,#fff3ce,#ead8b0)!important;color:#613d24!important;font-weight:700}.boss-challenge img{width:58px;height:58px;object-fit:contain;flex:0 0 58px}
#area-overview{width:min(1100px,94vw);max-height:90dvh;overflow:auto;background:#203a35;color:#fff0cc;border:2px solid #bb9656;border-radius:16px;padding:18px}#area-overview::backdrop{background:#091714b8}#area-overview header{display:flex;justify-content:space-between;align-items:center;font-size:22px}#area-overview canvas{display:block;width:100%;height:auto;border:1px solid #b19458;border-radius:8px;cursor:crosshair}#area-overview button{font-size:26px;color:inherit;background:transparent;border:0}#area-overview p{margin:10px 0}#warp-travel{display:block;margin-top:6px;padding:8px 18px;font-weight:bold}
@media(max-width:700px){#warp-travel{position:fixed;right:8px;top:198px;z-index:20;width:104px;font-size:12px;padding:8px 4px}}
#warp-travel{pointer-events:auto}
.character-equipment{margin:14px 0;padding:16px;border:1px solid #c6af7c;border-radius:12px;background:#f4ecd9}.character-equipment header{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-bottom:12px}.character-equipment h3{margin:0}.character-gear-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.character-gear-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:7px;padding:12px 8px;text-align:center;border:1px solid #c7ad76;border-radius:10px;background:linear-gradient(#fff9e9,#e9ddc0);min-width:0}.character-gear-card img{width:70px;height:70px;object-fit:contain}.character-gear-card strong{font-size:14px;overflow-wrap:anywhere}.character-gear-card small{color:#705c38}.character-gear-bonuses{font-size:12px;color:#325d49;line-height:1.5}.character-gear-rank{position:absolute;right:8px;top:32px;background:#554226;color:#ffe4a0;border-radius:6px;padding:3px 7px;font-weight:bold}.character-gear-empty{height:70px;display:grid;place-items:center;font-size:30px;color:#a4967d}.character-gear-card.empty{background:#ede8db;border-style:dashed}.character-gear-card.empty strong{font-weight:400;color:#81755f}@media(max-width:700px){.character-gear-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.character-equipment{padding:10px}.character-equipment header{align-items:flex-start}.character-equipment h3{font-size:18px}}
@media(max-width:700px){.character-gear-card{padding:8px 6px;gap:4px}.character-gear-card img{width:44px;height:44px}.character-gear-empty{height:32px;font-size:24px}.character-gear-card strong{font-size:12px}.character-gear-card small{font-size:11px}.character-gear-rank{top:25px;font-size:12px}.character-gear-grid{gap:7px}}
