@font-face { font-family: 'Jersey 10'; src: url(/assets/Jersey10.woff2) format('woff2'), url(../assets/herpderp/ui/fonts/Jersey10.ttf) format('truetype'); }
:root {
  --wood: #6e3f1c; --wood-dark: #3a2210; --wood-light: #8f5a2c;
  --parch: #ead6a4; --gold: #ffd43a; --ink: #2b1a0e; --text: #fff6dc; --muted: #eed9a8;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --title: 'Jersey 10', 'Trebuchet MS', sans-serif;
  color-scheme: dark;
  --ink-outline: 1px 0 0 #2b1a0e, -1px 0 0 #2b1a0e, 0 1px 0 #2b1a0e, 0 -1px 0 #2b1a0e, 1px 1px 0 #2b1a0e, -1px 1px 0 #2b1a0e, 1px -1px 0 #2b1a0e, -1px -1px 0 #2b1a0e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2a12; color: var(--text); font-family: var(--font); font-weight: 600; -webkit-font-smoothing: antialiased; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
/* HerpDerp v6: light haze at the top, soft dark edge and a warm wash over the world (as in Survivor). */
#atmosphere {
  position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(206,214,222,.14) 0%, rgba(206,214,222,.05) 18%, rgba(206,214,222,0) 36%),
    radial-gradient(ellipse 78% 72% at 50% 55%, rgba(20,12,4,0) 60%, rgba(20,12,4,.26) 100%),
    linear-gradient(rgba(255,186,96,.06), rgba(255,186,96,.06));
}
#hurt-edge { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(200,20,10,0) 40%, rgba(200,20,10,.7) 78%, rgba(120,0,0,.95) 100%); }
canvas { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; image-rendering: pixelated; }
/* Start and result windows: shared parts from css/phone.css; the overlay is ours, below the system buttons (z 50)
   and the pause menu (900). --vvh/--vvt follow the visible area, so an on-screen keyboard does not push the
   buttons out of view (TS-08); only the middle (.hscroll) scrolls. */
.ts-screen { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); z-index: 40; display: grid; place-items: center; padding: 12px; }
.ts-screen.hidden { display: none !important; }
.ts-panel { max-height: calc(var(--vvh, 100dvh) - 24px); }
.ts-panel .phm-stat b { font-size: var(--nx2, 28px); font-weight: 700; }
.ts-board { padding: 2px 6px; }
.ts-board ol { padding: 0; list-style: none; }
.ts-board li { display: flex; gap: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ts-board li .n { width: 24px; color: var(--phm-brown); }
.ts-board li .nm { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ts-board li.me { color: #b3361a; }
.ts-board .empty { justify-content: center; color: var(--phm-brown); }
.ts-board .dev { margin: 2px 0 0; text-align: center; color: var(--phm-brown); }
.ts-name { display: flex; flex-direction: column; gap: 4px; align-self: stretch; text-align: center; color: var(--phm-muted); text-shadow: var(--phm-outline); }
.ts-name.hidden { display: none; }
.ts-name input { min-height: 44px; font-size: var(--phm-px); }
.ts-name input:focus-visible { outline: 3px solid var(--phm-gold); outline-offset: 2px; }
/* Status bar as in Survivor (#topbar) */
#topbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 12px; white-space: nowrap;
  background: var(--wood); border: 3px solid var(--ink); border-top: 0; border-radius: 0 0 22px 22px; padding: calc(4px + env(safe-area-inset-top, 0px)) 16px 6px;
  box-shadow: 0 6px 0 rgba(0,0,0,.28), inset 0 2px 0 var(--wood-light); font-size: 18.667px; text-shadow: var(--ink-outline); pointer-events: none; }
#topbar b { color: var(--gold); font-weight: 400; font-size: 37.333px; }
#topbar .hearts { display: flex; gap: 3px; }
/* 3 CSS px per art pixel: whole device pixels at every pixel ratio */
#topbar .stat { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
#topbar .hearts img, #topbar .ico { width: 27px; height: 24px; image-rendering: pixelated; display: block; }
#topbar.hidden { display: none; }
/* phones: left-aligned like Idle-Dorf, clear of the music and menu buttons; digits drop to the small size when the bar still reaches them (fitTopbar) */
@media (max-width: 520px) { #topbar { left: 6px; transform: none; max-width: calc(100vw - 112px); } }
#topbar.tight { gap: 6px; padding-left: 10px; padding-right: 10px; }
#topbar.tight b { font-size: var(--phm-px); }
.ts-name input { user-select: text; -webkit-user-select: text; }
