/* canonical copy — identical in prism-web-app, samesame-web-app, pentaline-web-app (room contract v1). Edit the canonical copy, then re-copy. */

/*
 * UI kit: the controls every game shares — buttons, inputs, badges, toast,
 * dialog, presence dots, the quick-chat rail and seat bubbles. Plain class
 * names, so React `className` and vanilla `el.className` use them alike.
 *
 * Colours come only from each game's semantic tokens (spec F1), defined in its
 * own stylesheet between tokens:start / tokens:end markers:
 *   --bg --bg-deep --surface --surface-2 --surface-3 --line --line-strong
 *   --fg --fg-muted --fg-subtle --accent --accent-hover --accent-fg
 *   --accent-soft --accent-text --success --warning --danger --danger-hover
 *   --danger-fg --focus --scrim  plus --shadow-1 --shadow-2 --font-body --font-display
 * This file never names a colour itself (only transparent / currentColor), so
 * each game keeps its own hue while the shapes, sizes, type and motion stay one
 * family. The design rules it follows (docs/room-contract.md §21):
 *   - The accent is only the primary action, the current selection (picked
 *     chips) and focus (plus its dark step on the dialog disc and the faint
 *     backdrop glow). Badges (Host, You, Bot, Ready) are neutral.
 *   - Colour is never faded with opacity or an alpha wash: disabled controls
 *     use --surface-2 / --line / --fg-subtle, badges sit on --surface-3.
 *   - --danger is a fill only (buttons, the error disc, the 1px border of the
 *     field at fault); error text is --fg beside a --danger disc.
 *   - No side stripes, gradient text or glass. The focus ring is 2px, offset 2px.
 *   - Type comes only from --font-body (Nunito) and --font-display (Baloo 2),
 *     at the weights the family's Google Fonts link loads: Nunito 400 body,
 *     600 labels, 700 buttons, badges and room codes, 800 tiny labels;
 *     Baloo 2 700 headings, 800 result titles. --font-emoji is only for emoji.
 *
 * Load order: the game's tokens, then this file, then the game's own CSS.
 * The rules here are unlayered. Under Tailwind v4, whose utilities live in
 * `@layer utilities`, unlayered rules beat every layered one whatever their
 * specificity (`btn hidden` would stay visible), so Tailwind games import this
 * file into the components layer, after Tailwind itself:
 *   @import "tailwindcss";
 *   @import "./room/ui-kit.css" layer(components);
 * (before it, `components` would be declared ahead of `base` and preflight
 * would reset the buttons). Plain-CSS games link it as it is. Either way a
 * game's own CSS must not define these component classes (.btn*, .input,
 * .field-label, .badge*, .toast*, .banner, .scrim, .dialog*, .dock, .chip*,
 * .segmented*, .presence-*, .seat-bubble*): rules would merge property by property.
 * The kit's --ease-out deliberately replaces Tailwind's theme value, so the
 * `ease-out` utility uses the family curve too.
 * Game-content colours (Prism --plum-*, Pentaline --team-*, SameSame --board-*)
 * are not used here; a game passes one in through .dialog-icon's --tone.
 */

/* --- Shared non-colour tokens --------------------------------------------------- */

:root {
  color-scheme: dark;

  --radius-chip: 8px;
  --radius-control: 12px;
  --radius-card: 16px;
  --radius-dialog: 24px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-press: 120ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;

  --z-raised: 10;
  --z-sticky: 30;
  --z-overlay: 50;
  --z-toast: 60;

  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

/*
 * Page backdrop (spec F2): an accent glow pooling from the top centre, a
 * --surface-3 lift in the top-left corner, over a --bg → --bg-deep fall. The
 * glow is the accent mixed 10 % into --bg in OKLCH, then faded out: an alpha
 * accent wash would composite in sRGB and grey the ground (olive on felt,
 * mauve on indigo). :where() keeps specificity at zero, so any later unlayered
 * rule can put its own texture on top; under Tailwind the layer decides
 * instead — with this file in `components`, a `bg-*` or `outline-none`
 * utility wins.
 */
:where(body) {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 50% -140px, color-mix(in oklch, var(--accent) 10%, var(--bg)), transparent 62%),
    radial-gradient(700px 560px at 0% 0%, color-mix(in oklab, var(--surface-3) 70%, transparent), transparent 60%),
    linear-gradient(172deg, var(--bg), var(--bg-deep));
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* The accent ramp's opaque dark step, as for picked chips. */
::selection {
  background-color: var(--accent-soft);
  color: var(--fg);
}

/*
 * Controls fire on the first tap: `manipulation` keeps pan and pinch-zoom but
 * drops double-tap-to-zoom, so touch browsers stop holding every tap ~300 ms.
 */
:where(button, a, [role="button"], summary, label, input, select, textarea) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, [role="button"], input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Buttons -------------------------------------------------------------------- */

.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.625rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background-color: transparent;
  color: var(--fg);
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  /* Only these four ever animate: no hover lift, no shadow or width tweens. */
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn:active:not(:disabled, [aria-disabled="true"]) {
  transform: scale(0.97);
}

/*
 * Disabled: one token style for every variant, never opacity — a faded accent
 * turns to mud, and the host's Start game sits disabled for most of a lobby.
 * The label (--fg-subtle on --surface-2) still clears 4.5:1.
 */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 1;
  border-color: var(--line);
  background-color: var(--surface-2);
  color: var(--fg-subtle);
  box-shadow: none;
  cursor: not-allowed;
}

/* Flat accent fill with a 1px top highlight. No gradients. */
.btn-primary {
  background-color: var(--accent);
  color: var(--accent-fg);
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--fg) 24%, transparent);
}

.btn-secondary {
  background-color: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--fg);
}

.btn-tertiary {
  background-color: transparent;
  border-color: var(--line-strong);
  color: var(--fg);
}

.btn-ghost {
  background-color: transparent;
  color: var(--fg-muted);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--danger-fg);
}

/* A disabled ghost stays a ghost. */
.btn-ghost:disabled,
.btn-ghost[aria-disabled="true"] {
  border-color: transparent;
  background-color: transparent;
}

/* Hover only where a pointer can hover: no sticky hover after a tap on phones. */
@media (hover: hover) {
  .btn-primary:hover:not(:disabled, [aria-disabled="true"]) {
    background-color: var(--accent-hover);
  }

  .btn-secondary:hover:not(:disabled, [aria-disabled="true"]) {
    background-color: color-mix(in oklab, var(--surface-3) 88%, var(--fg));
  }

  .btn-tertiary:hover:not(:disabled, [aria-disabled="true"]) {
    background-color: color-mix(in oklab, var(--surface-3) 55%, transparent);
  }

  .btn-ghost:hover:not(:disabled, [aria-disabled="true"]) {
    background-color: var(--surface-3);
    color: var(--fg);
  }

  .btn-danger:hover:not(:disabled, [aria-disabled="true"]) {
    background-color: var(--danger-hover);
  }
}

.btn-sm {
  min-height: 2rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-chip);
  font-size: 0.8125rem;
}

.btn-lg {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Square icon-only button (✕, ＋, ✏️). Give it an aria-label. */
.btn-icon {
  width: 2.5rem;
  padding: 0;
}

.btn-sm.btn-icon {
  width: 2rem;
}

/* The line directly under a disabled Start / Play again: why it is disabled. */
.btn-reason {
  margin: 0.375rem 0 0;
  min-height: 1.25em;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: kit-spin 700ms linear infinite;
}

/* --- Inputs --------------------------------------------------------------------- */

.field-label {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.field-hint {
  margin: 0.375rem 0 0;
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

.input {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background-color: var(--bg);
  color: var(--fg);
  font: inherit;
  font-family: var(--font-body);
  /* 16px or more: iOS zooms the page into smaller inputs. */
  font-size: 1rem;
  line-height: 1.3;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.input::placeholder {
  color: var(--fg-muted);
  opacity: 1;
}

.input:focus-visible {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.input[readonly] {
  background-color: var(--surface-2);
  color: var(--fg-muted);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

/* The same token style as a disabled button (iOS fades disabled text unless told not to). */
.input:disabled {
  opacity: 1;
  border-color: var(--line);
  background-color: var(--surface-2);
  color: var(--fg-subtle);
  -webkit-text-fill-color: var(--fg-subtle);
  cursor: not-allowed;
}

/* Room code entry: 5 characters, uppercase, spaced for reading aloud. Data, so the body face. */
.input-code {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/*
 * An inline error under a field: --fg text beside an 18px --danger disc with a
 * white "!" (the disc is decoration; the text says what is wrong). Pair it with
 * aria-invalid="true" on the input and point aria-describedby at it.
 */
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin: 0.375rem 0 0;
  color: var(--fg);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.field-error::before {
  content: "!";
  content: "!" / "";
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background-color: var(--danger);
  color: var(--danger-fg);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

/* --- Badges and presence ------------------------------------------------------------ */

/* Neutral pills on --surface-3; only Ready and Reconnecting… / Away carry a status colour. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background-color: var(--surface-3);
  color: var(--fg-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* Host: the crown and the word in --fg, never the accent. */
.badge-host {
  background-color: var(--surface-3);
  color: var(--fg);
}

.badge-bot {
  background-color: var(--surface-3);
  color: var(--fg-muted);
}

/* You: an outline, so it never reads as a second Host. */
.badge-you {
  border-color: var(--line-strong);
  background-color: transparent;
  color: var(--fg);
}

.badge-ready {
  background-color: var(--surface-3);
  color: var(--success);
}

/* Reconnecting… / Away. */
.badge-offline {
  background-color: var(--surface-3);
  color: var(--warning);
}

.presence-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--fg-subtle);
}

.presence-online {
  background-color: var(--success);
}

.presence-reconnecting {
  background-color: var(--warning);
  animation: kit-pulse 1.2s ease-in-out infinite;
}

/* Hollow: the seat is kept, the player isn't here. */
.presence-away {
  background-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--fg-subtle);
}

/* --- Toast ---------------------------------------------------------------------- */

/*
 * One region per page, at the top centre; toasts stack downwards. The bottom
 * of the screen is where every game docks its controls (the hand, the chat
 * rail, the result dock, "Start game" on a phone, a sheet's footer), and a
 * toast there hid them for its 4 s. The top holds only the header. A toast
 * keeps its own taps, so a tap on one never reaches a control it hides.
 */
.toast-region {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: var(--z-toast);
  display: grid;
  gap: 0.5rem;
  width: min(28rem, calc(100vw - 2rem));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background-color: var(--surface-3);
  color: var(--fg);
  box-shadow: var(--shadow-2);
  font-size: 0.9375rem;
  line-height: 1.4;
  pointer-events: auto;
  animation: kit-drop-in var(--dur-base) var(--ease-out);
}

/* Errors: role="alert" in the markup; a full 1px --danger border and the danger disc. */
.toast-error {
  border-color: var(--danger);
}

/* Optional leading icon: a 22px disc holding an aria-hidden SVG or glyph. */
.toast-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background-color: var(--surface-2);
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}

.toast-error .toast-icon {
  background-color: var(--danger);
  color: var(--danger-fg);
}

.toast-message {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The ✕ (aria-label="Dismiss"). */
.toast-dismiss {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-chip);
  background-color: transparent;
  color: var(--fg-muted);
  font: inherit;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) {
  .toast-dismiss:hover {
    background-color: var(--surface-2);
    color: var(--fg);
  }
}

/* --- Banner (e.g. "Connection lost. Reconnecting…") ------------------------------------ */

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid color-mix(in oklab, var(--warning) 40%, var(--surface));
  background-color: color-mix(in oklab, var(--warning) 14%, var(--surface));
  color: var(--fg);
  font-size: 0.875rem;
  text-align: center;
}

/* --- Dialog ----------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: 1rem;
  background-color: var(--scrim);
  animation: kit-fade-in var(--dur-base) var(--ease-out);
}

/* role="dialog" / "alertdialog", aria-modal="true"; focus moves in and is trapped by the game. */
.dialog {
  box-sizing: border-box;
  width: min(26rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-dialog);
  background-color: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-2);
  animation: kit-pop-in var(--dur-base) var(--ease-out);
}

/*
 * The end-of-game disc (trophy, handshake …) above the title. A game may tint
 * it locally by setting --tone and --tone-ink on the dialog (Pentaline: the
 * winning team's chip with the game's ink, so "Green Team Wins!" gets a green
 * disc); otherwise it is the accent's dark step.
 */
.dialog-icon {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.625rem;
  border-radius: 50%;
  background-color: var(--tone, var(--accent-soft));
  color: var(--tone-ink, var(--accent-text));
}

.dialog-icon > svg {
  width: 1.75rem;
  height: 1.75rem;
}

.dialog-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

.dialog-body {
  margin: 0 0 1.25rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Phones: one full-width button per row, in markup order. */
@media (max-width: 30rem) {
  .dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dialog-actions > .btn {
    width: 100%;
  }
}

/* The end-of-game bar after "View board": result title + Show result (+ Play again). */
.dock {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background-color: var(--surface);
  box-shadow: var(--shadow-2);
}

.dock-title {
  flex: 1 1 10rem;
  min-width: 0;
  margin: 0;
}

/*
 * The result title ("Green Team Wins!"): Baloo 2 800 on one tight line. The
 * dock's title always is one; add .result-title to the end-of-game dialog's
 * .dialog-title. Baloo 2's tall ascent and descent are trimmed to the caps
 * where the browser can.
 */
.dock-title,
.result-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}

@supports (text-box: trim-both cap alphabetic) {
  .dock-title,
  .result-title {
    text-box: trim-both cap alphabetic;
  }

  .dialog-title.result-title {
    margin: 0.375rem 0 0.875rem;
  }
}

/* --- Segmented switch ---------------------------------------------------------------- */

/*
 * Two or three options inside a tab panel ("With AI" | "Pass & Play"): the
 * same well-and-raised-pill look as the Home tab strip. Buttons carry
 * aria-pressed; the group gets role="group" and an aria-label.
 */
.segmented {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-control);
  background-color: var(--bg);
}

.segmented-option {
  appearance: none;
  flex: 1 1 0;
  min-height: 2.25rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--radius-chip);
  background-color: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.segmented-option:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.segmented-option[aria-pressed="true"] {
  background-color: var(--surface-3);
  color: var(--fg);
}

@media (hover: hover) {
  .segmented-option:hover:not([aria-pressed="true"]) {
    color: var(--fg);
  }
}

/* --- Quick chat --------------------------------------------------------------------- */

.chip-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.375rem;
  min-width: 0;
  padding: 0.125rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.chip {
  appearance: none;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 2rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background-color: var(--surface-2);
  color: var(--fg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.chip:active:not(:disabled) {
  transform: scale(0.97);
}

@media (hover: hover) {
  .chip:hover:not(:disabled) {
    border-color: var(--line-strong);
    background-color: var(--surface-3);
  }
}

/* Selected in the picker. */
.chip.is-active,
.chip[aria-pressed="true"],
.chip[aria-checked="true"] {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent-text);
}

/* During the chat cooldown: the button's token style, after the selected state so it wins. */
.chip:disabled {
  opacity: 1;
  border-color: var(--line);
  background-color: var(--surface-2);
  color: var(--fg-subtle);
  cursor: not-allowed;
}

/* Emoji chips: colour-emoji font, bigger glyph, tighter sides. */
.chip-emoji {
  padding-inline: 0.5rem;
  font-family: var(--font-emoji);
  font-size: 1.125rem;
  line-height: 1;
}

/* A seat's chat bubble (3.5 s for presets, 6 s for text). The game positions it. */
.seat-bubble {
  z-index: var(--z-raised);
  box-sizing: border-box;
  max-width: min(16rem, 70vw);
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background-color: var(--surface-3);
  color: var(--fg);
  box-shadow: var(--shadow-1);
  font-size: 0.875rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
  animation: kit-pop-in var(--dur-fast) var(--ease-out);
}

.seat-bubble-emoji {
  font-family: var(--font-emoji);
  font-size: 1.5rem;
  line-height: 1.1;
}

/* --- Motion ----------------------------------------------------------------------- */

@keyframes kit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes kit-pulse {
  50% {
    opacity: 0.35;
  }
}

@keyframes kit-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes kit-pop-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes kit-drop-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .chip,
  .input,
  .toast-dismiss {
    transition-duration: 1ms;
  }

  .btn:active:not(:disabled, [aria-disabled="true"]),
  .chip:active:not(:disabled) {
    transform: none;
  }

  .scrim,
  .dialog,
  .toast,
  .seat-bubble,
  .presence-reconnecting {
    animation: none;
  }

  /* Still spinning — it is the only sign of progress — just slower. */
  .spinner {
    animation-duration: 1.6s;
  }
}

/* --- Touch targets --------------------------------------------------------------------- */

/*
 * A finger needs 44px. Buttons, chips and inputs simply grow. Isolated icon
 * buttons can instead opt into .hit-target, which grows an invisible hit area
 * so a 24px glyph still accepts a 44px tap — only safe where nothing else sits
 * within 44px, hence opt-in. (.hit-target sets no `position`: give the element
 * one if it has none.)
 */
@media (pointer: coarse) {
  .btn,
  .btn-sm,
  .chip,
  .input {
    min-height: 2.75rem;
  }

  .btn-icon,
  .btn-sm.btn-icon {
    width: 2.75rem;
  }

  /* Single-glyph chips (emoji, ✏️, ＋) would otherwise be about 39px wide. */
  .chip {
    min-width: 2.75rem;
  }

  .segmented-option {
    min-height: 2.75rem;
  }

  .toast-dismiss {
    width: 2.75rem;
    height: 2.75rem;
  }

  .hit-target::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 2.75rem;
    min-height: 2.75rem;
    width: 100%;
    height: 100%;
    translate: -50% -50%;
  }
}
