/* Codeland: black glass and chrome over a bright pixel world. */
:root {
  --glass: rgba(14, 15, 19, 0.78);
  --glass-2: rgba(28, 30, 37, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.22);
  --text: #f2f3f5;
  --mist: #a3a8b0;
  --gold: #f7dc5a;
  --gold-2: #f2b027;
  --red: #e8434f;
  --ok: #5bb84a;
  --ad-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: 'Saira', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #030303; color: var(--text); font: 14px/1.4 var(--body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; font: inherit; color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:is(button, a, label, .tool) > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

#game { position: fixed; inset: 0 0 var(--ad-h) 0; overflow: hidden; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; image-rendering: pixelated; cursor: default; touch-action: none; }
html[data-mode="paint"] #view { cursor: crosshair; }
html[data-mode="smash"] #view { cursor: pointer; }
#frames { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.screen-frame { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; image-rendering: auto; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03)); font-weight: 700; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:hover { background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.gold { background: linear-gradient(180deg, #ffe979, #f2b027); color: #1b1407; border-color: #ffe27a; box-shadow: 0 2px 0 #9a6a12, 0 6px 20px rgba(242,176,39,0.25); }
.btn.gold:hover { background: linear-gradient(180deg, #fff09a, #f7bd3a); }
.btn.red { background: linear-gradient(180deg, #ff6b74, #c52b37); border-color: #ff8a92; color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--mist); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 12px; border-radius: 9px; }
.btn.heart.on { color: #ff8ac0; border-color: #ff8ac0; }
.btn b { font-weight: 900; }
.iconbtn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.iconbtn:hover { border-color: var(--line-2); }
.iconbtn:active { transform: scale(0.95); }
#btn-mute .offx { display: none; }
#btn-mute.off .offx { display: inline; }
#btn-mute.off .on { display: none; }
.pill { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass); font-weight: 700; backdrop-filter: blur(10px); z-index: 6; }

/* ---- HUD ---- */
.hud-tl { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; display: flex; align-items: center; gap: 8px; z-index: 5; }
.back { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); color: var(--text); backdrop-filter: blur(10px); }
.brand { padding: 5px 14px 6px; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); }
.brand h1 { margin: 0; font: italic 900 20px/1 var(--display); text-transform: uppercase; letter-spacing: .5px; background: linear-gradient(180deg, #fff, #dfe2e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand h1 b { background: linear-gradient(180deg, #ffe979, #f2b027); -webkit-background-clip: text; background-clip: text; }
.brand p { margin: 2px 0 0; font-size: 11px; color: var(--mist); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-tr { position: absolute; top: calc(10px + var(--safe-t)); right: 10px; display: flex; gap: 6px; z-index: 5; }
.zoom { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 4; }
#net { position: absolute; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(120, 30, 30, .85); font-weight: 700; z-index: 8; }
#ticker { position: absolute; top: calc(64px + var(--safe-t)); left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 4; max-width: min(360px, calc(100% - 70px)); }
.tick { text-align: left; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); font-size: 12.5px; animation: slidein .35s ease-out; transition: opacity .6s, transform .6s; }
.tick.smashed { border-color: rgba(232,67,79,.5); }
.tick.rebuilt { border-color: rgba(91,184,74,.55); }
.tick.out { opacity: 0; transform: translateX(-20px); }
.tick b { color: #fff; }
.tick i { font-style: normal; color: var(--gold); }
@keyframes slidein { from { opacity: 0; transform: translateX(-20px); } }

#toasts { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 30; pointer-events: none; width: min(92vw, 460px); }
.toast { padding: 10px 16px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); font-weight: 600; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .25s ease-out; transition: opacity .5s, transform .5s; }
.toast.good { border-color: rgba(91,184,74,.7); }
.toast.bad { border-color: rgba(232,67,79,.7); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes pop { from { opacity: 0; transform: scale(.9); } }

/* ---- Dock ---- */
.dock { position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 6; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.dock button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 7px 8px 6px; border-radius: 14px; border: 1px solid transparent; background: none; font-size: 11px; font-weight: 700; color: var(--mist); }
.dock button svg { width: 22px; height: 22px; }
.dock button:hover { color: var(--text); }
.dock button.on { color: #1b1407; background: linear-gradient(180deg, #ffe979, #f2b027); }
.dock button.build { color: #fff; background: linear-gradient(180deg, #4c8dff, #2f5fc4); border-color: #77a8ff; min-width: 70px; }
.dock .sep { width: 1px; height: 34px; background: var(--line); margin: 0 4px; }
html.placing .dock, html.editing .dock { display: none; }

.bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); z-index: 6; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); max-width: calc(100% - 20px); }
.bar.note { margin: 0; padding: 10px 16px; font-weight: 600; color: #ffd0d3; border-color: rgba(232,67,79,.45); text-align: center; }
#paintbar { display: flex; align-items: center; gap: 10px; }
.grounds { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: min(760px, calc(100vw - 150px)); }
.grounds::-webkit-scrollbar { display: none; }
.gsw { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 2px solid transparent; background: linear-gradient(135deg, var(--c) 50%, var(--d) 50%); position: relative; }
.gsw span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gsw.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.gsw.natural { background: repeating-linear-gradient(45deg, #5bb84a 0 6px, #3d93db 6px 12px, #f0d48a 12px 18px); }
.seg { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: rgba(0,0,0,.35); }
.seg span { padding: 0 6px; font-size: 11px; color: var(--mist); font-weight: 700; }
.seg button { min-width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; font-weight: 800; color: var(--mist); }
.seg button.on { background: #fff; color: #111; }

.placebar { text-align: center; bottom: calc(10px + var(--safe-b)); padding: 10px 12px; border-color: rgba(247,220,90,.5); }
.placebar p { margin: 0 0 8px; font-weight: 600; color: #fff3c4; }
.placebar .row { display: flex; gap: 8px; justify-content: center; }

/* ---- Card ---- */
.sheet { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); width: min(560px, calc(100% - 20px)); padding: 12px 14px 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--glass-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 7; box-shadow: 0 16px 50px rgba(0,0,0,.5); animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }
.c-head { display: flex; align-items: center; gap: 8px; }
.c-head b { flex: 1; font: italic 800 19px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-by { margin: 2px 0 10px; color: var(--mist); font-size: 12.5px; }
.c-note { margin: 0 0 10px; }
.c-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.c-acts .btn { min-height: 36px; padding: 6px 12px; }
.x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--mist); flex: none; }
.x svg { width: 18px; height: 18px; }

/* ---- Chat ---- */
#chatlog { position: absolute; left: 10px; bottom: calc(90px + var(--safe-b)); margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; z-index: 3; max-width: min(340px, 60vw); pointer-events: none; }
#chatlog li { padding: 4px 10px; border-radius: 10px; background: rgba(0,0,0,.45); font-size: 12.5px; transition: opacity 1s; }
#chatlog li.old { opacity: 0; }
#chatlog b { color: var(--gold); margin-right: 4px; }
.chat { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); display: flex; gap: 6px; width: min(480px, calc(100% - 20px)); z-index: 9; }
.chat input { flex: 1; min-height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--glass-2); outline: none; }
.emotes { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); display: grid; grid-template-columns: repeat(5, 48px); gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass-2); z-index: 9; }
.emotes button { width: 48px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.95); display: grid; place-items: center; }
.emotes canvas { image-rendering: pixelated; }

/* ---- Phone controls ---- */
#stick, #btn-jump { display: none; }
@media (pointer: coarse) {
  #stick { display: block; position: absolute; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(92px + var(--safe-b)); width: 104px; height: 104px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(10,10,14,.35); z-index: 4; touch-action: none; }
  #stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
  #btn-jump { display: grid; place-items: center; position: absolute; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(104px + var(--safe-b)); width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(10,10,14,.5); z-index: 4; touch-action: none; }
  #btn-jump svg { width: 28px; height: 28px; }
  html.placing #stick, html.placing #btn-jump, html[data-mode="paint"] #stick, html[data-mode="paint"] #btn-jump { display: none; }
  #chatlog { bottom: calc(206px + var(--safe-b)); }
  .zoom { display: none; }
}

/* ---- Panels ---- */
.panel, .modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); animation: fade .15s; }
.modal { position: fixed; z-index: 60; }
@keyframes fade { from { opacity: 0; } }
.card { position: relative; width: min(420px, 100%); max-height: calc(100% - 10px); overflow: auto; padding: 18px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--glass-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.card.wide { width: min(640px, 100%); }
.card h2 { margin: 0 40px 12px 0; font: italic 900 24px/1.1 var(--display); text-transform: uppercase; }
.card h3 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--mist); }
.card h3 span { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.card > .x { position: absolute; top: 14px; right: 14px; }
.hint { color: var(--mist); font-size: 12.5px; }
.card input[type=search] { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.35); outline: none; }
.results, .list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.results button, .list button, .list li { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid transparent; background: rgba(255,255,255,.05); text-align: left; }
.list li:has(button) { padding: 0; background: none; }
.results button:hover, .list button:hover { border-color: var(--line-2); }
.results span, .list span { margin-left: auto; color: var(--mist); font-size: 12px; white-space: nowrap; }
.list i { font-style: normal; color: var(--gold); }
.list .rank { flex: none; width: 22px; color: var(--mist); font-weight: 800; }
.none { color: var(--mist); padding: 10px 4px !important; background: none !important; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: none; font-weight: 700; color: var(--mist); }
.tabs button.on { background: #fff; color: #111; border-color: #fff; }
.colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.colors .sw { aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; background: var(--c); }
.colors .sw.on { border-color: #fff; box-shadow: 0 0 0 2px #000 inset; }
.vol { width: 100%; accent-color: var(--gold); }
.who a { color: var(--gold); }
.reasons { display: grid; gap: 6px; }
.map-card { width: min(560px, 100%); }
.map-card canvas { width: 100%; aspect-ratio: 1; border-radius: 12px; image-rendering: pixelated; cursor: crosshair; display: block; background: #2662b6; }
.how-card { text-align: center; }
.how .pic { width: 100%; height: auto; max-height: 180px; margin-bottom: 8px; stroke: none; }
.how h2 { margin: 6px 0 6px; }
.how p { margin: 0 0 14px; color: #d6d9de; font-size: 15px; }
.dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.dots i.on { background: var(--gold); }
.h-next { width: 100%; min-height: 48px; font-size: 16px; }

/* ---- Make something ---- */
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 12px; }
.tpl:hover { border-color: var(--gold); background: rgba(247,220,90,.08); }
.tpl canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.tpl .scr { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; background: #1c2d6b; color: #f7dc5a; font: 800 14px/1 ui-monospace, monospace; font-style: normal; }

/* ---- Maker ---- */
.editor { position: fixed; inset: 0 0 var(--ad-h) 0; z-index: 50; display: flex; flex-direction: column; background: #0c0d10; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; border-bottom: 1px solid var(--line); background: #121318; flex-wrap: wrap; }
.ed-name { min-width: 0; width: 200px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.4); font-weight: 700; outline: none; }
.ed-top .grow { flex: 1; }
.ed-err { margin: 0; color: #ff9aa1; font-weight: 600; font-size: 13px; max-width: 360px; }
.ed-body { position: relative; flex: 1; min-height: 0; }
.pane { position: absolute; inset: 0; display: grid; }
.ed-top .iconbtn { background: rgba(255,255,255,.04); }

.art-pane { grid-template-columns: 56px 1fr 300px; }
.tools { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-right: 1px solid var(--line); overflow-y: auto; }
.tool { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 11px; border: 1px solid transparent; background: none; color: var(--mist); }
.tool:hover { color: #fff; background: rgba(255,255,255,.06); }
.tool.on { color: #111; background: var(--gold); }
.tools .sep { width: 28px; height: 1px; background: var(--line); margin: 4px 0; }
.canvas-wrap { display: grid; place-items: center; min-width: 0; min-height: 0; padding: 12px; background: radial-gradient(circle at 50% 40%, #1b1d24, #0c0d10); }
.canvas-wrap canvas { image-rendering: pixelated; touch-action: none; box-shadow: 0 0 0 1px var(--line-2), 0 20px 50px rgba(0,0,0,.5); cursor: crosshair; }
.side { padding: 12px; border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.palette .sw { aspect-ratio: 1; border-radius: 6px; border: 2px solid transparent; background: var(--c); padding: 0; }
.palette .sw.on { border-color: #fff; box-shadow: 0 0 0 2px #000 inset; }
.frames { display: flex; gap: 6px; align-items: center; }
.strip { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding-bottom: 2px; }
.fr { position: relative; flex: none; width: 52px; height: 52px; padding: 4px; border-radius: 10px; border: 2px solid var(--line); background: #1a1b20; }
.fr.on { border-color: var(--gold); }
.fr canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.fr i { position: absolute; left: 3px; bottom: 1px; font-size: 10px; font-style: normal; color: var(--mist); }
.fr .del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #333; font-size: 12px; line-height: 18px; display: none; }
.fr.on .del { display: block; }
.side .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--mist); }
.side select { padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line-2); background: #1a1b20; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.preview { display: grid; place-items: center; padding: 8px; border-radius: 12px; background: #5bb84a; }
.preview canvas { image-rendering: pixelated; }

.code-pane { grid-template-columns: 1fr 380px; }
.bl { position: relative; min-width: 0; min-height: 0; }
.bl .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mist); margin: 0; padding: 20px; text-align: center; }
.stage { border-left: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; background: #101115; }
.stage-top { display: flex; align-items: center; gap: 6px; }
.stage-top .grow { flex: 1; }
.stage-top select { max-width: 150px; padding: 5px 6px; border-radius: 9px; border: 1px solid var(--line-2); background: #1a1b20; font-size: 12px; }
.stage-cv { width: 100%; aspect-ratio: 3 / 2; border-radius: 12px; image-rendering: pixelated; touch-action: none; outline: none; box-shadow: 0 0 0 1px var(--line-2); }
.stage-cv:focus { box-shadow: 0 0 0 2px var(--gold); }
.stage .hint { margin: 0; }
.btn.small svg { width: 14px; height: 14px; }

.html-pane { grid-template-columns: 1fr 1fr; }
.code-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px; gap: 8px; border-right: 1px solid var(--line); }
.html-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--mist); }
.html-top select { flex: 1; min-width: 140px; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line-2); background: #1a1b20; }
.html-top input { width: 64px; padding: 6px 6px; border-radius: 9px; border: 1px solid var(--line-2); background: #1a1b20; }
.src { flex: 1; min-height: 160px; resize: none; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #08090b; color: #e6f0ff; font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; outline: none; tab-size: 2; white-space: pre-wrap; word-break: break-all; }
.count { margin: 0; color: var(--mist); font-size: 11px; text-align: right; }
.prev-col { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: #101115; }
.frame-wrap { position: relative; padding: 4px; border-radius: 12px; background: repeating-conic-gradient(#202228 0 25%, #191a1f 0 50%) 0 0 / 16px 16px; overflow: hidden; }
.frame-wrap iframe { border: 0; transform-origin: 0 0; background: #fff; display: block; }
.issues { margin: 0; padding-left: 18px; color: #ffd27a; font-size: 12.5px; }

/* Blockly, in our colours */
.blocklyToolboxDiv { padding-top: 6px; }
.blocklyTreeRow, .blocklyToolboxCategory { margin-bottom: 2px; }
.blocklyTreeLabel, .blocklyToolboxCategoryLabel { font: 700 13px var(--body) !important; color: #e8eaef; }
.blocklyMainBackground { stroke: none !important; }
.blocklyWidgetDiv .blocklyMenu, .blocklyDropDownDiv { font-family: var(--body) !important; }
.blocklyFlyoutBackground { fill-opacity: .97; }

@media (max-width: 860px) {
  .art-pane { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .tools { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; justify-content: flex-start; }
  .tools .sep { width: 1px; height: 28px; margin: 0 4px; }
  .side { border-left: 0; border-top: 1px solid var(--line); max-height: 42vh; }
  .palette { grid-template-columns: repeat(16, 1fr); }
  .preview { display: none; }
  .code-pane { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .stage { order: -1; border-left: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .stage-cv { width: 46%; max-width: 240px; }
  .stage-top { width: 100%; }
  .stage .hint { flex: 1; min-width: 140px; font-size: 11px; }
  .html-pane { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .code-col { border-right: 0; }
  .prev-col { max-height: 40vh; border-top: 1px solid var(--line); }
  .ed-name { width: 140px; flex: 1; }
  .ed-top .btn.gold { padding: 8px 12px; }
}
@media (max-width: 560px) {
  .brand p { display: none; }
  .brand h1 { font-size: 17px; }
  .hud-tr { gap: 4px; }
  .iconbtn { width: 38px; height: 38px; border-radius: 11px; }
  .back { width: 38px; height: 38px; border-radius: 11px; }
  .hud-tr #btn-help, .hud-tr #btn-mute { display: none; }
  .dock { gap: 0; padding: 4px; border-radius: 16px; }
  .dock button { min-width: 48px; padding: 6px 4px 5px; font-size: 10px; }
  .dock button.build { min-width: 56px; }
  .dock .sep { margin: 0 2px; }
  .bar, .sheet, .chat, .emotes, .pill { bottom: calc(74px + var(--safe-b)); }
  #stick { bottom: calc(80px + var(--safe-b)); width: 92px; height: 92px; }
  #btn-jump { bottom: calc(90px + var(--safe-b)); }
  .grounds { max-width: calc(100vw - 40px); }
  #paintbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .placebar { bottom: calc(10px + var(--safe-b)); }
  .ed-err { order: 9; width: 100%; max-width: none; }
  .ed-name { order: 8; width: 100%; flex: 1 1 100%; min-height: 36px; }
  .ed-top .grow { display: none; }
  .ed-top .btn.gold { margin-left: auto; }
  .tabs button { padding: 6px 9px; }
}
@media (max-height: 500px) {
  .dock button span { display: none; }
  .dock button { min-width: 44px; }
  .bar, .sheet, .chat, .emotes { bottom: calc(60px + var(--safe-b)); }
  #stick { bottom: 14px; width: 84px; height: 84px; left: 70px; }
  #btn-jump { bottom: 24px; right: 70px; }
  .side { max-height: none; }
}
