/* Dungeon Tavern's player manual (/games/dungeon-tavern/manual/, built by scripts/manual.mjs).
   Same ground as the game's page: stone wall, the game's nine-slice skins at 2×, pixel face for headings over the
   system's sans for reading. Each section is a sheet of recipe-book paper; screenshots sit in the game's item slot.
   v5.16.4: 17 languages. Each page loads /fonts/px/<lang>.css, which defines "FP Page": the Fusion Pixel letters that
   page's headings use (scripts/pixel-fonts.py); "Fusion Pixel" stays as the Chinese fallback. */
@font-face{font-family:"Fusion Pixel";src:url(/fonts/fusion-pixel.woff2) format("woff2");font-display:fallback}
:root{
  --stone:#1a1320;--stone-2:#221928;--stone-3:#33263b;
  --ink:#3b2a1d;--ink-2:#76593f;--rule:#d9c29a;--wash:#e6d2a8;
  --honey:#f2c14e;--text:#efe6da;--muted:#b6a698;--cream:#fbe9c8;
  --pixel:"FP Page","Fusion Pixel","Noto Sans SC","PingFang SC","Microsoft YaHei",ui-monospace,monospace;
  --body:"Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  --gut:clamp(16px,4vw,40px);--max:1160px;
  color-scheme:dark;
}
html:lang(zh-Hant){--body:"PingFang TC","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif}
html:lang(ja){--body:"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic","Meiryo","Noto Sans JP",system-ui,sans-serif}
html:lang(ko){--body:"Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR",system-ui,sans-serif}
html:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)){--body:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans",sans-serif}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:96px;background:var(--stone)}
body{margin:0;background:var(--stone);color:var(--text);font:16px/1.75 var(--body);-webkit-text-size-adjust:100%;overflow-x:hidden}
img{max-width:100%;height:auto}
.px{image-rendering:pixelated;image-rendering:crisp-edges}
a{color:var(--honey);text-underline-offset:3px}
a:hover{color:var(--cream)}
:focus-visible{outline:3px solid var(--honey);outline-offset:3px}
h1,h2,h3,p,ul,ol,figure{margin:0}
h1,h2,h3,.pixel{font-family:var(--pixel);font-weight:400;letter-spacing:.02em;text-wrap:balance;overflow-wrap:anywhere}
html:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)) :is(h1,h2,h3,.brand,.langs,.toc summary){word-spacing:-.3em;letter-spacing:0}
html:not(:lang(zh)):not(:lang(ja)) :is(h1,h2,h3){word-break:normal;overflow-wrap:break-word;hyphens:auto}
.wrap{max-width:var(--max);margin-inline:auto;padding-inline:var(--gut)}
.skip-link{position:absolute;left:8px;top:-120px;z-index:120;background:var(--honey);color:var(--stone);padding:10px 14px;font:16px/1 var(--pixel);text-decoration:none}
.skip-link:focus{top:8px}
main:focus{outline:none}

/* top bar: the in-game top bar */
.topbar{position:sticky;top:0;z-index:50;border-style:solid;border-width:0 0 20px;border-image:url(/img/ui/topbar.png) 8 0 20 fill / 0 0 20px stretch}
.topbar .wrap{display:flex;align-items:center;gap:12px 20px;min-height:60px;padding-block:6px}
.brand{display:flex;align-items:center;gap:10px;color:var(--text);text-decoration:none;font:18px/1 var(--pixel);white-space:nowrap}
.brand img{width:28px;height:30px;flex:none}
.brand small{color:var(--muted);font-size:12px;display:block;margin-top:4px;letter-spacing:.08em}
/* the language menu (scripts/dt-langs.mjs, same as the page for Steam): a plain <details>, so it works without script */
.chip-btn{font:18px/1 var(--pixel);color:var(--honey);background:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;text-decoration:none;
  border-style:solid;border-width:8px;border-image:url(/img/ui/tooltip.png) 8 fill / 8px stretch;padding:4px 6px;min-height:44px;white-space:nowrap}
.chip-btn svg{width:18px;height:18px}
@media (hover:hover){.chip-btn:hover{color:var(--cream)}}
.langs{position:relative;margin-left:auto}
.langs summary{list-style:none}
.langs summary::-webkit-details-marker{display:none}
.langs summary::after{content:"";width:0;height:0;border:5px solid transparent;border-top-color:currentColor;margin:5px 0 0 2px}
.langs[open] summary::after{border-top-color:transparent;border-bottom-color:currentColor;margin:0 0 5px 2px}
.langs ul{position:absolute;right:0;top:calc(100% + 6px);z-index:60;margin:0;padding:6px;list-style:none;width:max-content;max-width:calc(100vw - 2 * var(--gut));
  display:grid;grid-template-columns:repeat(2,minmax(0,auto));gap:0 4px;border-style:solid;border-width:8px;border-image:url(/img/ui/tooltip.png) 8 fill / 8px stretch;
  box-shadow:0 18px 40px rgba(0,0,0,.5)}
.langs a{display:block;font:16px/1 var(--pixel);color:var(--muted);text-decoration:none;padding:12px 10px;white-space:nowrap}
.langs a[aria-current="page"]{color:var(--honey)}
@media (hover:hover){.langs a:hover{color:var(--cream)}}

/* layout: contents on the left, the sheets on the right; one column on a phone */
.layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:32px;align-items:start;padding-block:32px 56px}
.toc{position:sticky;top:96px;max-height:calc(100vh - 120px);overflow:auto;border:16px solid transparent;
  border-image:url(/img/ui/panel_dark.png) 24 fill / 16px stretch;padding:2px 4px}
.toc summary{font:18px/1.3 var(--pixel);color:var(--honey);cursor:pointer;list-style:none;padding:4px 0}
.toc summary::-webkit-details-marker{display:none}
.toc ol{margin:6px 0 2px;padding:0;list-style:none;counter-reset:toc}
.toc li{counter-increment:toc}
.toc a{display:block;color:var(--text);text-decoration:none;padding:6px 0;font-size:14px;line-height:1.4}
.toc a::before{content:counter(toc) ". ";color:var(--muted);font-family:var(--pixel)}
.toc a[aria-current="true"]{color:var(--honey)}
@media (hover:hover){.toc a:hover{color:var(--honey)}}

.hero{padding:4px 4px 24px}
.hero h1{font-size:clamp(28px,5vw,40px);line-height:1.25;color:var(--honey);margin-bottom:14px}
.hero p{color:var(--text);max-width:46em}
.hero p+p{margin-top:8px;color:var(--muted)}

/* a section: one sheet of recipe-book paper */
.sheet{border:20px solid transparent;border-image:url(/img/ui/panel_parchment.png) 20 fill / 20px stretch;color:var(--ink);
  padding:6px 10px 10px;margin-bottom:28px;box-shadow:0 18px 40px rgba(0,0,0,.4);scroll-margin-top:96px}
.sheet h2{font-size:clamp(24px,3.4vw,30px);line-height:1.25;color:var(--ink);padding-bottom:10px;margin-bottom:14px;border-bottom:2px dashed #c9b28a}
.sheet h3{font-size:21px;line-height:1.3;color:var(--ink);margin:26px 0 10px;scroll-margin-top:96px}
.sheet p{margin:0 0 12px}
.sheet strong{color:#2a1c12}
.sheet a{color:#8a4b12}
.sheet a:hover{color:var(--ink)}
.sheet ul{margin:0 0 14px;padding-left:1.3em;list-style:none}
.sheet li{position:relative;margin-bottom:6px}
.sheet li::before{content:"";position:absolute;left:-1.05em;top:.72em;width:6px;height:6px;background:var(--ink-2)}

.table{overflow-x:auto;margin:4px 0 16px;-webkit-overflow-scrolling:touch}
.sheet table{border-collapse:collapse;width:100%;font-size:15px;line-height:1.5}
.sheet th,.sheet td{border:2px solid var(--rule);padding:6px 10px;text-align:left;vertical-align:top}
.sheet thead th{background:var(--wash);font-family:var(--pixel);font-weight:400;color:var(--ink);white-space:nowrap}
.sheet tbody tr:nth-child(even) td{background:rgba(217,194,154,.22)}
.sheet td:first-child{white-space:nowrap}

/* a screenshot: the game's own 640×360 capture in the item slot frame, at its own size (one capture pixel = one CSS
   pixel, so two device pixels on a 2× screen: crisp, never stretched by an odd factor). Narrower screens shrink it smoothly. */
.shot{width:fit-content;max-width:100%;margin:6px auto 18px;border:12px solid transparent;border-image:url(/img/ui/slot.png) 12 fill / 12px stretch;background:#140e18;line-height:0}
.shot img{display:block;width:640px;max-width:100%}
@media (max-width:760px){.shot img{image-rendering:auto}}

footer{padding-block:32px 48px;border-top:2px solid var(--stone-3);color:var(--muted);font-size:14px}
footer .wrap{display:flex;flex-wrap:wrap;gap:12px 32px;justify-content:space-between;align-items:center}
footer .pixel{color:var(--text)}

@media (max-width:900px){
  .layout{grid-template-columns:minmax(0,1fr);gap:16px;padding-top:20px}
  .toc{position:static;max-height:none}
  .toc details:not([open]) ol{display:none}
}
@media (max-width:560px){
  /* on a phone the bar scrolls away instead of covering a slice of the screen */
  .topbar{position:static}
  html{scroll-padding-top:12px}
  .sheet,.sheet h3{scroll-margin-top:12px}
  .sheet td:first-child,.sheet thead th{white-space:normal}
  .sheet{border-width:14px;border-image-width:14px;padding:4px 2px 6px}
  .sheet table{font-size:14px}
  .sheet th,.sheet td{padding:5px 5px}
  .langs a{padding:10px 8px;font-size:15px}
}
/* the narrowest phones: the language menu as the globe alone (its label names the language) */
@media (max-width:360px){.langs summary > span{display:none}}
@media print{
  .topbar,.toc,.skip-link{display:none}
  .layout{display:block}
  .sheet{box-shadow:none;break-inside:auto}
}
