/* Layout, header, cards, stats, controls and side panels follow Brick Breaker (app-brick-breaker). */
:root {
  --bg: #06111d;
  --panel: #0a1828;
  --panel-2: #0c1d30;
  --line: #163049;
  --line-2: #1f4060;
  --text: #eaf4fb;
  --muted: #8ea3b8;
  --soft: #b9cad9;
  --accent: #0ee6f5;
  --accent-2: #22d3ee;
  --accent-ink: #032a33;
  --board: #0a1a29;
  --radius: 14px;
  --reserve: 420px; /* vertical space taken by everything except the board */
  font-family: "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 700px at 50% -10%, #0b2236 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
}

svg { width: 20px; height: 20px; flex: none; }

button, select {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

h1, h2, h3, p { margin: 0; }

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 17, 29, .6);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-icon { width: 40px; height: 40px; }
.brand-logo { width: 110px; height: auto; }
.brand-sep { width: 1px; height: 28px; background: var(--line-2); margin: 0 10px 0 6px; }
.brand-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .5em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 16px; }
.divider { width: 1px; height: 24px; background: var(--line-2); }

.link-btn, .icon-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 6px; border-radius: 8px;
  color: #c6d6e4; font-size: 16px;
}
.link-btn svg, .icon-btn svg { width: 24px; height: 24px; color: var(--accent-2); }
.icon-btn svg { color: inherit; }
.link-btn:hover, .icon-btn:hover { color: var(--accent); }
.icon-btn[hidden] { display: none; }
.icon-btn[aria-pressed="false"] { color: var(--muted); }
.link-btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); }

/* ---------- Main ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 20px clamp(16px, 3.4vw, 60px) 0;
  display: flex; flex-direction: column;
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, rgba(12, 29, 48, .92) 0%, rgba(9, 22, 37, .92) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1.1fr auto;
  align-items: center;
  padding: 14px 0;
}
.stat { padding: 2px clamp(16px, 5.5vw, 82px); min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line-2); }
.stat-label { display: block; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.stat-value { display: block; font-size: 30px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }

.stat--level { display: flex; flex-direction: column; align-items: center; }
.level-row { display: flex; align-items: baseline; gap: 14px; }
.level-row .stat-label { display: inline; }
.level-bar {
  width: min(210px, 100%); height: 8px; margin-top: 8px;
  border-radius: 999px; background: var(--line-2); overflow: hidden;
}
.level-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--accent); box-shadow: 0 0 10px rgba(14, 230, 245, .6);
  transition: width .25s ease;
}

.stat--status { padding-left: clamp(16px, 3vw, 44px); padding-right: clamp(16px, 3vw, 44px); }
.status { display: inline-flex; align-items: center; gap: 12px; font-size: 16px; color: #d6e3ee; white-space: nowrap; }
.status i { display: block; width: 18px; height: 18px; border-radius: 50%; background: #64748b; }
.status[data-state="playing"] i { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, .6); }
.status[data-state="paused"] i { background: #f59e0b; }
.status[data-state="over"] i { background: #ef4444; }

/* ---------- Board ---------- */
/* The area is the space the board may use; JS sizes the frame inside it to whole square cells */
.board-area {
  --canvas-scale: 1; /* set from the Canvas size option */
  width: calc(100% * var(--canvas-scale));
  height: calc(max(240px, 100dvh - var(--reserve) - var(--extra, 0px)) * var(--canvas-scale));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  transition: width .25s ease, height .25s ease;
}
.board-frame {
  --glow: 14, 230, 245;
  position: relative;
  width: 100%; height: 100%;
  border: 2px solid rgb(var(--glow));
  border-radius: 12px;
  background: var(--board);
  box-shadow: 0 0 22px rgba(var(--glow), .28), inset 0 0 18px rgba(var(--glow), .06);
  overflow: hidden;
  touch-action: none;
  transition: border-color .3s, box-shadow .3s;
}
.board-frame[data-walls="wrap"] { border-style: dashed; }
.board-frame.is-dead { --glow: 239, 68, 68; }
.board-frame.is-eat { box-shadow: 0 0 36px rgba(var(--glow), .6), inset 0 0 26px rgba(var(--glow), .12); }
.board-frame canvas { display: block; width: 100%; height: 100%; }

.board-hint {
  position: absolute; left: 50%; top: 58%;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(14, 230, 245, .12);
  border: 1px solid rgba(14, 230, 245, .35);
  color: #d8f9fc; font-size: 15px;
  white-space: nowrap;
  pointer-events: none;
  animation: hint 1.6s ease-in-out infinite;
}
.board-hint[hidden] { display: none; }
@keyframes hint { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .board-hint { animation: none; } }

.board-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 20px; text-align: center;
  background: rgba(5, 13, 22, .76);
  backdrop-filter: blur(3px);
}
.board-overlay[hidden] { display: none; }
.board-overlay h3 { font-size: 34px; font-weight: 800; }
.board-overlay p { color: var(--muted); margin-bottom: 8px; line-height: 1.5; font-size: 17px; }
.board-overlay p b { color: var(--accent); font-size: 1.15em; }
.board-overlay .primary-btn { padding: 0 34px; min-width: 0; }

/* ---------- Controls ---------- */
.controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(14px, 2vw, 34px);
  padding: 18px clamp(16px, 2.8vw, 40px);
}
.controls-buttons { display: flex; gap: 18px; }
.vsep { width: 1px; height: 54px; background: var(--line-2); flex: none; }

.primary-btn, .outline-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 56px; padding: 0 30px;
  border-radius: 8px;
  font-size: 18px; font-weight: 600;
  white-space: nowrap;
}
.primary-btn svg, .outline-btn svg { width: 24px; height: 24px; }
.primary-btn {
  background: var(--accent); color: var(--accent-ink); border: 0; min-width: 180px;
  box-shadow: 0 6px 24px rgba(14, 230, 245, .22);
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:disabled { opacity: .45; cursor: default; filter: none; box-shadow: none; }
.outline-btn { background: transparent; border: 1px solid var(--soft); color: #fff; }
.outline-btn:hover { border-color: var(--accent); color: var(--accent); }
.outline-btn:disabled { opacity: .5; cursor: default; border-color: var(--soft); color: #fff; }
.primary-btn:focus-visible, .outline-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.seg {
  display: grid; grid-template-columns: repeat(3, 1fr);
  width: min(380px, 100%);
  border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden;
  background: rgba(6, 17, 29, .5);
}
.seg--2 { grid-template-columns: repeat(2, 1fr); width: min(260px, 100%); }
.controls .seg { flex: none; min-width: 300px; }
.controls .seg--2 { min-width: 220px; }
.seg button {
  padding: 12px 8px;
  background: transparent; border: 0;
  font-size: 17px; color: var(--text);
}
.seg button:hover { background: rgba(34, 211, 238, .08); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

/* Canvas / Board dropdowns (in the Display card on desktop, in the controls otherwise) */
.selects { display: flex; gap: 10px; }
.select { position: relative; width: 100%; min-width: 150px; }
.select select {
  width: 100%; height: 48px;
  appearance: none; -webkit-appearance: none;
  padding: 0 38px 0 14px;
  background: rgba(6, 17, 29, .5); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 15px;
}
.select select:hover { border-color: var(--accent-2); }
.select select option { background: #0a1828; }
.select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.select svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--accent-2); }

/* ---------- Hints ---------- */
.hints {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px 28px;
  padding: 12px 0 0;
  color: #9fb6cc; font-size: 15px;
}
.hint { display: inline-flex; align-items: center; gap: 12px; }
.hsep { width: 1px; height: 28px; background: var(--line-2); }
.key {
  display: inline-grid; place-items: center;
  min-width: 38px; height: 36px; padding: 0 10px;
  background: rgba(14, 230, 245, .04);
  border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--text);
  font-size: 13px; font-weight: 600;
  transition: background .08s, border-color .08s, transform .08s;
}
.key + .key { margin-left: -4px; }
.key svg { width: 15px; height: 15px; }
.key-space { min-width: 96px; }
.key.is-down { background: rgba(14, 230, 245, .2); border-color: var(--accent); transform: translateY(1px); }

.credit {
  text-align: center; color: #9fb6cc;
  font-size: 13px; letter-spacing: .22em;
  padding: 18px 0 20px;
}
.credit a { color: var(--accent); font-weight: 700; text-decoration: none; }
.credit a:hover { text-decoration: underline; }

/* ---------- Touch arrows ---------- */
.dpad { display: none; }
@media (max-width: 960px), (pointer: coarse) {
  :root { --reserve: 480px; }
  .dpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .dpad button {
    height: 56px;
    display: grid; place-items: center;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 10px;
  }
  .dpad button svg { width: 24px; height: 24px; }
  .dpad button.is-down { background: rgba(14, 230, 245, .2); border-color: var(--accent); transform: translateY(1px); }
  .hints { display: none; }
}
@media (pointer: coarse) and (min-width: 961px) {
  .dpad { grid-template-columns: repeat(4, 90px); justify-content: center; }
}

/* ---------- Full screen ---------- */
body.is-fullscreen { --reserve: 330px; }
body.is-fullscreen .hints, body.is-fullscreen .credit { display: none; }

/* ---------- Medium screens ---------- */
@media (max-width: 1280px) {
  .controls { flex-wrap: wrap; justify-content: center; row-gap: 16px; }
  .primary-btn, .outline-btn { min-height: 52px; padding: 0 24px; font-size: 17px; }
  .primary-btn { min-width: 150px; }
}

@media (max-height: 860px) and (min-width: 961px) {
  :root { --reserve: 340px; }
  .main { padding-top: 12px; gap: 10px; }
  .stats { padding: 8px 0; }
  .stat-value { font-size: 25px; }
  .stat-label { font-size: 13px; }
  .controls { padding: 10px 24px; }
  .primary-btn, .outline-btn { min-height: 46px; }
  .seg button { padding: 9px 8px; }
  .select select { height: 44px; }
  .hints { padding-top: 4px; }
  .credit { padding: 10px 0 14px; }
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 960px) {
  :root { --reserve: 440px; }
  .topbar { height: 56px; }
  .brand { gap: 10px; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-logo { width: 84px; }
  .brand-sep { margin: 0 2px; height: 22px; }
  .brand-title { font-size: 12px; letter-spacing: .3em; }
  .topbar-actions { gap: 8px; }
  .link-btn span { display: none; }

  .main { padding-top: 12px; gap: 10px; }
  .stats { padding: 8px 0; }
  .stat { padding: 2px 14px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 22px; }
  .level-row { gap: 8px; }
  .level-bar { height: 6px; margin-top: 5px; }
  .stat--status { padding: 0 12px; }
  .status { font-size: 13px; gap: 8px; }
  .status i { width: 12px; height: 12px; }

  .controls { padding: 12px; gap: 12px; }
  .controls .vsep { display: none; }
  .controls-buttons { width: 100%; gap: 12px; }
  .controls-buttons > * { flex: 1; min-width: 0; }
  .controls .seg { flex: 1 1 0; min-width: 0; width: auto; }
  .seg button { padding: 10px 6px; font-size: 16px; }
  .selects { width: 100%; flex-wrap: wrap; }
  .select { min-width: 0; flex: 1 1 140px; }
}

@media (max-width: 560px) {
  .brand-logo, .brand-sep { display: none; }
  .stats { grid-template-columns: 1.15fr 1fr 1fr auto; }
  .stat { padding: 2px 10px; }
  .stat-label { font-size: 11px; letter-spacing: .05em; }
  .stat-value { font-size: 19px; }
  .level-row { gap: 5px; }
  .level-bar { width: 100%; }
  .stat--status { padding: 0 8px; }
  .status span { display: none; } /* just the coloured dot */
  .controls .seg { flex-basis: 100%; }
  .select select { padding: 0 30px 0 10px; font-size: 14px; }
  .select svg { right: 8px; }
  .primary-btn, .outline-btn { min-height: 46px; font-size: 16px; gap: 10px; }
  .primary-btn svg, .outline-btn svg { width: 20px; height: 20px; }
  .primary-btn { min-width: 0; }
  .board-overlay h3 { font-size: 28px; }
  .credit { letter-spacing: .12em; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* ---------- Side panels (desktop only) ---------- */
.stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; container-type: inline-size; }
.side { display: none; container-type: inline-size; }

/* Desktop: side panels on both sides of the game */
@media (min-width: 961px) {
  .main {
    max-width: 2240px;
    display: grid;
    grid-template-columns: clamp(190px, 16vw, 300px) minmax(0, 1fr) clamp(190px, 16vw, 300px);
    column-gap: clamp(14px, 1.6vw, 36px);
    align-items: start;
  }
  .side { display: flex; flex-direction: column; gap: 14px; }
  .credit { grid-column: 1 / -1; }
}

/* The game column gets narrower with the side panels, so size its parts by the column, not the window */
@container (max-width: 1240px) {
  .board-area { --extra: 70px; } /* the controls wrap onto a second row */
  .controls { flex-wrap: wrap; justify-content: center; row-gap: 14px; padding: 14px 18px; }
  .primary-btn, .outline-btn { min-height: 50px; padding: 0 22px; font-size: 17px; }
  .primary-btn { min-width: 140px; }
  .stat { padding: 2px 28px; }
  .stat-value { font-size: 26px; }
  .stat--status { padding: 0 22px; }
  .hints { gap: 10px 18px; font-size: 14px; }
}
@container (max-width: 900px) {
  .controls .vsep { display: none; }
}
@container (max-width: 760px) {
  .stat { padding: 2px 16px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 22px; }
  .stat--status { padding: 0 14px; }
  .hsep { display: none; }
}

/* Narrow side panels on smaller desktops */
@container (max-width: 250px) {
  .side-card { padding: 14px; }
  .side-card h2 { margin-bottom: 10px; }
  .run-stats div { padding: 6px 0; }
  .run-stats dt { font-size: 13px; }
  .run-stats dd { font-size: 16px; }
  .best-list li { padding: 8px 10px; font-size: 14px; }
  .best-list b { font-size: 16px; }
  .food-guide li { gap: 10px; font-size: 12px; }
  .food-guide b { font-size: 14px; }
  .score-guide li { font-size: 12.5px; }
  .select select { font-size: 14px; }
}

.side-card { padding: 16px 18px; }
.side-card h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 10px; }
.side-note { color: var(--muted); font-size: 13px; margin-top: 12px; line-height: 1.4; }

/* Dropdowns stacked when they sit in the Display card */
.side-card .selects { flex-direction: column; gap: 8px; }
.side-card .select { min-width: 0; }

.run-stats { margin: 0; display: grid; gap: 2px; }
.run-stats div { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); }
.run-stats div:last-child { border-bottom: 0; }
.run-stats dt { color: var(--soft); font-size: 14px; }
.run-stats dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.best-list, .food-guide, .score-guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.best-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: rgba(6, 17, 29, .5);
}
.best-list span { color: var(--soft); }
.best-list b { font-size: 18px; font-variant-numeric: tabular-nums; }
.best-list li.is-current { border-color: var(--accent); background: rgba(14, 230, 245, .08); }
.best-list li.is-current span { color: var(--accent); }

.food-guide li { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.food-guide b { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.food-guide svg { width: 30px; height: 30px; }
.apple-red { color: #ff3b4e; filter: drop-shadow(0 0 6px rgba(255, 59, 78, .5)); }
.apple-gold { color: #fbbf24; filter: drop-shadow(0 0 6px rgba(251, 191, 36, .55)); }
body[data-bug="off"] .bug-only, body[data-rocks="off"] .rocks-only, body[data-poison="off"] .poison-only { display: none; }
.apple-poison { color: #4ade80; filter: drop-shadow(0 0 6px rgba(74, 222, 128, .55)); }
.rock-icon { color: #94a3b8; }

/* ---------- Hazards ---------- */
/* Each hazard has its own colour: bug purple, rocks stone, poison green */
.hazard { --hz: 168, 85, 247; }
.hazard--rocks { --hz: 148, 163, 184; }
.hazard--poison { --hz: 74, 222, 128; }

.hazards { display: grid; gap: 6px; }
.hazard {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: rgba(6, 17, 29, .5);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.hazard:hover { border-color: rgba(var(--hz), .6); }
.hazard:has(input:checked) {
  border-color: rgba(var(--hz), .7);
  background: rgba(var(--hz), .08);
  box-shadow: 0 0 12px rgba(var(--hz), .15);
}
.hazard input { position: absolute; opacity: 0; pointer-events: none; }
.hz-icon {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(var(--hz), .14);
  color: rgb(var(--hz));
}
.hz-icon svg { width: 20px; height: 20px; }
.hazard:not(:has(input:checked)) .hz-icon { color: var(--muted); background: rgba(148, 163, 184, .08); }
.hz-text { flex: 1; min-width: 0; }
.hz-text b { display: block; font-size: 14px; font-weight: 600; }
.hz-text small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.switch {
  position: relative; flex: none;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background .2s;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.hazard input:checked + .switch { background: rgb(var(--hz)); }
.hazard input:checked + .switch::after { transform: translateX(18px); }
.hazard input:focus-visible + .switch { outline: 2px solid rgb(var(--hz)); outline-offset: 2px; }

/* Tablet / phone: hazards sit in the controls as three compact toggles */
.controls .hazards { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.controls .hazard { gap: 6px; padding: 8px; min-width: 0; }
.controls .hz-text small { display: none; }
.controls .hz-icon { width: 28px; height: 28px; }
.controls .hz-icon svg { width: 18px; height: 18px; }
.controls .switch { display: none; }
.controls .hz-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@container (max-width: 250px) {
  .hazard { padding: 8px 10px; gap: 10px; }
  .hz-icon { width: 30px; height: 30px; }
  .hz-text b { font-size: 14px; }
}
.rival-bug { color: #a855f7; filter: drop-shadow(0 0 6px rgba(192, 132, 252, .6)); }

.bonus-status { margin-top: 10px; font-size: 13px; color: var(--muted); }
.bonus-status.is-live { color: #fde68a; }
.bonus-meter { height: 5px; margin-top: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bonus-meter div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #fde68a); }

.score-guide li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.score-guide li:last-child { border-bottom: 0; }
.score-guide span { color: var(--soft); }
.score-guide b { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- How to play modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(3, 9, 16, .72);
  backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.modal-box {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px 30px;
  background: linear-gradient(180deg, #0f1e2f, #0a1522);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal-box h2 { font-size: 28px; font-weight: 800; margin: 4px 0 16px; }
.modal-box h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 20px 0 10px; color: var(--accent); }
.modal-sub { color: var(--muted); line-height: 1.55; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #d2e0ec; line-height: 1.45; counter-reset: step; }
.steps li { display: flex; align-items: flex-start; gap: 14px; counter-increment: step; }
.steps li > span:first-child::before { content: counter(step); }
.steps li > span:first-child {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: #12416a; color: #fff;
  font-size: 13px; font-weight: 600;
  flex: none;
}
.howto-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.howto-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--muted); font-size: 14px; }
.howto-cols li { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.howto-cols li b { color: var(--text); }
kbd {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border: 1px solid var(--line-2); border-radius: 4px;
  font: 600 12px/1 inherit; font-family: inherit;
  color: var(--text);
}
kbd.wide { min-width: 56px; }
@media (max-width: 560px) {
  .howto-cols { grid-template-columns: 1fr; gap: 0; }
  .modal-box { padding: 24px 18px; }
}
