/* =====================================================================
   BLUEPRINT: a cyanotype drafting sheet. Navy grid paper, white technical
   lines, near-square corners, Space Grotesk for reading and IBM Plex Mono
   for labels and figures. Yellow is the one accent, as the highlighter on the
   drawing. The home screen is a drawing title block, then a numbered parts
   list whose cards carry corner marks.
   Spec: docs/themes/blueprint.md
   ===================================================================== */
:root[data-theme="blueprint"] {
  color-scheme: dark;
  --sheet: rgba(13, 52, 102, .78);
  --bg: #0d3466; --surface: #10407a; --surface-2: #17508f;
  --text: #eaf2ff; --muted: #a9c1e6; --faint: #86a3cf; --border: #4d76ad; --rule: #cfe0ff;
  --accent: #ffd23f;
  --primary: #eaf2ff; --primary-strong: #ffffff; --primary-contrast: #0d3466; --primary-soft: rgba(255, 210, 63, .2);
  --danger: #ff8a7a; --danger-soft: rgba(255, 138, 122, .25); --success: #7ee2b8;
  --radius: 2px; --r-ctl: 2px; --r-ctl-in: 1px; --r-dialog: 2px; --r-menu: 2px; --r-board: 2px; --r-cell: 1px; --r-pill: 2px;
  --content-w: 1040px;
  --shadow: none;
  --dialog-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  --menu-shadow: 0 20px 50px rgba(0, 0, 0, .4);
  --overlay: rgba(5, 20, 45, .6);
  --font: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --toast-bg: #eaf2ff; --toast-fg: #0d3466; --toast-action: #1c5aa3;
  --record-bg: #ffd23f; --record-fg: #0d3466;
  /* 2048 */
  --g-board: #0a2a52; --g-slot: rgba(234, 242, 255, .06);
  --t2: #1b5299; --t4: #2365b3; --t8: #3279cb; --t16: #4a92de; --t32: #6eaaea; --t64: #a3cbf5;
  --t128: #ffe68f; --t256: #ffd23f; --t512: #ffb627; --t1024: #ff8f3f; --t2048: #ff6b5a;
  --t-ink: #eaf2ff; --t-paper: #eaf2ff;
  --t64-fg: #0d3466; --t128-fg: #0d3466; --t256-fg: #0d3466; --t512-fg: #0d3466; --t1024-fg: #0d3466; --t2048-fg: #0d3466;
  /* memory grid */
  --flash: #ffd23f; --tile: #17508f;
  /* card table: gridded, cards on grid paper */
  --table-bg:
    linear-gradient(rgba(207, 224, 255, .13) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(207, 224, 255, .13) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(rgba(207, 224, 255, .055) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(207, 224, 255, .055) 1px, transparent 1px) 0 0 / 24px 24px,
    #17508f;
  --table-art:
    linear-gradient(rgba(207, 224, 255, .07) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(207, 224, 255, .07) 1px, transparent 1px) 0 0 / 16px 16px,
    #17508f;
  --table-frame: 0 0 0 1px var(--rule);
  --slot-line: rgba(207, 224, 255, .5);
  --card-paper:
    linear-gradient(rgba(13, 52, 102, .1) 1px, transparent 1px) 0 0 / 7px 7px,
    linear-gradient(90deg, rgba(13, 52, 102, .1) 1px, transparent 1px) 0 0 / 7px 7px,
    #eef3fa;
  --card-r: .03;
  --card-shadow: 0 0 0 1px #0d3466, 0 2px 5px rgba(0, 0, 0, .35);
  --court-panel: rgba(13, 52, 102, .07); --court-rule: inset 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent);
  --suit-red: #c0392b; --suit-black: #0d3466;
  --card-back-art:
    linear-gradient(rgba(207, 224, 255, .18) 1px, transparent 1px) 0 0 / 6px 6px,
    linear-gradient(90deg, rgba(207, 224, 255, .18) 1px, transparent 1px) 0 0 / 6px 6px,
    #0b2c58;
  --back-edge: rgba(207, 224, 255, .55); --back-edge-w: .05; --back-shadow: 0 0 0 1px #0b2c58;
  --font-card: var(--font-mono);
}
/* grid paper: a major line every 120px, a minor one every 24px, fixed to the viewport */
[data-theme="blueprint"] body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(207, 224, 255, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 224, 255, .14) 1px, transparent 1px),
    linear-gradient(rgba(207, 224, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 224, 255, .055) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  background-attachment: fixed;
}
[data-theme="blueprint"] ::selection { background: var(--accent); color: var(--bg); }
/* the backdrop: drawings that draft themselves, and the crosshair (js/backdrops/blueprint.js); faint over the content column */
[data-theme="blueprint"] .backdrop { --veil: .6; }

/* labels and figures: mono, uppercase, tracked */
[data-theme="blueprint"] :is(.btn, .segmented button, .tool, .stat-label, .game-status, .offline-badge, .toast-action, .record, .main-nav a, .field label, .footer-links, .version, .t-label, .icon-tile span, .theme-btn .theme-name) {
  font-family: var(--font-mono); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
}
[data-theme="blueprint"] :is(.stat-value, .g2048-board > div, .keypad button, #toast) { font-family: var(--font-mono); }

/* ---------- chrome ---------- */
[data-theme="blueprint"] .topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: var(--rule); }
[data-theme="blueprint"] .brand { font-weight: 700; letter-spacing: -.02em; }
[data-theme="blueprint"] body[data-route="home"] .brand { visibility: hidden; }
[data-theme="blueprint"] .main-nav a { color: var(--muted); border-radius: 0; }
[data-theme="blueprint"] .main-nav a:hover { background: rgba(234, 242, 255, .1); color: var(--text); }
[data-theme="blueprint"] .main-nav a[aria-current="true"] { background: transparent; color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
[data-theme="blueprint"] .theme-btn { background: transparent; border-color: var(--rule); }
[data-theme="blueprint"] .theme-btn:hover { background: rgba(234, 242, 255, .1); }
[data-theme="blueprint"] .theme-btn .theme-swatch { border-radius: 1px; width: 30px; height: 28px; }
[data-theme="blueprint"] .theme-menu { background: #0f3a6f; border-color: var(--rule); }
[data-theme="blueprint"] .theme-opt .ico { color: var(--accent); }
[data-theme="blueprint"] .theme-opt .apps i { border-color: var(--border); border-radius: 1px; }

/* ---------- controls ---------- */
[data-theme="blueprint"] .btn { background: transparent; border-color: var(--rule); }
[data-theme="blueprint"] .btn:hover:not(:disabled) { background: rgba(234, 242, 255, .1); }
[data-theme="blueprint"] .btn-primary { background: var(--text); color: var(--bg); }
[data-theme="blueprint"] .btn-primary:hover:not(:disabled) { background: #fff; }
[data-theme="blueprint"] .btn-danger { color: var(--danger); border-color: var(--danger); }
[data-theme="blueprint"] .segmented { background: transparent; padding: 0; box-shadow: inset 0 0 0 1px var(--border); }
[data-theme="blueprint"] .segmented button { padding: 9px 12px; }
[data-theme="blueprint"] .segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
[data-theme="blueprint"] .stat { background: rgba(13, 52, 102, .7); border-style: dashed; align-items: flex-start; }
[data-theme="blueprint"] .stat-label { font-size: .58rem; font-weight: 400; color: var(--muted); }
[data-theme="blueprint"] .stat-value { font-weight: 600; }
[data-theme="blueprint"] .tool { font-size: .6rem; }
[data-theme="blueprint"] .tool[aria-pressed="true"] { color: var(--accent); background: var(--primary-soft); }
[data-theme="blueprint"] .tool .badge { background: var(--accent); color: var(--bg); }
[data-theme="blueprint"] .field label { color: var(--muted); font-weight: 400; }
[data-theme="blueprint"] .field input { border-color: var(--border); background: rgba(13, 52, 102, .75); font-family: var(--font-mono); }
[data-theme="blueprint"] .switch { width: 44px; height: 24px; border-radius: 1px; background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
[data-theme="blueprint"] .switch::before { top: 5px; left: 5px; width: 14px; height: 14px; border-radius: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
[data-theme="blueprint"] .switch[aria-checked="true"] { box-shadow: inset 0 0 0 1px var(--accent); background: var(--primary-soft); }
[data-theme="blueprint"] .switch[aria-checked="true"]::before { transform: translateX(20px); background: var(--accent); box-shadow: none; }
[data-theme="blueprint"] :is(.check input, .range) { accent-color: var(--accent); }

/* ---------- surfaces, dialog, toast ---------- */
[data-theme="blueprint"] .box { position: relative; border-color: var(--border); background: var(--sheet); }
[data-theme="blueprint"] .box::before, [data-theme="blueprint"] .box::after { content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--rule); pointer-events: none; }
[data-theme="blueprint"] .box::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
[data-theme="blueprint"] .box::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }
[data-theme="blueprint"] .box > h3 { font-weight: 700; letter-spacing: -.015em; }
[data-theme="blueprint"] .dialog { background: #0f3a6f; border: 1px solid var(--rule); }
[data-theme="blueprint"] .dialog h2, [data-theme="blueprint"] .settings-title { font-weight: 700; letter-spacing: -.02em; }
[data-theme="blueprint"] .install-banner { background: rgba(13, 52, 102, .8); border: 1px dashed var(--rule); margin-bottom: 20px; }
[data-theme="blueprint"] .drawer { background: #0f3a6f; border-left: 1px solid var(--rule); }
[data-theme="blueprint"] .setting { border-top: 1px dashed var(--border); }
[data-theme="blueprint"] .icon-tile { border-color: var(--border); background: var(--sheet); }
[data-theme="blueprint"] .swatch-item i { border-radius: 1px; }

/* ---------- home: title block, then the parts list ---------- */
[data-theme="blueprint"] .home-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); grid-template-areas: "title meta" "intro meta";
  margin: 8px 0 36px;
  border: 1.5px solid var(--rule);
  background: rgba(13, 52, 102, .78);
}
[data-theme="blueprint"] .hero-title { grid-area: title; display: block; padding: 26px 26px 10px; font-size: clamp(2.5rem, 7.2vw, 4.8rem); font-weight: 700; line-height: .95; letter-spacing: -.045em; }
[data-theme="blueprint"] .intro { grid-area: intro; max-width: 50ch; margin: 0; padding: 0 26px 26px; font-size: 1.02rem; }
[data-theme="blueprint"] .hero-meta { grid-area: meta; display: grid; grid-auto-rows: 1fr; border-left: 1.5px solid var(--rule); }
[data-theme="blueprint"] .hero-meta > * { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 10px 16px; border-bottom: 1px solid var(--border); font: 400 .88rem/1.3 var(--font-mono); }
[data-theme="blueprint"] .hero-meta > :last-child { border-bottom: 0; }
[data-theme="blueprint"] .hero-meta > *::before { color: var(--muted); font-size: .6rem; letter-spacing: .14em; }
[data-theme="blueprint"] .meta-date::before { content: "DATE"; }
[data-theme="blueprint"] .meta-count::before { content: "CONTENTS"; }
[data-theme="blueprint"] .meta-note::before { content: "NOTES"; }
[data-theme="blueprint"]:lang(de) .meta-date::before { content: "DATUM"; }
[data-theme="blueprint"]:lang(de) .meta-count::before { content: "INHALT"; }
[data-theme="blueprint"]:lang(de) .meta-note::before { content: "HINWEISE"; }
[data-theme="blueprint"] .date-long { display: none; }

/* section heads: a yellow section letter, the title in mono, a rule out to "×count" */
[data-theme="blueprint"] #home { counter-reset: section part; }
[data-theme="blueprint"] .home-section:not(.untitled) { counter-increment: section; }
[data-theme="blueprint"] .section-head { align-items: center; gap: 6px 12px; margin: 0 0 14px; }
[data-theme="blueprint"] .section-title { font: 600 .72rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
[data-theme="blueprint"] .home-section .section-title::before { content: counter(section, upper-alpha) "\2002"; color: var(--accent); }
[data-theme="blueprint"] .section-head::after { content: ""; flex: 1; order: 2; height: 1px; background: var(--rule); opacity: .5; }
[data-theme="blueprint"] .section-count { display: block; order: 3; color: var(--muted); font: 400 .72rem/1 var(--font-mono); }
[data-theme="blueprint"] .section-count::before { content: "\00d7"; margin-right: 3px; }
[data-theme="blueprint"] .section-note { order: 4; flex-basis: 100%; color: var(--muted); font: 400 .72rem/1.3 var(--font-mono); letter-spacing: .06em; }
[data-theme="blueprint"] .page > .section-head .section-title { font: 700 1.6rem/1.1 var(--font); letter-spacing: -.02em; text-transform: none; }
[data-theme="blueprint"] .home-section + .home-section { margin-top: 34px; }

[data-theme="blueprint"] .game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
[data-theme="blueprint"] .game-card {
  position: relative; counter-increment: part;
  gap: 18px; padding: 18px;
  border: 1px solid var(--border); border-radius: 2px;
  background: rgba(13, 52, 102, .78); box-shadow: none;
}
[data-theme="blueprint"] .game-card::before, [data-theme="blueprint"] .game-card::after { content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--rule); }
[data-theme="blueprint"] .game-card::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
[data-theme="blueprint"] .game-card::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }
[data-theme="blueprint"] .game-card:hover { border-color: var(--rule); background: rgba(23, 80, 143, .85); transform: none; }
[data-theme="blueprint"] .game-card .game-icon { width: 64px; height: 64px; border-radius: 0; background: transparent; box-shadow: inset 0 0 0 1px rgba(207, 224, 255, .45); color: var(--bg); }
[data-theme="blueprint"] .game-icon svg [fill="#fff"] { fill: var(--text); }
[data-theme="blueprint"] .game-icon svg [stroke="#fff"] { stroke: var(--text); }
[data-theme="blueprint"] .kind-line .game-card .game-icon { width: 56px; height: 56px; color: var(--text); }
[data-theme="blueprint"] .kind-line .game-card .game-icon svg { width: 28px; height: 28px; stroke-width: 1.7; }
[data-theme="blueprint"] .game-num { display: block; margin-bottom: 4px; color: var(--accent); font: 600 .68rem/1 var(--font-mono); letter-spacing: .12em; font-size: 0; }
[data-theme="blueprint"] .game-num::before { content: attr(data-prefix) counter(part, decimal-leading-zero); font-size: .68rem; }
[data-theme="blueprint"] .game-meta h3 { font-size: 1.22rem; font-weight: 700; letter-spacing: -.015em; }
[data-theme="blueprint"] .game-meta p { margin-top: 4px; font-size: .9rem; }
[data-theme="blueprint"] .game-status { margin-top: 8px; color: var(--accent); font-size: .64rem; font-weight: 400; }
/* art panels: landscape art box at the right, so the widest layouts fit */
[data-theme="blueprint"] .kind-art .game-card { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 16px; padding: 16px; }
[data-theme="blueprint"] .kind-art .game-card .game-icon { grid-column: 2; grid-row: 1; width: 150px; height: 96px; aspect-ratio: auto; background: var(--table-art); box-shadow: inset 0 0 0 1px #6f97cf; --art-scale: .58; }
[data-theme="blueprint"] .kind-art .game-card .game-meta { grid-column: 1; grid-row: 1; padding: 0; }
[data-theme="blueprint"] .icon-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
[data-theme="blueprint"] .icon-list .game-num { display: none; }
[data-theme="blueprint"] .home-footer { justify-content: flex-start; }

/* ---------- footer: a title-block strip ---------- */
[data-theme="blueprint"] .site-footer { border-top: 1.5px solid var(--rule); background: rgba(13, 52, 102, .85); color: var(--muted); }
[data-theme="blueprint"] .footer-brand { font-weight: 700; letter-spacing: -.02em; }
[data-theme="blueprint"] .footer-note { font-family: var(--font-mono); font-size: .75rem; }

/* ---------- game pieces ---------- */
[data-theme="blueprint"] .keypad button { background: rgba(13, 52, 102, .75); border-color: var(--border); font-weight: 400; }
[data-theme="blueprint"] .keypad button:hover { background: rgba(234, 242, 255, .1); border-color: var(--rule); }
[data-theme="blueprint"] .keypad button.accent { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
[data-theme="blueprint"] .g2048-board > div { font-weight: 600; box-shadow: inset 0 0 0 1px rgba(234, 242, 255, .12); }
[data-theme="blueprint"] .mem-grid i.lit { box-shadow: 0 0 18px rgba(255, 210, 63, .5); }

@media (max-width: 680px) {
  [data-theme="blueprint"] .home-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "intro" "meta"; }
  [data-theme="blueprint"] .hero-meta { grid-auto-rows: auto; grid-auto-flow: column; grid-auto-columns: 1fr; border-left: 0; border-top: 1.5px solid var(--rule); }
  [data-theme="blueprint"] .hero-meta > * { border-bottom: 0; border-right: 1px solid var(--border); }
  [data-theme="blueprint"] .hero-meta > :last-child { border-right: 0; }
  [data-theme="blueprint"] .meta-note { display: none !important; }
  [data-theme="blueprint"] .hero-meta > :nth-last-child(2) { border-right: 0; }
  [data-theme="blueprint"] .game-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* ---------- hover: everything clickable has to visibly react ---------- */
/* the yellow accent marks what the pointer is on */
[data-theme="blueprint"] :is(.btn, .theme-btn):hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
[data-theme="blueprint"] :is(.btn-primary, .keypad button.accent):hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--bg); }
[data-theme="blueprint"] .btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
[data-theme="blueprint"] .segmented button:hover:not([aria-pressed="true"]) { background: transparent; box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
[data-theme="blueprint"] :is(.icon-btn, .tool):hover:not(:disabled), [data-theme="blueprint"] .theme-opt:hover strong { color: var(--accent); }
