@font-face{font-family:"Cinzel";src:url("assets/fonts/Cinzel.ttf") format("truetype");font-weight:400 900;font-style:normal;font-display:swap}
/* Shared game controls: worn leather, bronze edges, engraved marks. */
:root{--game-script:"Cinzel",Palatino,serif;--display:"Cinzel",Palatino,Georgia,serif;--control-ink:#f1dfb7;--control-bronze:#9a753e;--control-light:#e7bd71;--control-surface:linear-gradient(100deg,#362211ed,#241b10f5 48%,#362a16ef),repeating-linear-gradient(4deg,#d0ac6220 0 1px,transparent 1px 5px)}
html:root body :is(#commands button,.ghost,.primary,.stage-action,.filter,.sheet-tabs button,.sheet-companion,.sheet-cta,.text-action,.inventory-page,.creation-stages button,.creation-plan,.preparation,.trade-arrow,.trade-browse button,.cinematic-controls button,.cinematic-skip){
  position:relative;isolation:isolate;min-height:44px;border:1px solid var(--control-bronze);border-radius:3px 9px 3px 9px;
  color:var(--control-ink);background:var(--control-surface);background-blend-mode:normal;
  box-shadow:inset 0 1px #e8c88b55,inset 0 -3px #070604b3,inset 3px 0 #4e361d88,inset -3px 0 #0b0905a8,0 2px 5px #0007;
  font-family:var(--game-script);font-size:25px;font-weight:400;line-height:1.16;letter-spacing:.015em;
  text-shadow:0 2px 2px #000b;transition:filter .16s,border-color .16s,box-shadow .16s;
}
html:root body :is(#commands button,.ghost,.primary,.stage-action,.filter,.sheet-tabs button,.sheet-companion,.sheet-cta,.text-action,.inventory-page,.creation-stages button,.creation-plan,.preparation,.trade-arrow,.trade-browse button,.cinematic-controls button,.cinematic-skip):hover:not(:disabled){
  border-color:#edc47e;color:#fff1ce;filter:brightness(1.2);box-shadow:inset 0 1px #ffdea077,inset 0 -3px #070604b3,0 0 12px #d89d3433,0 3px 7px #0009;
}
html:root body :is(#commands button,.ghost,.primary,.stage-action,.filter,.sheet-tabs button,.sheet-companion,.sheet-cta,.text-action,.inventory-page,.creation-stages button,.creation-plan,.preparation,.trade-arrow,.trade-browse button,.cinematic-controls button,.cinematic-skip):focus-visible{outline:2px solid #ffe1a0;outline-offset:3px;box-shadow:0 0 0 5px #9e6c2844}
html:root body :is(#commands button,.ghost,.primary,.stage-action,.filter,.sheet-tabs button,.sheet-companion,.sheet-cta,.text-action,.inventory-page,.creation-stages button,.creation-plan,.preparation,.trade-arrow,.trade-browse button,.cinematic-controls button,.cinematic-skip):disabled{cursor:not-allowed;filter:saturate(.3);opacity:.46}
html:root body :is(.primary,#commands .object-action){background:linear-gradient(110deg,#80602d,#4c351b 55%,#6b4b22);color:#fff0c5;border-color:#d9ad60;box-shadow:inset 0 0 0 3px #27170988,inset 0 0 0 4px #bd8d4c77,0 3px 8px #0009}
html:root body :is(button[aria-pressed=true],button[aria-selected=true],.creation-stages .current button){border-color:#f2cb7d;color:#ffe8af;background:linear-gradient(100deg,#79542a,#3d2c17);box-shadow:inset 3px 0 #edc275,inset 0 0 0 1px #aa814c,0 0 12px #c3923622}
html:root body #field-panel{background:linear-gradient(#261c10e8,#17130def),url(assets/thornhaven-vellum.webp) center/cover;border:1px solid #906b37;box-shadow:inset 0 0 0 5px #120d0866,inset 0 0 35px #0008,0 0 0 3px #3f2b16,0 0 0 4px #916b3c99,0 12px 40px #0007;padding:22px}
html:root body[data-scene=TavernState] #field-panel:before{content:'Choose your path';font:32px/1 var(--game-script);text-transform:none;letter-spacing:.035em;color:#e7c183;border-bottom:3px double #a37a3a99;padding-bottom:14px;margin-bottom:12px;text-shadow:0 2px #000}
html:root body #commands{gap:9px}
html:root body #commands button{padding:10px 27px 10px 14px;text-align:left;min-height:49px;min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word;white-space:normal}
html:root body header nav button#sound-toggle{padding:5px 10px}
html:root body #commands button::after{content:'◆';position:absolute;right:10px;top:50%;transform:translateY(-50%);font:8px Georgia;color:#9d7640;text-shadow:0 1px #000;pointer-events:none}
html:root body #commands button:hover::after{color:#ffda8a}
/* Station identity derives from the live commands even in older saved sessions. */
html:root body #commands:has([data-code="_hub_shop"]){grid-template-columns:1fr;gap:9px}
html:root body #commands:has([data-code="_hub_shop"]) button{min-height:52px;display:flex;align-items:center;padding:9px 26px 9px 59px;background:var(--control-surface);font-size:27px;text-shadow:0 2px 2px #000c;border:1px solid #a17d46;border-radius:2px 12px 2px 12px;overflow:hidden}
html:root body #commands:has([data-code="_hub_shop"]) button::before{content:'';position:absolute;left:9px;top:50%;transform:translateY(-50%);width:35px;height:35px;border:1px solid #b48a46;border-radius:50%;background-color:#18150d;background-image:var(--menu-sigil);background-size:24px;background-position:center;background-repeat:no-repeat;box-shadow:inset 0 0 0 2px #5d4827,0 2px 4px #0009;pointer-events:none}
#commands [data-code=KeyQ]{--menu-sigil:url(assets/ui-controls/scroll.svg)}
#commands [data-code=KeyN]{--menu-sigil:url(assets/ui-controls/tankard.svg)}
#commands [data-code=KeyP]{--menu-sigil:url(assets/ui-controls/shield.svg)}
#commands [data-code=KeyR]{--menu-sigil:url(assets/ui-controls/swords.svg)}
#commands [data-code=_hub_shop]{--menu-sigil:url(assets/ui-controls/coins.svg)}
#commands [data-code=_flagon_hearth]{--menu-sigil:url(assets/ui-controls/flame.svg)}
#commands [data-code=_flagon_table]{--menu-sigil:url(assets/ui-controls/map.svg)}
#commands [data-code=_flagon_wall]{--menu-sigil:url(assets/ui-controls/candle.svg)}
html:root body #commands.travel-controls{grid-template-columns:1fr;gap:10px}
html:root body #commands.travel-controls .dpad-console{grid-column:1 / -1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:10px;border:1px solid #9e7b3f;border-radius:4px;background:linear-gradient(180deg,#1a150e,#100d09);box-shadow:inset 0 0 18px #000c,0 3px 8px #0009}
html:root body #commands.travel-controls .dpad-key{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:58px;padding:7px 4px;text-align:center;border:1px solid #a88346;border-radius:4px;background:linear-gradient(180deg,#3a2b18,#1f170d 55%,#140f08);color:#f3ddb0;box-shadow:inset 0 1px #f3d49455,inset 0 -3px #050402cc,0 2px 5px #000a}
html:root body #commands.travel-controls .dpad-key:hover:not(:disabled){border-color:#f2cb7d;color:#fff4d6;background:linear-gradient(180deg,#4c381f,#2a1f11 55%,#1b130a);box-shadow:inset 0 1px #ffe6ab77,0 0 12px #d89d3444,0 2px 6px #000a}
html:root body #commands.travel-controls .dpad-key svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 1px #000)}
html:root body #commands.travel-controls .dpad-key kbd{font:700 10px/1 var(--display);letter-spacing:.1em;color:#c9ae7a;opacity:.9}
html:root body #commands.travel-controls .gear-console{grid-column:1 / -1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
html:root body #commands.travel-controls .gear-key{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:48px;padding:6px 6px;text-align:center;font-size:14px;border:1px solid #8a6c3a;border-radius:4px;background:linear-gradient(180deg,#2c2214,#18130c);color:#e6d0a2}
html:root body #commands.travel-controls .gear-key svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html:root body #commands.travel-controls .gear-key span{font:600 13px/1.1 var(--game-script);letter-spacing:.03em}
html:root body #commands.travel-controls .gear-key kbd{font:700 10px/1 var(--display);color:#b99d6b}
html:root body #commands.travel-controls .dpad-key::after,html:root body #commands.travel-controls .gear-key::after,html:root body #commands.travel-controls .direction::after,html:root body #commands.travel-controls .gear-action::after{display:none}
html:root body #commands.travel-controls .direction,html:root body #commands.travel-controls .gear-action{font-size:22px;text-align:center;padding:7px 5px;min-height:53px}
html:root body #commands.travel-controls .object-action{grid-column:1 / -1;font-size:19px;padding:12px 16px}

/* =====================================================================
   1994 CARVED-GRANITE 4-ZONE DUNGEON CONSOLE (ExploringState only)
   ===================================================================== */
html:root body[data-scene=ExploringState] #game{
  max-width:1460px;
  background-color:#1c1b18;
  background-image:url("assets/ui-controls/hud-stone-tile.jpg");
  background-size:220px 220px;
  border:3px solid #000;
  box-shadow:inset 0 0 0 2px #524e45,inset 0 0 38px rgba(0,0,0,.78);
  padding:8px;
  gap:8px;
  grid-template-columns:66px minmax(0,1fr) minmax(250px,305px);
  align-items:stretch;
}
html:root body[data-scene=ExploringState] #left-rail{
  display:flex;flex-direction:column;align-items:center;gap:7px;padding:4px 2px;
}
html:root body[data-scene=ExploringState] #left-rail .rail-socket{
  width:56px;height:56px;padding:4px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  position:relative;border-radius:0;
  background-color:#292723;
  background-image:linear-gradient(rgba(18,17,15,.55),rgba(10,10,9,.72)),url("assets/ui-controls/hud-stone-tile.jpg");
  background-size:150px 150px;
  border-top:2px solid #d49c3d;border-left:2px solid #b5802b;border-right:2px solid #4a3110;border-bottom:2px solid #2b1b07;
  box-shadow:inset 0 0 11px rgba(255,156,36,.24),0 0 9px rgba(242,158,38,.30),0 0 0 1px #000;
  color:#f8ce6a;text-shadow:0 0 6px rgba(255,176,48,.5),1px 1px 0 #000;
}
html:root body[data-scene=ExploringState] #left-rail .rail-socket:hover{
  border-top-color:#ffd875;border-left-color:#f0ba4f;color:#fff4c8;
  box-shadow:inset 0 0 16px rgba(255,186,62,.44),0 0 15px rgba(255,172,44,.6),0 0 0 1px #000;
}
html:root body[data-scene=ExploringState] #left-rail .rail-socket svg{
  width:21px;height:21px;fill:none;stroke:#ffd978;stroke-width:2.2;stroke-linecap:square;stroke-linejoin:miter;
  filter:drop-shadow(0 0 4px rgba(255,168,42,.6)) drop-shadow(1px 1px 0 #000);
}
html:root body[data-scene=ExploringState] #left-rail .rail-socket span{font:700 8.5px/1 "Courier New",monospace;letter-spacing:.06em;color:#f7d688}
html:root body[data-scene=ExploringState] #left-rail .rail-socket kbd{position:absolute;top:2px;right:3px;font:700 8px/1 "Courier New",monospace;color:#ffdf8c}
html:root body[data-scene=ExploringState] .stage{
  border-top:3px solid #080807;border-left:3px solid #0c0c0a;border-right:3px solid #5c584f;border-bottom:3px solid #6c685e;
  box-shadow:inset 0 0 18px #000;border-radius:0;
}
html:root body[data-scene=ExploringState] #field-panel{
  border-radius:0;padding:12px 14px;
  background-color:#1f1e1b;
  background-image:linear-gradient(rgba(16,15,13,.84),rgba(11,10,9,.92)),url("assets/ui-controls/hud-stone-tile.jpg");
  background-size:180px 180px;
  border-top:3px solid #6e6a60;border-left:3px solid #59564d;border-right:3px solid #12110f;border-bottom:3px solid #090908;
  box-shadow:0 0 0 1px #000;
}
html:root body[data-scene=ExploringState] #commands.travel-controls .object-action,
html:root body[data-scene=ExploringState] #commands.travel-controls .dpad-key,
html:root body[data-scene=ExploringState] #commands.travel-controls .gear-key{
  border-radius:0;
  border-top:2px solid #8a7f6b;border-left:2px solid #6d6454;border-right:2px solid #151412;border-bottom:2px solid #090908;
}
html:root body[data-scene=ExploringState] #commands.travel-controls .object-action{
  border-top-color:#d4a74f;border-left-color:#b2893c;
}
/* Desktop keyboard-first: hide bulky D-pad by default unless user toggles ? Keys (always visible on mobile/touch) */
@media (min-width: 900px) and (pointer: fine){
  html:root body[data-scene=ExploringState]:not(.show-dpad) #commands.travel-controls .dpad-console,
  html:root body[data-scene=ExploringState]:not(.show-dpad) #commands.travel-controls .gear-console{
    display:none;
  }
}
@media (max-width: 899px){
  html:root body[data-scene=ExploringState] #game{grid-template-columns:1fr}
  html:root body[data-scene=ExploringState] #left-rail{flex-direction:row;justify-content:center;flex-wrap:wrap}
}
html:root body #commands kbd{font:11px/1.2 Georgia,serif;letter-spacing:.08em;color:#d4c1a2}
html:root body[data-scene=CombatState] #commands [data-code="_endTurn"]{border-color:#ddaa5c;background:linear-gradient(100deg,#71441c,#352313);color:#ffe5ae}
html:root body[data-scene=CombatState] #commands [data-code="_flee"]{border-color:#9d634c;color:#ebc3a8}
html:root body header{background:linear-gradient(#1f1b12,#10120d);border-bottom:3px double #8d704688}
html:root body header nav{gap:clamp(5px,1.8vw,28px)}
html:root body header nav button,html:root body .utility,html:root body .savetools button{font-family:var(--game-script);font-size:22px;letter-spacing:.025em;color:#dac19a}
html:root body header nav button:hover{color:#ffe0a3;text-shadow:0 0 10px #d2a44d99}
html:root body #rest{font-family:var(--game-script);font-size:21px;text-decoration:none;letter-spacing:.01em;color:#c5aa7a;margin-top:12px}
html:root body .overline,html:root body .location small{font-family:var(--display);letter-spacing:.15em;font-variant:small-caps}
/* Character menus use the same material; illustrated portraits and pack cells stay visible. */
html:root body .sheet-tabs{gap:5px;border-bottom:3px double #947346;padding-bottom:8px}
html:root body .sheet-tabs button{padding:7px 13px;font-size:24px}
html:root body .sheet-companion{font-size:23px;padding:4px 12px 4px 5px}
html:root body .sheet-cta,html:root body .text-action,html:root body .inventory-page{font-size:22px;padding:7px 12px}
html:root body .creation-stages button{font-size:23px;padding:7px 10px}
html:root body .creation-plan strong,html:root body .preparation strong{font:25px/1.15 var(--game-script);color:#efdfba}
html:root body .creation-plan small,html:root body .preparation small{font:14px/1.4 var(--display);letter-spacing:0;text-shadow:none;color:#dbcfb5}
html:root body :is(.sheet-slot,.inventory-cell,.class-choice,.creation-choice,.creation-variant){border-color:#8b7046;background-color:#231f14;box-shadow:inset 0 0 18px #0006}
html:root body .sheet-slot strong,html:root body .class-choice strong{font:25px/1.1 var(--game-script)}
html:root body #folio:not(:has(.cinematic-opening)){border:1px solid #c69b5e;background:linear-gradient(115deg,#292013f5,#11170ef5),url(assets/thornhaven-vellum.webp) center/cover;box-shadow:inset 0 0 0 5px #100d0877,0 0 0 3px #47301c,0 24px 100px #000c}
html:root body .dialog-bar{border-bottom:3px double #9f7e4d88}
html:root body .dialog-bar button{font:24px Georgia;color:#e3c791;min-width:44px;min-height:44px}
/* Story text is quill lettering, with readable numerals retained in gameplay statistics. */
#folio .cinematic-opening .cinematic-line{font-family:var(--game-script);font-size:clamp(32px,3.7vw,46px);font-weight:400;line-height:1.23;letter-spacing:.015em;text-shadow:0 2px 5px #000,0 0 18px #000a}
#folio .cinematic-opening .cinematic-title{font-family:var(--display);font-size:13px;font-variant:small-caps;letter-spacing:.18em}
#folio .cinematic-opening .cinematic-top .overline{font-family:var(--display);font-size:12px}
#folio .cinematic-opening .cinematic-caption{max-width:970px;min-height:270px}
#folio .cinematic-opening .cinematic-controls button{font-family:var(--game-script);font-size:25px;padding:8px 16px}
#folio .cinematic-opening .cinematic-skip{font-family:var(--game-script);font-size:24px;background:#201a10aa;border-color:#8a713f88}
#folio .cinematic-progress button{box-shadow:none;border-radius:0}
@media(max-width:800px){
 html:root body #field-panel{padding:21px}
 html:root body header nav button{font-size:19px}
 html:root body #commands button{font-size:25px}
 html:root body #commands:has([data-code="_hub_shop"]) button{font-size:28px;min-height:55px}
 html:root body #commands:has([data-code="_hub_shop"]){grid-template-columns:1fr}
 #folio .cinematic-opening .cinematic-line{font-size:34px;line-height:1.2}
 #folio .cinematic-opening .cinematic-caption{min-height:300px;padding-top:18px}
 #folio .cinematic-opening .cinematic-controls button{font-size:22px;padding:8px 10px}
 #folio .cinematic-opening .cinematic-skip{font-size:23px}
}
@media(max-width:420px){
 html:root body header{padding:0 13px}
 html:root body header nav{gap:11px;flex-wrap:wrap}
 html:root body header nav button{font-size:18px}
 html:root body .sheet-tabs button{font-size:22px;padding:7px 9px}
 html:root body .creation-stages button{font-size:21px;padding:7px}
 #folio .cinematic-opening .cinematic-top .overline{font-size:10px}
 #folio .cinematic-opening .cinematic-line{font-size:31px}
 #folio .cinematic-opening .cinematic-controls button{font-size:21px}
}
@media(max-height:560px) and (orientation:landscape){#folio .cinematic-opening .cinematic-line{font-size:29px}#folio .cinematic-opening .cinematic-caption{min-height:0}#folio .cinematic-opening .cinematic-controls button{font-size:22px}}
@media(prefers-reduced-motion:reduce){html:root body button{transition:none}}

html:root body header nav button[aria-pressed]{background:none;border:0;box-shadow:none;padding:5px 0;min-height:40px}
@media(max-width:600px){html:root body header{flex-wrap:wrap;padding:8px 12px 0;gap:3px}html:root body header nav{width:100%;justify-content:space-between;gap:5px;flex-wrap:nowrap}html:root body header nav button{font-size:17px;white-space:nowrap;padding:5px 0}html:root body header nav button[aria-pressed]{min-height:38px}}

/* Ben's selected typeface: Cinzel. Sizes are tuned for its wider engraved forms. */
html:root body :is(#commands button,.ghost,.primary,.stage-action,.filter,.sheet-tabs button,.sheet-companion,.sheet-cta,.text-action,.inventory-page,.creation-stages button,.creation-plan,.preparation,.trade-arrow,.trade-browse button,.cinematic-controls button,.cinematic-skip){font-size:17px;line-height:1.35;font-weight:500;letter-spacing:.015em}
html:root body #commands button{font-size:17px}
html:root body #commands:has([data-code="_hub_shop"]) button{font-size:19px;min-height:52px}
html:root body[data-scene=TavernState] #field-panel:before{font-size:25px;line-height:1.2}
html:root body :is(.primary,#commands .object-action){font-size:19px}
html:root body header nav button,html:root body .utility,html:root body .savetools button{font-size:13px}
html:root body #rest{font-size:14px}
html:root body .sheet-tabs button,html:root body .sheet-companion,html:root body .sheet-cta,html:root body .text-action,html:root body .inventory-page,html:root body .creation-stages button{font-size:15px}
html:root body .creation-plan strong,html:root body .preparation strong,html:root body .sheet-slot strong,html:root body .class-choice strong{font-size:19px;line-height:1.25}
html:root body #commands.travel-controls .direction,html:root body #commands.travel-controls .gear-action{font-size:16px}
html:root body #commands.travel-controls .object-action{font-size:19px}
#folio .cinematic-opening .cinematic-line{font-size:clamp(23px,2.65vw,34px);line-height:1.45;letter-spacing:0}
#folio .cinematic-opening .cinematic-controls button,#folio .cinematic-opening .cinematic-skip{font-size:16px}
@media(max-width:800px){#folio .cinematic-opening .cinematic-line{font-size:25px;line-height:1.4}html:root body #commands button{font-size:17px}}
@media(max-width:600px){html:root body header nav button{font-size:11px;letter-spacing:0}#folio .cinematic-opening .cinematic-line{font-size:21px;line-height:1.45}#folio .cinematic-opening .cinematic-controls button{font-size:13px}#folio .cinematic-opening .cinematic-skip{font-size:15px}html:root body .creation-stages button{font-size:13px}}
@media(max-height:560px) and (orientation:landscape){#folio .cinematic-opening .cinematic-line{font-size:21px;line-height:1.35}}
