/* Minecraft's own interface language: grey bevelled containers, slots, a hotbar,
   purple tooltips, chunky pixel type for numbers and Latin, and a GTA-style radar. */

@font-face { font-family: "Pixelify Sans"; src: url("assets/fonts/pixelify-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("assets/fonts/pixelify-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --gui: #c6c6c6;
  --gui-light: #ffffff;
  --gui-shade: #555555;
  --ink: #2b2b2b;
  --ink-soft: #4a4a4a;
  --slot: #8b8b8b;
  --slot-shade: #373737;
  --line: #000000;
  --accent: #2f5b46;
  --gold: #f2c14e;
  --pixel: "Pixelify Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --text: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; background: #7fb2e8; font-family: var(--text); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#world { position: fixed; inset: 0; }
#world canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#world, #hud, #bigmap { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#minimap canvas { touch-action: manipulation; }

/* ---------- Bevelled pieces ---------- */
.gui, dialog#panel {
  background: var(--gui);
  box-shadow: 0 0 0 2px var(--line), inset 3px 3px 0 var(--gui-light), inset -3px -3px 0 var(--gui-shade);
}
.mc-button, .page .links a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border: 0;
  font: 600 15px/1 var(--pixel); color: #fff; text-decoration: none; text-shadow: 2px 2px 0 #3f3f3f;
  background: #6f6f6f;
  box-shadow: 0 0 0 2px var(--line), inset 2px 2px 0 rgba(255, 255, 255, .32), inset -2px -3px 0 rgba(0, 0, 0, .38);
}
.mc-button:hover, .page .links a:hover { background: #7f87b8; box-shadow: 0 0 0 2px #fff, inset 2px 2px 0 rgba(255, 255, 255, .32), inset -2px -3px 0 rgba(0, 0, 0, .38); }
.mc-button:active, .page .links a:active { transform: translateY(1px); }

/* ---------- Hotbar ---------- */
#hotbar {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 0; padding: 3px;
  background: rgba(20, 20, 20, .55);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .7), inset 0 0 0 2px rgba(150, 150, 150, .55);
  z-index: 10;
}
#hotbar button {
  position: relative; width: 50px; height: 50px; padding: 0; border: 0; background: transparent;
  box-shadow: inset 0 0 0 2px rgba(120, 120, 120, .55);
}
#hotbar button img { width: 32px; height: 32px; image-rendering: pixelated; display: block; margin: auto; }
#hotbar button.on::after {
  content: ""; position: absolute; inset: -4px; pointer-events: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(0, 0, 0, .65), inset 0 0 0 2px rgba(0, 0, 0, .5);
}
#hotbar button:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Experience bar ---------- */
/* Minecraft's own: a thin green bar riding on the hotbar, the level in green above it.
   The bar is this week's handed-in work against the target; the number is the total. */
#xp { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); }
#xp i { display: block; height: 10px; background: #1b1b1b; box-shadow: 0 0 0 2px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(150, 150, 150, .3); }
#xp s { display: block; width: 0; height: 100%; background: linear-gradient(#a8ff5a, #5fcf17); box-shadow: inset 0 -2px #3f9c0e; transition: width .4s ease-out; }
#xp b { position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); font: 600 20px/1 var(--pixel); color: #80ff20; text-shadow: 2px 2px 0 #15210c; letter-spacing: 1px; pointer-events: none; }
#xp b:empty { display: none; }

/* ---------- Corner switches ---------- */
#corner { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; display: flex; gap: 10px; z-index: 10; }
#corner button {
  width: 44px; height: 44px; padding: 0; border: 0; background: #6f6f6f;
  box-shadow: 0 0 0 2px var(--line), inset 2px 2px 0 rgba(255, 255, 255, .32), inset -2px -3px 0 rgba(0, 0, 0, .38);
  display: grid; place-items: center;
}
#corner button:hover { background: #7f87b8; }
#corner button span { width: 32px; height: 32px; image-rendering: pixelated; background: center / contain no-repeat; }
#soundButton[aria-pressed="false"] span { opacity: .55; }
#viewButton[aria-pressed="true"], #webButton[aria-pressed="true"] { background: #7f87b8; }
#webButton[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--line), 0 0 0 4px #e8352b, inset 2px 2px 0 rgba(255, 255, 255, .32), inset -2px -3px 0 rgba(0, 0, 0, .38); }
#moodButton { position: relative; }
#moodButton b { position: absolute; right: -4px; bottom: -6px; padding: 1px 3px; font: 600 11px/1 var(--pixel); color: #fff; background: rgba(12, 23, 20, .85); text-shadow: 1px 1px 0 #000; pointer-events: none; }
#moodButton b:empty { display: none; }
#moodButton[aria-expanded="true"] { background: #7f87b8; }
#weatherMenu { position: fixed; right: 16px; top: calc(max(16px, env(safe-area-inset-top)) + 58px); z-index: 35; width: min(280px, calc(100vw - 32px)); max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - 74px - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; padding: 12px; color: #ece8dc; border: 1px solid #7c897a; background: #1d2c23; box-shadow: 0 8px 18px rgba(0,0,0,.28); }
#weatherMenu h2 { margin: 0 0 8px; font: 600 14px var(--pixel); color: #c1c9b8; }
#weatherMenu h2:not(:first-child) { margin-top: 16px; }
#weatherMenu [role="radiogroup"] { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#weatherMenu button { min-height: 44px; border: 1px solid #596c5b; background: #293b2e; color: #eee9df; font: 600 15px var(--pixel); }
#weatherMenu button[aria-checked="true"] { background: #587258; border-color: #d0cfb9; }
#weatherMenu button:focus-visible { outline: 2px solid #e6dbbd; outline-offset: 2px; }
#weatherMenu .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
#weatherMenu #environmentDone { background: #52644d; }
#weatherMenu .now { margin: 0 0 12px; font: 600 15px var(--pixel); color: #eee9df; }
#weatherMenu p { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: #c1c9b8; }
/* The web-zip marker: a small spider (white legs, red body), not a ring. */
#aim { position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; z-index: 9;
  background: center / contain no-repeat url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><g fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M13.5 12.5 9 8.5 7 3M13 15 7.5 13 2.5 11.5M13 17.5 7.5 19.5 2.5 22.5M13.5 20 9 24 7 29'/><path d='M18.5 12.5 23 8.5 25 3M19 15 24.5 13 29.5 11.5M19 17.5 24.5 19.5 29.5 22.5M18.5 20 23 24 25 29'/></g><ellipse cx='16' cy='12.2' rx='2.9' ry='2.7' fill='%23e8352b' stroke='%23fff' stroke-width='1.4'/><ellipse cx='16' cy='19' rx='3.8' ry='5.2' fill='%23e8352b' stroke='%23fff' stroke-width='1.4'/></svg>");
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .9)) drop-shadow(0 0 5px rgba(232, 53, 43, .55)); }
#crosshair { position: fixed; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none; z-index: 9; mix-blend-mode: difference; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; }
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
#crosshair::after { left: 0; top: 8px; width: 18px; height: 2px; }

/* ---------- Radar, bottom left like GTA ---------- */
#minimap {
  position: fixed; left: 20px; bottom: max(20px, env(safe-area-inset-bottom)); width: 204px; height: 204px; z-index: 10;
  border-radius: 18px; overflow: hidden;
  background: #1b2420;
  box-shadow: 0 0 0 3px rgba(10, 12, 14, .82), 0 6px 18px rgba(0, 0, 0, .35);
}
#minimap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
#minimap .zoom { position: absolute; right: 6px; top: 6px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .15s; }
#minimap:hover .zoom, #minimap:focus-within .zoom { opacity: 1; }
#minimap .zoom button, #minimap .expand {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  background: rgba(10, 12, 14, .7); color: #fff; font: 600 18px/1 var(--pixel);
}
#minimap .expand { position: absolute; left: 6px; top: 6px; opacity: 0; transition: opacity .15s; background: rgba(10, 12, 14, .7) center / 20px no-repeat; image-rendering: pixelated; }
#minimap:hover .expand, #minimap .expand:focus-visible { opacity: 1; }
#minimap .powered {
  position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px; padding: 3px 7px 3px 3px;
  border-radius: 6px; background: rgba(10, 12, 14, .7); color: #fff; text-decoration: none; font: 10px/1 -apple-system, "PingFang SC", sans-serif;
}
#minimap .powered img { width: 16px; height: 16px; border-radius: 4px; }
#minimap .powered span { opacity: .7; }
#minimap .powered b { font-weight: 600; }
#minimap .powered:hover { background: rgba(10, 12, 14, .88); }

#bigmap { position: fixed; inset: 0; z-index: 30; background: rgba(8, 12, 16, .78); display: grid; place-items: center; }
#bigmap canvas { width: min(92vw, 1100px); height: min(84vh, 860px); border-radius: 14px; box-shadow: 0 0 0 3px rgba(0, 0, 0, .8), 0 20px 60px rgba(0, 0, 0, .5); cursor: grab; touch-action: none; }
#bigmap canvas:active { cursor: grabbing; }
#bigmap .close { position: fixed; top: 18px; right: 18px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .6); color: #fff; font: 600 26px/1 var(--pixel); }

/* ---------- Tooltip ---------- */
#tooltip {
  position: fixed; z-index: 40; pointer-events: none; padding: 5px 9px 6px;
  font: 600 15px/1.3 var(--pixel); color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  background: rgba(16, 0, 16, .94);
  box-shadow: inset 0 0 0 2px rgba(80, 0, 255, .55), 0 0 0 2px rgba(16, 0, 16, .94);
  white-space: nowrap;
}

/* ---------- The prompt, bottom right ---------- */
#prompt {
  position: fixed; right: 20px; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 12;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 0;
  font: 600 16px/1 var(--pixel); color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  background: rgba(16, 16, 18, .72);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .14);
  animation: nudge .18s ease-out;
}
#prompt:hover { background: rgba(40, 40, 46, .8); }
@keyframes nudge { from { transform: translateY(8px); opacity: 0; } }
#prompt kbd {
  display: grid; place-items: center; width: 28px; height: 28px; font: 600 15px/1 var(--pixel); color: #2b2b2b; text-shadow: none;
  background: #e8e8e8; box-shadow: inset -2px -3px 0 #9a9a9a, inset 2px 2px 0 #fff, 0 0 0 2px #000;
}
#prompt .icon { width: 24px; height: 24px; image-rendering: pixelated; background: center / contain no-repeat; }
@media (pointer: coarse) { #prompt kbd { display: none; } #prompt { padding-left: 10px; } }

/* ---------- Phone, bottom right like GTA ---------- */
/* Only the handset for now: it slides up and back, and nothing on it responds. */
#phone {
  --s: 1;
  position: fixed; right: 30px; bottom: 26px; z-index: 15; width: 232px; height: 478px; padding: 8px;
  border-radius: 40px; background: linear-gradient(150deg, #5a5f66, #23262a 34%, #17191c 70%, #3e4248);
  box-shadow: 0 0 0 1.5px #08090a, inset 0 0 0 1.5px rgba(255, 255, 255, .16), inset 0 0 0 4px #0c0d0f, 0 22px 44px rgba(0, 0, 0, .45);
  transform-origin: 100% 100%; transform: translateY(calc(100% + 60px)) rotate(4deg) scale(var(--s)); visibility: hidden;
  transition: transform .24s cubic-bezier(.5, 0, .75, .4), visibility 0s .24s;
  pointer-events: auto; user-select: none; -webkit-user-select: none;
}
#phone.up { transform: scale(var(--s)); visibility: visible; transition: transform .34s cubic-bezier(.2, .95, .3, 1.08), visibility 0s; }
#phone .screen {
  position: relative; height: 100%; overflow: hidden; border-radius: 32px; color: #fff;
  background: radial-gradient(120% 55% at 15% 0%, rgba(98, 132, 255, .55), transparent 70%), radial-gradient(90% 45% at 100% 62%, rgba(255, 150, 104, .42), transparent 70%), linear-gradient(#141b33, #2c2647 52%, #59384b);
  font: 500 11px/1.2 var(--text); text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
#phone .island { position: absolute; top: 10px; left: 50%; width: 74px; height: 22px; margin-left: -37px; border-radius: 12px; background: #000; }
#phone .status { display: flex; align-items: center; gap: 5px; height: 42px; padding: 0 22px 0 26px; font: 600 13px/1 var(--pixel); }
#phone .status time { margin-right: auto; }
#phone .signal { display: flex; align-items: flex-end; gap: 1.5px; height: 9px; }
#phone .signal i { width: 2.5px; background: #fff; border-radius: 1px; }
#phone .signal i:nth-child(1) { height: 3px; } #phone .signal i:nth-child(2) { height: 5px; } #phone .signal i:nth-child(3) { height: 7px; } #phone .signal i:nth-child(4) { height: 9px; }
#phone .battery { position: relative; width: 20px; height: 10px; margin-left: 4px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 3px; }
#phone .battery::before { content: ""; position: absolute; inset: 1px 5px 1px 1px; border-radius: 1px; background: #fff; }
#phone .battery::after { content: ""; position: absolute; right: -4px; top: 2px; width: 2px; height: 3px; border-radius: 0 1px 1px 0; background: rgba(255, 255, 255, .55); }
#phone .today { margin-top: 18px; text-align: center; }
#phone .today span { font-size: 12px; opacity: .88; letter-spacing: .5px; }
#phone .today b { display: block; margin-top: 2px; font: 600 60px/1 var(--pixel); letter-spacing: 1px; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
#phone .apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 6px; margin-top: 40px; padding: 0 16px; }
#phone .app { display: grid; justify-items: center; gap: 6px; }
#phone .app i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 3px 8px rgba(0, 0, 0, .28); }
#phone .app span { width: 32px; height: 32px; image-rendering: pixelated; background: center / contain no-repeat; }
#phone .bar { position: absolute; bottom: 8px; left: 50%; width: 92px; height: 4px; margin-left: -46px; border-radius: 2px; background: rgba(255, 255, 255, .85); }
#phoneButton[aria-pressed="true"] { background: #7f87b8; }
body.phone-on #prompt { right: 286px; }
@media (max-height: 640px) { #phone { --s: .82; } body.phone-on #prompt { right: 246px; } }
@media (max-height: 480px) { #phone { --s: .6; } body.phone-on #prompt { right: 190px; } }

/* ---------- Touch ---------- */
#shootButton {
  position: fixed; right: 22px; bottom: 96px; z-index: 10; width: 72px; height: 72px; border: 0; border-radius: 50%;
  background: rgba(20, 20, 20, .5) center / 44px no-repeat; image-rendering: pixelated;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .55);
}

/* ---------- Panels ---------- */
dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .38); }
dialog#panel {
  position: fixed; top: 78px; right: 20px; left: auto; bottom: auto; margin: 0; z-index: 20;
  width: min(440px, calc(100vw - 40px)); max-height: calc(100vh - 78px - 100px);
  overflow: hidden; display: none; flex-direction: column;
}
dialog#panel[open] { display: flex; animation: slide .16s ease-out; }
@keyframes slide { from { transform: translateX(14px); opacity: 0; } }
#panel header { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px 20px; }
#panel header .icon { width: 32px; height: 32px; image-rendering: pixelated; background: center / contain no-repeat; flex: none; }
#panel h2 { margin: 0; flex: 1; font: 600 22px/1.2 var(--pixel); letter-spacing: .5px; color: #3f3f3f; }
.close { width: 40px; height: 40px; border: 0; background: transparent; font: 600 26px/1 var(--pixel); color: #3f3f3f; }
.close:hover { color: #000; }
#panel .body { padding: 4px 22px 24px; overflow: auto; overscroll-behavior: contain; outline: none; }
#panel .body > h2 { display: none; }

.page p { margin: 0 0 12px; font-size: 16px; line-height: 1.75; max-width: 62ch; }
.page .aside { color: var(--ink-soft); font-size: 15px; }
.page .links { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 4px; }
.page .links a { min-height: 36px; font-size: 14px; padding: 0 14px; }
/* Product names must read exactly: Pixelify 600 at this size turns "B" into "G". */
.page h3 { margin: 0 0 4px; font: 600 17px/1.35 var(--text); color: #3f3f3f; }

.items, .feats, .list, .contact { list-style: none; margin: 0; padding: 0; }
.items li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 14px 0; }
.items li + li { border-top: 2px solid rgba(0, 0, 0, .14); }
.items img {
  width: 64px; height: 64px; padding: 8px; background: var(--slot);
  box-shadow: inset 2px 2px 0 var(--slot-shade), inset -2px -2px 0 var(--gui-light);
}
.items p { margin-bottom: 6px; }

/* Honours read like advancements: a framed icon, a title, one line. */
.feats li { position: relative; padding: 12px 0 12px 64px; min-height: 64px; }
.feats li + li { border-top: 2px solid rgba(0, 0, 0, .14); }
.feats li::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 48px; height: 48px;
  background: #e2c46a var(--icon, none) center / 32px no-repeat; image-rendering: pixelated;
  box-shadow: 0 0 0 2px #000, inset 3px 3px 0 #fff3b0, inset -3px -3px 0 #a07a22;
}
.feats li[data-frame="goal"]::before { border-radius: 10px; }
.feats li[data-frame="challenge"]::before { clip-path: polygon(14% 0, 86% 0, 100% 14%, 100% 86%, 86% 100%, 14% 100%, 0 86%, 0 14%); background-color: #c9a8e8; box-shadow: inset 3px 3px 0 #efe0ff, inset -3px -3px 0 #7d58a8; }
.feats p { margin-bottom: 4px; }
.feats .links { margin-top: 8px; }

.list li { padding: 10px 0; border-top: 2px solid rgba(0, 0, 0, .14); }
.list li:last-child { border-bottom: 2px solid rgba(0, 0, 0, .14); }
.list a { font-size: 16px; line-height: 1.6; text-decoration: none; }
.list a:hover { text-decoration: underline; text-underline-offset: 3px; }

.contact li { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 12px; padding: 12px 0; border-top: 2px solid rgba(0, 0, 0, .14); }
.contact li:first-child { border-top: 0; }
.contact span { font: 600 15px/1 var(--pixel); color: var(--ink-soft); }
.contact a { font-size: 16px; text-decoration: none; overflow-wrap: anywhere; }
.contact a:hover { text-decoration: underline; text-underline-offset: 3px; }

.stats { font: 600 16px/1.4 var(--pixel); color: #3f3f3f; }
.stats:empty { display: none; }

/* ---------- The book: the save room ---------- */
dialog.book {
  width: min(520px, calc(100vw - 28px)); max-height: min(86vh, 820px); overflow: auto;
  background: #f3e9cf; color: #3b2a1b;
  box-shadow: 0 0 0 3px #3b2a1b, inset 0 0 0 6px #c9a46a, inset 0 0 0 8px #3b2a1b, 0 24px 60px rgba(0, 0, 0, .45);
  padding: 30px 32px 34px;
}
dialog.book .close { position: absolute; top: 10px; right: 10px; color: #6b4a2e; }
#lock { width: min(360px, calc(100vw - 28px)); text-align: center; }
#lock .mark { margin: 0 0 16px; font: 600 20px/1 var(--pixel); letter-spacing: 2px; color: #6b4a2e; }
#lock input {
  width: 100%; height: 44px; padding: 0 12px; border: 0; font: 600 18px/1 var(--pixel); color: #2b1d12; text-align: center;
  background: #fffaf0; box-shadow: inset 2px 2px 0 #c9b38a, inset -2px -2px 0 #fff;
}
#lock .hint { min-height: 22px; margin: 10px 0 0; font-size: 14px; color: #8a5a2e; }
#heart .pages h2 { margin: 0 0 18px; font: 600 24px/1.2 var(--pixel); color: #4a3220; }
#heart .pages h3 { margin: 22px 0 6px; font: 600 15px/1.2 var(--pixel); color: #8a5a2e; letter-spacing: 1px; }
#heart .pages p { margin: 0 0 10px; font-size: 16px; line-height: 1.8; }
#heart .pages blockquote { margin: 8px 0 12px; padding-left: 12px; border-left: 3px solid #c9a46a; font-size: 16px; line-height: 1.8; }
#heart .pages cite { display: block; font-size: 13px; font-style: normal; color: #8a5a2e; }

/* ---------- Loading: the dirt screen ---------- */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #3b2a1e; transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .bar { width: min(320px, 70vw); height: 12px; background: #4a4a4a; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #6f6f6f; }
#loading .bar i { display: block; height: 100%; width: 8%; background: #6fc94a; box-shadow: inset 0 -3px 0 #3f8a2a; transition: width .25s; }

/* ---------- Plain page (no WebGL, no script) ---------- */
#pages { display: none; }
body.plain { overflow: auto; background: #c6c6c6; }
body.plain #world, body.plain #hud, body.plain #loading { display: none; }
#startupNotice { max-width: 676px; margin: 28px auto 0; padding: 20px 24px; border: 2px solid #373737; background: #e0ded5; }
#startupNotice h2 { margin: 0 0 10px; font: 600 22px/1.3 var(--pixel); }
#startupNotice p { margin: 0 0 16px; font-size: 15px; line-height: 1.65; }
#startupNotice .startup-detail { margin-top: -8px; font: 12px/1.5 ui-monospace, Menlo, monospace; color: #6a6a6a; overflow-wrap: anywhere; }
#startupNotice:not([hidden]) + #pages { padding-top: 28px; }
@media (max-width: 720px) { #startupNotice { margin: 20px 22px 0; padding: 18px; } }
body.plain #pages, noscript ~ #pages { display: block; }
#pages { max-width: 720px; margin: 0 auto; padding: 40px 22px 80px; }
.plain-title { font: 600 34px/1.2 var(--pixel); color: #3f3f3f; margin: 0 0 24px; }
#pages .page { margin: 0 0 28px; padding: 22px 24px; background: var(--gui); box-shadow: 0 0 0 2px var(--line), inset 3px 3px 0 var(--gui-light), inset -3px -3px 0 var(--gui-shade); }
#pages .page > h2 { margin: 0 0 14px; font: 600 22px/1.2 var(--pixel); color: #3f3f3f; }

@media (max-width: 720px) {
  #hotbar { bottom: calc(22px + env(safe-area-inset-bottom)); padding: 2px; }
  #hotbar button { width: 40px; height: 40px; }
  #hotbar button img { width: 24px; height: 24px; }
  #minimap { left: 12px; top: max(12px, env(safe-area-inset-top)); bottom: auto; width: 132px; height: 132px; border-radius: 14px; }
  #minimap .zoom, #minimap .expand { opacity: 1; }
  #minimap .zoom { display: none; }
  #minimap .powered { left: 4px; bottom: 4px; padding: 2px 5px 2px 2px; font-size: 9px; }
  #minimap .powered img { width: 13px; height: 13px; border-radius: 3px; }
  #minimap .powered span { display: none; }
  #corner { right: 12px; top: max(12px, env(safe-area-inset-top)); gap: 8px; }
  #corner button { width: 40px; height: 40px; }
  #corner button span { width: 28px; height: 28px; }
  #weatherMenu { right: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 52px); }
  dialog#panel { top: auto; right: 0; left: 0; bottom: calc(76px + env(safe-area-inset-bottom)); width: 100vw; max-width: 100vw; max-height: 58vh; }
  dialog#panel[open] { animation: rise .18s ease-out; }
  #panel .body { padding: 2px 18px calc(22px + env(safe-area-inset-bottom)); }
  .page p { font-size: 15px; }
  #shootButton { bottom: 128px; right: 16px; }
  #prompt { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); font-size: 15px; }
  #xp { bottom: calc(100% + 6px); }
  #xp i { height: 8px; }
  #xp b { font-size: 16px; }
  /* Keep the prompt and the reading sheet clear of the experience bar. */
  body.xp-on #prompt, body.xp-on dialog#panel { bottom: calc(108px + env(safe-area-inset-bottom)); }
  /* The phone stands on the hotbar's right, clear of the experience bar. */
  #phone { --s: .7; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.xp-on #phone { bottom: calc(112px + env(safe-area-inset-bottom)); }
  body.phone-on #prompt { display: none; }
  /* On phones the web switch is a round thumb button in the bottom-right
     corner, so the corner row stays clear of the radar. */
  #corner #webButton { position: fixed; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; }
  #corner #webButton span { width: 30px; height: 30px; }
  body.phone-on #corner #webButton { display: none; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, dialog#panel[open] { animation: none !important; transition: none !important; }
}

/* A quiet companion to the mountain view: a place, without an overall score. */
#trailPosition { position: fixed; top: 24px; left: 24px; width: 280px; padding: 14px 16px; color: #f6f1e5; background: #24382f; border: 1px solid #677363; z-index: 9; }
#trailPosition h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
#trailPosition p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
#trailPosition div { display: flex; gap: 8px; }
#trailPosition button { min-height: 40px; padding: 0 12px; border: 1px solid #778270; background: #3d5344; color: #f6f1e5; font-size: 13px; }
#trailPosition button:hover { background: #526c55; }
#trailPosition button:active { background: #304436; }
#trailClear { background: transparent !important; }
@media (max-width: 600px) {
  #trailPosition { top: 158px; left: 16px; width: calc(100% - 32px); padding: 10px 12px; }
  #trailPosition h2 { margin-bottom: 4px; font-size: 15px; }
  #trailPosition p { margin-bottom: 8px; font-size: 12px; }
  #trailPosition button { min-height: 40px; }
}

/* Filing numbers required on the terryhu.cn homepage. */
#beian { position: fixed; left: 8px; bottom: max(2px, env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 8px; font: 10px/1.4 system-ui, sans-serif; pointer-events: none; }
#beian a { color: rgba(255,255,255,.6); text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: auto; }
body.plain #beian { position: static; justify-content: center; padding: 0 0 24px; }
body.plain #beian a { color: #666; text-shadow: none; }
