/* Second Mouse Arcade shell: tokens, overlays, touch buttons. Games add their own canvas styling only. */
:root { --sma-bg: #0b0d14; --sma-panel: #151a28; --sma-raised: #1e2538; --sma-ink: #f3f5fb; --sma-muted: #a7b0c7; --sma-faint: #6b7590; --sma-accent: #ffb547; --sma-accent-ink: #1a1200; --sma-good: #5ee39a; --sma-bad: #ff5f6d; --sma-info: #58c7ff; --sma-radius: 14px; --sma-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --sma-display: "Fraunces", Georgia, serif; }
:root[data-contrast="high"] { --sma-bg: #000; --sma-panel: #000; --sma-raised: #111; --sma-ink: #fff; --sma-muted: #eee; --sma-faint: #ccc; --sma-accent: #ffd400; }
html, body { margin: 0; height: 100%; background: var(--sma-bg); color: var(--sma-ink); font-family: var(--sma-font); overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100dvh; }
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; }
a { color: var(--sma-info); }
.sma-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.sma-stage canvas { display: block; background: #000; border-radius: 0; image-rendering: auto; }
.sma-topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--sma-panel); border-bottom: 1px solid #262d42; font-size: 14px; min-height: 48px; }
.sma-topbar .title { font-family: var(--sma-display); font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.sma-topbar .spacer { flex: 1; }
.sma-topbar a.home { color: var(--sma-muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.sma-topbar a.home:hover, .sma-topbar a.home:focus-visible { background: var(--sma-raised); color: var(--sma-ink); }
.sma-btn { background: var(--sma-raised); color: var(--sma-ink); border: 1px solid #343d58; border-radius: 10px; padding: 10px 16px; min-height: 44px; min-width: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sma-btn:hover { border-color: #4b567a; } .sma-btn:focus-visible, .sma-touch-btn:focus-visible, .sma-toggle:focus-visible { outline: 3px solid var(--sma-accent); outline-offset: 2px; }
.sma-btn.primary { background: var(--sma-accent); color: var(--sma-accent-ink); border-color: transparent; font-weight: 700; }
.sma-btn.ghost { background: transparent; }
.sma-btn.danger { border-color: var(--sma-bad); color: var(--sma-bad); }
.sma-btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.sma-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 8, 14, .78); backdrop-filter: blur(4px); z-index: 20; padding: 16px; }
.sma-overlay[hidden] { display: none; }
.sma-card { background: var(--sma-panel); border: 1px solid #2a3148; border-radius: var(--sma-radius); padding: 22px; width: min(560px, 100%); max-height: 100%; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.sma-card h2 { margin: 0 0 6px; font-family: var(--sma-display); font-size: 28px; }
.sma-card h3 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--sma-muted); }
.sma-card p { margin: 6px 0; color: var(--sma-muted); line-height: 1.45; }
.sma-card .lines p { color: var(--sma-ink); }
.sma-card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sma-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.sma-stat { background: var(--sma-raised); border-radius: 10px; padding: 10px 12px; } .sma-stat b { display: block; font-size: 22px; } .sma-stat span { font-size: 12px; color: var(--sma-muted); }
.sma-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #222a3f; min-height: 52px; }
.sma-row label { flex: 1; } .sma-row small { display: block; color: var(--sma-faint); font-size: 12px; }
.sma-toggle { width: 56px; height: 32px; border-radius: 16px; border: 1px solid #343d58; background: var(--sma-raised); position: relative; cursor: pointer; flex: none; }
.sma-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--sma-faint); transition: transform .15s; }
.sma-toggle[aria-checked="true"] { background: var(--sma-accent); border-color: transparent; } .sma-toggle[aria-checked="true"]::after { transform: translateX(24px); background: var(--sma-accent-ink); }
.sma-select, .sma-range { background: var(--sma-raised); color: var(--sma-ink); border: 1px solid #343d58; border-radius: 8px; padding: 8px; min-height: 40px; }
.sma-range { accent-color: var(--sma-accent); width: 140px; padding: 0; border: 0; background: none; }
.sma-caption { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(90%, 720px); background: rgba(0,0,0,.78); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 18px; line-height: 1.35; text-align: center; z-index: 15; pointer-events: none; }
.sma-caption[hidden] { display: none; } .sma-caption .who { color: var(--sma-accent); font-weight: 700; margin-right: 6px; }
.sma-toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--sma-raised); border: 1px solid #343d58; padding: 8px 14px; border-radius: 10px; z-index: 30; font-size: 14px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.sma-toast.on { opacity: 1; }
.sma-touch { position: fixed; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 10px; pointer-events: none; z-index: 25; }
.sma-touch[hidden] { display: none; }
.sma-touch-side { display: grid; grid-auto-rows: 64px; grid-auto-columns: 64px; gap: 10px; pointer-events: auto; }
.sma-touch-btn { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(20, 26, 40, .72); color: #fff; font-size: 15px; font-weight: 700; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; }
.sma-touch-btn.wide { width: 138px; border-radius: 32px; }
.sma-touch-btn.on { background: var(--sma-accent); color: var(--sma-accent-ink); border-color: transparent; }
.sma-kbd { display: inline-block; border: 1px solid #3a4360; border-bottom-width: 3px; border-radius: 6px; padding: 1px 7px; font-family: ui-monospace, monospace; font-size: 12px; background: var(--sma-raised); }
.sma-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .sma-toggle::after { transition: none; } }
@media (max-width: 640px) { .sma-card { padding: 16px; } .sma-card h2 { font-size: 22px; } .sma-topbar .title { font-size: 16px; } }
