@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/s_d7731959c4.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-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/s_8d0aead6b2.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-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/s_8864f19927.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-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/s_084c53850c.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-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/s_084c53850c.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-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(fonts/s_084c53850c.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;
}

  /* Layout: single dark arcade screen. HUD above the canvas, phase controls and the growing report below it. */
  :root {
    --bg: #070b16;
    --panel: #0e1526;
    --line: #1f2b45;
    --fg: #dfe7ff;
    --muted: #7f8db1;
    --accent: #38e8ff;
    --paper: #f6f1e4;
    --crit: #ff4d6d;
    --high: #ff9f43;
    --mid: #ffd166;
    --ok: #4ade80;
    --display: "Orbitron", "Segoe UI", system-ui, sans-serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    color-scheme: dark;
  }
  html, body { height: 100%; }
  body {
    background: var(--bg); color: var(--fg);
    font-family: var(--mono); font-size: 14px; line-height: 1.5;
    padding-inline: 16px; padding-block: 8px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
  }
  .wrap { width: 100%; max-width: none; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  h1 { font: 900 20px/1.1 var(--display); letter-spacing: .04em; margin: 0; color: #fff; text-wrap: balance; }
  h1 span { color: var(--accent); }
  .brandtag { font: 500 10px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
  .brandtag a, .hint a { color: var(--accent); text-decoration: none; }
  .share { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
  .share textarea { width: 100%; min-height: 76px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); font: 12px/1.4 var(--mono); padding: 8px; resize: none; }
  .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
  a.cta { font: 700 13px var(--display); letter-spacing: .1em; text-transform: uppercase; background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 12px 22px; text-decoration: none; }
  .phases { display: flex; gap: 6px; font: 500 9px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .phases span { padding: 3px 7px; border: 1px solid var(--line); }
  .phases span.on { color: #04121a; background: var(--accent); border-color: var(--accent); }
  .phases span.done { color: var(--ok); border-color: var(--ok); }
  .hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-variant-numeric: tabular-nums; }
  .hud div { background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; min-width: 0; }
  .hud b { display: block; font: 700 16px var(--display); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .screen { position: relative; width: 100%; margin-inline: auto; max-width: 100%; background: var(--bg); border: 1px solid var(--line); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
  canvas { display: block; width: 100%; height: 100%; }
  .banner {
    position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 420px;
    background: var(--paper); color: #1b1a17; border-left: 6px solid var(--mid);
    padding: 8px 12px; font-size: 12px; line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  }
  .banner.show { opacity: 1; transform: translateX(-50%) translateY(4px); }
  .banner em { display: block; font: 700 10px var(--display); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 2px; font-style: normal; }
  .overlay {
    position: absolute; inset: 0; background: rgba(4,7,18,.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 20px; text-align: center; overflow-y: auto;
  }
  .overlay h2 { font: 900 22px/1.15 var(--display); margin: 0; color: #fff; text-wrap: balance; }
  .overlay p { margin: 0; color: var(--muted); max-width: 36ch; font-size: 13px; }
  .overlay .score { font: 700 30px var(--display); color: var(--accent); }
  .overlay .delta { display: flex; gap: 18px; align-items: center; font-variant-numeric: tabular-nums; }
  .overlay .delta b { display: block; font: 700 26px var(--display); }
  .overlay .delta small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .overlay .delta .arrow { color: var(--muted); font-size: 22px; }
  button {
    font: 700 13px var(--display); letter-spacing: .1em; text-transform: uppercase;
    background: var(--accent); color: #04121a; border: 0; padding: 12px 22px; cursor: pointer;
  }
  button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
  button:disabled { opacity: .4; cursor: default; }
  .pad { display: grid; gap: 8px; }
  .pad[hidden] { display: none; }
  #padBuild { grid-template-columns: repeat(5, 1fr); }
  #padDefend { grid-template-columns: repeat(3, 1fr); }
  .pad button { padding: 12px 6px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); font-size: 12px; letter-spacing: .04em; text-transform: none; min-width: 0; }
  .pad button span { display: block; font: 500 10px var(--mono); color: var(--muted); margin-top: 2px; }
  .pad button.key { font-size: 18px; }
  .pad button:not(:disabled):active { background: var(--line); }
  .report { background: var(--panel); border: 1px solid var(--line); }
  .report h3 { margin: 0; padding: 8px 12px; font: 700 11px var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
  .report ul { list-style: none; margin: 0; padding: 0; }
  .report li { display: grid; grid-template-columns: 8px 76px 1fr; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 12px; align-items: start; }
  .report li:last-child { border-bottom: 0; }
  .report li .sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
  .report li .area { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding-top: 1px; }
  .report li .fix { display: block; color: var(--ok); font-size: 11px; }
  .report .empty { padding: 12px; color: var(--muted); font-size: 12px; display: block; }
  .hint { font-size: 11px; color: var(--muted); text-align: center; }
  @media (prefers-reduced-motion: reduce) { .banner { transition: none; } }
