@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  font-family: 'DM Sans', sans-serif;
  background: #101414;
  color: #f3f1e7;
  font-synthesis: none;
  --paper: #f3f1e7;
  --muted: #9da4a0;
  --orange: #f27f50;
  --green: #b7ee76;
  --panel: rgba(18, 24, 23, .9);
  --line: rgba(231, 236, 218, .14);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow: hidden; background: #101414; }
button, select { font: inherit; }
button { color: inherit; }
.game-shell { position: relative; width: 100vw; height: 100dvh; min-height: 560px; overflow: hidden; background: #a3a99b; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; outline: 0; touch-action: none; }
.vignette { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(8,13,12,.64),transparent 25%,transparent 55%,rgba(8,13,12,.67)),linear-gradient(90deg,rgba(8,13,12,.14),transparent 42%,rgba(8,13,12,.16)); }
.topbar { position: absolute; inset: 0 0 auto; z-index: 3; height: 76px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--paper); text-decoration: none; font: 500 11px 'DM Mono', monospace; letter-spacing: .13em; }
.brand b { font-weight: 500; color: var(--green); }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; background: var(--orange); color: #18201a; font: 700 18px 'Space Grotesk',sans-serif; transform: rotate(-5deg); }
.world-label,.eyebrow,.card-foot,.dock-heading,.dock-tip,.picker-wrap,.paint-picker,.text-button,.status-heading,.stat,.status-note { font-family: 'DM Mono',monospace; letter-spacing: .09em; }
.world-label { position: absolute; left: 50%; transform: translateX(-50%); color: var(--paper); font-size: 10px; }
.live-dot,.tip-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(183,238,118,.8); vertical-align: 1px; }
.divider { padding: 0 8px; color: rgba(255,255,255,.38); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button,.save-button { height: 36px; border: 1px solid rgba(255,255,255,.24); background: rgba(19,25,24,.34); cursor: pointer; transition: background .15s,border .15s; }
.icon-button:hover,.save-button:hover { border-color: var(--green); background: rgba(183,238,118,.1); }
.icon-button { width: 36px; border-radius: 50%; font: 600 14px 'DM Mono',monospace; }
.save-button { padding: 0 14px; color: var(--paper); font: 500 10px 'DM Mono',monospace; letter-spacing: .06em; }
.save-button span { color: var(--green); padding-right: 6px; font-size: 15px; }
.save-button kbd { padding-left: 5px; color: var(--green); }
.mouse-free { border-color: var(--green); color: var(--green); }
.intro-card { position: absolute; z-index: 2; top: 26%; left: 7%; width: 270px; padding: 23px 24px 18px; background: rgba(21,27,25,.82); border: 1px solid rgba(255,255,255,.15); box-shadow: 0 16px 70px rgba(0,0,0,.18); transition: opacity .25s,transform .25s; }
.intro-card.started { opacity: 0; transform: translateY(12px); pointer-events: none; }
.eyebrow { color: var(--green); font-size: 9px; }
.eyebrow span { color: var(--orange); padding-right: 8px; }
h1 { font: 600 34px/.99 'Space Grotesk',sans-serif; letter-spacing: -.07em; margin: 22px 0 13px; }
h1 em { color: var(--orange); font-style: normal; }
.intro-card p { margin: 0; color: #c1c6be; font-size: 12px; line-height: 1.7; }
.start-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 21px; padding: 0 14px; height: 41px; border: 0; color: #152019; background: var(--green); cursor: pointer; font: 600 10px 'DM Mono',monospace; letter-spacing: .11em; transition: background .15s,transform .15s; }
.start-button:hover { background: #d3ffa0; transform: translateY(-1px); }
.start-button span { font-size: 17px; }
.card-foot { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: #818a83; font-size: 8px; }
.reticle { z-index: 1; pointer-events: none; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; transform: translate(-50%,-50%); opacity: .8; }
.reticle i { position: absolute; width: 5px; height: 5px; border-color: white; border-style: solid; }
.reticle i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }.reticle i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }.reticle i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }.reticle i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.aim-label { z-index: 1; pointer-events: none; position: absolute; left: 50%; top: calc(50% + 17px); transform: translateX(-50%); color: white; text-shadow: 0 1px 4px #17201c; font: 500 8px 'DM Mono',monospace; letter-spacing: .12em; white-space: nowrap; }
.tool-dock { z-index: 3; position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(660px,calc(100vw - 380px)); min-width: 515px; padding: 15px 17px 11px; background: var(--panel); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 15px 55px rgba(0,0,0,.24); backdrop-filter: blur(14px); }
.dock-heading { height: 23px; display: flex; align-items: flex-start; justify-content: space-between; color: #a9b0a9; font-size: 9px; }
.mode-switch { display: flex; gap: 3px; margin-top: -6px; padding: 3px; background: rgba(0,0,0,.3); }
.mode-button { padding: 6px 11px; border: 0; color: #959e96; background: transparent; cursor: pointer; font: 500 9px 'DM Mono',monospace; letter-spacing: .05em; }
.mode-button.active { color: #172019; background: var(--green); }
.mode-button#destroy-mode.active { color: #fff3e8; background: var(--orange); }
.tools { display: flex; gap: 7px; }
.tool-button { display: grid; grid-template-columns: 24px 1fr 15px; align-items: center; gap: 5px; flex: 1; min-width: 86px; height: 43px; padding: 0 7px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #c4c9c1; text-align: left; cursor: pointer; transition: border .15s,background .15s,color .15s; }
.tool-button:hover { border-color: rgba(183,238,118,.5); color: white; }
.tool-button.active { border-color: var(--green); color: var(--green); background: rgba(183,238,118,.09); }
.tool-button.active.destroy-tool { border-color: var(--orange); color: var(--orange); background: rgba(242,127,80,.11); }
.tool-icon { font: 20px 'Space Grotesk',sans-serif; text-align: center; }
.tool-button span:nth-child(2) { font-size: 11px; }
kbd { justify-self: end; color: #768079; font: 9px 'DM Mono',monospace; }
.destroy-tool,.connection-picker { display: none; }
.dock-controls { display: flex; align-items: center; gap: 12px; min-height: 47px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.picker-wrap { display: flex; align-items: center; gap: 7px; color: #849087; font-size: 8px; }
select { max-width: 135px; height: 28px; padding: 0 20px 0 8px; color: #e6e9df; border: 1px solid rgba(255,255,255,.18); border-radius: 0; background-color: #202725; font: 10px 'DM Sans',sans-serif; }
.connection-picker select { max-width: 99px; }
.paint-picker { display: flex; align-items: center; gap: 6px; color: #849087; font-size: 8px; cursor: pointer; }
.paint-picker input { width: 19px; height: 19px; padding: 1px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.text-button { margin-left: auto; padding: 8px 0 8px 8px; border: 0; background: none; color: #c5cdc3; cursor: pointer; font-size: 8px; white-space: nowrap; }
.text-button:hover { color: var(--green); }
.text-button span { padding-left: 4px; color: var(--green); }
.dock-tip { color: #87918a; text-align: center; font-size: 8px; letter-spacing: .08em; }
.tip-dot { width: 5px; height: 5px; margin-right: 5px; }
.tip-sep { padding: 0 6px; color: var(--orange); }
.status-card { z-index: 2; position: absolute; top: 104px; right: 40px; width: 174px; padding: 15px 15px 12px; background: rgba(18,24,23,.78); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(9px); }
.status-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; color: #e8ebe1; font-size: 9px; }
.status-live { color: var(--green); font-size: 8px; }
.stat { display: flex; justify-content: space-between; padding: 7px 0; color: #8d9990; font-size: 8px; }
.stat b { color: var(--paper); font: 500 13px 'Space Grotesk',sans-serif; }
.status-rule { margin: 8px 0 10px; border-top: 1px solid var(--line); }
.status-note { color: #a2aaa3; font-size: 7px; line-height: 2.2; }
.key-hint { display: inline-block; min-width: 42px; margin-right: 5px; color: var(--green); }
.toast { z-index: 6; position: absolute; left: 50%; top: 92px; transform: translate(-50%,-8px); padding: 10px 15px; background: rgba(18,24,23,.94); border: 1px solid rgba(183,238,118,.42); color: var(--paper); font: 10px 'DM Mono',monospace; letter-spacing: .04em; opacity: 0; transition: opacity .18s,transform .18s; pointer-events: none; }
.toast.show { transform: translate(-50%,0); opacity: 1; }
.help-modal { z-index: 10; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,12,11,.74); backdrop-filter: blur(5px); }
.help-modal[hidden] { display: none; }
.help-content { position: relative; width: min(450px,calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 28px; background: #19201e; border: 1px solid var(--line); box-shadow: 0 20px 80px #0008; }
.help-content h2 { margin: 16px 0 12px; font: 600 29px 'Space Grotesk',sans-serif; letter-spacing: -.06em; }
.help-content p { color: #bac2b9; font-size: 12px; line-height: 1.65; }
.help-content p b { color: var(--green); font-weight: 600; }
.settings-controls { display: grid; gap: 14px; margin-top: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.setting-row { display: grid; gap: 8px; color: #aab4aa; font: 9px 'DM Mono',monospace; letter-spacing: .08em; }
.setting-row span { display: flex; justify-content: space-between; }
.setting-row output { color: var(--green); }
.setting-row input { width: 100%; accent-color: var(--green); cursor: pointer; }
.close-button { position: absolute; top: 14px; right: 16px; border: 0; background: none; color: #aab1a9; font-size: 24px; cursor: pointer; }
@media (max-width: 900px) {
  .topbar { padding: 0 20px; }.world-label { display: none; }.status-card { right: 20px; top: 88px; width: 150px; }.intro-card { left: 25px; top: 20%; }.tool-dock { width: calc(100vw - 36px); min-width: 0; bottom: 15px; }.tool-button { min-width: 0; grid-template-columns: 19px 1fr 11px; padding: 0 5px; }.tool-button span:nth-child(2) { font-size: 10px; }.dock-controls { gap: 8px; }.picker-wrap { gap: 4px; }select { max-width: 118px; }
}
@media (max-width: 620px) {
  .game-shell { min-height: 500px; }  .topbar { height: 60px; padding: 0 13px; }.brand { gap: 8px; font-size: 9px; }.brand-mark { width: 27px; height: 27px; }.world-label { display: none; }.save-button { padding: 0 8px; font-size: 8px; }.mouse-button kbd { display: none; }.intro-card { top: 16%; left: 15px; width: 218px; padding: 17px; }.intro-card h1 { font-size: 29px; margin-top: 16px; }.status-card { top: 75px; right: 12px; width: 130px; padding: 11px; }.status-heading { margin-bottom: 9px; }.status-note { font-size: 6px; }.tool-dock { bottom: 9px; width: calc(100vw - 16px); padding: 10px 9px 8px; }.tools { gap: 4px; }.tool-button { height: 39px; grid-template-columns: 16px 1fr; gap: 2px; padding: 0 3px; }.tool-button kbd { display: none; }.tool-icon { font-size: 17px; }.tool-button span:nth-child(2) { font-size: 9px; }.dock-controls { min-height: 41px; flex-wrap: wrap; gap: 6px 10px; margin-top: 7px; }.picker-wrap,.paint-picker { font-size: 7px; }.picker-wrap select { max-width: 105px; height: 25px; font-size: 9px; }.connection-picker select { max-width: 77px; }.paint-picker input { width: 17px; height: 17px; }.text-button { font-size: 7px; }.dock-tip { font-size: 7px; }
}
