/* =========================================================
   Pokémon Infinite Fusion Calculator — stylesheet
   Themes: set data-theme on <html>. Shell tokens colour the
   console, screen tokens colour everything calculator.js renders.
   ========================================================= */

:root {
  /* Page */
  --page-a:#dfe5f5;
  --page-b:#b8c4e0;
  --page-dot:rgba(255,255,255,.7);
  --page-ink:#1c2140;
  --page-muted:#4a5075;
  --paper:#ffffff;
  --paper-line:#d4d9ea;
  --paper-soft:#f3f5fb;
  --link:#3a3f94;
  --header-bg:rgba(255,255,255,.78);

  /* Console shell */
  --shell-light:#8a8fd4;
  --shell:#5d63a6;
  --shell-deep:#4a5096;
  --shell-edge:#252a53;
  --shell-ink:#ffffff;
  --shell-ink-shadow:#333862;
  --shell-accent:#f5cf55;
  --shell-groove:rgba(34,37,76,.3);
  --bezel:#2d314f;
  --bezel-edge:#20233b;
  --btn:#a74482;
  --btn-edge:#5b284c;
  --btn-hi:#cf79ae;
  --btn-ink:#f8d9ef;
  --dpad:#2d3150;
  --dpad-edge:#1f2239;
  --dpad-hi:#4b507b;
  --pill:#53598d;
  --pill-edge:#292d4e;

  /* Screen (green LCD) */
  --scr-bg:#e7f4d2;
  --scr-bg-2:#edf6dc;
  --scr-panel:#f7fbec;
  --scr-field:#f8ffe8;
  --scr-chip:#e6efcf;
  --scr-line:#819c6b;
  --scr-line-strong:#607a56;
  --scr-line-soft:#b2c2a6;
  --scr-ink:#17231a;
  --scr-muted:#4e614d;
  --scr-label:#3e573d;
  --scr-head:#576d50;
  --scr-head-ink:#f3f8ed;
  --scr-stripe:#eef6df;
  --scr-hover:#e0edce;
  --scr-check:#d7e8c4;
  --scr-check-bg:#eaf6d7;
  --scr-bar:#9db88b;
  --scr-bar-ink:#20301f;
  --scr-glass-edge:#627653;
  --scr-marker:#445b3f;
  --scr-marker-2:#8aa378;
  --scr-h3:#dbe9cb;
  --positive:#267742;
  --negative:#a52f3e;
  --error:#8d2837;

  --radius:10px;
  --font-ui:ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-screen:ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Courier New", monospace;
}

/* ---------- Screen palettes ---------- */
[data-theme="glacier"],
[data-theme="platinum"] {
  --scr-bg:#e6f0f8; --scr-bg-2:#edf4fa; --scr-panel:#f7fbff; --scr-field:#fbfdff; --scr-chip:#e3edf6;
  --scr-line:#86a3bd; --scr-line-strong:#5d7d99; --scr-line-soft:#bccddc;
  --scr-ink:#14202b; --scr-muted:#4b5f70; --scr-label:#37536d;
  --scr-head:#4f6c86; --scr-head-ink:#f2f7fb; --scr-stripe:#eef4fa; --scr-hover:#e0ebf5;
  --scr-check:#d6e4f0; --scr-check-bg:#e9f1f8; --scr-bar:#a6bfd6; --scr-bar-ink:#172636;
  --scr-glass-edge:#5f7f9c; --scr-marker:#34506b; --scr-marker-2:#86a3bd; --scr-h3:#d8e5f1;
  --positive:#1f6f45; --negative:#a3303e; --error:#9a2a3a;
}
[data-theme="spice"],
[data-theme="crimson"] {
  --scr-bg:#ecece8; --scr-bg-2:#f2f2ee; --scr-panel:#fafaf8; --scr-field:#ffffff; --scr-chip:#ebebe5;
  --scr-line:#9a9a92; --scr-line-strong:#6f6f68; --scr-line-soft:#cacac3;
  --scr-ink:#1d1d1b; --scr-muted:#56564f; --scr-label:#494943;
  --scr-head:#55554f; --scr-head-ink:#f6f6f3; --scr-stripe:#f1f1ed; --scr-hover:#e6e6e0;
  --scr-check:#deded8; --scr-check-bg:#efefeb; --scr-bar:#bdbdb4; --scr-bar-ink:#222220;
  --scr-glass-edge:#77776f; --scr-marker:#3f3f3a; --scr-marker-2:#a0a098; --scr-h3:#e2e2dc;
  --positive:#23703f; --negative:#a8303c; --error:#9a2a36;
}
[data-theme="onyx"],
[data-theme="midnight"] {
  --scr-bg:#141a22; --scr-bg-2:#1a222c; --scr-panel:#1f2833; --scr-field:#111820; --scr-chip:#28333f;
  --scr-line:#3a4a5c; --scr-line-strong:#56708a; --scr-line-soft:#2f3c4b;
  --scr-ink:#e8eef5; --scr-muted:#9fb0c2; --scr-label:#a9c3dc;
  --scr-head:#2c3b4c; --scr-head-ink:#e8eef5; --scr-stripe:#232d39; --scr-hover:#2a3644;
  --scr-check:#1b2430; --scr-check-bg:#202a36; --scr-bar:#243242; --scr-bar-ink:#cfe0f0;
  --scr-glass-edge:#0b0f14; --scr-marker:#7fc4ff; --scr-marker-2:#2f5170; --scr-h3:#263241;
  --positive:#6ad69a; --negative:#ff8a95; --error:#ff8a95;
}

/* ---------- Shells ---------- */
[data-theme="glacier"] {
  --page-a:#e4f3f8; --page-b:#b9dbe8; --page-ink:#10303d; --page-muted:#3c5f6e; --link:#1d5e78; --paper-line:#cfe3eb; --paper-soft:#f1f8fb;
  --shell-light:#cdebf3; --shell:#8fc7da; --shell-deep:#6aaec6; --shell-edge:#2f6d84;
  --shell-ink:#0f2f3d; --shell-ink-shadow:rgba(255,255,255,.55); --shell-accent:#1d5e78; --shell-groove:rgba(20,70,90,.25);
  --bezel:#24445a; --bezel-edge:#18303f;
  --btn:#3d5fb8; --btn-edge:#1f3570; --btn-hi:#7493e0; --btn-ink:#eef3ff;
  --dpad:#2c4a5e; --dpad-edge:#1a3040; --dpad-hi:#4d7088; --pill:#5e8fa6; --pill-edge:#2c5366;
}
[data-theme="fuchsia"] {
  --page-a:#f8e3ef; --page-b:#e8b6d2; --page-ink:#3d1029; --page-muted:#6e3a57; --link:#9b2566; --paper-line:#f0d0e1; --paper-soft:#fcf2f7;
  --shell-light:#f08cc4; --shell:#d4509a; --shell-deep:#b93a82; --shell-edge:#6b1c49;
  --shell-ink:#ffffff; --shell-ink-shadow:#7c2254; --shell-accent:#ffe27a; --shell-groove:rgba(90,20,60,.3);
  --bezel:#3b1a33; --bezel-edge:#2a1024;
  --btn:#4a3f9e; --btn-edge:#231c5a; --btn-hi:#7a70cf; --btn-ink:#ecebff;
  --dpad:#3b1a33; --dpad-edge:#260f21; --dpad-hi:#65304f; --pill:#9e3a74; --pill-edge:#5a1c41;
}
[data-theme="spice"] {
  --page-a:#fbeedd; --page-b:#f1c99a; --page-ink:#3a1d02; --page-muted:#6e4a28; --link:#9a4a05; --paper-line:#f0dcc4; --paper-soft:#fdf6ee;
  --shell-light:#ffc27a; --shell:#f28a1e; --shell-deep:#d9700c; --shell-edge:#7a3a04;
  --shell-ink:#2b1400; --shell-ink-shadow:rgba(255,230,190,.6); --shell-accent:#5c1c00; --shell-groove:rgba(110,50,0,.3);
  --bezel:#3a2414; --bezel-edge:#26170c;
  --btn:#6b3fa0; --btn-edge:#3b1f60; --btn-hi:#9a72cc; --btn-ink:#f1e8ff;
  --dpad:#3a2414; --dpad-edge:#24160b; --dpad-hi:#6a4a30; --pill:#b8620f; --pill-edge:#6e3606;
}
[data-theme="platinum"] {
  --page-a:#eef0f4; --page-b:#cdd2da; --page-ink:#1e2430; --page-muted:#4f5767; --link:#2f45a8; --paper-line:#dde1e8; --paper-soft:#f5f6f9;
  --shell-light:#f7f8fa; --shell:#cfd4db; --shell-deep:#b6bcc6; --shell-edge:#6d747f;
  --shell-ink:#1e2430; --shell-ink-shadow:rgba(255,255,255,.8); --shell-accent:#2f45a8; --shell-groove:rgba(60,66,80,.22);
  --bezel:#2e333d; --bezel-edge:#1e222a;
  --btn:#2f3a8f; --btn-edge:#161d52; --btn-hi:#5d69c4; --btn-ink:#eef0ff;
  --dpad:#3b414c; --dpad-edge:#23272e; --dpad-hi:#5d6573; --pill:#9aa1ad; --pill-edge:#5f6672;
}
[data-theme="kiwi"] {
  --page-a:#f0f8dc; --page-b:#cfe79a; --page-ink:#1d2a05; --page-muted:#4b5a2a; --link:#4a6b08; --paper-line:#dfecc0; --paper-soft:#f7fbec;
  --shell-light:#d6f28a; --shell:#a5d63a; --shell-deep:#86bb22; --shell-edge:#3f5c0a;
  --shell-ink:#1d2a05; --shell-ink-shadow:rgba(255,255,220,.55); --shell-accent:#4a1f7a; --shell-groove:rgba(50,80,10,.28);
  --bezel:#263010; --bezel-edge:#182008;
  --btn:#7a3fb0; --btn-edge:#42206a; --btn-hi:#a574d6; --btn-ink:#f4ebff;
  --dpad:#2b3612; --dpad-edge:#1a220a; --dpad-hi:#4c5c26; --pill:#6f9a1e; --pill-edge:#3f5c0a;
}
[data-theme="crimson"] {
  --page-a:#f9e2e2; --page-b:#e9b1b1; --page-ink:#3a0e0e; --page-muted:#6e3a3a; --link:#a42222; --paper-line:#f0d2d2; --paper-soft:#fcf3f3;
  --shell-light:#f07474; --shell:#d13b3b; --shell-deep:#b02a2a; --shell-edge:#5a1010;
  --shell-ink:#ffffff; --shell-ink-shadow:#6e1717; --shell-accent:#ffd66b; --shell-groove:rgba(80,10,10,.3);
  --bezel:#2d1a1a; --bezel-edge:#1e1010;
  --btn:#2d2f36; --btn-edge:#121317; --btn-hi:#555966; --btn-ink:#f3f3f5;
  --dpad:#3a1414; --dpad-edge:#240b0b; --dpad-hi:#632a2a; --pill:#932424; --pill-edge:#561010;
}
[data-theme="emerald"] {
  --page-a:#dff4ea; --page-b:#a9dcc4; --page-ink:#0b3324; --page-muted:#3b6352; --link:#146b4a; --paper-line:#cde8db; --paper-soft:#f0f9f5;
  --shell-light:#5fd0a0; --shell:#1f9e6e; --shell-deep:#16825a; --shell-edge:#0a3d2a;
  --shell-ink:#ffffff; --shell-ink-shadow:#0c4a33; --shell-accent:#ffe38a; --shell-groove:rgba(5,50,30,.32);
  --bezel:#15302a; --bezel-edge:#0b1f1a;
  --btn:#1d3f8a; --btn-edge:#0d224f; --btn-hi:#4d6fc0; --btn-ink:#eaf0ff;
  --dpad:#173a2d; --dpad-edge:#0a2419; --dpad-hi:#2e5c4a; --pill:#157a54; --pill-edge:#0a3d2a;
}
[data-theme="onyx"] {
  --page-a:#1d1f25; --page-b:#0f1013; --page-dot:rgba(255,255,255,.06); --page-ink:#e9ebf0; --page-muted:#a4a9b6;
  --paper:#1b1d23; --paper-line:#2e313a; --paper-soft:#22252c; --link:#ffcf4d; --header-bg:rgba(20,21,26,.82);
  --shell-light:#4a4d55; --shell:#2b2d33; --shell-deep:#1f2126; --shell-edge:#0c0d10;
  --shell-ink:#f2f3f5; --shell-ink-shadow:#000000; --shell-accent:#ffcf4d; --shell-groove:rgba(0,0,0,.45);
  --bezel:#0f1013; --bezel-edge:#050506;
  --btn:#c23b4f; --btn-edge:#5c1622; --btn-hi:#e56b7d; --btn-ink:#fff0f2;
  --dpad:#15161a; --dpad-edge:#050506; --dpad-hi:#3a3c44; --pill:#3d4048; --pill-edge:#111216;
}
[data-theme="midnight"] {
  --page-a:#141a33; --page-b:#0a0e1f; --page-dot:rgba(160,190,255,.07); --page-ink:#e6ebff; --page-muted:#9ea8cf;
  --paper:#141a30; --paper-line:#252d4d; --paper-soft:#1a2139; --link:#8fd3ff; --header-bg:rgba(12,16,34,.82);
  --shell-light:#3f4f8f; --shell:#26336b; --shell-deep:#1b2552; --shell-edge:#0a0f26;
  --shell-ink:#eef2ff; --shell-ink-shadow:#070b1c; --shell-accent:#8fd3ff; --shell-groove:rgba(0,0,20,.45);
  --bezel:#0c1024; --bezel-edge:#05070f;
  --btn:#3d7bd9; --btn-edge:#173a73; --btn-hi:#76a8f0; --btn-ink:#eef5ff;
  --dpad:#10163a; --dpad-edge:#05081c; --dpad-hi:#2e3a70; --pill:#34438a; --pill-edge:#131a45;
}

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing:border-box; }

:root { padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px); }
html { scroll-padding-top:calc(76px + env(safe-area-inset-top,0px)); background:var(--page-b); -webkit-text-size-adjust:100%; }
@media (prefers-reduced-motion:no-preference) { html { scroll-behavior:smooth; } }

body {
  margin:0;
  min-width:300px;
  color:var(--page-ink);
  background:
    radial-gradient(circle at 20% 20%, var(--page-dot) 0 1.5px, transparent 2.5px) 0 0/28px 28px,
    linear-gradient(180deg, var(--page-a) 0%, var(--page-b) 100%) fixed;
  font-family:var(--font-ui);
  font-size:17px;
  line-height:1.6;
}

img { max-width:100%; }
button, select, input { font:inherit; color:inherit; }
button { appearance:none; border:0; background:none; cursor:pointer; }
a { color:var(--link); text-underline-offset:.18em; }
a:hover { text-decoration-thickness:2px; }

:focus-visible { outline:3px solid var(--shell-accent); outline-offset:3px; border-radius:4px; }
.screen-glass :focus-visible { outline-color:var(--scr-marker); }

.skip-link {
  position:absolute; left:12px; top:-60px; z-index:100;
  padding:10px 14px; border-radius:8px;
  background:var(--shell-edge); color:#fff; font-weight:800; text-decoration:none;
}
.skip-link:focus { top:calc(12px + env(safe-area-inset-top,0px)); }

[hidden] { display:none !important; }

/* =========================================================
   Site header + theme picker
   ========================================================= */
.site-header {
  position:sticky; top:0; z-index:50;
  padding-top:env(safe-area-inset-top,0px);
  margin-top:calc(-1 * env(safe-area-inset-top,0px));
  background:var(--header-bg);
  -webkit-backdrop-filter:saturate(1.4) blur(10px);
  backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--paper-line);
}
.site-header-inner {
  width:min(1480px,100%); margin:0 auto;
  display:flex; align-items:center; gap:18px;
  padding:10px 18px;
}

.wordmark { display:inline-flex; align-items:center; gap:10px; color:var(--page-ink); text-decoration:none; font-weight:700; letter-spacing:-.01em; }
.wordmark b { font-weight:900; }
.wordmark-mark { position:relative; width:30px; height:22px; flex:none; }
.wordmark-mark i { position:absolute; top:1px; width:20px; height:20px; border-radius:50%; border:2px solid var(--shell-edge); }
.wordmark-mark i:first-child { left:0; background:var(--shell); }
.wordmark-mark i:last-child { right:0; background:var(--scr-bg); mix-blend-mode:normal; opacity:.92; }

.site-nav { display:flex; gap:4px; margin-left:auto; }
.site-nav a {
  padding:7px 11px; border-radius:8px;
  color:var(--page-muted); font-size:15px; font-weight:700; text-decoration:none;
}
.site-nav a:hover { color:var(--page-ink); background:var(--paper-soft); }

.theme-picker { position:relative; }
.theme-toggle {
  display:inline-flex; align-items:center; gap:8px;
  min-height:40px; padding:0 14px 0 8px;
  border:2px solid var(--paper-line); border-radius:999px;
  background:var(--paper); color:var(--page-ink);
  font-size:15px; font-weight:800;
}
.theme-toggle:hover { border-color:var(--shell); }
.theme-toggle-swatch {
  width:24px; height:24px; border-radius:50%;
  background:linear-gradient(135deg, var(--shell) 50%, var(--scr-bg) 50%);
  border:2px solid var(--shell-edge);
}
.theme-menu {
  position:absolute; right:0; top:calc(100% + 8px);
  width:min(320px, calc(100vw - 24px));
  padding:14px;
  border:1px solid var(--paper-line); border-radius:14px;
  background:var(--paper);
  box-shadow:0 18px 40px rgba(10,14,40,.22);
}
.theme-menu-title { margin:0 0 10px; font-size:14px; font-weight:800; color:var(--page-muted); }
.theme-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:6px; }
.theme-option {
  display:flex; align-items:center; gap:9px;
  min-height:42px; padding:6px 10px;
  border:2px solid transparent; border-radius:10px;
  color:var(--page-ink); font-size:14px; font-weight:700; text-align:left;
}
.theme-option::before {
  content:""; flex:none; width:26px; height:26px; border-radius:7px;
  background:linear-gradient(135deg, var(--sw-a) 55%, var(--sw-b) 55%);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.25);
}
.theme-option:hover { background:var(--paper-soft); }
.theme-option[aria-pressed="true"] { border-color:var(--shell); background:var(--paper-soft); }

/* =========================================================
   Console shell
   ========================================================= */
.gba-page { width:100%; padding:24px 14px 40px; }
#main { width:min(1480px,100%); margin:0 auto; }

.gba-shell {
  position:relative;
  padding:24px 24px 26px;
  border:4px solid var(--shell-edge);
  border-radius:34px 34px 74px 34px;
  color:var(--shell-ink);
  background:
    linear-gradient(145deg, rgba(255,255,255,.2), transparent 26%),
    linear-gradient(180deg, var(--shell-light), var(--shell) 24%, var(--shell-deep) 100%);
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,.32),
    inset 0 -7px 0 var(--shell-groove),
    0 24px 55px rgba(17,20,42,.28);
}
.gba-shell::after {
  content:""; position:absolute; right:26px; bottom:22px;
  width:60px; height:6px; border-radius:99px;
  background:var(--shell-groove);
  box-shadow:0 10px 0 var(--shell-groove), 0 20px 0 var(--shell-groove);
  transform:rotate(-14deg); pointer-events:none;
}

.gba-topbar { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:0 10px 18px; }
.brand-cluster { display:flex; align-items:center; gap:14px; min-width:0; }
.power-dot {
  flex:none; width:12px; height:12px; border-radius:50%;
  background:#ff6b75; border:2px solid #742735;
  box-shadow:0 0 0 3px rgba(255,255,255,.18), 0 0 12px rgba(255,81,96,.8);
}
@media (prefers-reduced-motion:no-preference) {
  .power-dot { animation:power-on 1.4s ease-out 1; }
  @keyframes power-on { 0%,30% { background:#5a2a30; box-shadow:none; } 100% { background:#ff6b75; } }
}

h1 {
  margin:0;
  font-size:clamp(26px, 3.6vw, 46px);
  font-weight:900;
  line-height:1.02;
  letter-spacing:-.035em;
  text-shadow:0 3px 0 var(--shell-ink-shadow);
  text-wrap:balance;
}
.subtitle {
  margin:8px 0 0;
  max-width:62ch;
  font-size:15px; font-weight:700; line-height:1.4;
  color:var(--shell-accent);
}

.speaker-dots { flex:none; display:grid; grid-template-columns:repeat(5,7px); gap:6px; transform:rotate(-8deg); }
.speaker-dots span { width:7px; height:7px; border-radius:50%; background:var(--shell-edge); opacity:.75; box-shadow:inset 0 1px 0 rgba(255,255,255,.2); }

.screen-frame {
  background:var(--bezel);
  border:5px solid var(--bezel-edge);
  border-radius:24px 24px 42px 24px;
  padding:18px;
  box-shadow:inset 0 4px 0 rgba(255,255,255,.1), 0 8px 0 var(--shell-groove);
}

.screen-glass {
  position:relative;
  min-height:540px;
  padding:18px;
  border:4px solid var(--scr-glass-edge);
  border-radius:7px;
  color:var(--scr-ink);
  font-family:var(--font-screen);
  font-size:14px;
  line-height:1.45;
  background:
    linear-gradient(rgba(0,0,0,.035) 50%, transparent 50%) 0 0/100% 4px,
    linear-gradient(90deg, rgba(255,255,255,.12), transparent 45%),
    var(--scr-bg);
  box-shadow:inset 0 0 0 3px rgba(255,255,255,.18), inset 0 0 30px rgba(0,0,0,.08);
}

.screen-statusbar {
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  margin:-2px -2px 16px; padding:8px 10px;
  border:2px solid var(--scr-line-strong);
  background:var(--scr-bar); color:var(--scr-bar-ink);
  font-size:12px; font-weight:900; letter-spacing:.06em;
}
.status-pill { padding:2px 8px; border:2px solid var(--scr-line-strong); background:var(--scr-bg-2); color:var(--scr-ink); }

/* ---------- Controls ---------- */
.controls {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto;
  gap:12px; align-items:center;
  margin-bottom:12px; padding:12px;
  border:3px solid var(--scr-line); border-radius:7px;
  background:var(--scr-bg-2);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.35);
}
.control-field { display:grid; gap:6px; min-width:0; }

.eyebrow, .parent-label, .field-label {
  font-size:12px; font-weight:900; letter-spacing:.06em;
}
.field-label, .parent-label { color:var(--scr-label); }
.field-hint { font-size:11px; color:var(--scr-muted); font-weight:700; }

select {
  width:100%; min-height:46px;
  padding:8px 38px 8px 10px;
  border:3px solid var(--scr-line-strong); border-radius:5px;
  color:var(--scr-ink);
  background:
    linear-gradient(45deg, transparent 50%, var(--scr-ink) 50%) calc(100% - 18px) 50%/6px 6px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--scr-ink) 50%) calc(100% - 12px) 50%/6px 6px no-repeat,
    var(--scr-field);
  -webkit-appearance:none; appearance:none;
  box-shadow:inset 0 -3px 0 rgba(0,0,0,.08);
  font-family:var(--font-screen); font-size:15px; font-weight:800;
  outline:none; text-overflow:ellipsis;
}
select:focus-visible { border-color:var(--scr-marker); box-shadow:0 0 0 3px var(--scr-marker-2); outline:none; }
select option { color:#111; background:#fff; }

.swap {
  width:58px; height:58px; flex:none;
  display:grid; place-items:center; align-content:center;
  border:3px solid var(--btn-edge); border-radius:50%;
  color:var(--btn-ink);
  background:linear-gradient(var(--btn-hi), var(--btn));
  box-shadow:0 5px 0 var(--btn-edge), 0 7px 8px rgba(0,0,0,.15);
  margin-top:8px;
}
.swap-icon { font-size:22px; line-height:1; }
.swap small { font-size:9px; font-weight:900; letter-spacing:.04em; }
.swap:active { transform:translateY(3px); box-shadow:0 2px 0 var(--btn-edge); }

.gba-action {
  min-height:52px; padding:0 26px; margin-top:8px;
  border:3px solid #8a5d12; border-radius:8px;
  color:#30250c;
  background:linear-gradient(#ffe574, #e6bd36);
  box-shadow:0 5px 0 #8a5d12, 0 7px 8px rgba(0,0,0,.15);
  font-family:var(--font-ui); font-size:18px; font-weight:900; letter-spacing:.02em;
}
.gba-action:hover { filter:brightness(1.04); }
.gba-action:active { transform:translateY(3px); box-shadow:0 2px 0 #8a5d12; }

.action-group { display:flex; gap:10px; align-items:center; }
.action-group .gba-action { margin-top:8px; }
.random-action {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:52px; padding:0 18px; margin-top:8px;
  border:3px solid var(--btn-edge); border-radius:8px;
  color:var(--btn-ink);
  background:linear-gradient(var(--btn-hi), var(--btn));
  box-shadow:0 5px 0 var(--btn-edge), 0 7px 8px rgba(0,0,0,.15);
  font-family:var(--font-ui); font-size:17px; font-weight:900;
}
.random-dice { font-size:24px; line-height:1; }
.random-action:hover { filter:brightness(1.06); }
.random-action:active { transform:translateY(3px); box-shadow:0 2px 0 var(--btn-edge); }
@media (prefers-reduced-motion:no-preference) {
  .random-action:active .random-dice { transform:rotate(90deg); transition:transform .15s ease; }
}

/* ---------- Collapsed console → expands after the first fusion ---------- */
.fuse-hint {
  margin:16px 0 4px; text-align:center;
  color:var(--scr-muted); font-size:13px; font-weight:800;
}
.fuse-hint b { color:var(--scr-ink); }

.fusion-drawer { display:grid; grid-template-rows:0fr; }
.fusion-drawer-inner { min-height:0; overflow:hidden; }
.is-expanded .fusion-drawer { grid-template-rows:1fr; }
.is-expanded .fusion-drawer-inner { animation:drawer-open 0s .5s forwards; padding-bottom:6px; }
@keyframes drawer-open { to { overflow:visible; } }
@media (prefers-reduced-motion:no-preference) {
  .fusion-drawer { transition:grid-template-rows .5s cubic-bezier(.2,.7,.2,1); }
  .is-expanded .result-block { animation:drawer-fade .45s ease-out both; }
  @keyframes drawer-fade { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:none; } }
}

.is-collapsed .screen-glass { min-height:0; }
.is-collapsed .parents { grid-template-columns:repeat(2,minmax(0,1fr)); }
.is-collapsed .parent-card { min-height:0; padding-bottom:12px; }
.is-collapsed .mini-stats { display:none; }
.is-collapsed .parent-card img { width:clamp(96px,22vw,170px); height:clamp(96px,22vw,170px); }


#status { min-height:0; margin:8px 3px 2px; color:var(--error); font-size:13px; font-weight:900; }
#status:empty { margin:0; }
#status.ok { color:var(--positive); }

.noscript { padding:12px; border:2px dashed var(--scr-line-strong); font-weight:800; }

/* ---------- Result sections ---------- */
.section-block { margin-top:18px; }
.section-title { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.section-title h2 { margin:0; font-size:15px; font-weight:900; letter-spacing:.04em; }
.pixel-marker { flex:none; width:10px; height:10px; background:var(--scr-marker); box-shadow:4px 4px 0 var(--scr-marker-2); }

.parents, .results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.parents > div, .results > div { min-width:0; }

.parent-card, .fusion-card {
  position:relative; min-width:0;
  padding:15px;
  border:3px solid var(--scr-line); border-radius:7px;
  background:var(--scr-panel);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.25), 0 5px 0 var(--scr-line);
}
.parent-card::before, .fusion-card::before {
  content:""; position:absolute; inset:5px; pointer-events:none;
  border:1px dashed var(--scr-line-soft);
}

.parent-card { text-align:center; min-height:280px; }
.parent-card img { width:150px; height:150px; object-fit:contain; filter:drop-shadow(0 7px 0 rgba(0,0,0,.1)); }
.parent-card h3 { margin:7px 0 10px; font-size:17px; }

.badges { display:flex; gap:6px; flex-wrap:wrap; }
.parent-card .badges { justify-content:center; }

.type, .ability, .effect {
  display:inline-flex; align-items:center; justify-content:center;
  min-height:26px; padding:4px 8px;
  border:2px solid rgba(0,0,0,.35); border-radius:4px;
  background:#f7ffe8; color:#1d2a1c;
  font-size:11px; line-height:1.1; font-weight:900; text-transform:uppercase;
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);
}
.type-normal{background:#dddcc9}
.type-fire{background:#f28a66}
.type-water{background:#7fb1e9}
.type-electric{background:#f5d85d}
.type-grass{background:#83c977}
.type-ice{background:#9bdde0}
.type-fighting{background:#c77267;color:#fff}
.type-poison{background:#b17bbb;color:#fff}
.type-ground{background:#ddb96c}
.type-flying{background:#9aaee8}
.type-psychic{background:#e984a6}
.type-bug{background:#aeb94c}
.type-rock{background:#b9a15b}
.type-ghost{background:#756b9e;color:#fff}
.type-dragon{background:#7963dc;color:#fff}
.type-dark{background:#6a5a50;color:#fff}
.type-steel{background:#9da9b8}
.type-fairy{background:#dfa0c0}

.mini-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:12px; }
.mini-stats span {
  padding:7px 4px; border:2px solid var(--scr-line-soft); border-radius:4px;
  background:var(--scr-bg-2); color:var(--scr-ink);
  font-size:11px; font-weight:900;
}

.fusion-top { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; padding:3px 3px 0; }
.fusion-top > * { min-width:0; }
.fusion-top h2 { margin:4px 0 8px; font-size:clamp(19px,2vw,27px); letter-spacing:-.03em; overflow-wrap:anywhere; }
.fusion-card .eyebrow { color:var(--scr-muted); font-size:11px; }

.alt-select { min-width:150px; max-width:220px; }

.sprite-wrap {
  min-height:300px; display:grid; place-items:center;
  margin:10px 0 6px; padding:10px;
  border:3px solid var(--scr-line);
  background:
    linear-gradient(45deg, var(--scr-check) 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(-45deg, var(--scr-check) 25%, transparent 25%) 0 10px/20px 20px,
    linear-gradient(45deg, transparent 75%, var(--scr-check) 75%) 10px -10px/20px 20px,
    linear-gradient(-45deg, transparent 75%, var(--scr-check) 75%) -10px 0/20px 20px,
    var(--scr-check-bg);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.2);
}
.fusion-sprite {
  width:min(100%,300px); height:300px; object-fit:contain;
  image-rendering:pixelated;
  filter:drop-shadow(0 8px 0 rgba(0,0,0,.12));
}
.fusion-sprite.missing { opacity:.2; }
.credit { padding:6px 8px; color:var(--scr-muted); text-align:center; font-size:11px; font-weight:800; overflow-wrap:anywhere; }

.fusion-card h3 {
  margin:18px 0 8px; padding:7px 9px;
  display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;
  border-left:6px solid var(--scr-marker);
  background:var(--scr-h3); color:var(--scr-ink);
  font-size:13px; letter-spacing:.04em; text-transform:uppercase;
}
.fusion-card h3 small { color:var(--scr-muted); font-size:11px; font-weight:900; }

.table-scroll {
  overflow:auto; -webkit-overflow-scrolling:touch;
  max-width:100%;
  border:3px solid var(--scr-line); border-radius:5px;
  background:var(--scr-field);
  scrollbar-color:var(--scr-line-strong) var(--scr-bg-2); scrollbar-width:thin;
}
.screen-glass table { width:100%; border-collapse:collapse; color:var(--scr-ink); background:var(--scr-field); font-size:12px; }
.screen-glass th, .screen-glass td {
  border-right:1px solid var(--scr-line-soft); border-bottom:1px solid var(--scr-line-soft);
  padding:8px; text-align:left; vertical-align:top;
}
.screen-glass tr:last-child th, .screen-glass tr:last-child td { border-bottom:0; }
.screen-glass th:last-child, .screen-glass td:last-child { border-right:0; }
.screen-glass thead th {
  position:sticky; top:0; z-index:2;
  color:var(--scr-head-ink); background:var(--scr-head);
  white-space:nowrap; font-size:11px; letter-spacing:.03em; text-transform:uppercase;
}
.screen-glass tbody tr:nth-child(even) { background:var(--scr-stripe); }
.screen-glass tbody tr:hover { background:var(--scr-hover); }

.stats-table td, .stats-table th { text-align:center !important; }
.stats-table th:first-child { text-align:left !important; }

.positive { color:var(--positive); font-weight:900; }
.negative { color:var(--negative); font-weight:900; }
.neutral { color:var(--scr-muted); font-weight:900; }

.ability-group { display:flex; align-items:flex-start; gap:8px; margin:8px 0; }
.ability-group > b { min-width:58px; padding-top:5px; color:var(--scr-label); font-size:12px; }
.ability-list { display:flex; flex-wrap:wrap; gap:6px; }
.ability { cursor:help; background:var(--scr-chip); color:var(--scr-ink); border-color:var(--scr-line-strong); }

.effect { margin:2px 3px 2px 0; text-transform:none; }
.effect.weak { color:#6d1f2a; background:#ffd8d5; border-color:#b75e65; }
.effect.resist { color:#244d31; background:#cce9c6; border-color:#6a9a6c; }
.effect.immune { color:#3f4650; background:#d9dfe4; border-color:#89949d; }

.move-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.move-tab {
  min-height:36px; padding:0 11px;
  border:2px solid var(--scr-line-strong); border-radius:4px;
  color:var(--scr-ink); background:var(--scr-bg-2);
  box-shadow:0 3px 0 var(--scr-line-strong);
  font-family:var(--font-screen); font-size:11px; font-weight:900; text-transform:uppercase;
}
.move-tab:active { transform:translateY(2px); box-shadow:0 1px 0 var(--scr-line-strong); }
.move-tab span { color:var(--scr-muted); font-size:10px; }
.move-tab.active { color:var(--scr-head-ink); background:var(--scr-head); border-color:var(--scr-marker); box-shadow:0 3px 0 var(--scr-marker); }
.move-tab.active span { color:var(--scr-head-ink); opacity:.8; }

.move-panel { display:none; }
.move-panel.active { display:block; }
.moves-table { min-width:920px; }
.fusion-card { container-type:inline-size; container-name:fcard; }
.moves-table td:nth-child(1), .moves-table td:nth-child(4), .moves-table td:nth-child(5), .moves-table td:nth-child(6) { white-space:nowrap; }
.effect-text { min-width:300px; line-height:1.45; }

/* Wide card: table fits the card, effect text wraps */
@container fcard (min-width:561px) {
  .moves-table { min-width:0; }
  .moves-table .effect-text { min-width:180px; }
}

/* Narrow card: each move becomes its own block */
@container fcard (max-width:560px) {
  .moves-table { min-width:0; display:block; }
  .moves-table thead {
    position:absolute; width:1px; height:1px; overflow:hidden;
    clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
  }
  .moves-table tbody { display:block; }
  .moves-table tr {
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 10px;
    padding:11px 12px;
    border-bottom:2px solid var(--scr-line-soft);
  }
  .moves-table tr:last-child { border-bottom:0; }
  .screen-glass .moves-table td {
    display:block; min-width:0; padding:0; border:0;
    white-space:normal !important; overflow-wrap:anywhere;
    font-size:13px;
  }
  .moves-table td::before {
    content:attr(data-label); display:block; margin-bottom:2px;
    color:var(--scr-muted); font-size:10px; font-weight:900; letter-spacing:.04em; text-transform:uppercase;
  }
  .moves-table td[data-label^="move" i],
  .moves-table td[data-label^="name" i] { grid-column:span 2; font-size:15px; font-weight:900; }
  .moves-table td.effect-text,
  .moves-table td:last-child { grid-column:1/-1; min-width:0; }
  .moves-table .type { min-height:22px; padding:2px 6px; }
}
.source { display:block; margin-top:3px; color:var(--scr-muted); font-size:10px; font-weight:900; }
.muted { color:var(--scr-muted); }

code { padding:2px 5px; border-radius:4px; background:var(--paper-soft); font-family:var(--font-screen); font-size:.9em; }

/* ---------- Working console buttons ---------- */
.gba-controls {
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
  min-height:110px; padding:24px 8px 0;
  user-select:none; -webkit-user-select:none;
}

.dpad { position:relative; width:96px; height:96px; margin-left:16px; }
.dpad-btn {
  position:absolute; width:32px; height:32px;
  background:var(--dpad); border:3px solid var(--dpad-edge);
  box-shadow:inset 0 2px 0 var(--dpad-hi);
}
.dpad-btn::after {
  content:""; position:absolute; left:50%; top:50%;
  border:5px solid transparent; transform:translate(-50%,-50%);
}
.dpad-up { left:32px; top:0; border-radius:5px 5px 0 0; border-bottom:0; }
.dpad-down { left:32px; bottom:0; border-radius:0 0 5px 5px; border-top:0; }
.dpad-left { left:0; top:32px; border-radius:5px 0 0 5px; border-right:0; }
.dpad-right { right:0; top:32px; border-radius:0 5px 5px 0; border-left:0; }
.dpad-up::after { border-bottom-color:var(--dpad-hi); margin-top:-3px; }
.dpad-down::after { border-top-color:var(--dpad-hi); margin-top:3px; }
.dpad-left::after { border-right-color:var(--dpad-hi); margin-left:-3px; }
.dpad-right::after { border-left-color:var(--dpad-hi); margin-left:3px; }
.dpad-center { position:absolute; left:32px; top:32px; width:32px; height:32px; background:var(--dpad); border-left:3px solid var(--dpad); }
.dpad-btn:active { filter:brightness(1.35); }

.system-buttons { display:flex; gap:22px; align-items:center; justify-content:center; }
.pill-btn {
  position:relative; padding:30px 2px 0;
  color:var(--shell-ink); font-size:12px; font-weight:900; letter-spacing:.04em;
}
.pill-btn::before {
  content:""; position:absolute; top:6px; left:50%;
  width:44px; height:13px; border-radius:99px;
  transform:translateX(-50%) rotate(-10deg);
  border:2px solid var(--pill-edge); background:var(--pill);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.22), 0 2px 0 var(--pill-edge);
}
.pill-btn:active::before { transform:translateX(-50%) rotate(-10deg) translateY(2px); box-shadow:inset 0 2px 0 rgba(255,255,255,.22); }

.ab-buttons { display:flex; justify-content:flex-end; gap:14px; padding-right:40px; transform:rotate(-16deg); }
.ab-buttons button {
  width:58px; height:58px;
  display:grid; place-items:center;
  border:3px solid var(--btn-edge); border-radius:50%;
  color:var(--btn-ink); background:var(--btn);
  box-shadow:0 6px 0 var(--btn-edge), inset 0 3px 0 var(--btn-hi);
  font-family:var(--font-ui); font-size:19px; font-weight:900;
}
.ab-buttons .btn-a { margin-top:-22px; }
.ab-buttons button:active { transform:translateY(4px); box-shadow:0 2px 0 var(--btn-edge), inset 0 3px 0 var(--btn-hi); }

.controls-legend { margin:14px 0 0; text-align:center; font-size:13px; font-weight:700; color:var(--shell-ink); opacity:.8; }

/* =========================================================
   Guide content
   ========================================================= */
.guide {
  width:min(820px,100%);
  margin:40px auto 0;
  padding:clamp(22px,4vw,48px);
  border:1px solid var(--paper-line);
  border-radius:22px;
  background:var(--paper);
  box-shadow:0 10px 30px rgba(17,20,42,.08);
}
.guide-section + .guide-section { margin-top:40px; padding-top:34px; border-top:1px solid var(--paper-line); }
.guide h2 {
  margin:0 0 14px;
  font-size:clamp(23px,2.6vw,30px); font-weight:900; line-height:1.15; letter-spacing:-.025em;
  text-wrap:balance;
}
.guide p { margin:0 0 14px; max-width:68ch; }
.guide p:last-child { margin-bottom:0; }
.guide b { font-weight:800; }

.feature-list { margin:0 0 14px; padding-left:1.2em; }
.feature-list li { margin:6px 0; padding-left:4px; }
.feature-list li::marker { color:var(--shell); }

.steps { counter-reset:step; list-style:none; margin:0 0 18px; padding:0; }
.steps li { counter-increment:step; position:relative; padding:0 0 14px 48px; min-height:34px; }
.steps li::before {
  content:counter(step);
  position:absolute; left:0; top:-2px;
  width:32px; height:32px; display:grid; place-items:center;
  border:3px solid var(--shell-edge); border-radius:50%;
  background:var(--shell); color:var(--shell-ink);
  font-weight:900; font-size:15px;
}

.guide-table { overflow-x:auto; margin:6px 0 16px; border:1px solid var(--paper-line); border-radius:12px; }
.guide-table table { width:100%; border-collapse:collapse; font-size:16px; min-width:360px; }
.guide-table caption { padding:12px 14px 4px; text-align:left; font-size:14px; font-weight:800; color:var(--page-muted); }
.guide-table th, .guide-table td { padding:10px 14px; border-bottom:1px solid var(--paper-line); text-align:left; }
.guide-table thead th { font-size:14px; color:var(--page-muted); }
.guide-table tbody tr:last-child > * { border-bottom:0; }
.guide-table tbody th { font-weight:800; }
.guide-table td { font-variant-numeric:tabular-nums; font-weight:700; }

.formula {
  display:inline-block;
  padding:12px 16px; border-radius:10px;
  background:var(--paper-soft); border-left:5px solid var(--shell);
  font-family:var(--font-screen); font-size:15px; font-weight:700; line-height:1.7;
}

.faq details { border-bottom:1px solid var(--paper-line); }
.faq details:first-of-type { border-top:1px solid var(--paper-line); }
.faq summary {
  position:relative; list-style:none; cursor:pointer;
  padding:16px 40px 16px 0;
  font-size:18px; font-weight:800; line-height:1.35;
}
.faq summary::-webkit-details-marker { display:none; }
.faq summary::after {
  content:"+"; position:absolute; right:4px; top:50%; transform:translateY(-50%);
  width:26px; height:26px; display:grid; place-items:center;
  border-radius:50%; background:var(--paper-soft); color:var(--link);
  font-size:20px; font-weight:900; line-height:1;
}
.faq details[open] summary::after { content:"−"; }
.faq details p { padding:0 0 16px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-top:48px;
  padding:44px 18px calc(28px + env(safe-area-inset-bottom,0px));
  background:var(--shell-edge);
  color:rgba(255,255,255,.86);
  font-size:15px;
}
[data-theme="onyx"] .site-footer, [data-theme="midnight"] .site-footer { background:var(--bezel); border-top:1px solid var(--paper-line); }
.site-footer-inner {
  width:min(1200px,100%); margin:0 auto;
  display:grid; grid-template-columns:1.6fr repeat(4,1fr); gap:28px;
}
.site-footer .wordmark { color:#fff; }
.site-footer .wordmark-mark i { border-color:rgba(255,255,255,.8); }
.footer-brand p { margin:12px 0 0; max-width:36ch; line-height:1.55; color:rgba(255,255,255,.72); }
.footer-col { display:flex; flex-direction:column; gap:8px; }
.footer-col h2 { margin:0 0 4px; font-size:15px; font-weight:900; color:#fff; }
.footer-col a { color:rgba(255,255,255,.76); text-decoration:none; }
.footer-col a:hover { color:#fff; text-decoration:underline; }
.footer-legal {
  width:min(1200px,100%); margin:34px auto 0; padding-top:20px;
  border-top:1px solid rgba(255,255,255,.16);
  font-size:13px; line-height:1.6; color:rgba(255,255,255,.6);
}
.footer-legal p { margin:0 0 6px; max-width:110ch; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width:1100px) {
  .controls { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
  .action-group { grid-column:1/-1; }
  .action-group .gba-action, .action-group .random-action { flex:1; margin-top:0; }
  .site-footer-inner { grid-template-columns:repeat(4,1fr); }
  .footer-brand { grid-column:1/-1; }
}

@media (max-width:900px) {
  .gba-page { padding:14px 8px 28px; }
  .gba-shell { padding:16px 12px 20px; border-radius:24px 24px 48px 24px; }
  .gba-shell::after { display:none; }
  .screen-frame { padding:9px; border-radius:18px 18px 28px 18px; }
  .screen-glass { padding:11px; min-height:0; }
  .gba-topbar { padding:0 5px 14px; }
  .speaker-dots { display:none; }
  .controls { padding:10px; }
  .results { grid-template-columns:1fr; }
  .gba-controls { min-height:90px; padding-top:18px; }
  .dpad { margin-left:4px; transform:scale(.86); transform-origin:left center; }
  .ab-buttons { padding-right:8px; gap:10px; }
  .ab-buttons button { width:50px; height:50px; font-size:17px; }
  .system-buttons { gap:14px; }
  .site-nav { display:none; }
  .theme-picker { margin-left:auto; }
  .guide { margin-top:28px; border-radius:18px; }
}

@media (max-width:640px) {
  body { font-size:16px; }
  .site-header-inner { padding:8px 12px; gap:10px; }
  .wordmark-text { font-size:15px; white-space:nowrap; }
  .brand-cluster { align-items:flex-start; }
  .power-dot { margin-top:8px; }
  h1 { font-size:clamp(24px,7.4vw,32px); }
  .subtitle { font-size:13px; }
  .screen-statusbar { font-size:11px; }
  .controls { grid-template-columns:1fr; gap:10px; }
  .swap { margin:0 auto; width:52px; height:52px; }
  .action-group { grid-column:auto; gap:8px; min-width:0; }
  .action-group .gba-action, .action-group .random-action { min-width:0; padding:0 10px; font-size:16px; }
  .is-expanded .parents { grid-template-columns:1fr; }
  .is-collapsed .parents { gap:8px; }
  .is-collapsed .parent-card { padding:10px 6px; }
  .is-collapsed .parent-card h3 { font-size:15px; }
  .fusion-top { flex-direction:column; }
  .alt-select { width:100%; max-width:none; min-width:0; }
  .sprite-wrap { min-height:230px; }
  .fusion-sprite { height:230px; }
  .parent-card, .fusion-card { padding:12px; }
  .parent-card { min-height:0; }
  .parent-card img { width:120px; height:120px; }
  .mini-stats { grid-template-columns:repeat(2,1fr); }
  .ability-group { flex-direction:column; gap:4px; }
  .ability-group > b { padding-top:0; }
  .gba-controls { grid-template-columns:auto 1fr auto; }
  .dpad { transform:scale(.72); margin:-12px -16px -12px -6px; }
  .system-buttons { gap:8px; }
  .pill-btn { font-size:11px; }
  .pill-btn::before { width:36px; }
  .ab-buttons { transform:rotate(-12deg); padding-right:2px; }
  .ab-buttons button { width:44px; height:44px; font-size:15px; }
  .ab-buttons .btn-a { margin-top:-16px; }
  .controls-legend { font-size:12px; }
  .guide { padding:22px 18px; border-radius:16px; }
  .guide-section + .guide-section { margin-top:30px; padding-top:26px; }
  .faq summary { font-size:17px; }
  .site-footer-inner { grid-template-columns:repeat(2,1fr); gap:24px 18px; }
}

@media (max-width:360px) {
  .theme-toggle span:last-child { display:none; }
  .theme-toggle { padding:0 8px; }
  .system-buttons { gap:4px; }
}

@media (prefers-reduced-motion:no-preference) {
  .parent-card, .fusion-card, button, select {
    transition:transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease;
  }
}

@media print {
  .site-header, .gba-controls, .controls-legend, .site-footer .footer-col { display:none; }
  .gba-shell, .screen-frame { background:none; border:0; box-shadow:none; padding:0; }
}
