/* 🎲 d20 Arena · Mesa screen (grid + reaction window + log on one page). Own file because the page's CSP forbids inline style and script.
   Colours come from the game's theme variables, with Day and Night fallbacks; nothing depends on colour alone. */
body.me-page { margin: 0; padding: 12px 16px; background: var(--page, #110e21); color: var(--text, #f1edff); font-family: system-ui, sans-serif; }
:root[data-theme="day"] body.me-page { background: var(--page, #fff7dc); color: var(--text, #2a1f00); }
.mq-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 auto 12px; max-width: 980px; }
.mq-bar a, .mq-bar label { color: inherit; }
.mq-bar strong { flex: 1 1 100%; overflow-wrap: anywhere; }
/* the demo toggle: app.css stretches every input to 100% width, which turned the checkbox into a big empty white square */
.mq-bar label { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-height: 44px; line-height: 1.4; overflow-wrap: anywhere; }
.mq-bar label input[type="checkbox"] { flex: 0 0 24px; width: 24px; height: 24px; min-height: 24px; min-width: 24px; margin: 0; padding: 0; accent-color: var(--tela-focus, #f1edff); }
.mq-bar label input[type="checkbox"]:focus-visible { outline: 3px solid var(--tela-focus, #f1edff); outline-offset: 2px; }
/* Day / Night / language links: touch targets of at least 44 px with a visible focus ring */
.mq-links { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.mq-links a { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 44px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border, #383063); border-radius: 8px; background: var(--panel-2, #241f45); text-decoration: none; font-weight: 600; }
:root[data-theme="day"] .mq-links a { background: var(--panel-2, #efd78d); border-color: var(--border, #b99a52); }
.mq-links a:focus-visible { outline: 3px solid var(--tela-focus, #f1edff); outline-offset: 2px; }
:root[data-theme="day"] .mq-links a:focus-visible, :root[data-theme="day"] .mq-bar label input[type="checkbox"]:focus-visible { outline-color: #4f2806; }
.mq-sim { display: flex; flex-wrap: wrap; gap: 8px; }
.mesa-tela {
  --tela-bg: var(--panel, #1a1632); --tela-ink: var(--text, #f1edff); --tela-dim: var(--dim, #a6a0cc); --tela-line: var(--border, #383063);
  --tela-warn: #e8412c; --tela-focus: var(--focus-ring, #f1edff);
  display: grid; gap: 12px; max-width: 980px; margin: 0 auto; color: var(--tela-ink);
}
:root[data-theme="day"] .mesa-tela { --tela-bg: var(--panel, #fcf0c6); --tela-ink: var(--text, #2a1f00); --tela-dim: var(--dim, #6b5a1f); --tela-line: var(--border, #b99a52); --tela-warn: #b3261e; }
/* both boxes sit in a grid with side margins auto (this one and .mesa of mesa.css): without a width they shrank to their content, and the
   board to the 300 px an SVG has on its own (a 40 x 16 field at 300 x 120 px, the owner's test of 30/11/2026) */
.mesa-tela, .mesa-tela-grid.mesa { width: 100%; box-sizing: border-box; }
.mesa-tela-bar { display: grid; gap: 10px; background: var(--tela-bg); border: 1px solid var(--tela-line); border-radius: 10px; padding: 12px; }
.mesa-tela .mesa-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mesa-tela .mesa-btn { min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--tela-line); background: var(--panel-2, #241f45); color: var(--tela-ink); font: inherit; cursor: pointer; touch-action: manipulation; }
:root[data-theme="day"] .mesa-tela .mesa-btn, :root[data-theme="day"] .mq-sim .mesa-btn { background: var(--panel-2, #efd78d); }
.mq-sim .mesa-btn { min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border, #383063); background: var(--panel-2, #241f45); color: inherit; font: inherit; cursor: pointer; }
.mesa-tela .mesa-btn:focus-visible, .mq-sim .mesa-btn:focus-visible { outline: 3px solid var(--tela-focus); outline-offset: 2px; }
.mesa-tela .mesa-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mesa-tela-banner { margin: 0; min-height: 0; color: var(--tela-warn); font-weight: 700; }
.mesa-tela-banner:not(:empty) { border: 2px solid var(--tela-warn); border-radius: 8px; padding: 10px 12px; background: var(--tela-bg); }
.mesa-tela-banner:not(:empty)::before { content: "⚠ "; }
.mesa-tela-clock { margin: 0; color: var(--tela-dim); font-variant-numeric: tabular-nums; }
.mesa-tela-rx:empty { display: none; }
.mesa-tela-log-box { background: var(--tela-bg); border: 1px solid var(--tela-line); border-radius: 10px; padding: 12px; }
.mesa-tela-log-title { margin: 0 0 6px; font-size: 1rem; }
.mesa-tela-log { margin: 0; padding-left: 18px; max-height: 220px; overflow-y: auto; color: var(--tela-dim); }
.mesa-tela .mesa-rx-policy { margin: 0; }
