/* Pick a Beat UI kit — components shared by the lab, the editors and the public site (uses tokens.css).
   Brand rules: cards radius 24, actions as pills, one main CTA per block, visible 3 px focus, hover = slight lift or border,
   micro-interactions 160–220 ms, no glow/shadow on the logo, no automatic sound, reduced motion respected. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg-0); }
html, body { color: var(--tx-mid); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
::selection { background: rgba(210, 255, 77, 0.3); color: var(--tx-hi); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
/* a region that only takes focus from code (tabindex="-1": a tab panel, a skip-link target) gets no ring: when a popup closes, focus goes back to it and the
   whole panel was framed in lime (the console after Share — the user, 2026-11-26: «se le hace un marco verde alrededor de la página») */
:is(section, div, main, article, aside, nav)[tabindex="-1"]:focus-visible { outline: none; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; color: var(--tx-hi); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* logo lockup: symbol left, name right (DynaPuff 600, no effects) */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tx-hi); font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1; white-space: nowrap; }
/* the symbol box has room above and below for the ticking arm: the drawn symbol is 85% of its height */
.logo img, .logo svg { height: 42px; width: auto; aspect-ratio: 316.6 / 334.6; display: block; flex: none; margin: -3px 0; }
.logo .tag { font-family: var(--font); font-weight: 700; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--night); background: var(--violet); padding: 3px 8px; border-radius: 999px; }
.logo.sm { font-size: 17px; gap: 8px; }
.logo.sm img, .logo.sm svg { height: 33px; }
/* small lockup used inside tools (editor top bars) */
.wordmark-sm { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--tx-hi); white-space: nowrap; }
.wordmark-sm span { font-family: var(--font); color: var(--violet-soft); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-left: 6px; }

/* labels */
.section-label { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet-soft); }
.sub-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-faint); }
.muted { color: var(--tx-lo); }
.faint { color: var(--tx-faint); }
.err { color: var(--danger); font-size: 12.5px; }

/* panels & cards */
.panel { background: var(--surface-panel); border: 1px solid var(--line-subtle); border-radius: var(--r-lg); }
.panel > .section-label:first-child { display: block; text-align: center; padding: 10px 0 8px; }
.card { position: relative; background: var(--bg-1); border: 1px solid var(--line-subtle); border-radius: var(--r-lg); overflow: hidden; transition: transform 0.2s var(--ease), border-color 0.2s var(--ease); }
.card.hover:hover { transform: translateY(-3px); border-color: var(--line-accent); }

/* buttons: lime pill = the one main action; outline pill = secondary */
.btn-primary { background: var(--lime); color: var(--night); border: 0; border-radius: 999px; font-weight: 700; padding: 10px 20px; min-height: 40px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform 0.18s var(--ease), background 0.18s var(--ease); }
.btn-primary:hover { transform: translateY(-1px); background: var(--accent-bright); }
.btn-primary:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn { background: transparent; color: var(--tx-hi); border: 1.5px solid var(--line-strong); border-radius: 999px; font-weight: 600; padding: 7px 15px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: border-color 0.18s var(--ease), color 0.18s var(--ease); }
.btn:hover { border-color: var(--lime); color: var(--lime); }
.btn.sm { padding: 4px 11px; font-size: 12px; }
.btn.ghost { border-color: var(--line); color: var(--tx-lo); }
.btn.violet { background: var(--violet); border-color: var(--violet); color: var(--night); }
.btn.violet:hover { background: var(--violet-soft); border-color: var(--violet-soft); color: var(--night); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); border-radius: 999px; font-weight: 700; padding: 7px 15px; cursor: pointer; font-size: 13px; }
.icon-btn { background: transparent; border: 0; color: var(--tx-lo); cursor: pointer; padding: 5px; display: inline-grid; place-items: center; border-radius: 10px; }
.icon-btn:hover { color: var(--tx-hi); background: var(--bg-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* chips, badges, segmented */
.chip { background: transparent; color: var(--tx-mid); border: 1.5px solid var(--line-strong); border-radius: 999px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; cursor: pointer; }
.chip.on { background: var(--lime); border-color: var(--lime); color: var(--night); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--tx-lo); white-space: nowrap; }
.badge.live { color: var(--night); background: var(--lime); border-color: var(--lime); }
.badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--night); }
.badge.warn { color: var(--warn); border-color: rgba(255, 201, 77, 0.5); }
.badge.accent { color: var(--violet-soft); border-color: rgba(164, 123, 255, 0.6); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-input); border: 1px solid var(--line-subtle); }
.seg button { background: transparent; border: 0; color: var(--tx-lo); border-radius: 999px; font-weight: 600; font-size: 11.5px; padding: 5px 11px; cursor: pointer; text-transform: capitalize; transition: all 0.16s var(--ease); }
.seg button.on { background: var(--lime); color: var(--night); }
.seg button:hover:not(.on) { color: var(--tx-hi); }

/* fields */
.input, select.input, textarea.input { background: var(--surface-input); border: 1px solid var(--line); border-radius: 12px; color: var(--tx-hi); font-size: 13px; padding: 8px 12px; outline: none; }
.input:focus { border-color: var(--lime); }
.input:focus-visible, select.input:focus-visible, textarea.input:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }   /* (the brand's ring) */
textarea.input { resize: vertical; min-height: 88px; line-height: 1.5; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--grad-cool); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ivory); border: 3px solid var(--night); box-shadow: 0 0 0 1.5px var(--lime); cursor: pointer; }
.tog { width: 32px; height: 19px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-input); position: relative; cursor: pointer; flex: none; }
.tog::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--tx-faint); transition: left 0.16s var(--ease); }
.tog.on { background: var(--lime); border-color: var(--lime); }
.tog.on::after { left: 15px; background: var(--night); }
.tog:disabled { opacity: 0.45; cursor: default; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; background: var(--surface-overlay); display: grid; place-items: center; animation: fade 0.2s ease; }
.modal .panel { width: min(560px, 92vw); max-height: 88vh; overflow: auto; padding: 26px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.modal h2 { font-size: 24px; line-height: 30px; margin-bottom: 8px; }
@keyframes fade { from { opacity: 0; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; padding: 11px 18px; border-radius: 999px; background: var(--bg-2); border: 1.5px solid var(--lime); color: var(--tx-hi); font-size: 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); animation: toast-in 0.22s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* misc */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }
.center-page { min-height: 100vh; display: grid; place-items: center; }
.login { width: 340px; padding: 30px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
.login .logo { justify-content: center; margin-bottom: 4px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-input); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--lime); transition: width 0.4s; }
.scroll-thin { scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }

/* param rows (rules, balance, game settings) */
.params { display: flex; flex-direction: column; gap: 9px; }
.prow { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: center; }
.prow > * { min-width: 0; }
.prow > label { color: var(--tx-lo); font-size: 12px; font-weight: 500; display: flex; flex-direction: column; gap: 1px; }
.prow > label small { font-size: 10px; color: var(--tx-faint); }
.prow.changed > label { color: var(--lime); }
.prow.per { grid-template-columns: 1fr; gap: 5px; }
.prow.text { grid-template-columns: 1fr; gap: 5px; align-items: stretch; }
.prow.per > label { flex-direction: row; gap: 6px; align-items: baseline; }
.numrow { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 8px; align-items: center; }
.num { width: 100%; padding: 5px 7px; }
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.pcell { display: flex; flex-direction: column; gap: 3px; padding: 4px; border-radius: var(--r-sm); border: 1px solid transparent; }
.pcell.cur { background: var(--tint-accent-low); border-color: var(--line-accent); }
.pcell .dl { background: none; border: 0; padding: 0; text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--tx-faint); cursor: pointer; }
.pcell.cur .dl { color: var(--lime); }
.pcell select, .pcell input { width: 100%; min-width: 0; padding: 4px 5px; font-size: 11px; }
.pieces { display: flex; gap: 3px; flex-wrap: wrap; }
.pieces .chip { padding: 2px 6px; font-size: 10px; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat b { color: var(--tx-hi); font-weight: 600; font-size: 16px; }
.stat span { font-size: 10px; color: var(--tx-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
