@font-face { font-family: 'Tiny5'; src: url(../fonts/tiny5.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Lexend'; src: url(../fonts/lexend.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'PressStart'; src: url(../fonts/PressStart2P-Regular.ttf) format('truetype'); font-display: swap; }

:root {
  --bg: #1b2937; --ink: #171521; --cream: #f6e8c5;
  --orange: #f7a34a; --gold: #ffcf5c; --teal: #56d6b2; --red: #ff9a95; --muted: #afc2ce;
  --street: #3a6fd1;
  --font: 'Lexend', 'Segoe UI', sans-serif; --pixel: 'Tiny5', 'Segoe UI', sans-serif; --logo: 'PressStart', monospace;
  --s: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0e141c; color: var(--cream); font-family: var(--font); font-size: 20px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.px { image-rendering: pixelated; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.ico { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.star { width: 28px; height: 28px; image-rendering: pixelated; }
.star.off { filter: grayscale(1) brightness(.55); opacity: .7; }

#app { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform: translate(-50%, -50%) scale(var(--s)); background: var(--bg); overflow: hidden; }
.screen { position: absolute; inset: 0; }

/* ---------- pixel frames: 9-slice from the original PNGs ---------- */
#goals, #dock, #insp, #hintbox, .world, .node, .pill, #browser, .say p, #tip {
  border-style: solid; border-width: 8px; border-image: url(../assets/ui/panel_dark.png) 4 fill / 8px; image-rendering: pixelated; background: none;
}
#modal .card, #coach .bubble, .node.now {
  border-style: solid; border-width: 8px; border-image: url(../assets/ui/panel_cream.png) 4 fill / 8px; image-rendering: pixelated; color: var(--ink); background: none;
}

/* ---------- buttons ---------- */
.btn, .icon-btn, .tool, .tray-item, .g-card, .look {
  border-style: solid; border-width: 12px; border-image: url(../assets/ui/btn_gray_normal.png) 6 fill / 12px; background: none; image-rendering: pixelated;
  color: var(--cream); font-family: var(--font); font-weight: 700;
}
.btn:hover, .icon-btn:hover, .tool:hover, .tray-item:hover, .g-card:hover, .look:hover { border-image-source: url(../assets/ui/btn_gray_hover.png); }
.btn:active, .icon-btn:active, .tool:active, .tray-item:active { border-image-source: url(../assets/ui/btn_gray_pressed.png); transform: translateY(2px); }
.btn.primary, .tool.active, .tray-item.active { border-image-source: url(../assets/ui/btn_orange_normal.png); color: var(--ink); }
.btn.primary:hover, .tool.active:hover, .tray-item.active:hover { border-image-source: url(../assets/ui/btn_orange_hover.png); }
.btn.primary:active { border-image-source: url(../assets/ui/btn_orange_pressed.png); }
.btn.warn { border-image-source: url(../assets/ui/btn_red_normal.png); }
.btn.warn:hover { border-image-source: url(../assets/ui/btn_red_hover.png); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 0 12px; font-size: 22px; }
.btn.big { min-height: 64px; font-size: 24px; padding: 0 18px; }
.btn.huge { min-height: 84px; font-size: 34px; padding: 0 44px; }
.btn.small { min-height: 48px; font-size: 19px; padding: 0 6px; }
.icon-btn { width: 60px; height: 60px; display: inline-grid; place-items: center; padding: 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; min-height: 52px; font-size: 22px; font-weight: 700; color: var(--gold); }
.pill .star, .pill .ico { width: 26px; height: 26px; }

/* ---------- glossary terms ---------- */
.term { display: inline; padding: 0 1px; border: 0; background: none; font: inherit; font-weight: 700; color: #8fb6ff; border-bottom: 3px dotted currentColor; cursor: help; }
#modal .card .term, #coach .term { color: #2c5fc4; }
#tip { position: fixed; z-index: 120; max-width: 320px; padding: 4px 6px; color: var(--cream); font-size: 18px; line-height: 1.3; pointer-events: none; }
#tip b { display: block; font-size: 21px; color: var(--gold); margin-bottom: 2px; }

/* ---------- title ---------- */
.t-bg { position: absolute; inset: 0; width: 1280px; height: 720px; }
#title::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,20,28,.82) 0%, rgba(14,20,28,.55) 45%, rgba(14,20,28,0) 70%); }
.t-center { position: absolute; left: 80px; top: 110px; z-index: 1; }
.logo { font-family: var(--logo); font-weight: 400; font-size: 68px; line-height: 1.3; color: var(--gold); text-shadow: 6px 6px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink); }
.t-sub { font-size: 28px; margin: 24px 0 34px; max-width: 520px; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); }
.t-foot { position: absolute; left: 80px; bottom: 34px; z-index: 1; margin: 0; font-size: 19px; color: var(--muted); text-shadow: 2px 2px 0 var(--ink); }
.t-packet { position: absolute; z-index: 1; left: 830px; top: 440px; animation: hop 1.2s steps(2) infinite; }
@keyframes hop { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, -14px); } }
.t-sound { position: absolute; right: 24px; top: 24px; z-index: 2; }

/* ---------- map ---------- */
#map { padding: 18px 24px; }
.map-head { display: flex; align-items: center; gap: 12px; }
.map-head h2 { font-size: 38px; flex: 1; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); }
.map-stats { display: flex; gap: 10px; }
#worlds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; height: 600px; }
.world { padding: 6px 6px; }
.world h3 { font-size: 30px; color: var(--gold); }
.world.w2 h3 { color: var(--teal); } .world.w3 h3 { color: var(--orange); } .world.w4 h3 { color: #b8a6ff; }
.w-sub { margin: 0 0 10px; font-size: 18px; color: var(--muted); }
.nodes { display: flex; flex-direction: column; gap: 10px; }
.node { position: relative; display: grid; grid-template-columns: 66px 1fr; align-items: center; column-gap: 10px; text-align: left; padding: 4px 6px; min-height: 134px; color: var(--cream); }
.node:hover:not([disabled]) { filter: brightness(1.15); }
.node .n-num { grid-row: 1 / 3; width: 62px; height: 62px; display: grid; place-items: center; font-size: 22px; font-weight: 700;
  border-style: solid; border-width: 9px; border-image: url(../assets/ui/btn_gray_normal.png) 6 fill / 9px; image-rendering: pixelated; }
.node.done .n-num { border-image-source: url(../assets/ui/btn_green_normal.png); color: var(--ink); }
.node.now .n-num { border-image-source: url(../assets/ui/btn_orange_normal.png); color: var(--ink); animation: blink 1s steps(2) infinite; }
.node .n-title { font-size: 23px; font-weight: 700; line-height: 1.1; align-self: end; }
.node .n-stars { display: flex; gap: 2px; align-self: start; margin-top: 4px; }
.node .n-stars .star { width: 24px; height: 24px; }
.node.locked { opacity: .45; cursor: not-allowed; }
.node.locked .n-num .ico { width: 28px; height: 28px; }
.n-bit { position: absolute; right: -4px; top: -34px; animation: hop 1.2s steps(2) infinite; }
@keyframes blink { 50% { filter: brightness(1.3); } }

/* ---------- level HUD ---------- */
#level { display: grid; grid-template-rows: 82px 1fr; }
.hud { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
#lvl-title { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; white-space: nowrap; }
.lvl-badge { display: inline-block; padding: 0 4px; font-weight: 700; font-size: 20px; color: var(--ink);
  border-style: solid; border-width: 8px; border-image: url(../assets/ui/btn_gold_normal.png) 6 fill / 8px; image-rendering: pixelated; }
.lvl-badge.w2 { border-image-source: url(../assets/ui/btn_green_normal.png); }
.lvl-badge.w3 { border-image-source: url(../assets/ui/btn_orange_normal.png); }
.lvl-badge.w4 { border-image-source: url(../assets/ui/btn_blue_normal.png); color: var(--cream); }
#goals { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 0 6px; margin: 0 4px; font-size: 22px; font-weight: 700; }
.goal-ico .ico { width: 36px; height: 36px; display: block; }
.goal-txt { flex: 1; line-height: 1.15; }
.chips { display: flex; gap: 8px; flex: 6; }
#goals .chips + * { display: none; }
.chip { font-size: 19px; padding: 3px 8px; background: #0f1820; border: 3px solid #3b5161; white-space: nowrap; }
.chip.done { background: #20483f; border-color: var(--teal); color: #d5f5e6; }
#stars-hud { display: flex; flex-direction: column; align-items: center; line-height: 1; }
#stars-hud .row { display: flex; gap: 2px; }
#stars-hud small { font-size: 15px; color: var(--muted); margin-top: 4px; }

/* ---------- play area ---------- */
#play { position: relative; }
#board-wrap { position: absolute; left: 12px; right: 12px; top: 4px; bottom: 104px; }
#board { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
#board image { image-rendering: pixelated; }
.dev-name { font-family: var(--font); font-weight: 700; font-size: 26px; fill: var(--cream); paint-order: stroke; stroke: var(--ink); stroke-width: 6px; stroke-linejoin: round; }
.dev-sub { font-family: var(--font); font-size: 20px; fill: var(--cream); paint-order: stroke; stroke: var(--ink); stroke-width: 5px; }
.plate-street { font-family: var(--font); font-weight: 700; fill: #fff; }
.plate-house { font-family: var(--font); font-weight: 700; fill: var(--ink); }
.plate-empty { font-family: var(--font); font-weight: 700; fill: var(--red); }
.dev { cursor: pointer; }
.dev .hit, .plate-hit { fill: transparent; }
.dev .halo { fill: rgba(255, 207, 92, .16); opacity: 0; }
.dev:hover .halo, .dev.cand .halo { opacity: 1; }
.dev.sel .halo { opacity: 1; fill: rgba(255, 207, 92, .22); stroke: var(--gold); stroke-width: 5; stroke-dasharray: 12 8; animation: march .6s steps(4) infinite; }
.dev.cand .art { animation: bounce .8s steps(2) infinite; }
.plate { cursor: pointer; }
.plate:hover .plate-hit { fill: rgba(255, 207, 92, .3); }
.plate.bump { animation: bump .4s steps(3); transform-box: fill-box; transform-origin: center; }
.dev.drop .art { animation: drop .35s steps(5); }
.art.shake { animation: shake .4s steps(6); }
@keyframes march { to { stroke-dashoffset: -40; } }
@keyframes bounce { 50% { transform: translateY(-6px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-9px); } 50% { transform: translateX(9px); } 75% { transform: translateX(-6px); } }
@keyframes drop { from { transform: translateY(-48px); } to { transform: none; } }
@keyframes bump { 50% { transform: scale(1.15); } }
.cable { cursor: pointer; }
.c-hit { fill: none; stroke: transparent; stroke-width: 30; }
.c-out { fill: none; stroke: var(--ink); stroke-width: 12; stroke-linejoin: miter; stroke-linecap: square; }
.c-in { fill: none; stroke: #4fa3d9; stroke-width: 5; stroke-linejoin: miter; stroke-linecap: square; }
.cable:hover .c-in { stroke: var(--gold); }
.cable.sel .c-in { stroke: var(--red); }
.cut-btn { cursor: pointer; }
.cut-btn rect { fill: #9a5969; stroke: var(--ink); stroke-width: 4; }
.rubber { stroke-width: 6; fill: none; stroke-dasharray: 12 10; }
.rubber.cable { stroke: var(--cream); } .rubber.ping { stroke: var(--gold); }
#l-ghost, #l-fx { pointer-events: none; }
.ghost rect { fill: rgba(86, 214, 178, .22); stroke: var(--teal); stroke-width: 5; stroke-dasharray: 12 8; }
.ghost.no rect { fill: rgba(255, 154, 149, .2); stroke: var(--red); }
.pkt.stuck { animation: shake .4s steps(6) 2; }
.arrive { fill: none; stroke: var(--teal); stroke-width: 6; animation: arrive .6s steps(5) forwards; }
@keyframes arrive { to { r: 80; opacity: 0; } }
.stop-mark rect { fill: #e2525e; stroke: var(--ink); stroke-width: 4; }
.stop-mark text { font-family: var(--logo); font-size: 20px; fill: #fff; }

/* Byte says */
.say { position: absolute; left: 12px; bottom: 6px; width: 560px; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; z-index: 4; }
.say p { pointer-events: auto; flex: 1; margin: 0 0 4px; padding: 0 6px; font-size: 21px; line-height: 1.22; color: var(--cream); min-height: 70px; display: flex; align-items: center; }
.say.ok p { border-image-source: url(../assets/ui/btn_green_normal.png); border-image-slice: 6 fill; color: var(--ink); }
.say.bad p { border-image-source: url(../assets/ui/btn_red_normal.png); border-image-slice: 6 fill; color: #fff0e9; }
.say.pop p { animation: popin .2s steps(3); }
.say-bit { flex: none; }
@keyframes popin { from { transform: scale(.92); opacity: .2; } to { transform: none; opacity: 1; } }

/* dock */
#dock { position: absolute; right: 12px; bottom: 4px; display: flex; align-items: stretch; gap: 8px; padding: 0 2px; }
#tray, #tools { display: flex; gap: 8px; align-items: center; }
#tray { padding-right: 10px; border-right: 3px dashed #3b5161; }
.tray-label { display: flex; flex-direction: column; align-items: center; font-size: 16px; color: var(--muted); }
.tray-label .ico { width: 28px; height: 28px; }
.tray-item, .tool { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 98px; height: 84px; padding: 0; font-size: 19px; }
.tray-item img { width: 48px; height: 48px; image-rendering: pixelated; }
.tool.active, .tray-item.active { transform: translateY(-4px); }
.tool.hint.nudge { border-image-source: url(../assets/ui/btn_gold_normal.png); color: var(--ink); animation: blink .8s steps(2) infinite; }

/* hint box */
#hintbox { position: absolute; right: 14px; bottom: 98px; width: 420px; padding: 4px 6px; z-index: 6; }
#hintbox header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#hintbox header b { display: flex; gap: 8px; align-items: center; font-size: 26px; color: var(--gold); }
#hintbox .icon-btn { width: 50px; height: 50px; }
#hintbox ol { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
#hintbox li { display: flex; gap: 10px; padding: 8px 10px; background: #0f1820; border: 3px solid #3b5161; line-height: 1.25; font-size: 20px; }
#hintbox li b { flex: none; width: 30px; height: 30px; background: var(--gold); color: var(--ink); display: grid; place-items: center; }
#hintbox li.solution { border-color: var(--red); }
#hintbox li.solution b { background: var(--red); }
#hintbox .btn { width: 100%; }
#hintbox p { margin: 0 0 10px; }

/* inspector */
#insp { position: absolute; right: 14px; top: 6px; width: 400px; max-height: calc(100% - 112px); overflow: auto; z-index: 5; padding: 2px 8px 8px; }
#insp.slide { animation: slidein .2s steps(3); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#insp header { display: flex; align-items: center; gap: 10px; }
#insp header h3 { font-size: 30px; color: var(--gold); }
#insp header > div { flex: 1; }
.insp-art { width: 64px; height: 64px; image-rendering: pixelated; }
#insp .icon-btn { width: 52px; height: 52px; }
.role { margin: 8px 0 4px; line-height: 1.3; font-size: 20px; }
.f-label { display: block; margin: 14px 0 6px; font-weight: 700; font-size: 22px; }
.f-label .muted { font-weight: 400; font-size: 17px; }
.plate-ed { display: inline-flex; align-items: stretch; border: 4px solid var(--ink); position: relative; box-shadow: 4px 4px 0 rgba(0,0,0,.35); }
.plate-ed input { font-family: var(--font); font-weight: 700; font-size: 28px; border: 0; height: 54px; text-align: center; outline: none; border-radius: 0; }
.pe-street { width: 164px; background: var(--street); color: #fff; box-shadow: inset 0 4px 0 #6f9bea; }
.pe-street::placeholder { color: #a9c2f5; }
.pe-house { width: 80px; background: var(--gold); color: var(--ink); box-shadow: inset 0 4px 0 #ffe7a8; border-left: 4px solid var(--ink) !important; }
.pe-house::placeholder { color: #9b7a2a; }
.plate-ed input:not([readonly]):focus { outline: 4px solid #fff; outline-offset: -4px; }
.plate-ed input[readonly] { cursor: default; filter: saturate(.75); }
.pe-lock { position: absolute; right: -40px; top: 12px; }
.pe-lock .ico { width: 28px; height: 28px; }
.plate-ed.mini input { font-size: 20px; height: 44px; }
.plate-ed.mini .pe-street { width: 108px; } .plate-ed.mini .pe-house { width: 52px; }
.if-row { margin-bottom: 10px; } .if-row > span { display: block; font-size: 18px; color: var(--muted); margin-bottom: 4px; }
.insp-err { margin: 12px 0 0; padding: 8px 10px; background: #623543; border: 3px solid var(--red); color: #fff0e9; font-size: 19px; }
.shake-x { animation: shake .35s steps(5); }
.links { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 18px; margin: 14px 0 6px; }
.links .ico { width: 24px; height: 24px; }
.site-tag { font-weight: 700; color: var(--gold); }
.ports { display: flex; gap: 8px; margin: 12px 0 6px; }
.ports i { width: 32px; height: 32px; background: #0f1820; border: 3px solid #3b5161; position: relative; }
.ports i.on { border-color: var(--teal); }
.ports i.on::after { content: ''; position: absolute; inset: 7px; background: var(--teal); }
.dns-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dns-name { width: 124px; height: 52px; border: 4px solid var(--ink); padding: 0 6px; font-family: var(--font); font-size: 20px; font-weight: 700; background: var(--cream); color: var(--ink); border-radius: 0; }
.dns-name:focus { outline: 4px solid var(--gold); outline-offset: 0; }
.dns-row .icon-btn { width: 44px; height: 44px; }
.dns-row .icon-btn .ico { width: 22px; height: 22px; }
.arrow-r { font-weight: 700; }

/* browser */
#browser { position: absolute; right: 14px; top: 6px; width: 500px; z-index: 7; padding: 0 4px 4px; }
#browser.slide { animation: slidein .2s steps(3); }
.b-top { display: flex; align-items: center; gap: 8px; padding: 0 0 6px; }
.b-title { flex: 1; font-weight: 700; font-size: 22px; color: var(--gold); }
.b-top .icon-btn { width: 50px; height: 50px; }
.bar { display: flex; gap: 8px; padding: 8px; background: #0f1820; border: 3px solid #3b5161; }
.url { flex: 1; min-width: 0; height: 58px; border: 4px solid var(--ink); padding: 0 10px; font-family: var(--font); font-size: 24px; font-weight: 700; background: var(--cream); color: var(--ink); border-radius: 0; }
.url:focus { outline: 4px solid var(--gold); outline-offset: 0; }
.b-page { min-height: 230px; display: grid; place-items: center; padding: 14px 6px 6px; }
.b-empty { text-align: center; max-width: 380px; line-height: 1.3; font-size: 20px; }
.b-empty.err p { color: #ffd0cc; }
.b-empty.loading img { animation: hop .5s steps(2) infinite; }
.site { text-align: center; width: 100%; padding: 12px; background: var(--cream); color: var(--ink); border: 4px solid var(--ink); animation: popin .25s steps(3); }
.site-art img { width: 144px; height: 108px; image-rendering: pixelated; }
.site h4 { font-size: 30px; margin: 4px 0; }
.site p { margin: 0; font-size: 20px; }

/* ---------- modal ---------- */
#modal { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(14, 20, 28, .72); }
#modal .card { width: 600px; max-height: 690px; overflow: auto; padding: 10px 22px 14px; text-align: center; }
#modal .card.wide { width: 920px; text-align: left; }
#modal .card.small { width: 470px; }
#modal .card.pop { animation: popin .22s steps(3); }
.card h2 { font-size: 42px; margin: 4px 0; }
.card h3 { font-size: 32px; margin: 4px 0; }
.card p { line-height: 1.3; }
.card .muted { color: #6d5a40; }
.intro-top { display: flex; justify-content: center; align-items: center; gap: 10px; }
.world-name { color: #6d5a40; font-weight: 700; font-size: 22px; }
.intro-goal { font-size: 26px; font-weight: 700; margin: 8px 0 14px; padding: 12px; background: #fff5d9; border: 4px solid var(--ink); }
.rules { list-style: none; padding: 0; margin: 0 auto 16px; display: grid; gap: 4px; width: max-content; text-align: left; }
.rules li { display: flex; align-items: center; gap: 10px; font-size: 21px; }
.rules .star { width: 26px; height: 26px; }
.row2 { display: flex; gap: 14px; justify-content: center; margin-top: 14px; }
.predict p { font-size: 26px; font-weight: 700; }
.m-head { display: flex; justify-content: space-between; align-items: center; }
.m-head h2 { display: flex; align-items: center; gap: 10px; font-size: 36px; }
.help-list { display: grid; gap: 10px; margin-top: 16px; }
.win-stars { display: flex; justify-content: center; gap: 12px; margin-top: 4px; }
.ws { opacity: 0; animation: starin .45s steps(4) forwards; animation-delay: var(--d); }
.ws:nth-child(2) { transform: translateY(-14px); }
.ws .star { width: 80px; height: 80px; }
@keyframes starin { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
.score { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 28px; font-weight: 700; margin: 2px 0 10px; }
.score .ico { width: 32px; height: 32px; }
.learn, .g-detail { display: flex; gap: 14px; align-items: center; text-align: left; padding: 12px; background: #263749; border: 4px solid var(--ink); color: var(--cream); }
.learn-ico { flex: none; width: 112px; height: 96px; display: grid; place-items: center; }
.learn-ico img { width: 96px; height: 96px; image-rendering: pixelated; }
.learn-ico img[src*="env_"] { width: 96px; height: 72px; }
.learn-ico svg { width: 112px; height: 60px; }
.learn h4, .g-detail h4 { font-size: 30px; color: var(--gold); }
.learn p, .g-detail p { margin: 4px 0; font-size: 21px; }
.learn small, .g-detail small { color: var(--muted); font-size: 18px; }
.learn .muted { color: var(--muted); }
.unlock { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 21px; }
.gloss { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.g-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; font-size: 18px; min-height: 128px; }
.g-card b { line-height: 1.05; text-align: center; }
.g-card.active { border-image-source: url(../assets/ui/btn_orange_normal.png); color: var(--ink); }
.g-card.locked { opacity: .45; cursor: not-allowed; }
.g-ico { width: 76px; height: 64px; display: grid; place-items: center; }
.g-ico img { width: 64px; height: 64px; image-rendering: pixelated; }
.g-ico img[src*="env_"] { width: 64px; height: 48px; }
.g-ico svg { width: 76px; height: 34px; }
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.look { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.look b { font-size: 24px; }
.look small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 17px; }
.look small .ico { width: 20px; height: 20px; }
.look.active { border-image-source: url(../assets/ui/btn_orange_normal.png); color: var(--ink); }
.look.active small { color: var(--ink); }
.look[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- coach overlay ---------- */
#coach { position: fixed; inset: 0; z-index: 100; pointer-events: none; font-family: var(--font); }
#coach .dim { position: absolute; inset: 0; background: rgba(8, 12, 20, .68); pointer-events: none; }
#coach .block { position: absolute; inset: 0; pointer-events: auto; }
#coach .ring { position: absolute; border: 6px dashed var(--gold); border-radius: 0 !important; pointer-events: none; animation: blink .7s steps(2) infinite; box-shadow: 0 0 0 4px var(--ink); }
#coach .arrow { position: absolute; width: 48px; height: 48px; pointer-events: none; transform: rotate(var(--rot)); }
#coach .arrow svg { width: 48px; height: 48px; animation: nudge .7s steps(2) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-4px); } }
#coach .bubble { position: absolute; width: 480px; display: flex; gap: 10px; align-items: flex-start; padding: 4px 8px; pointer-events: auto; box-shadow: 8px 8px 0 rgba(0,0,0,.35); }
#coach .bubble.pop { animation: popin .2s steps(3); }
#coach .b-bit img { image-rendering: pixelated; display: block; }
#coach .b-body { flex: 1; }
#coach .txt { margin: 4px 0 10px; font-size: 23px; line-height: 1.25; font-weight: 700; color: var(--ink); }
#coach .row { display: flex; align-items: center; gap: 8px; }
#coach .dots { display: flex; gap: 5px; }
#coach .dots i { width: 10px; height: 10px; background: #c9b58a; }
#coach .dots i.done { background: #3aa786; } #coach .dots i.now { background: var(--orange); outline: 2px solid var(--ink); }
#coach .count { font-size: 17px; color: #6d5a40; }
#coach .sp { flex: 1; }
#coach .skip { border: 0; background: none; font-size: 16px; color: #6d5a40; text-decoration: underline; padding: 6px; }
#coach .next { min-height: 52px; font-size: 21px; }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 110; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* side panels push the board aside instead of covering it */
#play.side-insp #board-wrap { right: 430px; }
#play.side-browser #board-wrap { right: 500px; }
#browser { width: 470px; }

/* level intro banner (non-blocking) */
#banner { position: absolute; left: 50%; top: 120px; transform: translateX(-50%); width: 640px; z-index: 8; text-align: center; padding: 8px 18px 12px; cursor: pointer;
  border-style: solid; border-width: 12px; border-image: url(../assets/ui/panel_cream.png) 4 fill / 12px; image-rendering: pixelated; color: var(--ink);
  box-shadow: 10px 10px 0 rgba(0,0,0,.4); animation: banin .3s steps(4); }
#banner.out { animation: banout .25s steps(3) forwards; }
@keyframes banin { from { transform: translate(-50%, -40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes banout { to { transform: translate(-50%, -30px); opacity: 0; } }
.ban-top { display: flex; justify-content: center; align-items: center; gap: 10px; }
#banner h2 { font-size: 44px; margin: 6px 0 2px; }
.ban-goal { font-size: 28px; margin: 4px 0 10px; }
.ban-rules { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 19px; color: #6d5a40; margin: 0; }
.ban-rules .star { width: 22px; height: 22px; }

/* readable text everywhere; pixel font only for titles */
h1, h2, h3, .map-head h2, .world h3, #insp header h3, #banner h2, .card h2, .b-title, .lvl-badge, .n-num, #hintbox header b { font-family: var(--pixel); font-weight: 400; letter-spacing: .5px; }
body, .btn, .tool, .tray-item, .icon-btn, .g-card, .look, input, .term, #coach, #coach .txt { font-family: var(--font); }
.btn, .tool, .tray-item, .g-card, .look { font-weight: 600; }
#coach .txt { font-weight: 500; font-size: 21px; line-height: 1.35; }
.say p { font-size: 19px; line-height: 1.35; }
#goals { font-size: 20px; font-weight: 600; }
.chip { font-size: 17px; }
.role, .learn p, .g-detail p, #hintbox li, .b-empty, .site p { font-size: 18px; line-height: 1.4; }
.node .n-title { font-size: 20px; font-weight: 600; }
.plate-ed input, .url, .dns-name { font-family: var(--font); font-weight: 600; }
.dev-name, .dev-sub, .plate-street, .plate-house, .plate-empty { font-family: var(--font); }
.dev-name { font-weight: 700; font-size: 24px; }
.plate-street, .plate-house { font-weight: 700; }
.t-sub { font-size: 25px; font-weight: 500; }

#coach .b-body { min-width: 0; }
#coach .row { flex-wrap: wrap; }
#coach .txt { overflow-wrap: anywhere; }
#btn-test { flex: none; min-height: 50px; font-size: 19px; }
#btn-test .ico { width: 24px; height: 24px; }
