:root {
  color-scheme: dark;
  font-family: "Segoe UI", Tahoma, sans-serif;
  --paper: #f5f2df;
  --muted: #b6c3b9;
  --accent: #ffce63;
  --amber: #a36329;
  --mint: #a8d7b6;
  --ink: #132120;
  --line: #ffffff28;
  --okg-red: #d0171c;
  --okg-red-light: #fb4a48;
  --okg-black: #161416;
  --menu-inset: clamp(24px, 6.7vw, 122px);
  --mono: "Consolas", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #101b1a; color: var(--paper); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
kbd { font: 700 .85rem var(--mono); color: var(--accent); }

.game { height: 100vh; height: 100svh; min-height: 340px; position: relative; overflow: hidden; isolation: isolate; background: #5b867e; }
#world, #menu-transition, .weather, .vignette, .wake, .impact, .prank-impact, .interface, .start { position: absolute; inset: 0; width: 100%; height: 100%; }
#world, #menu-transition, .weather, canvas.held, #equipment-icon, .tool-item canvas, .hotbar canvas { image-rendering: pixelated; }
#world { display: block; touch-action: none; }
.mouse-locked #world { cursor: none; }
#menu-transition { opacity: 0; pointer-events: none; transition: opacity .64s ease-out; }
#menu-transition.is-visible { opacity: 1; transition: none; }
.weather { pointer-events: none; }
.vignette { pointer-events: none; background: radial-gradient(ellipse at 52% 43%, transparent 42%, #0c1c2144 100%); }
.wake { pointer-events: none; z-index: 4; opacity: 0; background: #101b1a; }
.wake.opening { animation: wake .85s ease-out; }
@keyframes wake { 0%, 15% { opacity: 1; } 100% { opacity: 0; } }
.impact { pointer-events: none; z-index: 4; opacity: 0; background: radial-gradient(ellipse, #e87a352d 20%, #8d2406bd 100%); }
.impact.flash { animation: impact .65s ease-out; }
@keyframes impact { 0% { opacity: 1; } 100% { opacity: 0; } }
.prank-impact { pointer-events: none; z-index: 4; opacity: 0; background: radial-gradient(ellipse at center, transparent 38%, #d64d433d 73%, #b7353b8f 100%); }
.prank-impact.flash { animation: prank-tint .42s ease-out; }
#world.prank-shake { animation: prank-shake .31s ease-out; }
@keyframes prank-tint { 0% { opacity: .73; } 36% { opacity: .33; } 100% { opacity: 0; } }
@keyframes prank-shake {
  0%, 100% { transform: none; }
  11% { transform: translate(-4px, 2px) scale(1.015); }
  29% { transform: translate(3px, -2px) scale(1.012); }
  46% { transform: translate(-2px, -1px) scale(1.01); }
  63% { transform: translate(2px, 1px) scale(1.008); }
  81% { transform: translate(-1px, 0) scale(1.004); }
}

.topbar { position: absolute; z-index: 3; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 21px 24px; pointer-events: none; }
.identity { display: flex; align-items: center; gap: .75rem; text-shadow: 0 2px 3px #14221e; }
.identity strong, .identity div > span { display: block; }
.identity strong { font: 800 .85rem var(--mono); letter-spacing: .12em; }
.identity div > span { color: #e0e9d8; margin-top: .13rem; font-size: .79rem; }
.logo-filter { position: absolute; }
.brand-mark { display: inline-flex; align-items: center; flex: none; }
/* Lighten the black portions of the transparent artwork and retain its red accent. */
.brand-mark img { display: block; width: 46px; height: auto; filter: url("#okg-on-dark") drop-shadow(0 1px 2px #121014b0); }
.game:has(.start:not([hidden])) .topbar { padding: clamp(16px, 5vh, 46px) var(--menu-inset) 0; align-items: center; }
.game:has(.start:not([hidden])) .brand-mark img { width: clamp(68px, 6vw, 104px); }
.game:has(.start:not([hidden])) .identity-title { display: none; }
.game:has(.start:not([hidden])) #location-name { color: #e6e2e5; margin: 0; font-size: .85rem; font-weight: 650; }
.game:has(.start:not([hidden])) #mute { background: #181619dc; border-color: #ffffff48; }
.game:has(.start:not([hidden])) #mute-icon { color: #f9f4f4; }
.hud-button, .hud-box { background: #172521f0; border: 1px solid var(--line); box-shadow: 3px 3px 0 #131d1c55; }
.hud-button { padding: .5rem .65rem; min-height: 38px; pointer-events: auto; font-size: .8rem; }
.hud-button:hover, .book-button:hover, .close:hover { background: #354940; }
#mute-icon { color: var(--accent); font-family: var(--mono); }

.start { z-index: 2; display: flex; align-items: safe center; padding: clamp(82px, 12vh, 123px) var(--menu-inset) clamp(24px, 6vh, 62px); overflow: auto; background: linear-gradient(90deg, #161416 0%, #171518f6 24%, #181619da 38%, #19161978 59%, #17141912 83%), linear-gradient(0deg,#15121576, transparent 37%); }
.start-copy { width: min(100%, 35rem); }
.eyebrow { display: flex; align-items: center; gap: .55rem; font: 700 .74rem var(--mono); color: var(--mint); letter-spacing: .14em; }
.eyebrow > span { background: var(--accent); width: .56rem; height: .56rem; display: inline-block; flex: none; box-shadow: 2px 2px 0 #c1792e59; }
.start h1 { color: #fff9f9; font-family: "Arial Black", "Segoe UI", sans-serif; font-size: clamp(2.85rem, 6.7vw, 6.4rem); font-weight: 950; line-height: .94; letter-spacing: -.078em; margin: 0 0 .37em; text-transform: uppercase; white-space: nowrap; text-shadow: 3px 4px #0f0d1080; }
.start h1 em { font-style: normal; color: var(--okg-red-light); }
.primary { display: inline-flex; gap: 1.28rem; align-items: center; justify-content: space-between; background: var(--accent); color: #1c261e; border: 1px solid #ffdc92; box-shadow: 3px 3px 0 var(--amber); font-weight: 800; padding: .78rem 1rem; text-align: left; min-height: 46px; }
.primary:hover { background: #ffdf91; }
.primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--amber); }
.primary span { font-size: 1.15em; line-height: 1; }
.start .primary { justify-content: center; min-width: 12rem; min-height: 49px; padding: .72rem 1.3rem; background: var(--okg-red); color: #fff; border: 1px solid #ef4044; box-shadow: 3px 3px 0 #790d14; }
.start .primary:hover { background: #b51219; }
.start .primary:active { box-shadow: 1px 1px 0 #790d14; }
.start-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .7rem; }
.coop-open { min-height: 49px; padding: .70rem 1.1rem; color: #fff6f7; border: 1px solid #b1a2aab5; background: #252227ed; box-shadow: 3px 3px 0 #130f1580; font-weight: 750; }
.coop-open:hover { border-color: var(--okg-red-light); background: #41282e; }
.secondary { display: block; margin-top: .8rem; background: #25392f; border: 1px solid #718a79; padding: .62rem .8rem; }
.secondary:hover { background: #354940; }
.interface { pointer-events: none; }
.watch { position: absolute; right: 24px; top: 74px; display: flex; gap: 1rem; align-items: center; padding: .53rem .68rem; }
.watch span, .watch strong { display: block; }
.watch span { color: var(--mint); font: 700 .72rem var(--mono); letter-spacing: .1em; }
.watch strong { color: var(--paper); font: 700 1.45rem var(--mono); font-variant-numeric: tabular-nums; }
.book-button, .close { pointer-events: auto; margin-left: auto; border: 1px solid var(--line); background: #22332d; color: var(--accent); }
.book-button { width: 31px; min-height: 31px; font: 700 .84rem var(--mono); }

.coop-hud { position: absolute; z-index: 1; top: 145px; right: 24px; display: flex; align-items: center; gap: .45rem; max-width: calc(100vw - 48px); padding: .25rem .25rem .25rem .5rem; }
.coop-hud-summary { display: flex; align-items: center; gap: .33rem; min-width: 0; color: #e0e9e1; font-size: .79rem; }
.coop-signal { flex: none; width: .43rem; height: .43rem; background: var(--accent); }
.coop-hud[data-state="connected"] .coop-signal { background: var(--mint); }
.coop-hud[data-state="disconnected"] .coop-signal, .coop-hud[data-state="error"] .coop-signal { background: #ffa37f; }
#coop-player-count { flex: none; color: var(--muted); font: 700 .73rem var(--mono); }
#coop-player-count:empty { display: none; }
.coop-hud .hud-button { min-height: 28px; padding: .25rem .42rem; white-space: nowrap; font-size: .75rem; }

.guide-hint { display: flex; align-items: center; gap: .78rem; width: min(26rem, calc(100vw - 245px)); position: absolute; top: 76px; left: 24px; padding: .55rem .65rem; border-left: 3px solid var(--accent); }
.hint-direction { align-self: stretch; min-width: 44px; display: grid; place-content: center; justify-items: center; gap: .18rem; padding: 0 .35rem; background: #222f28; color: var(--accent); white-space: nowrap; }
.hint-arrow { display: inline-block; font: 800 1rem/1 var(--mono); transform-origin: center; }
#hint-distance { font: 700 .74rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.hint-copy { flex: 1; min-width: 0; }
.hint-head { display: flex; gap: .4rem .8rem; align-items: baseline; flex-wrap: wrap; }
.hint-head strong { font-size: .91rem; line-height: 1.19; }
#hint-progress { color: var(--accent); font: 700 .73rem var(--mono); white-space: nowrap; }
#hint-detail { margin: .28rem 0 0; color: #d4dfd5; font-size: .78rem; line-height: 1.3; }
#hint-detail:empty { display: none; }

.crosshair { position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; transform: translate(-50%,-50%); }
.crosshair::before, .crosshair::after { position: absolute; content: ""; background: #fff6d5e0; box-shadow: 0 0 0 1px #17241d75; }
.crosshair::before { width: 13px; height: 1px; top: 7px; left: 1px; }
.crosshair::after { width: 1px; height: 13px; top: 1px; left: 7px; }
.held { position: absolute; right: 4%; bottom: -4%; width: min(49vw, 560px); height: auto; }
.focus { position: absolute; z-index: 1; left: 50%; top: 58%; transform: translateX(-50%); white-space: nowrap; text-align: center; }
.prompt { pointer-events: auto; display: inline-flex; gap: .55rem; align-items: center; background: #172622f5; color: #fff6dd; border: 1px solid #f4cb769f; box-shadow: 2px 2px 0 #15261dc2; padding: .35rem .65rem .35rem .38rem; font-weight: 700; touch-action: none; user-select: none; }
.prompt kbd { color: #1b271f; background: var(--accent); padding: .16rem .38rem; }
.measurement { margin: 0 auto .32rem; padding: .28rem .52rem; width: max-content; color: var(--mint); font: 700 .91rem var(--mono); font-variant-numeric: tabular-nums; }
.action-progress { height: 5px; background: #17352b; margin: 0 auto .32rem; width: 100%; outline: 1px solid #e8c369a5; }
.action-progress div { height: 100%; width: 100%; background: var(--accent); transform-origin: left center; }
.notification, .road-alert { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.notification { z-index: 2; bottom: 107px; max-width: min(520px, 84%); padding: .55rem .78rem; background: #1b3029f7; border-left: 3px solid var(--mint); box-shadow: 3px 3px 0 #15261d9c; font-size: .91rem; }
.notification.error { border-left-color: #ffa37f; }
.road-alert { top: 75px; background: #38281bf7; color: #ffcb74; border: 1px solid #e4a34472; font: 800 .85rem var(--mono); padding: .42rem .6rem; white-space: nowrap; }
.road-alert span { background: #ffcb74; color: #38281b; padding: 0 .26rem; }

.bottom { position: absolute; bottom: 19px; right: 24px; left: 24px; display: grid; grid-template-columns: minmax(8.5rem, 1fr) minmax(0, 31rem) minmax(15rem, 1fr); align-items: end; gap: .7rem; }
.equipment { display: flex; gap: .55rem; align-items: center; justify-self: start; padding: .43rem .62rem; min-height: 48px; min-width: 136px; }
#equipment-icon { width: 34px; height: 30px; background: #293d34; border: 1px solid var(--line); }
.equipment span, .equipment strong { display: block; }
.equipment span { color: var(--muted); font: 700 .63rem var(--mono); letter-spacing: .1em; margin-bottom: .12rem; }
.equipment strong { font-size: .82rem; }
.controls { position: absolute; left: 24px; bottom: 81px; display: flex; gap: .35rem .7rem; flex-wrap: wrap; max-width: min(385px, 36vw); padding: .37rem .49rem; background: #172521d9; border: 1px solid var(--line); color: #dbe5d9; font-size: .75rem; }
.controls kbd { font-size: .73rem; }
.hotbar { width: min(100%, 31rem); display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); justify-self: center; gap: 3px; padding: 4px; background: #16231ee8; border: 1px solid #e8eee643; box-shadow: 2px 3px 0 #101d1c80; }
.hotbar:empty { display: none; }
.hotbar > button { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; min-height: 45px; aspect-ratio: 1; padding: 6px 1px 2px; user-select: none; pointer-events: auto; border: 1px solid #8da59754; background: #32423a; }
.hotbar > button:hover { border-color: #eaeec4; }
.hotbar > button[aria-pressed="true"], .hotbar > button[aria-current="true"], .hotbar > button.selected, .hotbar > button.active, .hotbar > button.is-active { z-index: 1; border-color: #ffdb82; background: #4b4934; box-shadow: inset 0 0 0 1px #ffdb82; }
.hotbar > button:empty, .hotbar > button[data-empty="true"], .hotbar > button.is-empty { background: #222e28; }
.hotbar canvas { display: block; width: min(100%, 38px); height: auto; max-height: 34px; background: transparent; }
.slot-index { position: absolute; top: 2px; left: 4px; color: #d2dacf; font: 700 .65rem/1 var(--mono); }
.hotbar button[aria-pressed="true"] .slot-index { color: #ffda80; }
.hotbar .slot-label { position: absolute; inset: auto 1px 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 .63rem/1 var(--mono); }
.view-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; align-items: end; }
.view-controls kbd { margin-left: .14rem; font-size: .72rem; }
.view-controls #toggle-hints[aria-pressed="true"] { border-color: #c5b4856e; }
.pause-button { min-width: 38px; font-family: var(--mono); color: var(--accent); }
.touch-controls { display: none; }

.sheet { color: var(--paper); background: #1b2b26; border: 1px solid #82998b; box-shadow: 6px 6px #101f1b9c, inset 0 3px #e6b958; padding: clamp(17px, 3.3vw, 33px); width: min(645px, calc(100% - 32px)); max-height: min(85svh, 750px); overflow: auto; }
.sheet::backdrop { background: #101b1bc4; }
.sheet-header { display: flex; align-items: start; gap: 1rem; justify-content: space-between; }
.sheet h2 { font-size: clamp(1.45rem, 4vw, 2.15rem); line-height: 1.12; margin: .4rem 0 .55rem; }
.sheet-intro { color: #c6d3c9; margin: .2rem 0 1rem; line-height: 1.42; }
.close { width: 35px; height: 35px; flex: none; font-size: 1.35rem; line-height: 1; }
.coop-sheet { width: min(515px, calc(100% - 32px)); background: #211e21; border-color: #9d9699; box-shadow: 6px 6px #1010159c, inset 0 3px var(--okg-red); }
.coop-sheet .sheet-intro { color: #d3cbce; }
.coop-sheet .close, .coop-sheet .secondary { color: #f7eef1; background: #343034; border-color: #a297a3; }
.coop-sheet .close:hover, .coop-sheet .secondary:hover { background: #49353c; border-color: var(--okg-red-light); }
.coop-sheet .primary { color: white; background: var(--okg-red); border-color: #ef4044; box-shadow: 2px 2px 0 #790d14; }
.coop-sheet .primary:hover { background: #b51219; }
.coop-sheet button:disabled { opacity: .48; cursor: default; }
.coop-status { margin: .48rem 0 .85rem; padding: .44rem .54rem; color: #ece5e8; border-left: 2px solid #b994aa; background: #352c34; font-size: .87rem; line-height: 1.35; }
.coop-status.error, .coop-status[data-state="error"] { border-color: var(--okg-red-light); }
.coop-join-form { padding-top: .9rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.coop-join-form label, .coop-room label, .coop-room-code span { color: #e1d6dc; font-size: .9rem; font-weight: 650; }
.coop-input-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: stretch; gap: .55rem; margin-top: .4rem; }
.coop-input-row input { min-width: 0; padding: .53rem .6rem; color: #fff9f9; background: #141315; border: 1px solid #8e858e; font: 400 .9rem var(--mono); }
.coop-input-row input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.coop-input-row button { min-height: 42px; margin: 0; padding: .52rem .6rem; font-size: .85rem; }
.coop-room-code { display: flex; align-items: center; gap: .6rem; margin: .55rem 0 .86rem; }
.coop-room-code code { color: #fff; background: #3a2b33; padding: .24rem .48rem; font: 800 .96rem var(--mono); letter-spacing: .07em; }
.coop-room-code code:empty { display: none; }
.coop-scenario { display: flex; align-items: baseline; flex-wrap: wrap; gap: .22rem .6rem; margin: .5rem 0 .7rem; }
.coop-scenario:has(#coop-scenario:empty) { display: none; }
.coop-scenario > span { color: #c6bfc4; font-size: .85rem; }
.coop-scenario > strong { color: #fff6f8; font-size: .93rem; }
.coop-seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .48rem; list-style: none; margin: .55rem 0 .88rem; padding: 0; }
.coop-seat { display: flex; flex-direction: column; justify-content: center; gap: .32rem; min-width: 0; padding: .52rem .6rem; border: 1px solid #ffffff36; background: #2d282d; font-size: .88rem; line-height: 1.25; }
.coop-seat-status { display: inline-flex; gap: .36rem; align-items: center; color: #ded4dc; font-size: .79rem; }
.coop-seat-status::before { content: ""; flex: none; width: .43rem; height: .43rem; background: #8d858e; }
.coop-seat-status[data-state="connected"]::before { background: var(--mint); }
.coop-seat-status[data-state="connecting"]::before { background: var(--accent); }
.coop-seat-status[data-state="disconnected"]::before, .coop-seat-status[data-state="error"]::before { background: #ffa37f; }
.coop-invitation { margin: 0 0 .85rem; padding: .08rem 0 .85rem; border-block: 1px solid var(--line); }
.coop-start-wait { margin: .5rem 0 .75rem; color: #ebe3e8; font-size: .91rem; line-height: 1.4; }
.fixing-map { width: min(748px, calc(100% - 32px)); }
.fixing-map-group + .fixing-map-group { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.fixing-map-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .7rem; margin-bottom: .45rem; }
.fixing-map-heading h3 { margin: 0; font-size: 1rem; }
.fixing-map-summary { margin: 0; color: var(--mint); font-size: .83rem; }
.fixing-map-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: .42rem; margin: 0; padding: 0; list-style: none; }
.fixing-map-point { display: grid; align-content: start; gap: .17rem; min-width: 0; padding: .48rem .6rem; border: 1px solid var(--line); border-left: 3px solid #799587; background: #243931; }
.fixing-map-point strong { color: var(--paper); font-size: .88rem; }
.fixing-map-point span { font-size: .83rem; color: #d3ded5; line-height: 1.3; }
.fixing-map-point .fixing-map-detail { color: #b6c8bc; }
.fixing-map-point[data-status="waiting"] { border-left-color: var(--accent); }
.fixing-map-point[data-status="ready"] { border-left-color: var(--mint); }
.fixing-map-point[data-status="fault"] { border-left-color: #ffa37f; }
.guide-steps { margin: .5rem 0 1rem; padding: 0; list-style: none; counter-reset: step; }
.guide-steps li { display: flex; align-items: flex-start; gap: .78rem; counter-increment: step; padding: .5rem 0; border-top: 1px solid var(--line); }
.guide-steps li::before { content: counter(step, decimal-leading-zero); min-width: 27px; padding: .18rem 0; text-align: center; color: var(--accent); background: #344135; font: 700 .77rem var(--mono); }
.guide-steps strong, .guide-steps span { display: block; }
.guide-steps span { font-size: .9rem; color: #c7d4ca; margin-top: .12rem; line-height: 1.35; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: .42rem; margin: .75rem 0 1rem; }
.specs > div { background: #263d32; padding: .53rem .65rem; }
.specs dt { font-size: .81rem; color: #c7d4ca; }
.specs dd { margin: .24rem 0 0; color: var(--accent); font: 700 1.2rem var(--mono); }
.temperature-table { width: 100%; border-collapse: collapse; margin: .7rem 0 1rem; color: #e3ebe2; font-size: .87rem; }
.temperature-table caption { color: var(--paper); font-weight: 700; margin-bottom: .35rem; text-align: left; }
.temperature-table th, .temperature-table td { border-bottom: 1px solid var(--line); text-align: left; padding: .33rem .24rem; }
.temperature-table thead th { color: var(--mint); font-weight: 700; }
.temperature-table tbody th { font-weight: 400; }
.guide-note { padding: .55rem .62rem; border-left: 3px solid var(--accent); background: #423323; font-size: .88rem; line-height: 1.4; margin: 0 0 .65rem; color: #ffe4ab; }
.guide-note strong { margin-right: .3rem; }
.source-note { color: #b1c2b6; font-size: .85rem; line-height: 1.35; margin: .6rem 0 .95rem; }
.source-note a { color: var(--mint); }
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: .48rem; }
.tool-item { background: #263b32; border: 1px solid #526b59; padding: .48rem; text-align: left; display: flex; gap: .52rem; align-items: center; min-height: 53px; font-size: .9rem; }
.tool-item:hover, .tool-item[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.tool-item canvas { width: 34px; height: 30px; background: #1c2a22; flex: none; }
.inventory-sheet { width: min(680px, calc(100% - 32px)); background: #211f21; border-color: #9d9699; box-shadow: 6px 6px #1010159c, inset 0 3px var(--okg-red); }
.inventory-sheet .sheet-intro { color: #d3cbce; }
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .52rem; }
.inventory-grid .tool-item { position: relative; flex-direction: column; justify-content: center; gap: .28rem; min-width: 0; min-height: 78px; padding: .45rem .26rem; background: #343034; border-color: #ffffff34; color: #fbf3f5; text-align: center; line-height: 1.15; }
.inventory-grid .tool-item canvas { width: 49px; height: 43px; background: transparent; }
.inventory-grid .tool-item:hover, .inventory-grid .tool-item[aria-pressed="true"], .inventory-grid .tool-item.is-selected { color: #fff; background: #40272b; border-color: var(--okg-red-light); }
.inventory-grid .tool-item[data-empty="true"] { background: #272427; color: #a7a1a5; }
.inventory-hotbar { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.inventory-hotbar:has(.hotbar:empty) { display: none; }
.inventory-hotbar h3 { margin: 0 0 .45rem; color: #f0e9ea; font-size: .91rem; }
.inventory-tip { margin: .55rem 0 0; color: #c3b9c1; font-size: .83rem; }
.inventory-sheet:not(:has(.tool-item:not([hidden]))) .inventory-tip { display: none; }
.inventory-hotbar .hotbar { width: 100%; max-width: none; background: #252225; justify-self: stretch; }
.inventory-hotbar .hotbar > button { background: #373438; }
.inventory-hotbar .hotbar > button[data-empty="true"], .inventory-hotbar .hotbar > button.is-empty { background: #29262a; }
.inventory-hotbar .hotbar > button[aria-pressed="true"], .inventory-hotbar .hotbar > button.is-active { background: #4a2b31; border-color: var(--okg-red-light); box-shadow: inset 0 0 0 1px var(--okg-red-light); }
.compact { width: min(465px, calc(100% - 32px)); }
.wait-options { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin: .55rem 0; }
.wait-options label { color: #dddcd0; font-size: .89rem; }
.wait-options input { display: block; width: 100%; padding: .57rem; margin-top: .38rem; background: #25392f; color: var(--paper); border: 1px solid #718a79; font: 700 1.1rem var(--mono); }
.wait-preview { min-height: 1.4em; color: var(--mint); font: .87rem var(--mono); }
.primary:disabled { opacity: .48; cursor: default; }

.score { display: flex; align-items: center; gap: .8rem; margin: 1.02rem 0; border-bottom: 1px solid var(--line); padding-bottom: .85rem; }
.score strong { color: var(--accent); font: 900 clamp(3.6rem, 12vw, 6em)/.85 Impact, "Arial Black", sans-serif; letter-spacing: .015em; }
.score span { color: var(--muted); line-height: 1.25; font: 700 .9rem var(--mono); }
.score-details { margin: 0; }
.score-details div { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.score-details dd { margin: 0; color: var(--mint); font-family: var(--mono); white-space: nowrap; }
.score-note { color: #c6d3c9; line-height: 1.45; margin: 1rem 0; }
.report { width: min(570px, calc(100% - 32px)); }
.report-learning { margin: 1rem 0 1.3rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.report-learning h3 { margin: 0 0 .58rem; font-size: 1.02rem; }
.report-takeaways { display: grid; gap: .48rem; margin: 0; padding: 0; list-style: none; }
.report-takeaways li { padding: .48rem .6rem; border-left: 2px solid #d5ad53; background: #27382f; }
.report-takeaways strong { display: block; font-size: .88rem; }
.report-takeaways p { margin: .22rem 0 0; color: #d7e1d7; line-height: 1.4; font-size: .86rem; }
.scenario-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; border: 0; padding: 0; margin: 0 0 1.35rem; max-width: 34rem; min-width: 0; }
.scenario-picker legend { padding: 0; margin: 0 0 .55rem; color: #d9d2d7; font: 700 .83rem var(--mono); }
.scenario-picker label { display: grid; position: relative; }
.scenario-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.scenario-card { display: grid; grid-template-columns: 2.45rem 1fr; align-items: center; gap: .66rem; width: 100%; min-height: 63px; padding: .55rem .65rem; background: #222023ee; border: 1px solid #bab0ba62; box-shadow: 2px 2px 0 #120e1280; cursor: pointer; }
.scenario-name { color: #f9f4f6; font-size: .93rem; font-weight: 650; line-height: 1.18; }
.scenario-glyph { color: #d2c9cf; background: #303034; border: 1px solid #ffffff24; display: block; position: relative; width: 2.45rem; height: 2.06rem; }
.scenario-card:hover { border-color: #f4eaf3; background: #332b31; }
.scenario-picker input:checked + .scenario-card { background: #40292e; border-color: var(--okg-red-light); box-shadow: inset 2px 0 0 var(--okg-red-light), 2px 2px 0 #120e1280; }
.scenario-picker input:checked + .scenario-card .scenario-glyph { color: #fff1ee; background: #711c23; border-color: #fa6f766b; }
.scenario-picker input:focus-visible + .scenario-card { outline: 2px solid #fff; outline-offset: 2px; }
.scenario-glyph::before, .scenario-glyph::after { content: ""; position: absolute; }
.glyph-screen::before { inset: 5px 5px 8px; border: 2px solid currentColor; background: repeating-linear-gradient(90deg, transparent 0 3px, currentColor 3px 4px); }
.glyph-screen::after { inset: auto 5px 5px; height: 4px; background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 11px); }
.glyph-barrier::before { inset: 10px 4px auto; height: 7px; border-block: 2px solid currentColor; }
.glyph-barrier::after { inset: 12px 8px 6px; border-inline: 2px solid currentColor; }
.glyph-pipe::before { inset: 12px 4px 8px; border-block: 2px solid currentColor; background: #ffffff28; }
.glyph-pipe::after { inset: 6px 11px 6px; border: 2px solid currentColor; border-top-width: 0; }
.glyph-brick::before { inset: 5px 5px 17px; height: 8px; border-block: 2px solid currentColor; background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 9px); }
.glyph-brick::after { inset: 13px 5px auto; height: 8px; border-bottom: 2px solid currentColor; background: repeating-linear-gradient(90deg, transparent 0 5px, currentColor 5px 7px, transparent 7px 9px); }

@media (max-width: 870px) {
  .bottom { grid-template-columns: minmax(0, 1fr) max-content; }
  .hotbar { grid-column: 1 / -1; grid-row: 1; }
  .hotbar > button { min-height: 31px; }
  .equipment { grid-column: 1; grid-row: 2; }
  .view-controls { grid-column: 2; grid-row: 2; }
  .notification { bottom: 136px; }
}

@media (max-width: 690px) {
  .topbar { padding: 12px; }
  .identity { gap: .48rem; }
  .identity strong { font-size: .73rem; }
  .identity div > span { font-size: .69rem; }
  .watch { top: 61px; right: 12px; padding: .42rem .52rem; gap: .55rem; }
  .coop-hud { top: 151px; right: 12px; max-width: calc(100vw - 24px); }
  .guide-hint { top: 61px; left: 12px; width: min(25rem, calc(100vw - 130px)); gap: .38rem; padding: .35rem; }
  .hint-direction { min-width: 34px; padding-inline: .20rem; }
  .hint-head { gap: .15rem .4rem; }
  .hint-head strong { font-size: .84rem; }
  #hint-detail { font-size: .74rem; }
  .bottom { left: 12px; right: 12px; bottom: 12px; }
  .controls { display: none; }
  .held { width: min(63vw, 310px); right: 0; }
  .road-alert { top: 119px; right: 12px; left: auto; transform: none; font-size: .68rem; }
  .notification { bottom: 130px; padding: .43rem .52rem; }
  .start { background: linear-gradient(90deg, #161416ec 0%, #171518c3 65%, #17141982 100%), linear-gradient(0deg,#15121576, transparent 37%); }
  .scenario-card { min-height: 56px; gap: .45rem; padding: .45rem; }
  .scenario-name { font-size: .84rem; }
}

@media (pointer: coarse) {
  .controls { display: none; }
  .touch-controls { position: absolute; bottom: 132px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: end; }
  .view-controls kbd { display: none; }
  .dpad { display: grid; grid-template-columns: repeat(3, 43px); grid-template-areas: ". n ." "w s e"; gap: 3px; }
  .dpad button, .touch-action { pointer-events: auto; min-height: 43px; touch-action: none; user-select: none; color: var(--accent); background: #1e332bd9; border: 1px solid #e2d79c7a; }
  .dpad button:active, .touch-action:active { background: #476253; }
  .dpad button:nth-child(1) { grid-area: n; }
  .dpad button:nth-child(2) { grid-area: w; }
  .dpad button:nth-child(3) { grid-area: s; }
  .dpad button:nth-child(4) { grid-area: e; }
  .touch-action { width: 48px; font: 800 1rem var(--mono); }
  .notification { bottom: 189px; }
}

@media (max-width: 930px) {
  .controls { display: none; }
}

@media (max-height: 460px) {
  .start { padding-top: 66px; padding-bottom: 12px; }
  .start h1 { font-size: clamp(2rem, 6vw, 3.65rem); margin-bottom: .25em; }
  .scenario-picker { gap: .36rem; margin-bottom: .58rem; }
  .scenario-picker legend { margin-bottom: .35rem; }
  .scenario-card { min-height: 42px; padding: .32rem .38rem; }
  .start .primary { min-height: 40px; padding-block: .52rem; }
  .coop-open { min-height: 40px; padding-block: .52rem; }
}

@media (max-width: 410px) {
  .tool-item { font-size: .77rem; }
  .tool-item canvas { width: 28px; height: 25px; }
  .hotbar { gap: 2px; padding: 3px; }
  .hotbar > button { min-height: 28px; }
  .hotbar .slot-label { display: none; }
  .bottom { gap: .35rem; }
  .equipment { min-width: 0; max-width: 100%; padding: .34rem; }
  .equipment strong { font-size: .72rem; }
  .view-controls { gap: .24rem; max-width: min(196px, 51vw); }
  .view-controls .hud-button { padding: .34rem; font-size: .7rem; }
  .view-controls kbd { display: none; }
  .scenario-card { grid-template-columns: 1fr; gap: .28rem; }
  .start h1 { font-size: clamp(2.48rem, 12vw, 3.1rem); }
  .start .primary { min-width: 0; }
  .start-actions { gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wake.opening, .impact.flash { animation-duration: .12s; }
  #world.prank-shake { animation: none; }
  .prank-impact.flash { animation: prank-tint-reduced .22s ease-out; }
  #menu-transition { transition: none; }
}
@keyframes prank-tint-reduced { 0% { opacity: .27; } 100% { opacity: 0; } }
