:root {
  color-scheme: light;
  /* Bingo Buzz logo: navy, sky blue, golden yellow */
  --ink: #0f2d5c;
  --muted: #4f6685;
  --accent: #2b6fd4;
  --accent-strong: #0d2f6e;
  --accent-soft: #e3effc;
  --accent-rgb: 43, 111, 212;
  --gold: #ffc20e;
  --gold-strong: #e89500;
  --gold-rgb: 255, 194, 14;
  --bg: #fff9f0;
  --bg-strong: #f3ead6;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --danger: #c92a2a;
  --line: rgba(15, 45, 92, 0.12);
  --shadow: 0 24px 70px rgba(15, 45, 92, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(var(--gold-rgb), 0.32), transparent 35rem),
    radial-gradient(circle at 80% 10%, rgba(var(--accent-rgb), 0.2), transparent 30rem),
    linear-gradient(135deg, #fffdf8 0%, var(--bg) 48%, #eef5ff 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: max(0.65rem, env(safe-area-inset-top, 0)) clamp(1rem, 4vw, 4rem) 0.65rem;
  background: rgba(255, 249, 240, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.top-nav,
.language-switch,
.hero-actions,
.join-row,
.board-header,
.bingo-word {
  display: flex;
  align-items: center;
}

.brand {
  flex-shrink: 0;
  margin-right: auto;
}

.brand-logo {
  display: block;
  width: auto;
  height: 8.125rem;
  max-width: min(26.25rem, 70vw);
  object-fit: contain;
  object-position: left center;
}

.top-nav {
  gap: 1rem;
  color: var(--muted);
  font-weight: 700;
}

.top-nav a {
  transition: color 160ms ease;
}

.top-nav a:hover {
  color: var(--accent);
}

.language-switch {
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-button {
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  font-weight: 800;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.lang-button.active {
  color: white;
  background: var(--accent);
}

.auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--line);
}

.auth-bar.auth-bar--signed-in {
  border-left-color: var(--accent-soft);
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
}

.auth-anonymous,
.auth-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
}

.auth-user-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(16rem, 42vw);
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.auth-user-avatar {
  display: grid;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  background: linear-gradient(145deg, var(--gold), var(--gold-strong));
  border-radius: 50%;
}

.auth-user-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  line-height: 1.2;
}

.auth-user-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-logout-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.auth-hint {
  max-width: 15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.auth-link.button {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.auth-local {
  width: min(100%, 20rem);
  margin-top: 0.35rem;
}

.auth-local-form {
  display: grid;
  gap: 0.55rem;
}

.auth-local-field {
  display: grid;
  gap: 0.25rem;
}

.auth-local-field > span {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-local-field input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.auth-local-field input:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.auth-local-error {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger);
}

.auth-local-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.auth-local-submit,
.auth-local-toggle {
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.auth-sign-in-link {
  white-space: nowrap;
}

.login-page {
  width: min(480px, calc(100% - 2rem));
}

.login-panel h1 {
  margin-bottom: 0.75rem;
}

.login-page-message {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: var(--radius-md);
}

.login-page-message--error {
  color: var(--danger);
  background: rgba(201, 42, 42, 0.08);
}

.login-oauth {
  margin-bottom: 0.5rem;
}

.login-google-btn {
  justify-content: center;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.login-local {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.login-local-actions {
  flex-direction: column;
}

.login-local-actions .full {
  width: 100%;
}

.login-back {
  margin: 1.5rem 0 0;
  text-align: center;
}

.login-back a {
  color: var(--accent-strong);
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 2rem));
  max-width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 70vh;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1.2rem;
  font-size: clamp(3rem, 7vw, 5.9rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 0.6rem;
}

.hero-text {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.15rem;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 35px rgba(var(--accent-rgb), 0.28);
}

.button.secondary {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.button.ghost {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
}

.button.full {
  width: 100%;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: clamp(1rem, 4vw, 2rem);
  border-radius: var(--radius-xl);
  transform: rotate(2deg);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.mini-grid span {
  display: grid;
  min-height: 6.5rem;
  place-items: center;
  padding: 0.75rem;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: center;
  background: linear-gradient(145deg, #ffffff, var(--accent-soft));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.mini-grid .free {
  color: white;
  background: linear-gradient(145deg, var(--gold), var(--gold-strong));
}

.game-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 2rem 0 5rem;
}

.game-shell > * {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1025px) {
  .game-shell {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  }
}

.panel {
  border-radius: var(--radius-xl);
}

.settings-panel,
.board-panel {
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.settings-panel {
  position: sticky;
  top: 6rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.settings-form,
fieldset,
.field {
  display: grid;
  gap: 0.9rem;
}

.multi-options {
  display: none;
  gap: 0.9rem;
}

.multi-options.is-open {
  display: grid !important;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field span {
  margin-bottom: 0.1rem;
  color: var(--ink);
  font-weight: 800;
}

.radio-card {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.radio-card > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.radio-card input {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.radio-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1.4;
}

.word-source-fieldset,
.game-mode-fieldset {
  min-width: 0;
}

.word-source-switch,
.game-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.word-source-option,
.game-mode-option {
  position: relative;
  display: block;
  margin: 0;
  min-width: 0;
  cursor: pointer;
}

.word-source-option input,
.game-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.word-source-option-inner,
.game-mode-option-inner {
  display: grid;
  gap: 0.2rem;
  min-height: 100%;
  padding: 0.7rem 0.5rem;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) - 5px);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.word-source-option input:focus-visible + .word-source-option-inner,
.game-mode-option input:focus-visible + .game-mode-option-inner {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.word-source-option input:checked + .word-source-option-inner,
.game-mode-option input:checked + .game-mode-option-inner {
  background: var(--panel-solid);
  border-color: rgba(var(--accent-rgb), 0.28);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.14);
}

.word-source-option-title,
.game-mode-option-title {
  display: block;
  color: var(--ink);
  font-size: clamp(0.72rem, 2.8vw, 0.86rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.word-source-option input:checked + .word-source-option-inner .word-source-option-title,
.game-mode-option input:checked + .game-mode-option-inner .game-mode-option-title {
  color: var(--accent-strong);
}

.word-source-option-hint,
.game-mode-option-hint {
  display: block;
  color: var(--muted);
  font-size: clamp(0.62rem, 2.2vw, 0.72rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: 0;
}

input,
select {
  height: 3rem;
  padding: 0 0.85rem;
}

textarea {
  resize: vertical;
  padding: 0.85rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.join-row {
  gap: 0.5rem;
}

.room-status {
  min-height: 1.4rem;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 800;
}

.host-callout {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--accent-strong);
  font-weight: 700;
  line-height: 1.45;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius-md);
}

.room-roster {
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.room-roster:not([hidden]) {
  display: grid;
}

.room-roster .eyebrow {
  margin: 0;
}

.room-roster-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.room-roster-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--accent-strong);
  font-weight: 700;
  line-height: 1.45;
}

.room-roster-list li {
  margin: 0.15rem 0;
}

.room-roster-empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.join-room-block[hidden] {
  display: none !important;
}

.player-name-row {
  display: none;
  gap: 0.9rem;
}

.player-name-row.is-open {
  display: grid !important;
}

.player-name-row .field {
  margin-bottom: 0;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius-md);
}

.form-error {
  min-height: 1.25rem;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.board-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.score-card {
  min-width: 8.5rem;
  padding: 0.8rem 1rem;
  text-align: right;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.score-card span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-card strong {
  font-size: 1.45rem;
}

.bingo-word {
  justify-content: stretch;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bingo-word span {
  flex: 1;
  color: var(--accent-strong);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  text-align: center;
}

.board-play-area {
  position: relative;
}

.winner-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 45, 92, 0.62);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
}

.winner-overlay-inner {
  max-width: min(100%, 28rem);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2rem);
  text-align: center;
  color: #fff;
  background: linear-gradient(155deg, var(--gold), var(--gold-strong));
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 60px rgba(15, 45, 92, 0.35);
}

.winner-overlay-title {
  margin: 0 0 0.5rem;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-transform: uppercase;
}

.winner-overlay-name {
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 3.5vw, 1.65rem);
  font-weight: 800;
  line-height: 1.35;
}

.winner-overlay-sub {
  margin: 0;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  font-weight: 600;
  opacity: 0.95;
}

.bingo-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
}

.cell {
  position: relative;
  display: grid;
  min-height: clamp(5.2rem, 10vw, 7.6rem);
  place-items: center;
  padding: 0.65rem;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(227, 239, 252, 0.92));
  border: 1px solid var(--line);
  border-radius: clamp(0.7rem, 2vw, 1.1rem);
  cursor: pointer;
}

.cell:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
}

.cell.marked {
  color: white;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.cell.marked::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  content: "X";
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 900;
  line-height: 1;
}

.cell.marked span {
  opacity: 0.22;
}

.cell.free {
  color: white;
  background: linear-gradient(145deg, var(--gold), var(--gold-strong));
}

.cell.winning {
  outline: 4px solid rgba(var(--gold-rgb), 0.65);
  outline-offset: 2px;
}

.winner-banner {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  color: #fff;
  background: linear-gradient(145deg, var(--gold), var(--gold-strong));
  border-radius: var(--radius-md);
  box-shadow: 0 18px 34px rgba(var(--gold-rgb), 0.35);
}

.winner-banner[hidden],
[hidden] {
  display: none !important;
}

.site-version-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem clamp(1rem, 4vw, 4rem) max(2rem, env(safe-area-inset-bottom, 0));
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--line);
  background: rgba(255, 249, 240, 0.65);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  font-weight: 700;
}

.site-footer-links a {
  color: var(--accent-strong);
  transition: color 160ms ease;
}

.site-footer-links a:hover {
  color: var(--accent);
}

.site-footer-links a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer-sep {
  color: var(--muted);
  opacity: 0.65;
}

.legal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  flex-wrap: wrap;
}

.legal-top-nav {
  margin-left: auto;
}

.legal-page {
  flex: 1;
  width: min(820px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 2.5rem;
}

.legal-panel {
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border-radius: var(--radius-xl);
}

.legal-updated {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.legal-panel h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
  color: var(--accent-strong);
}

.legal-lead {
  margin: 0 0 1.75rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.7;
}

.legal-section {
  margin-bottom: 1.35rem;
}

.legal-section h2 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  color: var(--accent-strong);
}

.legal-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.legal-cta {
  margin-top: 1rem;
}

.delete-data-form {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

.delete-data-form .field {
  display: grid;
  gap: 0.4rem;
}

.delete-data-form .field > span {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.92rem;
}

.delete-data-form input[type="email"],
.delete-data-form input[type="text"],
.delete-data-form select,
.delete-data-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.delete-data-form input:focus,
.delete-data-form select:focus,
.delete-data-form textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.delete-data-confirm {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.delete-data-confirm input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.delete-data-form .form-error {
  min-height: 1.25rem;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.delete-data-success {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--accent-strong);
  font-weight: 700;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius-md);
}

.delete-data-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.site-version-footer small {
  font-size: inherit;
}

.site-version-footer .deploy-version {
  color: var(--accent-strong);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.how-it-works {
  padding: 1rem 0 5rem;
}

.centered {
  max-width: 650px;
  margin: 0 auto 1.4rem;
  text-align: center;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.rules-grid article {
  padding: 1.3rem;
  background: rgba(255, 250, 242, 0.74);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.rules-grid span {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  margin-bottom: 1rem;
  color: white;
  font-weight: 900;
  background: var(--accent);
  border-radius: 50%;
}

.rules-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .hero,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header,
  .top-nav {
    align-items: flex-start;
  }

  .site-header {
    position: static;
    flex-direction: column;
  }

  .brand-logo {
    height: 6.875rem;
    max-width: min(22.5rem, 85vw);
  }

  .top-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .language-switch {
    margin-left: auto;
  }

  .auth-bar {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.5rem;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .auth-user {
    width: 100%;
    justify-content: space-between;
  }

  .auth-user-card {
    max-width: none;
    flex: 1;
  }

  .hero {
    min-height: auto;
  }

  main {
    width: min(1180px, calc(100% - 1.25rem));
  }

  .game-shell {
    gap: 1rem;
    padding-top: 1.25rem;
  }

  .settings-panel {
    padding: 1rem 0.85rem;
  }

  .settings-panel h2 {
    font-size: clamp(1.35rem, 5vw, 1.7rem);
  }

  .settings-form,
  .settings-form fieldset {
    min-width: 0;
  }

  .word-source-switch,
  .game-mode-switch {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .word-source-option-inner,
  .game-mode-option-inner {
    padding: 0.8rem 0.85rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .word-source-option input:checked + .word-source-option-inner,
  .game-mode-option input:checked + .game-mode-option-inner {
    background: var(--accent-soft);
    border-color: rgba(var(--accent-rgb), 0.4);
    box-shadow: none;
  }

  .word-source-option-title,
  .game-mode-option-title {
    font-size: 0.92rem;
  }

  .word-source-option-hint,
  .game-mode-option-hint {
    font-size: 0.78rem;
  }

  .board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-card {
    width: 100%;
    text-align: left;
  }

  .bingo-board {
    gap: 0.35rem;
  }

  .cell {
    min-height: 4.6rem;
    padding: 0.35rem;
    font-size: clamp(0.62rem, 2.5vw, 0.9rem);
    border-radius: 0.65rem;
  }

  .join-row {
    flex-direction: column;
    align-items: stretch;
  }

  .join-row input {
    width: 100%;
    min-height: 3rem;
  }

  .join-row .button {
    width: 100%;
    min-height: 3rem;
  }

  .hero-actions .button {
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
  }

  .legal-top-nav {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 400px) {
  main,
  .legal-page,
  .login-page {
    width: min(1180px, calc(100% - 1rem));
  }

  .site-header {
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .brand-logo {
    height: 4.75rem;
    max-width: min(16rem, 78vw);
  }

  .top-nav {
    gap: 0.5rem 0.75rem;
    font-size: 0.92rem;
  }

  .lang-button {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 0.75rem;
  }

  .auth-sign-in-link,
  .auth-logout-btn {
    min-height: 2.75rem;
  }

  h1 {
    max-width: none;
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }

  .hero-text {
    font-size: 1rem;
  }

  .game-shell {
    padding-bottom: 3rem;
  }

  .settings-panel {
    padding: 0.9rem 0.7rem;
  }

  .board-panel {
    padding: 1rem 0.7rem;
  }

  .radio-card {
    padding: 0.65rem 0.7rem;
    gap: 0.5rem;
  }

  .bingo-word span {
    font-size: clamp(1rem, 4.5vw, 1.35rem);
  }

  .bingo-board {
    gap: 0.28rem;
  }

  .cell {
    min-height: 3.35rem;
    padding: 0.25rem;
    font-size: clamp(0.55rem, 2.8vw, 0.78rem);
    border-radius: 0.5rem;
  }

  .site-footer-links {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.35rem;
  }

  .legal-panel h1 {
    font-size: clamp(1.5rem, 6vw, 1.85rem);
  }
}

@media (hover: none) and (pointer: coarse) {
  .button,
  .lang-button,
  .cell,
  .auth-local-submit,
  .auth-local-toggle {
    min-height: 2.75rem;
  }

  .cell {
    min-height: max(3.35rem, 2.75rem);
  }
}
