/* DWAPP Banner Lab: a Dark War Survival fan tool. A game HUD (amber on gunmetal, clipped buttons, corner brackets,
   Chakra Petch and Black Ops One); a night base like the game, a concrete-and-sand day when asked. The pixel preview and
   the crop window stay dark in both, like a screen. The canvas lettering fonts (Black Ops One, Russo One, Bungee,
   Orbitron, Press Start 2P) are declared here so dws.js can draw with them under the CSP (font-src 'self'). */

@font-face {
  font-family: "Chakra Petch";
  src: url(assets/fonts/chakrapetch-400-vietnamese.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url(assets/fonts/chakrapetch-400-latin.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url(assets/fonts/chakrapetch-600-vietnamese.woff2) format("woff2");
  font-weight: 600;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url(assets/fonts/chakrapetch-600-latin.woff2) format("woff2");
  font-weight: 600;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url(assets/fonts/chakrapetch-700-vietnamese.woff2) format("woff2");
  font-weight: 700;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url(assets/fonts/chakrapetch-700-latin.woff2) format("woff2");
  font-weight: 700;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Black Ops One";
  src: url(assets/fonts/blackopsone-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Russo One";
  src: url(assets/fonts/russoone-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Bungee";
  src: url(assets/fonts/bungee-400-vietnamese.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Bungee";
  src: url(assets/fonts/bungee-400-latin.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Orbitron";
  src: url(assets/fonts/orbitron-900-latin.woff2) format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Press Start 2P";
  src: url(assets/fonts/pressstart2p-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* The text layers' fonts: Google Fonts hosted here (OFL), loaded only when a layer uses one (the CSP allows no
   font from elsewhere). VT323 and Be Vietnam Pro are the site's own files. */
@font-face {
  font-family: "Bebas Neue";
  src: url(assets/fonts/bebasneue-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Anton";
  src: url(assets/fonts/anton-400-vietnamese.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Anton";
  src: url(assets/fonts/anton-400-latin.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Bangers";
  src: url(assets/fonts/bangers-400-vietnamese.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Bangers";
  src: url(assets/fonts/bangers-400-latin.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Creepster";
  src: url(assets/fonts/creepster-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nosifer";
  src: url(assets/fonts/nosifer-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Metal Mania";
  src: url(assets/fonts/metalmania-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Rubik Glitch";
  src: url(assets/fonts/rubikglitch-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url(assets/fonts/silkscreen-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Righteous";
  src: url(assets/fonts/righteous-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Audiowide";
  src: url(assets/fonts/audiowide-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Staatliches";
  src: url(assets/fonts/staatliches-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Lobster";
  src: url(assets/fonts/lobster-400-vietnamese.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Lobster";
  src: url(assets/fonts/lobster-400-latin.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Pacifico";
  src: url(assets/fonts/pacifico-400-vietnamese.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Pacifico";
  src: url(assets/fonts/pacifico-400-latin.woff2) format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Caveat Brush";
  src: url(assets/fonts/caveatbrush-400-latin.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Teko";
  src: url(assets/fonts/teko-600-latin.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url(assets/fonts/vt323-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url(assets/fonts/vt323-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url(assets/fonts/bevietnampro-800-vietnamese.woff2) format("woff2");
  font-weight: 800;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url(assets/fonts/bevietnampro-800-latin.woff2) format("woff2");
  font-weight: 800;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}

/* Korean, Chinese and Japanese pages: Chakra Petch has no hangul, hanzi or kana, so those fall to the system's own
   fonts (none are hosted: CJK fonts weigh megabytes); latin letters and digits keep Chakra Petch. */
:root:lang(ko) {
  --ui: "Chakra Petch", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
:root:lang(zh-Hans) {
  --ui: "Chakra Petch", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
:root:lang(ja) {
  --ui: "Chakra Petch", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans JP", system-ui,
    sans-serif;
}
/* the HUD's wide letter-spacing suits latin capitals; hangul, hanzi and kana read better nearly set solid */
:root:is(:lang(ko), :lang(zh-Hans), :lang(ja)) :is(h2, label, .label, .eyebrow, .chip, .meta, .btn, .link, .dw-links a,
  .style-tag, .stat span, .style-card[aria-pressed="true"]::after) {
  letter-spacing: 0.5px;
}

/* --- tokens: day (concrete and sand) by default, night when the system or the switch asks -------------- */
:root {
  --display: "Black Ops One", Impact, "Arial Black", sans-serif;
  --ui: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
  --accent: #ffb627;
  --accent-hi: #ffe08a;
  --accent-lo: #f09300;
  --orange: #ff7a18;
  --on-accent: #1d1200;
  --red: #e0283a;

  --bg: #e6e2d7;
  --grid: rgba(40, 36, 24, 0.06);
  --glow-a: rgba(255, 140, 0, 0.16);
  --glow-b: rgba(0, 140, 170, 0.08);
  --panel-a: #f8f6f0;
  --panel-b: #eeeae0;
  --panel-shadow: 0 18px 36px rgba(60, 50, 30, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --field: #fffdf8;
  --field-shadow: inset 0 2px 4px rgba(60, 50, 30, 0.08);
  --line: #cdc5b2;
  --line-2: #b1a78f;
  --text: #1b2026;
  --muted: #56606b;
  --label: #333c46;
  --ink: #9a5600;
  --ink-grad: linear-gradient(180deg, #e88f00 10%, #c06a00 55%, #9a4a00);
  --cyan: #0a7690;
  --green: #2c7a30;
  --card-a: #fbfaf6;
  --card-b: #f1ede4;
  --card-sel: linear-gradient(180deg, #fff5d9, #fbe9bd);
  --tile: #fbfaf6;
  --val-bg: #ffffff;
  --track: #d9d2c1;
  --track-line: #bfb59e;
  --knob: #8a8270;
  --sec-a: #ffffff;
  --sec-b: #ebe6da;
  --sec-line: #b4a98f;
  --notice-bg: #fff4d6;
  --notice-line: #e2c477;
  --notice-text: #4a3a10;
  --ok-bg: #e7f4e2;
  --ok-line: rgba(44, 122, 48, 0.4);
  --ok-text: #22432a;
  --code: #1d6b4a;
  --h1-shadow: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.7));
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #080b10;
  --grid: rgba(255, 255, 255, 0.025);
  --glow-a: rgba(255, 122, 24, 0.16);
  --glow-b: rgba(69, 227, 255, 0.09);
  --panel-a: #151d27;
  --panel-b: #0f151c;
  --panel-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --field: #070a0e;
  --field-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
  --line: #243140;
  --line-2: #34465a;
  --text: #eef3f8;
  --muted: #90a1b4;
  --label: #c6d2df;
  --ink: #ffb627;
  --ink-grad: linear-gradient(180deg, #ffe08a 10%, #ffb627 55%, #ff7a18);
  --cyan: #45e3ff;
  --green: #8cff6b;
  --card-a: #111821;
  --card-b: #0b1016;
  --card-sel: linear-gradient(180deg, #1f1b10, #0f0e0a);
  --tile: #0a0f15;
  --val-bg: #0a1118;
  --track: #1c2733;
  --track-line: #2e3d4d;
  --knob: #5d6f83;
  --sec-a: #2a3746;
  --sec-b: #1a232d;
  --sec-line: #445a70;
  --notice-bg: #17130a;
  --notice-line: #43360f;
  --notice-text: #e6dab7;
  --ok-bg: #0f1a10;
  --ok-line: rgba(140, 255, 107, 0.35);
  --ok-text: #cfe9c6;
  --code: #a8f0cf;
  --h1-shadow: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6));
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --bg: #080b10;
    --grid: rgba(255, 255, 255, 0.025);
    --glow-a: rgba(255, 122, 24, 0.16);
    --glow-b: rgba(69, 227, 255, 0.09);
    --panel-a: #151d27;
    --panel-b: #0f151c;
    --panel-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --field: #070a0e;
    --field-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
    --line: #243140;
    --line-2: #34465a;
    --text: #eef3f8;
    --muted: #90a1b4;
    --label: #c6d2df;
    --ink: #ffb627;
    --ink-grad: linear-gradient(180deg, #ffe08a 10%, #ffb627 55%, #ff7a18);
    --cyan: #45e3ff;
    --green: #8cff6b;
    --card-a: #111821;
    --card-b: #0b1016;
    --card-sel: linear-gradient(180deg, #1f1b10, #0f0e0a);
    --tile: #0a0f15;
    --val-bg: #0a1118;
    --track: #1c2733;
    --track-line: #2e3d4d;
    --knob: #5d6f83;
    --sec-a: #2a3746;
    --sec-b: #1a232d;
    --sec-line: #445a70;
    --notice-bg: #17130a;
    --notice-line: #43360f;
    --notice-text: #e6dab7;
    --ok-bg: #0f1a10;
    --ok-line: rgba(140, 255, 107, 0.35);
    --ok-text: #cfe9c6;
    --code: #a8f0cf;
    --h1-shadow: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6));
    color-scheme: dark;
  }
}

/* --- base ------------------------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 var(--ui);
  background:
    radial-gradient(1000px 520px at 85% -12%, var(--glow-a), transparent 60%),
    radial-gradient(900px 520px at -5% 0%, var(--glow-b), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
}
p {
  margin: 0;
}
a {
  color: var(--cyan);
}
code {
  font: 13px ui-monospace, Consolas, monospace;
  color: var(--ink);
  background: var(--tile);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
}
.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}
.lu {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.skip:focus {
  top: 8px;
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* --- header ----------------------------------------------------------------------------------------- */
.dw-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dw-nav-in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.dw-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  font: 700 16px var(--ui);
  letter-spacing: 1px;
}
.dw-back b,
.dw-foot-brand b {
  color: var(--ink);
}
.dw-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.dw-links a {
  padding: 8px 12px;
  color: var(--label);
  text-decoration: none;
  font: 600 12px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.dw-links a:hover {
  color: var(--ink);
}
.dw-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-icon,
.dw-lchip {
  display: inline-grid;
  place-items: center;
  height: 34px;
  min-width: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  background: var(--tile);
  color: var(--text);
  font: 700 12px var(--ui);
  text-decoration: none;
  cursor: pointer;
}
.dw-lang {
  display: flex;
}
.dw-lchip[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
#theme .lu-moon,
:root[data-theme="night"] #theme .lu-sun {
  display: none;
}
:root[data-theme="night"] #theme .lu-moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) #theme .lu-sun {
    display: none;
  }
  :root:not([data-theme="day"]) #theme .lu-moon {
    display: block;
  }
}

/* --- hero ------------------------------------------------------------------------------------------- */
.dws {
  padding-top: 28px;
  padding-bottom: 56px;
}
.hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.badge {
  position: relative;
  flex: none;
  width: 66px;
  height: 74px;
  filter: drop-shadow(0 0 16px rgba(255, 138, 0, 0.45));
}
.badge::before,
.badge span {
  position: absolute;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.badge::before {
  content: "";
  inset: 0;
  background: linear-gradient(160deg, var(--accent-hi), var(--orange));
}
.badge span {
  inset: 5px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #1a222c, #0c1015);
  font: 400 22px var(--display);
  color: var(--accent);
  letter-spacing: 1px;
}
.titles {
  flex: 1;
  min-width: 230px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font: 600 12px var(--ui);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--cyan);
}
h1 {
  margin: 6px 0 0;
  font: 400 clamp(32px, 5.6vw, 58px)/1 var(--display);
  letter-spacing: 1px;
  filter: var(--h1-shadow);
}
/* the words people search, under the name (one heading for search engines) */
h1 .h1-sub {
  display: block;
  margin-top: 10px;
  font: 600 clamp(15px, 2.2vw, 20px)/1.3 var(--ui);
  letter-spacing: 0.5px;
  color: var(--muted);
}
h1 .brand {
  background: var(--ink-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  background: var(--tile);
  font: 600 12px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
.dot.red {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
.lede {
  margin-top: 16px;
  max-width: 72ch;
  color: var(--muted);
}
.fan {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  max-width: 72ch;
  font-size: 12px;
  color: var(--muted);
}
.fan .lu {
  color: var(--green);
}

/* --- panels ----------------------------------------------------------------------------------------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  box-shadow: var(--panel-shadow);
  scroll-margin-top: 72px;
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.panel::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}
.panel::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-head.flush {
  margin-bottom: 0;
}
.step {
  font: 700 13px var(--ui);
  color: var(--on-accent);
  background: var(--accent);
  padding: 3px 13px 3px 11px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
h2 {
  margin: 0;
  font: 700 16px var(--ui);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 11px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.styles {
  margin-top: 24px;
}
/* Tune on the left; on the right the live preview. The whole page scrolls (no box scrolls on its own); the preview's
   top (picture, counts, copy) is pinned under the header for the full height of the row, so every change, and the
   crop window and text layers under it, shows at once. The code and the downloads follow below, full width. */
.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}
#tune {
  align-self: start;
}
.monitor-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.monitor {
  flex: 1 0 auto; /* as tall as the row, so its pinned top travels all of it */
  display: flex;
  flex-direction: column;
  background: var(--panel-a); /* one colour behind the pinned top wherever it stops */
}
.framing-empty {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  margin: 12px 0 0;
  padding: 20px;
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  color: var(--muted);
  font: 500 13px var(--ui);
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  cursor: pointer;
}
.framing-empty[hidden] {
  display: none;
}
.framing-empty .lu {
  width: 30px;
  height: 30px;
  color: var(--ink);
}
.framing-empty:hover {
  border-color: var(--accent-lo);
  color: var(--text);
}
.monitor .buttons {
  margin-top: 4px;
}
.export {
  margin-top: 18px;
}
.export-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.export .out-block {
  margin-top: 0;
}
.export textarea {
  height: 240px;
}
.export-side {
  display: grid;
  gap: 12px;
}
.buttons.stacked {
  flex-direction: column;
}
/* the phone's floating preview: shown by dws.js while the controls are on screen and the preview is not */
.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #05080b;
  border: 1px solid #34465a;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.dock[hidden] {
  display: none;
}
.dock canvas {
  flex: 1;
  min-width: 0;
  height: auto;
  max-width: calc(64px * var(--arn, 5.8333));
  aspect-ratio: var(--ar, 140 / 24);
  max-height: 64px;
  image-rendering: pixelated;
  border: 1px solid #1e2c38;
}
.dock .btn {
  flex: none;
  padding: 10px 12px;
  font-size: 12px;
}
.stack {
  display: grid;
  gap: 18px;
}

/* --- fields ----------------------------------------------------------------------------------------- */
label,
.label {
  display: block;
  margin-bottom: 8px;
  font: 600 12px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--label);
}
.label.flat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
input[type="text"],
select,
textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 3px;
  padding: 11px 12px;
  font: inherit;
  box-shadow: var(--field-shadow);
}
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-lo);
  box-shadow: var(--field-shadow), 0 0 0 3px rgba(255, 182, 39, 0.22);
}
.sel {
  position: relative;
  display: block;
}
.sel.compact {
  width: 180px;
}
.sel::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--accent-lo);
  border-bottom: 2px solid var(--accent-lo);
  transform: rotate(45deg);
  pointer-events: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 38px;
}
select option {
  background: var(--field);
  color: var(--text);
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.row label {
  margin: 0;
}
.row.gap-top {
  margin-top: 14px;
}
.val {
  min-width: 52px;
  text-align: center;
  font: 700 13px var(--ui);
  color: var(--cyan);
  background: var(--val-bg);
  border: 1px solid var(--line);
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
#name {
  font: 700 22px var(--ui);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
  padding: 9px 14px;
}
.name-row {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 6px 18px;
  align-items: end;
  margin-bottom: 18px;
}
.name-row .hint {
  margin: 0;
  padding-bottom: 13px;
}

/* range: --p is the filled part, set by dws.js */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 6px 0 0;
  background: transparent;
  --p: 50%;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(90deg, var(--accent) 0 var(--p), var(--track) var(--p) 100%);
  border: 1px solid var(--track-line);
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 20px;
  margin-top: -7px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border: 2px solid var(--on-accent);
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(255, 182, 39, 0.25), 0 2px 4px rgba(0, 0, 0, 0.4);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  background: var(--track);
  border: 1px solid var(--track-line);
  border-radius: 2px;
}
input[type="range"]::-moz-range-progress {
  height: 8px;
  background: var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 16px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border: 2px solid var(--on-accent);
  border-radius: 2px;
}
input[type="range"]:focus {
  outline: none;
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--cyan);
}
input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--cyan);
}

/* switch */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font: 500 14px var(--ui);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  cursor: pointer;
  position: relative;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.track {
  position: relative;
  flex: none;
  width: 44px;
  height: 22px;
  background: var(--track);
  border: 1px solid var(--line-2);
  border-radius: 2px;
}
.knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--knob);
  border-radius: 1px;
  transition: left 0.15s, background 0.15s;
}
.switch input:checked + .track {
  border-color: var(--accent-lo);
}
.switch input:checked + .track .knob {
  left: 24px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 182, 39, 0.6);
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* upload */
.drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  background: repeating-linear-gradient(135deg, var(--grid) 0 10px, transparent 10px 20px), var(--field);
  color: var(--muted);
  font-size: 13px;
}
.drop strong {
  color: var(--text);
}
.drop-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: var(--tile);
}
.drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop:hover,
.drop.drag {
  border-color: var(--accent-lo);
  color: var(--text);
}
.drop:focus-within {
  border-color: var(--cyan);
  border-style: solid;
}
.upload-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  font-size: 13px;
  color: var(--ok-text);
}
.upload-state[hidden],
.framing[hidden] {
  display: none;
}
.upload-state strong {
  color: var(--green);
  word-break: break-all;
}

/* framing: the crop window over the uploaded picture, under the live preview; its controls beside it */
.framing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
  align-items: start;
  margin-top: 12px;
  padding: 12px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.framing-ctl {
  display: grid;
  gap: 12px;
}
.framing-ctl .hint {
  margin: 0;
}
.framer-wrap {
  --framer-h: 220; /* the crop window's greatest height in px, read by dws.js */
  display: flex;
  justify-content: center;
  padding: 6px;
  background: #05080b;
  border: 1px solid var(--line);
}
#framer {
  display: block;
  max-width: 100%;
  cursor: grab;
  touch-action: none;
  outline: none;
}
#framer:active {
  cursor: grabbing;
}
#framer:focus-visible {
  box-shadow: 0 0 0 2px var(--cyan);
}
.framing {
  grid-template-columns: minmax(180px, 30%) minmax(0, 1fr); /* a narrow crop window, the tabs given the room */
}
.framing-ctl {
  min-width: 0;
}

/* tabs of the framing box: Crop | Text */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  padding: 8px 10px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: 700 12px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.pane {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}
.pane[hidden],
.text-props[hidden] {
  display: none;
}
.pane .hint {
  margin: 0;
}

/* colour swatch + eyedropper, small buttons */
.swatches,
.toggles,
.font-row,
.layers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.font-row .sel {
  flex: 1;
  min-width: 0;
}
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--field);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 2px;
}
input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 2px;
}
.icon-btn,
.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-width: 34px;
  padding: 0 9px;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--tile);
  color: var(--text);
  font: 700 11px var(--ui);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}
.icon-btn:hover,
.mini:hover {
  border-color: var(--accent-lo);
}
.icon-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.mini.danger {
  color: var(--red);
}
.file-btn {
  position: relative;
  overflow: hidden;
}
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* the font list: each name in its own font. Browsers with customisable selects (Chromium's appearance: base-select)
   draw the open list in the page, so it takes these styles; others keep their own list (Firefox still shows the fonts). */
#textFont {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the framing box's fields are a size smaller, so a layer's properties take fewer lines */
.framing input[type="text"],
.framing select {
  padding: 7px 34px 7px 10px;
  font-size: 14px;
}
.framing input[type="text"] {
  padding-right: 10px;
}
.framing label,
.framing .label {
  margin-bottom: 6px;
}
.layers #removeText {
  margin-left: auto;
}
.icon-btn.danger {
  color: var(--red);
}
.icon-btn:disabled,
.mini:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@supports (appearance: base-select) {
  #textFont,
  #textFont::picker(select) {
    appearance: base-select;
  }
  #textFont::picker-icon {
    display: none; /* .sel::after draws the chevron */
  }
  #textFont::picker(select) {
    max-height: min(420px, 60vh);
    padding: 4px;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    background: var(--field);
    color: var(--text);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  #textFont optgroup {
    padding: 8px 8px 4px;
    font: 700 11px var(--ui);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
  }
  #textFont option {
    padding: 7px 10px;
    border-radius: 3px;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    cursor: pointer;
  }
  #textFont option::checkmark {
    display: none;
  }
  #textFont option:hover,
  #textFont option:focus-visible {
    background: var(--tile);
    outline: 1px solid var(--line-2);
  }
  #textFont option:checked {
    background: var(--accent);
    color: var(--on-accent);
  }
}

/* banner size: Mobile 140x24 | iPad/PC 140x30 (suggestions), or any width from 24 to 140 columns and height from 24
   to 100 rows */
.size-row {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin: -6px 0 12px;
}
/* the width and height sliders share a line under the suggested sizes */
.dims {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
}
.rows-ctl {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 180px;
}
.rows-ctl input[type="range"] {
  margin: 0;
}
.rows-ctl .val {
  white-space: nowrap;
  min-width: 84px;
}
/* the banner on a phone, an iPad and a PC (dws.js drawDevices; each canvas gets its screen's shape) */
.devices {
  margin-top: 16px;
}
.devices > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--tile);
  font: 600 12px var(--ui);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.devices > summary::-webkit-details-marker {
  display: none;
}
.devices > summary:hover {
  border-color: var(--accent-lo);
}
.devices > summary svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.devices > summary svg:last-child {
  transition: transform 0.15s ease;
}
.devices[open] > summary svg:last-child {
  transform: rotate(90deg);
}
.dev-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.device {
  margin: 0;
}
.device figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}
.device figcaption strong {
  font: 700 11px var(--ui);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text);
}
.device canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 6 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  image-rendering: pixelated;
}
.mini[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* text layers */
.layer-list {
  display: contents;
}
.layer-chip {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--tile);
  color: var(--text);
  font: 700 13px var(--ui);
  cursor: pointer;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-chip[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--ink);
}
/* a layer's properties: 2 columns, 4 when the framing box is wide (text | font / size | colour | style /
   effect | effect colour / effect size | snap) */
.text-props {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}
.cell-text,
.cell-font,
.cell-size,
.cell-effectsize,
.cell-snap,
.cell-foot {
  grid-column: span 2;
}
.cell-effectsize[hidden] {
  display: none;
}
.text-props .row .hint {
  margin: 0;
}
@media (min-width: 1101px) {
  .text-props {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cell-effect,
  .cell-effectcolor {
    grid-column: span 2;
  }
  .cell-foot {
    grid-column: 1 / -1;
  }
}
/* picking a colour without the browser's eyedropper: click a canvas */
.picking canvas {
  cursor: crosshair !important;
}
.picking .pick {
  background: var(--accent);
  color: var(--on-accent);
}
.screen.pannable.text-drag #preview {
  cursor: move;
}

/* --- buttons ---------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 0;
  cursor: pointer;
  font: 700 14px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 48%, var(--accent-lo));
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: filter 0.15s, transform 0.08s;
}
.btn:hover {
  filter: brightness(1.06) saturate(1.05);
}
.btn:active {
  transform: translateY(2px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--cyan);
}
.btn.secondary {
  color: var(--text);
  background: linear-gradient(180deg, var(--sec-a), var(--sec-b));
  box-shadow: inset 0 0 0 1px var(--sec-line), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.btn.secondary:focus-visible {
  box-shadow: inset 0 0 0 3px var(--cyan);
}
.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.buttons .btn {
  flex: 1 1 auto;
}
.out-block + .buttons {
  margin-top: 12px;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--cyan);
  font: 600 12px var(--ui);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* --- the style picker ------------------------------------------------------------------------------- */
.style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 8px 8px 10px;
  background: linear-gradient(180deg, var(--card-a), var(--card-b));
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.style-card canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: calc(150px * var(--arn, 5.8333));
  margin-inline: auto;
  aspect-ratio: var(--ar, 140 / 24);
  max-height: 150px;
  image-rendering: pixelated;
  background: #000;
  border-radius: 2px;
}
.style-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}
.style-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--card-sel);
  box-shadow: 0 0 0 1px var(--accent), 0 0 26px rgba(255, 182, 39, 0.22);
}
.style-card[aria-pressed="true"]::after {
  content: attr(data-badge);
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 0 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 10px/1.7 var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.style-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.style-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.style-tag {
  flex: none;
  font: 700 9.5px/1.6 var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-2);
  padding: 0 6px;
}
.style-tag.new {
  color: var(--green);
  border-color: var(--ok-line);
}

/* --- preview and output ----------------------------------------------------------------------------- */
.screen {
  position: relative;
  padding: 14px;
  background: radial-gradient(ellipse at 50% 0%, rgba(69, 227, 255, 0.08), transparent 70%), #05080b;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 30px rgba(0, 0, 0, 0.8);
}
.screen::before,
.screen::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #45e3ff;
  opacity: 0.8;
}
.screen::before {
  top: 5px;
  left: 5px;
  border-right: 0;
  border-bottom: 0;
}
.screen::after {
  bottom: 5px;
  right: 5px;
  border-left: 0;
  border-top: 0;
}
#preview {
  display: block;
  width: 100%;
  height: auto;
  /* a tall banner narrows to fit (keeping its cells' shape), so the pinned top stays within the screen */
  max-width: calc(min(34vh, 290px) * var(--arn, 5.8333));
  margin-inline: auto;
  aspect-ratio: var(--ar, 140 / 24);
  max-height: min(34vh, 290px);
  image-rendering: pixelated;
  border: 1px solid #1e2c38;
}
.screen.pannable #preview {
  cursor: grab;
  touch-action: none;
}
.screen.pannable #preview:active {
  cursor: grabbing;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}
.stat {
  position: relative;
  background: var(--tile);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  padding: 5px 10px;
}
.stat span {
  display: block;
  font: 600 10px var(--ui);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.stat strong {
  font: 700 16px var(--ui);
  font-variant-numeric: tabular-nums;
}
/* the code is longer than the PC game's text box takes */
.stat.over {
  border-left-color: var(--red);
}
.stat.over strong {
  color: var(--red);
}
.len-warn {
  margin: -2px 0 10px;
  padding: 6px 10px;
  border-left: 3px solid var(--red);
  background: var(--tile);
  font-size: 12px;
  line-height: 1.45;
}
.len-warn[hidden] {
  display: none;
}
/* merged to fit the PC game's box: an amber edge and a small mark in the corner of the code-length tile (its size
   never changes, so nothing below moves while a picture is dragged) */
.stat.fitted {
  border-left-color: var(--accent);
}
.fit-tag {
  position: absolute;
  top: 5px;
  right: 6px;
  color: var(--accent-lo);
  line-height: 0;
  cursor: help;
}
.fit-tag svg {
  width: 14px;
  height: 14px;
}
#methodRow[hidden],
.fit-tag[hidden] {
  display: none;
}
.out-block {
  margin-top: 20px;
}
textarea {
  display: block;
  height: 200px;
  resize: vertical;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--code);
  overflow-wrap: anywhere;
}
.status {
  min-height: 20px;
  margin: 12px 0;
  font: 600 13px var(--ui);
  color: var(--green);
}
.status:not(:empty)::before {
  content: "› ";
  color: var(--accent-lo);
}
.notice {
  font-size: 13px;
  line-height: 1.55;
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-left: 4px solid var(--accent);
  border-radius: 2px;
  padding: 12px 14px;
  color: var(--notice-text);
}
.notice strong {
  color: var(--ink);
}

/* --- footer ----------------------------------------------------------------------------------------- */
.dw-foot {
  border-top: 1px solid var(--line);
  background: var(--panel-b);
  padding: 22px 0 28px;
  font-size: 13px;
  color: var(--muted);
}
.dw-foot-in {
  display: grid;
  gap: 10px;
}
.dw-foot-brand {
  color: var(--text);
  text-decoration: none;
  font: 700 16px var(--ui);
  letter-spacing: 1px;
}
.dw-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.dw-foot nav a,
.dw-foot-credits a {
  color: var(--label);
}
.dw-foot-credits a {
  margin-left: 8px;
}
.dw-foot-thanks {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 72ch;
  padding: 8px 12px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-left: 3px solid var(--accent);
  color: var(--notice-text);
}
.dw-foot-thanks .lu {
  color: var(--red);
  margin-top: 2px;
}
.dw-foot-thanks strong {
  color: var(--ink);
}

/* --- small screens ---------------------------------------------------------------------------------- */
/* wide screens: the preview's top is pinned right under the header (no gap for the page to show through) for as long
   as its row is on screen; the page itself scrolls, so the framing box and text layers below are reached normally */
@media (min-width: 821px) {
  .monitor-top {
    position: sticky;
    top: 56px; /* the header's height: flush under it */
    z-index: 3;
    margin: 0 -20px;
    padding: 10px 20px 2px;
    background: var(--panel-a);
    box-shadow: 0 10px 12px -12px rgba(0, 0, 0, 0.6);
  }
  .monitor-top .status {
    margin: 8px 0 4px;
  }
}
/* a short window: a lower crop window and no long hints */
@media (min-width: 821px) and (max-height: 760px) {
  .framer-wrap {
    --framer-h: 150;
  }
  .framing-ctl .hint {
    display: none;
  }
  .monitor .panel-head {
    margin-bottom: 12px;
  }
}
/* wide screens: the sticky preview is nearly always in view, so the floating copy (when it does show, in a short
   window at the foot of the controls) sits small in the bottom-right corner */
@media (min-width: 821px) {
  .dock {
    left: auto;
    right: 24px;
    width: min(560px, calc(100vw - 48px));
  }
}
@media (max-width: 960px) {
  .framing {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 980px) {
  .style-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .layout,
  .export-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dws {
    padding-bottom: 110px;
  }
}
@media (max-width: 700px) {
  .dw-links {
    display: none;
  }
  .dw-tools {
    margin-left: auto;
  }
}
@media (max-width: 620px) {
  .dws {
    padding-top: 20px;
    padding-bottom: 48px;
  }
  .panel {
    padding: 16px;
  }
  .badge {
    width: 52px;
    height: 58px;
  }
  .badge span {
    font-size: 17px;
  }
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .name-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .name-row .hint {
    padding: 0;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .style-tag {
    display: none;
  }
  .panel-head {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .panel-head h2 {
    white-space: nowrap;
    font-size: 15px;
    letter-spacing: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* the guide and the questions people ask, under the export (what the page tells a reader and a search engine) */
.lab-guide {
  margin-top: 18px;
}
.lab-guide h3 {
  margin: 22px 0 10px;
  font: 700 15px var(--ui);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.lab-guide p,
.lab-guide li {
  max-width: 82ch;
  line-height: 1.65;
}
.guide-intro a {
  color: var(--cyan);
}
.guide-steps {
  margin: 0;
  padding-left: 22px;
}
.guide-steps li + li {
  margin-top: 6px;
}
.faq h4 {
  margin: 16px 0 4px;
  font: 600 15px var(--ui);
}
.faq p {
  margin: 0;
  color: var(--muted);
}
.lab-guide .step .lu {
  width: 16px;
  height: 16px;
}
/* its title is a sentence: it wraps (the steps' short titles stay on one line on a phone) */
.lab-guide .panel-head h2 {
  min-width: 0;
  white-space: normal;
}
