/* SET — shared interface styles */

:root {
  --bg: #f7f6f2;
  --surface: #fff;
  --ink: #19201f;
  --ink-soft: #66706e;
  --ink-faint: #707977;
  --border: #dedfd9;
  --accent: #5746d9;
  --accent-soft: #efedff;
  --danger: #bb3c3c;
  --danger-soft: #fbe9e7;
  --success: #16734b;
  --success-soft: #e5f5ec;
  --fun: #f05f52;

  --card-red: #c0392b;
  --card-green: #1e8449;
  --card-purple: #6c3483;

  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --shadow-card:
    0 1px 2px rgba(25, 32, 31, 0.05), 0 10px 24px rgba(25, 32, 31, 0.08);
  --shadow-card-lift:
    0 4px 10px rgba(25, 32, 31, 0.08), 0 20px 40px rgba(25, 32, 31, 0.12);
  --shadow-float: 0 16px 50px rgba(25, 32, 31, 0.14);

  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13.5px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 22px;
  --text-2xl: 30px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.35, 0.64, 1);
  --dur-fast: 0.15s;
  --dur-med: 0.25s;
  --dur-slow: 0.45s;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
html,
body {
  min-width: 280px;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      circle at 8% 18%,
      rgba(87, 70, 217, 0.07),
      transparent 24rem
    ),
    radial-gradient(
      circle at 92% 82%,
      rgba(240, 95, 82, 0.055),
      transparent 22rem
    );
  pointer-events: none;
}
body.modal-open {
  overflow: hidden;
}
button {
  font: inherit;
}
[hidden] {
  display: none !important;
}

:where(button, a, input, select):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
/* Headings are focused programmatically for screen readers on view change;
   they are not interactive, so no visible ring. */
:is(h1, h2)[tabindex="-1"]:focus {
  outline: none;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
  transition: transform var(--dur-fast) ease;
}
.skip-link:focus {
  transform: translateY(0);
}
.symbol-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px max(var(--space-5), calc((100vw - 1200px) / 2));
  border-bottom: 1px solid rgba(222, 223, 217, 0.8);
  background: rgba(247, 246, 242, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 2px;
}
.brand-mark i {
  display: block;
  width: 7px;
  height: 22px;
  border-radius: 5px;
  background: var(--fun);
  transform: rotate(8deg);
}
.brand-mark i:nth-child(2) {
  height: 28px;
  background: var(--success);
  transform: rotate(-7deg);
}
.brand-mark i:nth-child(3) {
  background: var(--accent);
  transform: rotate(6deg);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.icon-btn {
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
  transition:
    background var(--dur-fast) ease,
    color var(--dur-fast) ease,
    transform 0.1s ease;
}
@media (hover: hover) {
  .icon-btn:hover {
    background: var(--surface);
    color: var(--accent);
  }
}
.icon-btn:active {
  transform: scale(0.95);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.icon-btn .icon-off {
  display: none;
}
.icon-btn[aria-pressed="true"] .icon-on {
  display: none;
}
.icon-btn[aria-pressed="true"] .icon-off {
  display: inline;
}
.help-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}
.palette-popover {
  position: fixed;
  top: 70px;
  right: max(var(--space-5), calc((100vw - 1200px) / 2));
  z-index: 1;
  width: min(260px, calc(100vw - 24px));
  max-height: calc(100dvh - 82px - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}
.palette-title {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
}
.palette-hint {
  margin: 0 0 var(--space-2);
  color: var(--ink-soft);
  font-size: var(--text-xs);
}
.palette-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  cursor: pointer;
}
.palette-row input[type="color"] {
  width: 42px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.palette-reset {
  width: 100%;
  min-height: 44px;
  margin-top: var(--space-3);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-sm);
  cursor: pointer;
}
@media (hover: hover) {
  .palette-reset:hover {
    filter: brightness(0.97);
  }
}
.deck-status {
  min-height: 40px;
  padding: 0 var(--space-2);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  white-space: nowrap;
}
.deck-status strong {
  color: var(--ink);
  font-size: var(--text-md);
}
.deck-status .deck-icon {
  width: 16px;
  height: 22px;
}

/* Shared layout, type, and controls */
.content {
  max-width: 1240px;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--space-5) var(--space-7);
}
.room-page .content {
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  min-height: 0;
  padding-bottom: var(--space-5);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.room,
.room > section {
  height: 100%;
  min-height: 0;
}
.room .center-panel {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.panel {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}
.center-panel {
  max-width: 540px;
  margin: 0 auto;
  padding-top: var(--space-6);
  color: var(--ink-soft);
  text-align: center;
}
.game-title {
  margin: 0 0 var(--space-1);
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0 0 var(--space-5);
  color: var(--ink-soft);
}
.muted {
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.section-label {
  margin: 0 0 var(--space-3);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.section-heading-row .section-label {
  margin: 0;
}
.count-pill {
  padding: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 700;
}
.notice {
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  text-align: left;
}

.field-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 650;
}
.text-input {
  width: 100%;
  min-height: 54px;
  margin-bottom: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(25, 32, 31, 0.025);
  font-size: var(--text-lg);
  transition: border-color var(--dur-fast) ease;
}
@media (hover: hover) {
  .text-input:hover {
    border-color: #c5c5bf;
  }
}
.text-input:focus {
  border-color: var(--accent);
  outline: none;
}
.field-help {
  margin: 0 0 var(--space-4);
  color: var(--ink-faint);
  font-size: var(--text-sm);
}
.field-error {
  margin: var(--space-1) 0 0;
  color: var(--danger);
  font-size: var(--text-sm);
}
.btn {
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 650;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    filter var(--dur-fast) ease,
    opacity var(--dur-fast) ease;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
  }
}
.btn-secondary {
  border: 1px solid rgba(87, 70, 217, 0.13);
  background: var(--accent-soft);
  color: var(--accent);
}
@media (hover: hover) {
  .btn-secondary:hover:not(:disabled) {
    filter: brightness(0.97);
  }
}
.btn-wide {
  width: 100%;
}
.link-btn {
  min-height: 44px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: var(--text-sm);
  line-height: 1.25;
  text-decoration: underline;
  cursor: pointer;
}
.icon-text-btn {
  min-height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  line-height: 1.25;
  cursor: pointer;
}
@media (hover: hover) {
  .icon-text-btn:hover {
    color: var(--danger);
    text-decoration: underline;
  }
}
kbd {
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  font: inherit;
  font-size: 0.7em;
  opacity: 0.6;
  vertical-align: 1px;
}

.row-list {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}
.row-list li {
  min-height: 48px;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.row-list li:last-child {
  border-bottom: 0;
}
.row-list .row-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.row-list .row-meta {
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.tag {
  margin-left: var(--space-2);
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
}
.tag-offline {
  border: 0;
  color: var(--ink-faint);
}

/* Home */
.home {
  width: 100%;
  max-width: 1080px;
  min-height: calc(100vh - 160px);
  min-height: calc(100dvh - 160px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(40px, 8vw, 100px);
}
.home-hero {
  max-width: 590px;
}
.home-title {
  margin: 0;
  font-size: clamp(43px, 6vw, 76px);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.home-title em {
  color: var(--accent);
  font-style: normal;
  white-space: nowrap;
}
.home-lede {
  max-width: 520px;
  margin: var(--space-5) 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.8vw, 19px);
}
.home-step {
  max-width: 460px;
  padding: clamp(16px, 3vw, 28px) 0;
  text-align: left;
}
.home-step h2 {
  margin: 0 0 var(--space-5);
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.nickname-gate .text-input {
  text-align: left;
}
.hello-row {
  margin: 0 0 var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--ink-soft);
}
.lobby-heading {
  align-items: flex-start;
  margin-bottom: var(--space-4);
}
.lobby-heading h2 {
  margin-bottom: 0;
}
.join-by-code {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.join-by-code h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
}
.join-by-code .muted {
  margin-top: 0;
}
.code-entry-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.code-entry-row .btn {
  min-height: 54px;
  flex: 0 0 auto;
}
.room-code-input {
  min-width: 0;
  margin-bottom: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-cards {
  position: relative;
  width: 250px;
  height: 138px;
  margin-bottom: var(--space-6);
}
.hero-card {
  position: absolute;
  bottom: 6px;
  left: 70px;
  width: 88px;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(222, 223, 217, 0.9);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.hero-card i {
  width: 42px;
  height: 18px;
  border: 3px solid var(--accent);
  border-radius: 50%;
}
.hero-card-one {
  transform: translateX(-54px) rotate(-11deg);
}
.hero-card-two {
  z-index: 2;
  transform: translateY(-8px);
}
.hero-card-two i {
  border-color: var(--success);
}
.hero-card-three {
  transform: translateX(54px) rotate(11deg);
}
.hero-card-three i {
  border-color: var(--fun);
}

/* Waiting room */
.waiting-view {
  width: 100%;
  max-width: 620px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}
.waiting-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.waiting-heading .subtitle {
  margin-bottom: 0;
}
/* One hairline rhythm for the whole waiting room: the invite code is the
   hero (it's what people read aloud to friends), everything else -- the
   player list and the bot setting -- follows the same single-rule idiom
   instead of three different container styles stacked in one screen. */
.invite-block {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
.invite-block .field-label {
  margin: 0;
}
.invite-code {
  padding: 0;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.invite-copy-btn {
  min-width: 210px;
}
.manual-copy {
  width: 100%;
  min-width: 0;
}
.manual-copy .text-input {
  margin: 0 0 var(--space-2);
  padding: var(--space-3);
  text-align: center;
}
.waiting-view .row-list {
  max-height: min(320px, 30dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.waiting-view .row-list li {
  min-height: 52px;
}
@media (prefers-reduced-motion: no-preference) {
  .waiting-view .row-list li.player-enter {
    animation: player-row-in var(--dur-med) var(--ease-spring);
  }
}
@keyframes player-row-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.bot-row {
  margin: var(--space-4) 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.bot-config-label {
  font-size: var(--text-sm);
  font-weight: 650;
}
.bot-difficulty-select {
  min-height: 36px;
  margin-left: auto;
  padding: 5px 30px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.bot-difficulty-select:disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.75;
}
.bot-setting-status {
  min-width: 100%;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  text-align: left;
}
.tag-bot {
  color: var(--success);
}
.tag-bot-level {
  color: var(--ink-faint);
}

/* Match */
.game-view {
  max-width: 1160px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
/* Fixed-height reservation so the board's available space never changes
   when a buzz starts/ends or a reveal begins -- only the content inside
   this bar changes, the bar itself is always present. See .card-found
   below and .buzz-bar further down for how the countdown and reveal now
   live right above the board instead of in a floating pill. */
.stage-caption {
  min-height: 48px;
  padding: 2px var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  text-align: center;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.stage-caption.is-active {
  opacity: 1;
}
.stage-caption strong {
  color: var(--ink);
  font-weight: 650;
}
.buzz-caption {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.reveal-caption {
  flex-wrap: wrap;
  row-gap: 2px;
  gap: var(--space-3);
}
/* A bold, unmistakable drain -- easier to read at a glance than a thin
   trace around the board's edge. Width updates on the same rAF loop as
   everything else (ensureTicking / updateBuzzTimer in game.js). */
.buzz-bar {
  width: min(360px, 80%);
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}
.buzz-bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition:
    width 0.1s linear,
    background var(--dur-med) ease;
}
.buzz-bar-fill.urgent {
  background: #d97706;
}
/* Pure measurement box: always fills the remaining stage space regardless
   of the board's own (JS-computed) size, so game.js can read its rect to
   size cards without a feedback loop. */
.board-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board {
  --board-gap: clamp(8px, 1.3vw, 16px);
  display: grid;
  grid-template-rows: repeat(var(--board-rows, 3), auto);
  grid-auto-flow: column;
  grid-auto-columns: var(--card-w, clamp(88px, min(10.5vw, 14.5dvh), 142px));
  justify-content: center;
  align-content: center;
  gap: var(--board-gap);
  transition:
    filter var(--dur-med) ease,
    opacity var(--dur-med) ease;
}
.board.dimmed {
  filter: saturate(0.4);
  opacity: 0.5;
  pointer-events: none;
}
.board.revealing .card:not(.card-found) {
  filter: saturate(0.35) brightness(0.94);
  opacity: 0.55;
  pointer-events: none;
}
.card {
  position: relative;
  max-width: 165px;
  aspect-ratio: 3 / 4;
  padding: var(--space-3);
  border: 1px solid rgba(222, 223, 217, 0.72);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
  transition:
    transform 0.22s var(--ease-out),
    box-shadow 0.22s ease,
    opacity 0.22s ease;
}
.card::after {
  position: absolute;
  top: 5px;
  right: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: -1px;
  line-height: 1;
  opacity: 0.72;
}
.card[data-color-category="red"]::after {
  content: "I";
}
.card[data-color-category="green"]::after {
  content: "II";
}
.card[data-color-category="purple"]::after {
  content: "III";
}
.board .card {
  width: 100%;
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.card svg {
  width: 100%;
  height: 100%;
}
.card.selected {
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 0 0 5px var(--accent),
    var(--shadow-card-lift);
  transform: translateY(-4px) scale(1.02);
}
.card.not-interactive,
.card[aria-disabled="true"] {
  cursor: default;
}
/* The set-reveal now lights the found cards up in place on the board
   (instead of duplicating them into an overlay), so their vanish and the
   board's recompaction stay visible -- see .board.revealing above and
   showReveal()/reveal_ended in game.js. */
.card.card-found {
  box-shadow:
    0 0 0 3px var(--success-soft),
    0 0 0 5px var(--success),
    var(--shadow-card-lift);
  transform: translateY(-4px) scale(1.02);
  z-index: 2;
}

@keyframes card-select-pop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.055) translateY(-4px);
  }
  100% {
    transform: translateY(-4px) scale(1.02);
  }
}
.card.card-vanish {
  animation: card-vanish 0.38s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes card-vanish {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
  35% {
    transform: scale(1.045);
    opacity: 0.92;
    box-shadow:
      0 0 0 4px var(--accent-soft),
      var(--shadow-card);
  }
  100% {
    transform: scale(0.92);
    opacity: 0;
    filter: blur(2px);
  }
}
.card.card-enter {
  animation: card-enter 0.52s var(--ease-out) both;
}
@keyframes card-enter {
  0% {
    transform: translate(var(--deal-x, 0), var(--deal-y, -24px)) scale(0.72)
      rotate(-4deg);
    opacity: 0;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
}
.card.card-flip {
  z-index: 1;
  transition: transform 0.4s var(--ease-out);
}
.card.card-flip-start {
  transform: translate(var(--flip-x, 0), var(--flip-y, 0));
  transition: none;
}
.card.card-invalid {
  animation: card-invalid 0.42s ease;
}
@keyframes card-invalid {
  0%,
  100% {
    transform: translateX(0);
    box-shadow: var(--shadow-card);
  }
  15%,
  85% {
    box-shadow:
      0 0 0 4px var(--danger-soft),
      0 0 0 5px var(--danger),
      var(--shadow-card);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
@keyframes card-selected-invalid {
  0%,
  100% {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
      0 0 0 3px var(--accent-soft),
      0 0 0 5px var(--accent),
      var(--shadow-card-lift);
  }
  15%,
  85% {
    box-shadow:
      0 0 0 4px var(--danger-soft),
      0 0 0 6px var(--danger),
      var(--shadow-card-lift);
  }
  20% {
    transform: translate(-6px, -4px) scale(1.02);
  }
  40% {
    transform: translate(6px, -4px) scale(1.02);
  }
  60% {
    transform: translate(-4px, -4px) scale(1.02);
  }
  80% {
    transform: translate(4px, -4px) scale(1.02);
  }
}

.deck-icon {
  width: 24px;
  height: 32px;
  border: 2px solid var(--ink-faint);
  border-radius: 4px;
  box-shadow:
    4px -4px 0 -2px var(--bg),
    4px -4px 0 0 var(--ink-faint);
}

.reveal-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-1) var(--space-4);
}
.reveal-credit {
  margin: 0;
  color: var(--accent);
  font-weight: 650;
}
.reveal-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.reveal-feature {
  padding: var(--space-1) 0;
  border: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  opacity: 0;
  animation: reveal-feature-in var(--dur-fast) ease forwards;
}
.reveal-feature strong {
  color: var(--ink);
}
.reveal-feature.all-same,
.reveal-feature.all-same strong {
  color: var(--success);
}
.reveal-feature.all-diff,
.reveal-feature.all-diff strong {
  color: var(--accent);
}
@keyframes reveal-feature-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.reveal-countdown {
  color: var(--ink-faint);
  font-size: var(--text-xs);
}

.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.scoreboard {
  width: 100%;
}
.players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
.player-tile {
  max-width: min(100%, 320px);
  min-height: 38px;
  padding: 5px var(--space-2);
  border-bottom: 2px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-soft);
  transition:
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease;
}
.player-tile .name {
  min-width: 0;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.player-tile .score {
  min-width: 1.6em;
  font-weight: 700;
  text-align: center;
}
.player-tile.score-bump .score {
  animation: score-bump var(--dur-fast) var(--ease-spring);
}
@keyframes score-bump {
  50% {
    transform: scale(1.4);
  }
}
.player-tile.active-buzzer {
  border-color: var(--accent);
  color: var(--accent);
}
.player-tile.active-buzzer .name {
  color: var(--accent);
}
.player-tile.locked-out {
  opacity: 0.6;
}
.player-tile .cooldown {
  margin-left: 2px;
  color: var(--danger);
  font-size: var(--text-xs);
}
.player-tile:not(.locked-out) .cooldown {
  display: none;
}
.player-tile.spectator {
  font-style: italic;
}
.player-tile.voted-no-set {
  border-color: var(--accent);
}
.tag-vote {
  margin-left: var(--space-1);
}
.actions {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.no-set-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.vote-status {
  min-height: 16px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  line-height: 1.2;
}
.btn-buzz {
  min-width: 210px;
  padding: var(--space-4) var(--space-6);
  background: var(--accent);
  color: #fff;
}
@media (hover: hover) {
  .btn-buzz:hover:not(:disabled) {
    filter: brightness(1.08);
  }
}
.btn-buzz.cooldown {
  background: var(--danger-soft);
  color: var(--danger);
}
#no-set-btn {
  min-width: 150px;
}
#no-set-btn.voted {
  background: var(--accent);
  color: #fff;
}

/* Game over */
.gameover-view {
  max-width: 540px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.winner-line {
  margin-bottom: var(--space-5);
  color: var(--accent);
  font-size: var(--text-lg);
  font-weight: 650;
}
.standings-list {
  max-height: 42dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
}
.standings-list li.is-winner {
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.standings-list li.is-winner .row-title {
  color: var(--accent);
}
.gameover-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}
.return-lobby-btn {
  text-decoration: none;
}

/* Transient UI */
.view {
  animation: view-in var(--dur-med) var(--ease-standard);
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  z-index: 50;
  max-width: calc(100vw - 24px);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-float);
  font-size: var(--text-sm);
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in var(--dur-fast) ease;
}
.toast.toast-leaving {
  animation: toast-out var(--dur-fast) ease forwards;
}
.toast.toast-error {
  background: var(--danger);
}
.toast.toast-success {
  background: var(--success);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: var(--space-5);
  background: rgba(25, 32, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-backdrop-in var(--dur-fast) ease;
}
@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: modal-in var(--dur-med) var(--ease-spring);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  margin: 0;
  font-size: var(--text-xl);
}
.close-btn {
  width: 44px;
  padding: 0;
  font-size: var(--text-md);
}
.modal-body {
  padding: var(--space-5) var(--space-5) var(--space-6);
}
.modal-body h3 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--text-md);
}
.modal-body p {
  color: var(--ink-soft);
}
.rule-callout {
  margin-top: 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-4);
  border-left: 2px solid var(--accent);
  color: var(--ink) !important;
}
.htp-features {
  margin: var(--space-4) 0 var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.htp-features strong {
  color: var(--ink);
}
.htp-example {
  margin-bottom: var(--space-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.htp-label {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 650;
}
.htp-label-good {
  color: var(--success);
}
.htp-label-bad {
  color: var(--danger);
}
.htp-cards {
  display: flex;
  gap: var(--space-2);
}
.htp-cards .card {
  flex: 1;
  cursor: default;
}
.htp-caption {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}
.htp-rules {
  padding-left: var(--space-5);
  color: var(--ink-soft);
}
.htp-rules li {
  margin-bottom: var(--space-2);
}
.shortcut-row {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}
.shortcut-row kbd {
  margin: 0 3px 0 0;
}
.status-title {
  margin: var(--space-4) 0 0;
  font-size: var(--text-xl);
}
.loading-mark {
  display: inline-flex;
  gap: 5px;
}
.loading-mark i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: loading-bounce 0.8s ease-in-out infinite alternate;
}
.loading-mark i:nth-child(2) {
  animation-delay: 0.15s;
}
.loading-mark i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes loading-bounce {
  to {
    transform: translateY(-7px);
    opacity: 0.4;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .home {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  .home-title {
    font-size: clamp(42px, 7vw, 60px);
  }
  .hero-cards {
    margin-bottom: var(--space-5);
    transform: scale(0.88);
    transform-origin: left bottom;
  }
}

/* Phones */
@media (max-width: 640px) {
  .topbar {
    min-height: 58px;
    padding: 7px 10px;
  }
  .topbar-actions {
    gap: 1px;
  }
  .icon-btn {
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    gap: 5px;
    font-size: 12px;
  }
  .icon-btn svg {
    width: 16px;
    height: 16px;
  }
  .brand {
    gap: 6px;
    font-size: var(--text-md);
  }
  .brand-mark i {
    width: 5px;
    height: 17px;
  }
  .brand-mark i:nth-child(2) {
    height: 22px;
  }
  .palette-popover {
    top: 62px;
    right: 10px;
    max-height: calc(100dvh - 72px - env(safe-area-inset-bottom));
  }
  .content {
    min-height: calc(100dvh - 58px);
    padding: var(--space-5) var(--space-4)
      calc(var(--space-5) + env(safe-area-inset-bottom));
  }
  .room-page .content {
    height: calc(100dvh - 58px);
    min-height: 0;
    padding-top: var(--space-3);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }
  .room-page .brand > span:last-child,
  .room-page .topbar .icon-btn > span:not(.help-icon) {
    display: none;
  }
  .room-page .topbar .icon-btn {
    width: 44px;
    padding: 0;
  }
  .deck-status {
    min-height: 38px;
    padding: 4px 8px;
    gap: 7px;
  }
  .game-title {
    font-size: 30px;
  }

  .home {
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }
  .home-hero {
    text-align: center;
  }
  .home-title {
    font-size: clamp(42px, 13vw, 59px);
  }
  .home-lede {
    margin-top: var(--space-4);
  }
  .hero-cards {
    width: 210px;
    height: 116px;
    margin: 0 auto var(--space-5);
    transform: scale(0.8);
    transform-origin: center bottom;
  }
  .home-step {
    width: 100%;
    padding: var(--space-5);
  }
  .home-step h2 {
    font-size: 25px;
  }
  .code-entry-row {
    flex-wrap: wrap;
  }
  .code-entry-row .btn {
    width: 100%;
  }

  .waiting-view {
    height: 100%;
    min-height: 0;
    justify-content: flex-start;
  }
  .waiting-heading {
    align-items: center;
    margin-bottom: var(--space-3);
  }
  .waiting-heading .subtitle {
    margin-top: var(--space-1);
  }
  .invite-block {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    gap: var(--space-2);
  }
  .waiting-view .row-list {
    max-height: 24dvh;
  }
  .bot-row {
    margin: var(--space-3) 0;
    padding-top: var(--space-3);
    gap: var(--space-2);
  }
  .bot-setting-status {
    min-width: 0;
    flex: 1 1 100%;
    text-align: left;
  }

  .game-view {
    height: 100%;
    min-height: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .stage {
    gap: var(--space-3);
  }
  .board {
    grid-template-columns: repeat(3, var(--card-w, 96px));
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: var(--space-2);
  }
  .board .card {
    min-width: 0;
    padding: var(--space-2);
  }
  .deck-icon {
    width: 18px;
    height: 24px;
  }
  .players {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 2px 0 5px;
    scrollbar-width: thin;
  }
  .player-tile {
    flex: 0 0 auto;
    max-width: 85vw;
  }
  .game-view .actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(222, 223, 217, 0.86);
    background: rgba(247, 246, 242, 0.94);
    box-shadow: 0 -8px 24px rgba(25, 32, 31, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .game-view .actions .btn,
  .game-view .no-set-control {
    width: 100%;
    min-width: 0;
  }
  .game-view #no-set-btn {
    min-width: 0;
  }
  .game-view .actions .btn {
    min-height: 48px;
    padding: 10px 12px;
    font-size: var(--text-sm);
  }
  .reveal-features {
    display: none;
  }
  .toast {
    bottom: calc(94px + env(safe-area-inset-bottom));
    width: max-content;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0
      env(safe-area-inset-left);
  }
  .modal {
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-header,
  .modal-body {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }
  .modal-body {
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
  .htp-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
  .htp-example {
    grid-template-columns: 1fr;
  }
  .gameover-view {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 640px) and (max-height: 750px) {
  .home {
    gap: var(--space-4);
  }
  .home-title {
    font-size: 38px;
  }
  .home-lede {
    display: none;
  }
  .hero-cards {
    display: none;
  }
  .home-step {
    padding: var(--space-4);
  }
  .home-step h2 {
    margin-bottom: var(--space-3);
    font-size: var(--text-xl);
  }
  .hello-row {
    margin-bottom: var(--space-3);
  }
  .join-by-code {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
  }
}

@media (max-width: 640px) and (max-height: 620px) {
  .home-hero {
    display: none;
  }
  .home-step {
    padding: var(--space-3);
  }
  .waiting-heading .subtitle,
  .invite-block > .field-label {
    display: none;
  }
  .invite-block {
    padding-bottom: var(--space-2);
    gap: 6px;
  }
  .waiting-view .row-list {
    max-height: 18dvh;
  }
  .bot-row {
    min-height: 40px;
    margin: var(--space-2) 0;
    padding-block: 4px;
  }
  .bot-setting-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (min-width: 641px) and (max-height: 560px) {
  .content {
    padding: var(--space-3) var(--space-5);
  }
  .home {
    min-height: calc(100dvh - 88px);
  }
  .hero-cards {
    display: none;
  }
  .home-title {
    font-size: clamp(40px, 6vw, 58px);
  }
  .home-lede {
    margin-top: var(--space-2);
    font-size: var(--text-md);
  }
  .home-step {
    padding: var(--space-4);
  }
  .home-step h2,
  .hello-row {
    margin-bottom: var(--space-3);
  }
  .join-by-code {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
  }
  .waiting-heading {
    margin-bottom: var(--space-2);
  }
  .waiting-heading .subtitle,
  .invite-block > .field-label {
    display: none;
  }
  .invite-block {
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }
  .manual-copy:not([hidden]) {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2) var(--space-3);
  }
  .manual-copy .text-input {
    width: min(100%, 390px);
    min-height: 44px;
    margin: 0;
  }
  .manual-copy .muted {
    flex: 1 1 230px;
  }
  .waiting-view .row-list {
    max-height: 22dvh;
  }
}

@media (max-width: 350px) {
  .topbar {
    padding-inline: 7px;
  }
  .icon-btn {
    padding-inline: 6px;
  }
  .brand {
    font-size: var(--text-sm);
  }
  .content {
    padding-inline: var(--space-3);
  }
  .home-step {
    padding: var(--space-4);
  }
  .board {
    max-width: 296px;
  }
}
@media (max-width: 300px) {
  .brand > span:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card.selected:not(.card-enter):not(.card-vanish):not(.card-flip):not(
      .card-invalid
    ) {
    animation: card-select-pop var(--dur-fast) var(--ease-spring);
  }
  .card.selected.card-invalid {
    animation: card-selected-invalid 0.42s ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal-caption,
  .reveal-feature {
    opacity: 1 !important;
    transform: none !important;
  }
}
@media (forced-colors: active) {
  .card,
  .btn,
  .player-tile,
  .invite-block,
  .home-step {
    border: 1px solid CanvasText;
  }
  .brand-mark i {
    forced-color-adjust: none;
  }
  .card svg,
  .hero-card i {
    forced-color-adjust: none;
  }
  .card.selected {
    outline: 4px double Highlight;
    outline-offset: 2px;
  }
  .card.selected.card-invalid {
    outline-color: Mark;
    border-style: dashed;
  }
  .card.card-found {
    outline: 4px solid Highlight;
    outline-offset: 2px;
  }
  .buzz-bar {
    border: 1px solid CanvasText;
  }
  .buzz-bar-fill {
    background: Highlight;
  }
  .player-tile.active-buzzer {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
  .player-tile.voted-no-set {
    border: 3px dashed Highlight;
  }
  .player-tile.active-buzzer.voted-no-set {
    outline-style: double;
    border-style: dashed;
  }
  #no-set-btn.voted {
    outline: 3px dashed Highlight;
    outline-offset: 2px;
  }
}

/* Site footer and information pages (home, contact, privacy, terms, credits) */
.site-footer {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-5)
    calc(var(--space-5) + env(safe-area-inset-bottom));
  color: var(--ink-faint);
  font-size: var(--text-xs);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}
.site-footer a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (hover: hover) {
  .site-footer a:hover {
    color: var(--accent);
  }
}
.site-footer-note {
  max-width: 560px;
  margin: var(--space-2) 0 0;
}
.legal {
  max-width: 720px;
  margin: 0 auto;
}
.legal h1 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.03em;
}
.legal h2 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--text-lg);
}
.legal p,
.legal li {
  color: var(--ink-soft);
}
.legal ul {
  padding-left: var(--space-5);
}
.legal li + li {
  margin-top: var(--space-2);
}
.legal a {
  color: var(--accent);
  text-underline-offset: 2px;
}
.legal-updated {
  margin: var(--space-1) 0 var(--space-5);
  color: var(--ink-faint);
  font-size: var(--text-sm);
}
.legal-callout {
  font-size: var(--text-xl);
  font-weight: 650;
}
.legal-back {
  margin-top: var(--space-6);
}
@media (max-width: 640px) {
  .site-footer {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }
}
/* Keep the home footer in view: the content area absorbs the leftover height
   instead of forcing the page to scroll. */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.home-page .content {
  display: flex;
  flex: 1 0 auto;
  width: 100%;
  min-height: 0;
}
.home-page .home {
  min-height: 0;
}
