/* Shared start menu and in-game Controls sheet. Shell IDs/handlers stay
 * intact. Only the guide column can scroll on desktop; phones have one
 * content scroller above a permanently reserved action bar. */
dialog.howto-dlg {
  --outline-w: 1px; --outline: var(--line);
  --focus-ring: 2px solid var(--fam); --focus-offset: 2px;
  box-sizing: border-box;
  min-width: 0;
  width: min(var(--howto-controls-w), calc(100vw - var(--space-48)));
  max-height: calc(100dvh - var(--space-48) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-12);
  padding: var(--space-24); overflow: hidden; overscroll-behavior: contain;
  border: var(--outline-w) solid var(--outline); border-radius: var(--radius-xl);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-card);
  font: var(--text-body);
  color-scheme: light;
}
[data-theme="night"] dialog.howto-dlg { color-scheme: dark; }
dialog.howto-dlg::backdrop { overflow: hidden; overscroll-behavior: contain; background: color-mix(in srgb, var(--ink) 40%, transparent); animation: none; }
[data-theme="night"] dialog.howto-dlg::backdrop { background: color-mix(in srgb, var(--bg) 80%, transparent); }
dialog.howto-dlg:not([open]) { display: none; }
dialog.howto-start {
  width: min(var(--howto-dialog-w), calc(100vw - var(--space-48)));
  height: fit-content;
}
/* Content sets the height; long guides shrink into their own scroller.
 * A short voting-game guide should not inherit a kart-sized empty panel. */
.howto-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--howto-seat-w); gap: var(--space-24); flex: 0 1 auto; min-width: 0; min-height: 0; max-width: 100%; }
.howto-main { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; min-height: 0; }
.howto-dlg .howto-head { flex: none; align-items: center; gap: var(--space-12); margin: 0; }
.howto-dlg .howto-art { width: var(--space-64); height: var(--space-64); padding: 0; object-fit: contain; border: 0; border-radius: var(--radius-md); background: var(--well); box-shadow: none; transform: none; }
.howto-dlg .howto-titles h2 { margin: 0; font: var(--text-heading); text-wrap: balance; overflow-wrap: anywhere; }
.howto-dlg .howto-tag { margin: var(--space-4) 0 0; color: var(--ink-dim); font: var(--text-caption); text-wrap: pretty; }
.howto-dlg #howtoClose { flex: none; width: var(--control-h-sm); height: var(--control-h-sm); min-height: var(--control-h-sm); margin: 0; padding: 0; border: var(--outline-w) solid transparent; border-radius: var(--radius-pill); color: var(--ink-dim); background: var(--well); box-shadow: none; transition: transform var(--dur-quick) var(--ease); }
.howto-dlg .howto-meta { flex: none; gap: var(--space-8); margin: 0; }
.howto-dlg .howto-meta:empty { display: none; }
.howto-dlg .howto-pill { display: inline-flex; align-items: center; gap: var(--space-4); min-height: var(--space-32); max-width: 100%; padding: var(--space-4) var(--space-8); border: var(--outline-w) solid var(--outline); border-radius: var(--radius-sm); background: var(--well); color: var(--ink); box-shadow: none; font: var(--text-caption); overflow-wrap: anywhere; }
.howto-dlg .howto-pill:nth-child(2) { color: var(--accent-deep); background: var(--accent-soft); }
.howto-dlg .howto-tabs { display: flex; flex: none; gap: var(--space-4); padding: var(--space-4); margin: 0; border: var(--outline-w) solid var(--outline); border-radius: var(--radius-lg); background: var(--well); }
.howto-dlg .howto-tabs button { flex: 1; min-width: var(--control-h-sm); min-height: var(--control-h-sm); padding: var(--space-8) var(--space-12); border: var(--outline-w) solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--ink-dim); font: var(--text-button-sm); white-space: normal; transition: transform var(--dur-quick) var(--ease); }
.howto-dlg .howto-tabs [aria-selected="true"] { border-color: var(--fam); color: var(--ink); background: var(--fam-soft); box-shadow: none; }
.howto-dlg .howto-tabs [aria-selected="true"]::after { content: none; }
.howto-panels { min-height: 0; padding: var(--space-4); overflow-y: auto; overscroll-behavior: contain; }
.howto-dlg :is(#howtoPlayPanel, .howto-body) { min-height: auto; margin: 0; overflow: visible; }
.howto-dlg .howto-body { padding: 0 0 var(--space-16); }
.howto-dlg .howto-body p { margin: 0 0 var(--space-12); font: var(--text-body); text-wrap: pretty; }
.howto-dlg .howto-body p:last-child { margin-bottom: 0; }
.howto-dlg #howtoPlayPanel.howto-intro:has(.howto-glance) { margin: 0; }
.howto-dlg .howto-intro { color: var(--ink-dim); font: var(--text-body); text-wrap: pretty; }
.howto-dlg .howto-glance { gap: var(--space-12); }
.howto-dlg .howto-goal { align-items: flex-start; gap: var(--space-8); margin: 0; padding: var(--space-12); border-radius: var(--radius-md); background: var(--fam-soft); color: var(--fam-deep); font: var(--text-button-sm); text-wrap: pretty; }
.howto-dlg .howto-label { padding: 0; border-radius: 0; background: transparent; color: inherit; font: var(--text-caption); letter-spacing: normal; text-transform: none; transform: none; }
.howto-dlg .howto-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
.howto-dlg .howto-controls li { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; grid-column: auto; gap: var(--space-8); min-width: 0; min-height: var(--space-64); padding: var(--space-8); border: var(--outline-w) solid var(--outline); border-radius: var(--radius-md); background: var(--well); }
.howto-dlg .howto-keys { gap: var(--space-4); max-width: 100%; }
.howto-dlg .howto-keys kbd, .howto-dlg .howto-touch { min-width: var(--space-32); min-height: var(--space-32); height: auto; max-width: 100%; padding: var(--space-4) var(--space-8); border: var(--outline-w) solid var(--outline); border-radius: var(--radius-sm); color: var(--ink); background: var(--card); box-shadow: none; font: var(--text-caption); white-space: normal; overflow-wrap: anywhere; }
.howto-dlg .is-touch-only .howto-touch { display: inline-grid; }
.howto-dlg .howto-does { min-width: 0; color: var(--ink); font: var(--text-caption); text-wrap: pretty; overflow-wrap: anywhere; }
.howto-dlg .howto-tips { gap: var(--space-12); margin: 0 0 var(--space-16); }
.howto-dlg .howto-tips li { padding-left: var(--space-24); font: var(--text-body); }
.howto-dlg .howto-tips li::before { left: var(--space-4); width: var(--space-8); height: var(--space-8); border-radius: var(--radius-sm); background: var(--fam); }
.howto-dlg .howto-all { margin-top: var(--space-8); padding-top: var(--space-8); border: 0; }
.howto-dlg .howto-all summary { gap: var(--space-8); min-height: var(--control-h-sm); padding: var(--space-8); border-radius: var(--radius-sm); color: var(--fam-deep); font: var(--text-button-sm); }
.howto-dlg .howto-all summary::after { width: var(--space-8); height: var(--space-8); transition: transform var(--dur-quick) var(--ease); }
.howto-dlg .howto-all p { margin: 0 0 var(--space-12); font: var(--text-body) !important; }
/* Keep actions outside the content scroller, without a second raised frame. */
.howto-dlg .howto-foot { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--well); box-shadow: none; }
.howto-seat-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; padding: var(--space-16); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.howto-seat-title { margin: 0 0 var(--space-16); color: var(--fam-deep); font: var(--text-title); }
.howto-seat-fields { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12) var(--space-8); min-width: 0; }
.howto-dlg .howto-name { order: -2; flex: 1 1 100%; gap: var(--space-8); margin: 0; color: var(--fam-deep); font: var(--text-caption); }
.howto-dlg #howtoName { width: 100%; min-width: 0; min-height: var(--control-h); margin: 0; padding: var(--space-8) var(--space-12); border: var(--outline-w) solid var(--outline); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); box-shadow: none; font: var(--text-title); }
.howto-dlg #howtoName::placeholder { color: var(--ink-dim); opacity: 1; }
.howto-dlg .howto-seat-fields .garage-card { order: -1; margin: 0; padding: var(--space-12); border-radius: var(--radius-sm); }
.howto-dlg .howto-seat-fields .garage-card-face { width: var(--space-48); height: var(--space-48); }
.howto-dlg :is(.howto-seat-fields, .howto-actions) :is(.btn, .howto-btn) { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); flex: 1 1 auto; min-height: var(--control-h-sm); max-width: 100%; margin: 0; padding: var(--space-8); border: var(--outline-w) solid var(--outline); border-radius: var(--radius-sm); background: var(--card); color: var(--ink-dim); box-shadow: none; font: var(--text-button-sm); text-align: center; text-decoration: none; white-space: normal; cursor: pointer; transition: transform var(--dur-quick) var(--ease); }
.howto-dlg .howto-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); flex: none; min-width: 0; padding: var(--space-16); border-radius: 0 0 var(--radius-xl) var(--radius-xl); background: var(--well); }
.howto-dlg .howto-actions[hidden] { display: none; }
.howto-dlg .howto-actions #howtoGo { width: 100%; min-height: var(--control-h-lg); padding: var(--space-12) var(--space-16); border-color: var(--fam-lip); border-radius: var(--radius-sm); background: var(--fam); color: var(--on-fam); box-shadow: none; font: var(--text-button); }
.howto-dlg .howto-actions #howtoGo:disabled { border-color: var(--line); background: var(--line); color: var(--ink-dim); box-shadow: none; opacity: 1; cursor: not-allowed; transform: none; }
.howto-dlg .howto-note { flex: 1 1 100%; margin: 0; color: var(--ink-dim); font: var(--text-caption); text-wrap: pretty; }
.howto-dlg :is(button, input, a, summary, [role="tabpanel"]):focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.howto-dlg :is(.howto-seat-fields, .howto-actions) :is(.btn, .howto-btn):active:not(:disabled), .howto-dlg .howto-tabs button:active, .howto-dlg #howtoClose:active { transform: none; box-shadow: none; }
.howto-dlg .howto-actions #howtoGo:active:not(:disabled) { transform: none; box-shadow: none; }
.howto-dlg.controls-dlg { overflow-y: auto; }
.howto-dlg.controls-dlg .howto-glance { flex: none; }
@media (hover: hover) {
  .howto-dlg :is(.howto-seat-fields, .howto-actions) :is(.btn, .howto-btn):hover:not(:disabled), .howto-dlg #howtoClose:hover { border-color: var(--fam); color: var(--fam-deep); transform: none; }
  .howto-dlg .howto-actions #howtoGo:hover:not(:disabled) { border-color: var(--fam-lip); color: var(--on-fam); box-shadow: none; }
  .howto-dlg .howto-tabs button:hover:not([aria-selected="true"]) { color: var(--ink); border-color: var(--line-strong); }
  .howto-dlg .howto-all summary:hover { background: var(--well); }
  .howto-dlg #howtoName:hover { border-color: var(--fam); }
}
@media (width < 860px) {
  /* Anchor to the dynamic viewport, not an overflowing page's containing
   * block. Native dialog insets/margins must not add to the sheet's size. */
  dialog.howto-start { position: fixed; inset: auto env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); box-sizing: border-box; width: calc(100dvw - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: calc(100dvw - env(safe-area-inset-left) - env(safe-area-inset-right)); height: auto; max-height: calc(100dvh - var(--space-24) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-width: 0; margin: 0; padding: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .howto-start :is(.howto-layout, .howto-main, .howto-seat-scroll, .howto-seat-content, .howto-seat-fields, .howto-name, .howto-actions) { box-sizing: border-box; min-width: 0; max-width: 100%; }
  .howto-start .howto-name { grid-template-columns: minmax(0, 1fr); }
  .howto-start .howto-layout { display: flex; gap: 0; flex: 0 1 auto; }
  .howto-start .howto-foot { flex: 1; margin: 0; border: 0; border-radius: inherit; background: var(--card); box-shadow: none; }
  .howto-start .howto-foot > .howto-head { padding: var(--space-16); }
  .howto-start .howto-seat-scroll { padding: 0 var(--space-16) var(--space-16); }
  .howto-start .howto-main { gap: var(--space-12); margin-bottom: var(--space-24); }
  .howto-start .howto-panels { flex: none; overflow: visible; padding: var(--space-4) 0; }
  .howto-start .howto-seat-content { padding: var(--space-16); border: var(--outline-w) solid var(--outline); border-radius: var(--radius-lg); background: var(--well); box-shadow: var(--shadow-sm); }
  .howto-start .howto-seat-title { margin-bottom: var(--space-12); }
  .howto-start .howto-actions { z-index: 1; padding: var(--space-12) var(--space-16) calc(var(--space-16) + env(safe-area-inset-bottom)); border-radius: 0; background: var(--card); }
  /* The fade belongs to the floating bar, never to readable rules. */
  .howto-start .howto-actions::before { content: ''; position: absolute; right: 0; bottom: 100%; left: 0; height: var(--space-16); background: linear-gradient(to top, var(--card), transparent); pointer-events: none; }
  .howto-dlg .howto-titles h2 { font: var(--text-title); }
  .howto-dlg .howto-art { width: var(--space-48); height: var(--space-48); border-radius: var(--radius-md); }
  .howto-dlg.controls-dlg { width: calc(100vw - var(--space-16)); max-height: calc(100dvh - var(--space-16) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: var(--space-16); }
}
@media (max-height: 500px) {
  .howto-sheet .howto-meta { display: none; }
  .howto-sheet .howto-foot > .howto-head { padding-block: var(--space-8); }
  .howto-sheet .howto-actions { padding-block: var(--space-8) max(var(--space-8), env(safe-area-inset-bottom)); }
  .howto-sheet .howto-actions #howtoGo { min-height: var(--control-h); padding-block: var(--space-8); }
}
@keyframes howto-menu-enter { from { opacity: 0; transform: translateY(var(--space-8)) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { dialog.howto-dlg[open] { animation: howto-menu-enter var(--dur-base) var(--ease); } }
@media (prefers-reduced-motion: reduce) { dialog.howto-dlg { animation: none; } .howto-dlg *, .howto-dlg *::after { transition: none; } .howto-dlg button:hover, .howto-dlg button:active, .howto-dlg a:hover, .howto-dlg a:active { transform: none; } }

/* ---- v3 sheet: cover first, one primary action, quiet secondary controls ---- */
dialog.howto-dlg { border-color: var(--line); box-shadow: 0 24px 64px #0d0b1433; }
[data-theme="night"] dialog.howto-dlg { box-shadow: 0 24px 64px #00000099; }
dialog.howto-dlg::backdrop { background: color-mix(in srgb, #0d0b14 46%, transparent); }
[data-theme="night"] dialog.howto-dlg::backdrop { background: color-mix(in srgb, #050408 72%, transparent); }
@media (width >= 860px) {
  .howto-two-column .howto-main > .howto-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); }
  .howto-two-column .howto-head .howto-art { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 40%; border-radius: var(--radius-lg); background: var(--well); }
  .howto-two-column .howto-head #howtoClose { position: absolute; top: var(--space-12); right: var(--space-12); color: #fff; background: color-mix(in srgb, #0d0b14 55%, transparent); border-color: #ffffff2e; backdrop-filter: blur(6px); }
}
.howto-dlg .howto-pill { border-color: transparent; border-radius: var(--radius-pill); padding-inline: var(--space-12); background: var(--well); }
.howto-dlg .howto-pill:nth-child(2) { color: var(--accent-deep); background: var(--accent-soft); }
[data-theme="night"] .howto-dlg .howto-pill:nth-child(2) { color: var(--ink); }
/* Tabs read as quiet text with a sliding underline, not a second set of buttons. */
.howto-dlg .howto-tabs { gap: var(--space-24); padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.howto-dlg .howto-tabs button { position: relative; flex: none; min-height: var(--control-h-sm); padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink-dim); font: var(--text-button-sm); transition: color .16s ease-out; }
.howto-dlg .howto-tabs [aria-selected="true"] { border: 0; background: transparent; color: var(--ink); }
.howto-dlg .howto-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--fam); scale: 0 1; transition: scale .22s var(--ease); }
.howto-dlg .howto-tabs [aria-selected="true"]::after { content: ""; scale: 1 1; }
@media (hover: hover) { .howto-dlg .howto-tabs button:hover:not([aria-selected="true"]) { color: var(--ink); border-color: transparent; } }
/* The goal is a plain line, not a tinted box. */
.howto-dlg .howto-goal { padding: 0; background: transparent; color: var(--ink); font: var(--text-body); }
.howto-dlg .howto-goal .howto-label { color: var(--ink-dim); }
/* Your seat: a flat panel with neutral heading; secondary actions are quiet. */
.howto-dlg .howto-foot { border-color: var(--line); background: var(--well); }
.howto-seat-title { color: var(--ink); font: 700 15px/1.3 var(--font-body); letter-spacing: .01em; }
.howto-dlg .howto-name { color: var(--ink-dim); }
.howto-dlg :is(.howto-seat-fields, .howto-actions) :is(.btn, .howto-btn) { border-color: var(--line-strong); border-radius: var(--radius-md); background: var(--card); color: var(--ink); transition: background-color .16s ease-out, border-color .16s ease-out, scale .16s ease-out; }
.howto-dlg .howto-actions #howtoGo { border: 0; border-radius: var(--radius-md); font: var(--text-primary); transition: background-color .16s ease-out, scale .16s ease-out; }
@media (hover: hover) {
  .howto-dlg :is(.howto-seat-fields, .howto-actions) :is(.btn, .howto-btn):hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: var(--card); color: var(--ink); }
  .howto-dlg .howto-actions #howtoGo:hover:not(:disabled) { background: color-mix(in srgb, var(--fam) 86%, #fff); }
  .howto-two-column .howto-head #howtoClose:hover { color: #fff; background: color-mix(in srgb, #0d0b14 75%, transparent); }
}
.howto-dlg :is(.howto-seat-fields, .howto-actions) :is(.btn, .howto-btn):active:not(:disabled), .howto-dlg .howto-actions #howtoGo:active:not(:disabled), .howto-dlg #howtoClose:active { scale: .97; }
.howto-dlg .howto-actions { background: var(--well); }
@media (width < 860px) { .howto-start .howto-actions { background: var(--card); } }
/* The sheet rises with a small spring; the cover morph runs on top of it. */
@media (prefers-reduced-motion: no-preference) {
  dialog.howto-dlg[open] { animation: howto-v3-enter .38s cubic-bezier(0.34, 1.3, 0.64, 1); }
  @keyframes howto-v3-enter { from { opacity: 0; translate: 0 16px; scale: .97; } }
  dialog.howto-dlg[open]::backdrop { animation: howto-v3-fade .25s ease-out; }
  @keyframes howto-v3-fade { from { opacity: 0; } }
}
/* Secondary seat actions read as a quiet 2-up list; only Play / Create stays filled. */
.howto-dlg .howto-seat-fields :is(.btn, .howto-btn) { flex: 1 1 calc(50% - var(--space-8)); justify-content: flex-start; min-height: 40px; padding: var(--space-8) var(--space-12); border-color: transparent; background: color-mix(in srgb, var(--card) 70%, transparent); color: var(--ink); font: 600 14px/1.25 var(--font-body); text-align: left; }
@media (hover: hover) { .howto-dlg .howto-seat-fields :is(.btn, .howto-btn):hover:not(:disabled) { border-color: var(--line-strong); background: var(--card); } }
.howto-dlg .howto-actions :is(.btn, .howto-btn):not(#howtoGo) { min-height: 44px; border-color: transparent; background: transparent; color: var(--ink-dim); font: var(--text-button-sm); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .16s ease-out, text-decoration-color .16s ease-out; }
@media (hover: hover) { .howto-dlg .howto-actions :is(.btn, .howto-btn):not(#howtoGo):hover:not(:disabled) { border-color: transparent; background: transparent; color: var(--ink); text-decoration-color: currentColor; } }
.howto-dlg .howto-art { object-fit: cover; }

/* ---- v3.2 Play tab: reads like a game's controls screen ----
   Three quiet sections (Goal, Controls, Your seat) share one small label style.
   Controls are one bordered list: the action on the left, its input on the right. */
.howto-dlg .howto-glance { display: grid; gap: 20px; }
.howto-dlg .howto-goal { display: grid; gap: 6px; margin: 0; padding: 0; background: none; color: var(--ink); font: 500 16px/1.5 var(--font-body); text-wrap: pretty; }
.howto-dlg .howto-goal .howto-label,
.howto-dlg .howto-ctl-title,
.howto-dlg .howto-seat-title { margin: 0; padding: 0; border-radius: 0; background: none; color: var(--ink-dim); font: 600 13px/1.2 var(--font-body); letter-spacing: .01em; text-transform: none; transform: none; }
.howto-dlg .howto-ctl { display: grid; gap: 8px; min-width: 0; }
.howto-dlg .howto-controls.howto-controls { display: block; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.howto-dlg .howto-controls.howto-controls li { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 0; background: none; }
.howto-dlg .howto-controls.howto-controls li + li { border-top: 1px solid var(--line); }
.howto-dlg .howto-controls .howto-does { flex: 1 1 auto; min-width: 0; color: var(--ink); font: 500 15px/1.35 var(--font-body); }
.howto-dlg .howto-inputs { display: inline-flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; max-width: 58%; }
.howto-dlg .howto-controls .howto-keys { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.howto-dlg .howto-keygroup { display: inline-flex; gap: 3px; }
.howto-dlg .howto-controls kbd { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 28px; height: 28px; min-height: 0; padding: 0 8px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 7px; background: var(--well); box-shadow: none; color: var(--ink); font: 600 13px/1 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.howto-dlg .howto-controls :is(.howto-gesture, .howto-touch) { align-items: center; gap: 6px; box-sizing: border-box; height: 28px; min-height: 0; padding: 0 10px 0 8px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: none; color: var(--ink); font: 600 13px/1 var(--font-body); white-space: nowrap; }
.howto-dlg .howto-controls .howto-gesture { display: inline-flex; }
.howto-dlg .howto-controls :is(.howto-gesture, .howto-touch)::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--howto-pointer) center / contain no-repeat; mask: var(--howto-pointer) center / contain no-repeat; }
.howto-dlg { --howto-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3l14 7-6 2-2 6z' fill='black'/%3E%3C/svg%3E"); }
.howto-dlg .howto-controls .howto-touch { display: none; }
.touch-preferred .howto-dlg .howto-controls .has-touch .howto-touch,
.howto-dlg .howto-controls .is-touch-only .howto-touch { display: inline-flex; }
.touch-preferred .howto-dlg .howto-controls .has-touch .howto-touch::before { --howto-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='6' fill='black'/%3E%3C/svg%3E"); }
.touch-preferred .howto-dlg .howto-controls .has-touch .howto-keys { display: none; }

/* Meta reads as one quiet line, not a row of mismatched chips. */
.howto-dlg .howto-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.howto-dlg .howto-meta .howto-pill.howto-pill { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink-dim); font: 600 14px/1.4 var(--font-body); }
.howto-dlg .howto-meta .howto-pill + .howto-pill::before { content: "·"; margin-inline: 8px; color: var(--ink-dim); }

/* Your seat: flat, separated by a hairline; the name field, then quiet outlined actions. */
.howto-start .howto-seat-content.howto-seat-content { padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.howto-dlg .howto-seat-title { margin-bottom: 12px; }
.howto-dlg .howto-name { color: var(--ink); font: 600 14px/1.3 var(--font-body); }
.howto-dlg .howto-seat-fields :is(.btn, .howto-btn).btn,
.howto-dlg .howto-seat-fields .howto-btn { justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; color: var(--ink); font: 600 14px/1.25 var(--font-body); text-align: center; }
.howto-dlg .howto-seat-fields :is(.btn, .howto-btn) .game-ui-icon { flex: none; color: var(--ink-dim); }
@media (hover: hover) { .howto-dlg .howto-seat-fields :is(.btn, .howto-btn):hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: color-mix(in srgb, var(--ink) 4%, transparent); } }
@media (max-width: 380px) { .howto-dlg .howto-inputs { max-width: 50%; } .howto-dlg .howto-controls.howto-controls li { padding-inline: 12px; } }
/* Seat actions: Find players and Customize side by side; the extras sit below as one row of quiet links. */
.howto-dlg .howto-seat-fields.howto-seat-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.howto-dlg .howto-seat-fields .howto-name { flex: 1 1 100%; margin-bottom: 4px; }
.howto-dlg .howto-seat-fields :is(.howto-find, #howtoCustom) { flex: 1 1 calc(50% - 4px); }
.howto-dlg .howto-seat-fields.howto-seat-fields :is(.details-link, .practice-link, .meet-play-link) { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 44px; margin: 0 12px 0 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink-dim); font: 600 14px/1.2 var(--font-body); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.howto-dlg .howto-seat-fields .meet-play-link .game-ui-icon { width: 18px; height: 18px; }
@media (hover: hover) { .howto-dlg .howto-seat-fields.howto-seat-fields :is(.details-link, .practice-link, .meet-play-link):hover { color: var(--ink); background: none; text-decoration-color: currentColor; } }
/* Desktop sheet shares its height with the cover: keep the list compact so Play never scrolls. */
@media (width >= 860px) {
  .howto-dlg .howto-glance { gap: 14px; }
  .howto-dlg .howto-goal { gap: 4px; font-size: 15px; line-height: 1.45; }
  .howto-dlg .howto-ctl { gap: 6px; }
  .howto-dlg .howto-controls.howto-controls li { min-height: 38px; padding-block: 5px; }
  .howto-dlg .howto-controls .howto-does { font-size: 14px; }
  .howto-dlg .howto-controls kbd, .howto-dlg .howto-controls :is(.howto-gesture, .howto-touch) { height: 26px; }
}
/* Desktop: the list splits into two columns, like a controls card, so Play fits beside the cover. */
@media (width >= 860px) {
  .howto-dlg .howto-controls.howto-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .howto-dlg .howto-controls.howto-controls li + li { border-top: 0; }
  .howto-dlg .howto-controls.howto-controls li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .howto-dlg .howto-controls.howto-controls li:nth-child(even) { border-left: 1px solid var(--line); }
  .howto-dlg .howto-controls.howto-controls li:only-child { grid-column: 1 / -1; }
  .howto-dlg .howto-controls.howto-controls li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .howto-dlg .howto-inputs { max-width: 50%; }
}
@media (width >= 860px) {
  .howto-dlg .howto-controls .howto-keys { flex-wrap: nowrap; }
}
/* Short laptop screens: a wider, shorter cover, and a fixed sheet height so switching tabs never moves Play. */
@media (width >= 860px) and (max-height: 820px) {
  .howto-two-column .howto-head .howto-art { aspect-ratio: 3 / 1; }
  dialog.howto-dlg.howto-two-column:not(.controls-dlg) { height: calc(100dvh - var(--space-48) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  dialog.howto-dlg.howto-two-column:not(.controls-dlg) .howto-layout { flex: 1 1 auto; }
}
