/* ──────────────────────────────────────────────────────────────────────────
   Little Pagan Land — a desktop with the game running on it.
   OS chrome: the visitor's system font (Segoe UI on Windows), flat and quiet.
   Page inside the browser window: the game's own book — parchment, Jersey 15 /
   Fusion Pixel headings, Alegreya text, gold-and-wood frames from the game UI.
   ────────────────────────────────────────────────────────────────────────── */

/* the game's fonts (GameFonts.cs), subset to the characters the site uses — see tools/subset_fonts.py */
@font-face { font-family: "LPL Jersey"; src: url("fonts/jersey.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Tiny5"; src: url("fonts/tiny5.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Fusion SC"; src: url("fonts/fusion-zh-hans.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Fusion TC"; src: url("fonts/fusion-zh-hant.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Fusion JA"; src: url("fonts/fusion-ja.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Fusion KO"; src: url("fonts/fusion-ko.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Chakra Petch"; src: url("fonts/chakra-petch.woff") format("woff"); font-display: swap; }
@font-face { font-family: "LPL Alegreya"; src: url("fonts/alegreya.woff") format("woff"); font-weight: 400 900; font-display: swap; }

:root {
  --tb: 48px;
  --strip: 176px;
  --os: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --px: "LPL Jersey", "Segoe UI", sans-serif;
  --text: "LPL Alegreya", Georgia, "Times New Roman", serif;
  --ink: #3b1e0d;
  --ink-2: #6e4a30;
  --paper: #fcf6e9;
  --paper-2: #e8cd94;
  --wood: #3b1e0d;
  --wood-2: #5a2e14;
  --gold: #ffd84a;
  --gold-lo: #c27a0c;
  --night: #1d2b4a;
  --moon: #f6e9b2;
}
.script-cyr { --px: "LPL Tiny5", "LPL Jersey", sans-serif; }
.lang-zh-hans {
  --px: "LPL Fusion SC", "LPL Jersey", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
.lang-zh-hant {
  --px: "LPL Fusion TC", "LPL Jersey", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --text: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}
.lang-ja {
  --px: "LPL Fusion JA", "LPL Jersey", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --text: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
}
.lang-ko {
  --px: "LPL Fusion KO", "LPL Jersey", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --text: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
.script-thai {
  --px: "LPL Chakra Petch", "Leelawadee UI", sans-serif;
  --text: "Noto Sans Thai", "Leelawadee UI", "Thonburi", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; height: 100vh; overflow: hidden;
  background: #0a1a47 url("os/wallpaper.webp") center / cover no-repeat;
  font-family: var(--os); color: #fff;
}
img, video, picture, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
.px, .px img { image-rendering: pixelated; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--gold); color: var(--ink); padding: 8px 14px; font-weight: 600; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px #1f1f1f; }

/* ── desktop (Windows 11 look, dark theme, Bloom-style wallpaper) ────── */
.desk { position: fixed; inset: 0 0 var(--tb) 0; }
.dicons { position: absolute; left: 4px; top: 6px; display: grid; gap: 2px; z-index: 1; }
.dicon {
  width: 80px; padding: 6px 2px 6px; display: grid; justify-items: center; gap: 5px; cursor: default;
  color: #fff; text-decoration: none; font: 12px/1.25 var(--os); text-align: center; background: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 1px #000; border: 1px solid transparent; border-radius: 4px;
}
.dicon img, .dicon svg { width: 44px; height: 44px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.dicon:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .12); }
.dicon:focus-visible { outline: none; box-shadow: none; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .5); }

/* ── browser window (Edge-like, light) ─────────────────────────────────── */
.win {
  position: absolute; z-index: 2;
  left: max(96px, calc(50% - 600px)); top: 14px;
  width: min(1240px, calc(100vw - 112px)); height: calc(100vh - var(--tb) - 14px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: #1b1b1b; border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 32px 64px rgba(0, 0, 0, .42), 0 2px 21px rgba(0, 0, 0, .28);
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, .9, .3, 1), height .25s ease;
}
.win.max { left: 0 !important; top: 0 !important; width: 100vw; height: calc(100vh - var(--tb)); border-radius: 0; }
.win.min { opacity: 0; transform: translateY(60px) scale(.94); pointer-events: none; visibility: hidden; transition: opacity .16s ease, transform .2s ease, visibility 0s .2s; }
.win.dragging { transition: none; user-select: none; }
.win-top { height: 40px; flex: none; display: flex; align-items: flex-end; padding-left: 8px; background: #e4e9f0; user-select: none; touch-action: none; }
.tab {
  position: relative; height: 32px; width: 248px; padding: 0 6px 0 12px; display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 8px 8px 0 0; font: 12px/1 var(--os); color: #1b1b1b; white-space: nowrap;
}
.tab::before, .tab::after { content: ""; position: absolute; bottom: 0; width: 8px; height: 8px; background: radial-gradient(circle at 0 0, transparent 7.5px, #fff 8px); }
.tab::before { left: -8px; transform: scaleX(-1); }
.tab::after { right: -8px; }
.tab > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tab-x { width: 24px; height: 24px; border: 0; border-radius: 4px; background: none; display: grid; place-items: center; color: #424242; }
.tab-x:hover { background: rgba(0, 0, 0, .06); }
.tab-x svg { width: 9px; height: 9px; stroke: currentColor; stroke-width: 1.2; }
.win-ctl { margin-left: auto; display: flex; align-self: stretch; }
.win-ctl button { width: 46px; border: 0; background: none; display: grid; place-items: center; color: #1b1b1b; }
.win-ctl svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1; }
.win-ctl button:hover { background: rgba(0, 0, 0, .06); }
.win-ctl .x:hover { background: #c42b1c; color: #fff; }
.win-bar { height: 44px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 8px; background: #fff; border-bottom: 1px solid #e5e5e5; }
.win-bar > button { width: 36px; height: 32px; border: 0; border-radius: 4px; background: none; display: grid; place-items: center; color: #3c3c3c; }
.win-bar > button:hover { background: #f0f0f0; }
.win-bar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.addr {
  flex: 1; height: 32px; margin: 0 8px; padding: 0 14px; display: flex; align-items: center; gap: 10px;
  border-radius: 16px; background: #f3f3f3; font: 14px/1 var(--os); color: #1b1b1b; white-space: nowrap; overflow: hidden;
}
.addr:hover { background: #ececec; }
.addr svg { width: 14px; height: 14px; color: #616161; flex: none; }
.win-body { flex: 1; overflow: auto; overscroll-behavior: contain; scroll-behavior: smooth; background: var(--paper); }
.win-body:focus { outline: none; }
.win-body .site-foot { padding-bottom: calc(24px + var(--strip)); }
.game-off .win-body .site-foot { padding-bottom: 24px; }

/* ── the game strip, always on top like the real overlay ──────────────── */
.habitat {
  position: fixed; left: 0; right: 0; bottom: var(--tb); height: var(--strip); z-index: 50;
  transition: transform .26s cubic-bezier(.3, .8, .3, 1), opacity .2s ease; pointer-events: none;
}
.habitat.gone { transform: translateY(calc(100% + var(--tb))); opacity: 0; pointer-events: none; }
.habitat.flash { animation: flash .5s ease; }
@keyframes flash { 30% { transform: translateY(-6px); } }
#game { width: 100%; height: var(--strip); touch-action: none; pointer-events: auto; -webkit-touch-callout: none; user-select: none; }
.placement-hint {
  position: absolute; top: 6px; left: 8px; right: 54px; width: max-content; max-width: calc(100% - 62px);
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px;
  border: 1px solid #bda16e; border-radius: 10px; background: #fff7df; color: #47341d;
  box-shadow: 0 2px 8px #15200f50; font: 14px/1.35 var(--os); pointer-events: auto;
}
.placement-hint[hidden] { display: none; }
.placement-hint span { min-width: 0; }
.placement-hint button {
  flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 7px;
  background: #6b4c2612; color: inherit; font: 26px/1 var(--os); cursor: pointer;
}
.placement-hint button:focus-visible { outline: 2px solid #76572d; outline-offset: -2px; }
.habitat-still { width: 100%; height: var(--strip); object-fit: cover; object-position: left; }

/* ── taskbar ───────────────────────────────────────────────────────────── */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tb); z-index: 55;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 32, 40, .84); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border-top: 1px solid rgba(255, 255, 255, .08); font: 12px/1 var(--os); color: #fff;
}
.tb-center { display: flex; align-items: center; gap: 4px; }
.tb-btn {
  position: relative; width: 40px; height: 40px; border: 0; border-radius: 4px; background: none; color: #fff;
  display: grid; place-items: center; text-decoration: none; transition: background .1s;
}
.tb-btn svg, .tb-btn img { width: 24px; height: 24px; }
.tb-btn:hover, .start[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }
.tb-btn:active svg, .tb-btn:active img { transform: scale(.88); }
.start .start-glyph { width: 24px; height: 24px; }
.tb-app::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px;
  background: #9da3ad; opacity: 0; transition: width .15s, margin .15s, background .15s;
}
.tb-app.on::after, #task-win::after, #task-game::after { opacity: 1; }
.tb-app.on { background: rgba(255, 255, 255, .06); }
.tb-app.on::after { width: 16px; margin-left: -8px; background: #4cc2ff; }
.tb-app.off::after { opacity: 0; }
.tb-app.off { background: none; }
.tb-search {
  height: 32px; width: 196px; margin: 0 2px; padding: 0 14px; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .78); font: 13px/1 var(--os);
}
.tb-search:hover { background: rgba(255, 255, 255, .1); }
.tb-search svg { width: 15px; height: 15px; color: #fff; }
.tray { position: absolute; right: 0; top: 0; bottom: 0; display: flex; align-items: center; gap: 2px; padding-right: 0; }
.tray-btn {
  height: 40px; padding: 0 8px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 4px; background: none;
  color: #fff; text-decoration: none; font: 12px/1 var(--os);
}
a.tray-btn:hover, button.tray-btn:hover, .tray-chev:hover { background: rgba(255, 255, 255, .08); }
.tray-chev svg { width: 14px; height: 14px; }
.tray-lang { padding: 0 10px; font-size: 12px; }
.tray-qs { gap: 10px; padding: 0 10px; }
.tray-qs svg { width: 16px; height: 16px; }
.tray-qs .mute, .tray-qs[aria-pressed="false"] .wave { display: none; }
.tray-qs[aria-pressed="false"] .mute { display: inline; }
.clock { flex-direction: column; justify-content: center; align-items: flex-end; gap: 3px; padding: 0 10px; min-width: 76px; }
.show-desk { width: 10px; height: 40px; border: 0; margin-left: 4px; background: none; border-left: 1px solid rgba(255, 255, 255, .22); }
.show-desk:hover { background: rgba(255, 255, 255, .08); }

/* start menu */
.start-menu {
  position: fixed; left: 50%; bottom: calc(var(--tb) + 12px); z-index: 70; width: 640px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--tb) - 24px); display: flex; flex-direction: column; overflow: hidden;
  margin-left: -320px; color: #fff; font: 13px/1.3 var(--os);
  background: rgba(36, 38, 46, .9); backdrop-filter: blur(40px) saturate(1.6); -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  animation: rise .2s cubic-bezier(.2, .9, .3, 1);
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.start-menu[hidden] { display: none; }
.sm-search {
  margin: 28px 32px 6px; height: 36px; padding: 0 14px; display: flex; align-items: center; gap: 12px;
  border-radius: 18px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); border-bottom: 2px solid #4cc2ff;
}
.sm-search svg { width: 15px; height: 15px; flex: none; color: #ddd; }
.sm-search input { flex: 1; min-width: 0; border: 0; background: none; color: #fff; font: 13px/1 var(--os); outline: none; }
.sm-search input::placeholder { color: rgba(255, 255, 255, .62); }
.sm-main, .sm-results { padding: 8px 32px 18px; overflow: auto; }
.sm-main[hidden], .sm-results[hidden] { display: none; }
.sm-h { margin: 18px 4px 10px; font: 600 14px/1 var(--os); }
.sm-pins { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.pin {
  width: 100%; height: 84px; padding: 10px 2px 6px; display: grid; justify-items: center; align-content: start; gap: 8px;
  border: 0; border-radius: 4px; background: none; color: #fff; text-decoration: none; font: 12px/1.25 var(--os); text-align: center;
}
.pin svg, .pin img { width: 32px; height: 32px; }
.pin span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin:hover, .sm-rec a:hover, .sm-results a:hover { background: rgba(255, 255, 255, .07); }
.sm-rec, .sm-results { list-style: none; margin: 0; padding-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.sm-results { padding: 14px 32px 18px; grid-template-columns: 1fr; }
.sm-rec a, .sm-results a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 4px; color: #fff; text-decoration: none; }
.sm-rec svg { width: 32px; height: 32px; flex: none; }
.sm-rec span, .sm-results span { display: grid; gap: 3px; min-width: 0; }
.sm-rec b, .sm-results b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-rec small, .sm-results small { color: rgba(255, 255, 255, .62); font-size: 12px; }
.sm-results .ic { width: 32px; height: 32px; flex: none; border-radius: 4px; background: center / 28px no-repeat; }
.ic-browser { background-image: radial-gradient(circle at 40% 35%, #8ee3ff, #1a6fd8 70%); border-radius: 50% !important; transform: scale(.82); }
.ic-doc { background: #fff linear-gradient(#3a8de0, #3a8de0) 7px 11px / 16px 2px no-repeat; box-shadow: inset 0 0 0 1px #b9c3cf; transform: scale(.8, .95); }
.ic-folder { background: linear-gradient(#ffd767, #f2a91f); border-radius: 3px !important; transform: scale(.9, .75); }
.sm-empty { padding: 10px; color: rgba(255, 255, 255, .7); }
.sm-foot { margin-top: auto; flex: none; height: 64px; padding: 0 44px; display: flex; align-items: center; justify-content: space-between; background: rgba(0, 0, 0, .22); border-top: 1px solid rgba(255, 255, 255, .06); }
.sm-user { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; border-radius: 4px; }
.sm-user svg { width: 32px; height: 32px; }
.sm-power { width: 40px; height: 40px; border: 0; border-radius: 4px; background: none; color: #fff; display: grid; place-items: center; }
.sm-power svg { width: 16px; height: 16px; }
.sm-power:hover { background: rgba(255, 255, 255, .08); }

/* the guide: a Windows notification from the game */
.toast {
  position: fixed; right: 12px; bottom: calc(var(--tb) + var(--strip) + 12px); z-index: 60; width: 364px; max-width: calc(100vw - 24px);
  color: #fff; font: 14px/1.4 var(--os);
  background: rgba(40, 42, 50, .94); backdrop-filter: blur(40px) saturate(1.5); -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
}
.toast[hidden] { display: none; }
.toast.in { animation: slidein .32s cubic-bezier(.2, .9, .3, 1); }
@keyframes slidein { from { transform: translateX(calc(100% + 24px)); } }
.game-off .toast { bottom: calc(var(--tb) + 12px); }
.toast-head { height: 40px; padding: 0 6px 0 16px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgba(255, 255, 255, .78); }
.toast-head span { flex: 1; }
.toast-head button { width: 32px; height: 28px; border: 0; border-radius: 4px; background: none; color: #fff; display: grid; place-items: center; }
.toast-head button:hover { background: rgba(255, 255, 255, .08); }
.toast-head svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.2; }
.toast-body { display: flex; gap: 14px; padding: 2px 16px 16px; align-items: flex-start; }
.toast-face { width: 48px; height: 48px; flex: none; }
.toast-body b { display: block; font-weight: 600; margin-bottom: 2px; }
.toast-body p { margin: 0; color: rgba(255, 255, 255, .86); min-height: 2.8em; }
.toast-act { padding: 0 16px 16px; }
.toast-act[hidden] { display: none; }
.toast-act button { width: 100%; height: 32px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 4px; background: rgba(255, 255, 255, .1); color: #fff; font: 14px/1 var(--os); }
.toast-act button:hover { background: rgba(255, 255, 255, .15); }

/* the game's own "Save and exit?" dialog (SaveAndExitDialog, day palette) */
.lpl-dialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10, 8, 14, .35); padding: 16px; }
.lpl-dialog[hidden] { display: none; }
.lpl-dialog-box {
  width: 540px; max-width: 100%; padding: 30px 40px 34px; text-align: center; color: #f6e6d2; font: 15px/1.4 var(--text);
  background: linear-gradient(rgb(106, 49, 72), rgb(54, 25, 45)); border-radius: 15px;
  box-shadow: inset 0 0 0 2px rgb(229, 166, 57), inset 0 0 0 4px rgb(39, 17, 34), inset 0 0 0 5px rgba(255, 218, 126, .4), 0 20px 50px rgba(0, 0, 0, .5);
  animation: rise .18s ease;
}
.lpl-dialog h2 { margin: 6px 0 14px; font: 700 25px/1.1 var(--text); letter-spacing: .06em; color: rgb(255, 218, 126); }
.lpl-dialog p { margin: 0 0 30px; }
.lpl-dialog-act { display: flex; justify-content: center; gap: 33px; flex-wrap: wrap; }
.lpl-dialog-act button {
  height: 43px; min-width: 157px; padding: 0 22px; border-radius: 8px; font: 700 15px/1 var(--text); letter-spacing: .05em; cursor: pointer;
  color: rgb(255, 218, 126); background: rgb(39, 17, 34); border: 2px solid rgb(229, 166, 57);
}
#exit-ok { min-width: 262px; background: rgb(229, 166, 57); color: rgb(39, 17, 34); box-shadow: inset 0 2px rgb(255, 218, 126); }
.lpl-dialog-act button:hover { filter: brightness(1.12); }
.lpl-dialog-act button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: none; }
.relaunch { position: fixed; right: 12px; bottom: 12px; z-index: 60; width: 56px; height: 56px; border: 0; border-radius: 14px; display: grid; place-items: center; background: rgba(30, 32, 40, .9); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.relaunch[hidden] { display: none; }

/* ── pixel buttons (the game's gold buttons) ───────────────────────────── */
.cta { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; }
.pbtn {
  display: inline-block; padding: 8px 18px 11px; font: 24px/1 var(--px); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: #f6e3b4; box-shadow: inset 0 3px #fff6dc, inset 0 -4px #c9a56c, 0 0 0 3px var(--ink), 0 5px 0 3px #24100a;
  transition: transform .06s ease; cursor: pointer; border: 0;
}
.pbtn-gold { background: var(--gold); box-shadow: inset 0 3px #fff0a0, inset 0 -4px var(--gold-lo), 0 0 0 3px var(--ink), 0 5px 0 3px #24100a; }
.pbtn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.pbtn:active { transform: translateY(3px); box-shadow: inset 0 3px #fff0a0, inset 0 -2px var(--gold-lo), 0 0 0 3px var(--ink), 0 2px 0 3px #24100a; }
.pbtn:focus-visible { outline: 3px solid #fff; outline-offset: 5px; box-shadow: inset 0 3px #fff0a0, inset 0 -4px var(--gold-lo), 0 0 0 3px var(--ink), 0 5px 0 3px #24100a; }
.pbtn-sm { font-size: 20px; padding: 5px 12px 8px; box-shadow: inset 0 2px #fff0a0, inset 0 -3px var(--gold-lo), 0 0 0 2px var(--ink), 0 3px 0 2px #24100a; }
:is(.script-cjk, .script-thai) .pbtn { font-size: 20px; padding: 10px 18px 12px; }
:is(.script-cjk, .script-thai) .pbtn-sm { font-size: 20px; padding: 5px 12px 7px; }

/* ── the page inside the window: the game's book ───────────────────────── */
.page { color: var(--ink); font: 19px/1.6 var(--text); min-height: 100%; display: flex; flex-direction: column; }
:is(.script-cjk, .script-thai) .page { font-size: 17px; line-height: 1.85; }
.page a { color: #7a3a10; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.page a:hover { color: #a3470c; }
.page p { margin: 0; }
.page p + p { margin-top: .8em; }
.page h1, .page h2, .page h3 { font-family: var(--px); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: .01em; }
.page h2 { font-size: 38px; color: var(--wood-2); }
:is(.script-cjk, .script-thai) .page h2 { font-size: 30px; line-height: 1.3; }
.page :focus-visible { outline: 3px solid var(--wood-2); outline-offset: 3px; box-shadow: none; }

.site-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 22px; padding: 10px max(26px, calc((100% - 1120px) / 2));
  background: rgba(252, 246, 233, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #ecdcbc; box-shadow: 0 6px 18px -12px rgba(59, 30, 13, .35);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink) !important; text-decoration: none; font: 24px/1 "LPL Jersey", var(--px); margin-right: auto; }
.brand img { width: 24px; height: 24px; }
.site-nav ul, .foot-links, .link-list { list-style: none; margin: 0; padding: 0; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a { display: block; color: var(--ink) !important; text-decoration: none; font: 22px/1 var(--px); padding: 6px 12px 7px; border-radius: 6px; }
:is(.script-cjk, .script-thai) .site-nav a { font-size: 20px; }
.site-nav a:hover { background: #f3e5c6; }
.site-nav a[aria-current="page"] { background: #f6e0a6; box-shadow: inset 0 -3px var(--gold-lo); }

/* hero */
.hero { position: relative; text-align: center; padding: 22px 32px 40px; }

.hero-title { display: grid; justify-items: center; gap: 4px; }
.hero-logo { width: 12.5rem; filter: drop-shadow(0 6px 0 rgba(59, 30, 13, .22)); }
.tagline {
  /* Jersey 15 draws on a 27-unit grid: 27px puts every font pixel on one screen pixel, outline in whole pixels */
  font-size: 27px; line-height: 36px; letter-spacing: 1px; color: var(--gold); margin-top: 6px;
  text-shadow: 2px 0 #4a1a04, -2px 0 #4a1a04, 0 2px #4a1a04, 0 -2px #4a1a04, 2px 2px #4a1a04, -2px 2px #4a1a04, 2px -2px #4a1a04, -2px -2px #4a1a04,
    0 4px #2a0d02, 2px 4px #2a0d02, -2px 4px #2a0d02;
}
:is(.script-cjk, .script-thai) .tagline { font-size: 30px; line-height: 40px; letter-spacing: 2px; }
.lede { max-width: 42rem; margin: 12px auto 22px !important; font-size: 20px; line-height: 1.5; }
:is(.script-cjk, .script-thai) .lede { font-size: 18px; }
.hero .cta { justify-content: center; }
.status { margin-top: 20px !important; font-style: italic; color: var(--ink-2); font-size: 17px; }
:is(.script-cjk, .script-thai) .status { font-style: normal; font-size: 15px; }
.try {
  max-width: 50rem; margin: 30px auto 0; padding: 16px 20px 18px; text-align: left;
  background: #fff; border: 1px solid #ecdcbc; border-radius: 14px; box-shadow: 0 10px 30px -18px rgba(59, 30, 13, .5);
}
.try-t { display: flex; align-items: center; gap: 10px; font: 22px/1.2 var(--px); color: var(--wood-2); }
:is(.script-cjk, .script-thai) .try-t { font-size: 20px; }
.try-steps { list-style: none; counter-reset: s; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 22px; font-size: 16px; line-height: 1.4; }
.try-steps li { counter-increment: s; display: flex; gap: 8px; }
.try-steps li::before { content: counter(s); flex: none; width: 22px; height: 22px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); font: 700 13px/1 var(--os); }
.try-arrow { flex: none; width: 18px; height: 22px; background: var(--gold);
  clip-path: polygon(30% 0, 70% 0, 70% 55%, 100% 55%, 50% 100%, 0 55%, 30% 55%); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* sections */
.sec { position: relative; padding: 48px max(40px, calc((100% - 1080px) / 2)); }
.sec::before { content: ""; position: absolute; left: max(40px, calc((100% - 1080px) / 2)); right: max(40px, calc((100% - 1080px) / 2)); top: 0; height: 0; border-top: 2px dotted #d4b27a; }
.sec::after { content: ""; position: absolute; left: 50%; top: -16px; width: 32px; height: 32px; margin-left: -16px; background: url("os/sun-32.png") 0 0 / 32px; image-rendering: pixelated; }
.sec-text h2 + p { margin-top: 14px; }
.sec-text.narrow { max-width: 46rem; }
.sec-text.narrow + * { margin-top: 26px; }
.sec-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.shots { display: grid; gap: 18px; }

.frame { margin: 0; }
.frame > img, .frame > video, .frame > picture, .frame > a {
  display: block; width: 100%; background: var(--wood);
  box-shadow: 0 0 0 2px #2a1208, 0 0 0 6px #d9a441, 0 0 0 8px #6b3a12, 0 8px 0 8px rgba(42, 18, 8, .22);
}
.frame > picture img { width: 100%; }
.frame figcaption { margin-top: 16px; font-size: 16px; line-height: 1.45; font-style: italic; color: var(--ink-2); }
:is(.script-cjk, .script-thai) .frame figcaption { font-style: normal; font-size: 14px; }
.frame.wide { max-width: 100%; }
.frame.mid { max-width: 40rem; }
.look { display: flex; align-items: center; gap: 12px; margin-top: 20px !important; font: 22px/1.3 var(--px); color: var(--wood-2); max-width: 40rem; }
:is(.script-cjk, .script-thai) .look { font-size: 20px; }
.look .try-arrow { background: var(--gold-lo); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

.sec-night { background: var(--night); color: #e3e9f6; }
.sec-night::before { border-top-color: transparent; }
.sec-night::after { background-image: url("ui/tab-moon.png"); background-size: 0; }
.sec-night h2 { color: var(--moon); }
.sec-night .frame figcaption { color: #b9c4dc; }
.cards { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.card { display: grid; justify-items: center; gap: 8px; text-align: center; }
.card img { width: 128px; height: 128px; }
.card span { font: 22px/1 var(--px); color: var(--gold); }
:is(.script-cjk, .script-thai) .card span { font-size: 20px; }
.card-locked span { color: #b9c4dc; }

.items { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; }
.items li { display: flex; align-items: center; gap: 12px; font: 24px/1 var(--px); color: var(--wood-2); }
:is(.script-cjk, .script-thai) .items li { font-size: 20px; }
.slot { width: 60px; height: 60px; flex: none; display: grid; place-items: center; background: #fbecc8;
  box-shadow: inset 0 0 0 2px #2a1208, inset 0 0 0 5px #d9a441, inset 0 0 0 7px #6b3a12, 0 4px 0 rgba(42, 18, 8, .18); }
.slot img { max-width: none; }

.sec-demo { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.plaque { border: 44px solid transparent; border-image: url("ui/price-plaque.png") 44 fill / 44px stretch; padding: 0 10px; max-width: 34rem; }
.plaque h2 { margin: -12px 0 12px; }
.plaque .cta { margin: 20px 0 -14px; }

.sec-facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; }
.facts { margin: 16px 0 0; font-size: 17px; }
.fact { display: grid; grid-template-columns: 11rem 1fr; gap: 4px 16px; padding: 9px 0; border-top: 2px dotted #b68b55; }
.fact:last-child { border-bottom: 2px dotted #b68b55; }
.fact dt { font-weight: 700; }
.fact dd { margin: 0; }
.sec-facts h2 + p { margin-top: 14px; }
.closing { margin-top: 20px !important; padding-top: 16px; border-top: 2px dotted #b68b55; }

.site-foot { margin-top: auto; padding: 20px max(26px, calc((100% - 1120px) / 2)) 24px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center;
  background: #f3e7cc; color: var(--ink-2); font-size: 15px; border-top: 1px solid #e6d3ad; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--ink) !important; }

/* faq & press */
.page-head { padding: 38px max(40px, calc((100% - 1080px) / 2)) 12px; }
.page-head h1 { font-size: 54px; line-height: 60px; color: var(--gold);
  text-shadow: 2px 0 #4a1a04, -2px 0 #4a1a04, 0 2px #4a1a04, 0 -2px #4a1a04, 2px 2px #4a1a04, -2px 2px #4a1a04, 2px -2px #4a1a04, -2px -2px #4a1a04,
    0 4px #2a0d02, 2px 4px #2a0d02, -2px 4px #2a0d02; }
:is(.script-cjk, .script-thai) .page-head h1 { font-size: 40px; line-height: 1.25; }
.intro { margin-top: 18px !important; max-width: 46rem; }
.doc { padding: 14px max(40px, calc((100% - 1080px) / 2)) 48px; }
.doc > * { max-width: 58rem; }
.toc { margin: 8px 0 26px; padding: 18px 22px 20px; background: #fff; border: 1px solid #ecdcbc; border-radius: 14px; }
.toc h2 { font-size: 26px; }
.toc ul { margin: 10px 0 0; padding-left: 1.2rem; font-size: 17px; columns: 2; column-gap: 2rem; }
.toc li { break-inside: avoid; margin-bottom: 4px; }
.toc li::marker { color: var(--gold-lo); }
.qa { padding: 22px 0; border-top: 2px dotted #b68b55; scroll-margin-top: 70px; }
.qa h2 { font-size: 30px; margin-bottom: 10px; }
:is(.script-cjk, .script-thai) .qa h2 { font-size: 20px; line-height: 1.5; }
.qa:target h2 { background: linear-gradient(transparent 55%, rgba(255, 216, 74, .7) 55%); }
.doc > .closing { margin: 10px 0 22px !important; }
.block { padding-top: 30px; }
.block h2, .copyable h2 { font-size: 32px; margin-bottom: 12px; }
:is(.script-cjk, .script-thai) .block h2, :is(.script-cjk, .script-thai) .copyable h2 { font-size: 30px; }
.copyable + .copyable { margin-top: 26px; }
.copy-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.copy-btn { font: 18px/1 var(--px); padding: 4px 10px 6px; border: 0; background: #f6e3b4; color: var(--ink); box-shadow: 0 0 0 2px var(--ink); cursor: pointer; }
.copy-btn:hover { background: var(--gold); }
.copy-text { padding: 16px 20px; background: #fff; border: 1px solid #ecdcbc; border-radius: 10px; }
.sheet { width: 100%; border-collapse: collapse; font-size: 17px; }
.sheet th, .sheet td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-top: 2px dotted #b68b55; }
.sheet tr:last-child > * { border-bottom: 2px dotted #b68b55; }
.sheet th { width: 34%; }
.note { margin-top: 10px !important; font-size: 16px; font-style: italic; color: var(--ink-2); }
.features, .link-list { padding-left: 1.2rem; }
.link-list { list-style: disc; }
.features li + li { margin-top: 8px; }
.features li::marker, .link-list li::marker { color: var(--gold-lo); }
.block .pbtn { margin: 16px 0 6px; }
.press-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-top: 26px; }
.logo-well { aspect-ratio: 16 / 9; padding: 18px; background: repeating-conic-gradient(#e8dcc0 0 25%, #fbf3e0 0 50%) 0 0 / 22px 22px !important; }
.logo-well img { width: 100%; height: 100%; object-fit: contain; }
.dl { white-space: nowrap; font-style: normal; }

/* background switch, wired to the live strip */
.bgswitch { display: inline-flex; align-items: center; gap: 0; margin-top: 22px; box-shadow: 0 0 0 3px var(--ink), 0 5px 0 3px #24100a; }
.bgswitch-label { padding: 0 14px; font: 20px/1 var(--px); color: #f6e3b4; background: var(--wood); align-self: stretch; display: grid; place-items: center; }
.bgswitch button { border: 0; padding: 8px 16px 10px; font: 22px/1 var(--px); background: #f6e3b4; color: var(--ink); cursor: pointer; }
.bgswitch button[aria-pressed="true"] { background: var(--gold); box-shadow: inset 0 3px #fff0a0, inset 0 -4px var(--gold-lo); }
.sec-text .note { margin-top: 18px !important; }
.no-js .js-only { display: none !important; }

/* Russian and Ukrainian: Tiny5, as in the game's menu */
.script-cyr .page h2, .script-cyr .block h2, .script-cyr .copyable h2 { font-size: 32px; line-height: 1.2; }
.script-cyr .site-nav a, .script-cyr .pbtn, .script-cyr .card span, .script-cyr .items li, .script-cyr .try-t, .script-cyr .look,
.script-cyr .bgswitch button, .script-cyr .bgswitch-label { font-size: 24px; }
.script-cyr .pbtn-sm, .script-cyr .copy-btn, .script-cyr .qa h2 { font-size: 16px; }
.script-cyr .qa h2 { font-size: 24px; line-height: 1.3; }
.script-cyr .tagline { font-size: 32px; line-height: 40px; }
.script-cyr .page-head h1 { font-size: 40px; line-height: 48px; }
.script-cyr .brand { font-family: "LPL Jersey", sans-serif; }
.script-thai .page { line-height: 1.75; }
.script-thai .page h2, .script-thai .page h1 { font-weight: 600; }

/* ── language pickers ──────────────────────────────────────────────────── */
.langpick { position: relative; }
.langpick summary {
  list-style: none; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: #f1e4c8; color: var(--ink); font: 14px/1 var(--os); white-space: nowrap;
}
.langpick summary::-webkit-details-marker { display: none; }
.langpick summary::after { content: ""; width: 7px; height: 7px; margin: -3px 0 0 2px; border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.langpick[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.langpick summary svg { width: 16px; height: 16px; }
.langpick summary:hover { background: #ead9b5; }
.langpick ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 2px; width: max-content;
  background: #fff; border: 1px solid #ecdcbc; border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(59, 30, 13, .45);
}
.langpick a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink) !important; text-decoration: none; font: 14px/1.2 var(--os); }
.langpick a:hover { background: #f6ecd6; }
.langpick a[aria-current] { background: #f6e0a6; font-weight: 600; }
.lang-flyout {
  position: fixed; right: 12px; bottom: calc(var(--tb) + 12px); z-index: 72; width: 320px; max-height: calc(100vh - var(--tb) - 24px); overflow: auto;
  padding: 14px 8px 8px; color: #fff; font: 13px/1.3 var(--os);
  background: rgba(36, 38, 46, .94); backdrop-filter: blur(40px) saturate(1.6); -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, .5); animation: rise .18s ease;
}
.lang-flyout[hidden] { display: none; }
.lang-flyout h2 { margin: 0 10px 10px; font: 600 14px/1 var(--os); }
.lang-flyout ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lang-flyout a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 4px; color: #fff; text-decoration: none; }
.lang-flyout a:hover { background: rgba(255, 255, 255, .07); }
.lang-flyout a[aria-current] { background: rgba(255, 255, 255, .1); box-shadow: inset 3px 0 #4cc2ff; }
.lang-flyout .lc { min-width: 34px; color: rgba(255, 255, 255, .62); font-size: 12px; }
.tray-lang[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }

/* ── small screens: no desktop, just the page and the forest ───────────── */
@media (max-width: 860px), (max-height: 560px) {
  body { height: auto; overflow: auto; background: var(--paper); padding-bottom: var(--strip); }
  .desk { position: static; }
  .dicons, .win-top, .win-bar, .taskbar, .start-menu { display: none !important; }
  .habitat.gone { transform: translateY(100%); }
  .game-off .toast, .toast { right: 8px; left: 8px; width: auto; bottom: calc(var(--strip) + 8px); }
  .game-off .toast { bottom: 8px; }
  .try-steps { grid-template-columns: 1fr; }
  .toc ul { columns: 1; }
  .sec::before { left: 18px !important; right: 18px !important; }
  .win { position: static; width: auto; height: auto; border-radius: 0; box-shadow: none; transform: none !important; opacity: 1 !important; pointer-events: auto !important; background: transparent; }
  .win-body { overflow: visible; background: none; }
  .win-body .site-foot { padding-bottom: 24px; }
  .habitat { bottom: 0; }
  .site-bar { flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .site-nav { order: 3; width: 100%; }
  .site-nav ul { flex-wrap: wrap; }
  .site-bar > .pbtn { display: none; }
  .langpick { position: static; }
  .langpick ul {
    right: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(330px, calc(100vw - 32px));
    max-height: min(320px, calc(100dvh - var(--strip) - 100px)); overflow-y: auto;
  }
  .hero { padding: 30px 16px; }
  .hero::before, .hero::after { width: 48px; height: 48px; background-size: 48px; }
  .hero-logo { width: 16rem; }
  :is(.script-cjk, .script-thai) .tagline { font-size: 20px; line-height: 30px; }
  :is(.script-cjk, .script-thai) .page h2 { font-size: 24px; }
  .lede { font-size: 18px; }
  .sec, .page-head, .doc, .site-foot { padding-left: 18px; padding-right: 18px; }
  .sec::before { left: 18px; right: 18px; }
  .sec-split, .sec-facts, .pair, .press-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card img { width: 96px; height: 96px; }
  .fact { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 27px; line-height: 36px; }
  .plaque { border-width: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 404 */
.nf-body { height: auto; overflow: auto; background: var(--paper); color: var(--ink); font-family: var(--text); }
.nf { max-width: 700px; margin: 60px auto; padding: 0 20px; }
.nf h2 { font: 40px/1 var(--px); margin: 30px 0 10px; color: var(--wood-2); }
