:root {
  color-scheme: dark;
  --bg: #111418;
  --panel: #1b2026;
  --panel-strong: #252c34;
  --text: #f4f0e8;
  --muted: #a9b0b8;
  --accent: #e7bd59;
  --accent-strong: #ffd46f;
  --success: #67d391;
  --danger: #ff7d75;
  --line: #313944;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(231, 189, 89, 0.13), transparent 34rem),
    linear-gradient(135deg, #111418 0%, #191f25 52%, #101316 100%);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(231, 189, 89, 0.22);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
  user-select: none;
}

.app-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(56px, env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-self: center;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-strong);
  font-weight: 800;
}

.icon-button {
  cursor: pointer;
}

#helpButton {
  justify-self: start;
}

.leaderboard-icon svg {
  width: 23px;
  height: 23px;
}

.leaderboard-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.auth-button {
  min-height: 44px;
  max-width: 180px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-wrap {
  position: relative;
}

.account-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1114;
  box-shadow: var(--shadow);
}

.account-menu button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.account-menu-name {
  max-width: 230px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu button:hover:not(:disabled),
.account-menu button:focus-visible {
  background: var(--panel-strong);
  outline: none;
}

.account-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.account-menu .muted-menu-item {
  color: var(--muted);
}

.icon-button:hover,
.secondary-button:hover,
.auth-button:hover {
  border-color: var(--accent);
}

.game-type-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -8px 0 18px;
}

.game-type-button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(27, 32, 38, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.game-type-button.active {
  border-color: var(--accent);
  background: rgba(231, 189, 89, 0.14);
  color: var(--accent-strong);
}

.game-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--muted);
}

.game-status p {
  margin: 0;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.mode-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.mode-button.active {
  border-color: var(--accent);
  background: rgba(231, 189, 89, 0.14);
  color: var(--accent-strong);
}

.attempt-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
}

.dot.missed {
  background: var(--danger);
  border-color: var(--danger);
}

.dot.hit {
  background: var(--success);
  border-color: var(--success);
}

.quote-stage {
  position: relative;
  min-height: 340px;
  display: grid;
  align-content: center;
  gap: 24px;
  padding: clamp(24px, 6vw, 56px);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.quote-count {
  margin: 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

blockquote {
  position: relative;
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 3.5rem);
  line-height: 1.08;
  font-weight: 850;
  text-wrap: balance;
}

blockquote::before {
  content: open-quote;
  color: var(--accent);
}

blockquote::after {
  content: close-quote;
  color: var(--accent);
}

.hint-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -4px;
  max-width: 100%;
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(236, 196, 83, 0.4);
  border-radius: 999px;
  background: rgba(236, 196, 83, 0.08);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint-pill span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quote-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.quote-nav .secondary-button {
  position: absolute;
  top: 50%;
  width: 54px;
  min-height: 86px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: rgba(244, 240, 232, 0.88);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: auto;
}

.quote-nav .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.22;
}

#prevQuoteButton {
  left: -56px;
}

#nextQuoteButton {
  right: -56px;
}

.quote-nav .secondary-button:not(:disabled):hover {
  color: var(--accent-strong);
  border-color: transparent;
}

.quote-skip-button {
  justify-self: end;
  width: auto;
  min-height: 42px;
  margin-top: -4px;
  padding: 0 14px;
  border-color: rgba(169, 176, 184, 0.34);
  background: rgba(14, 17, 20, 0.48);
  color: rgba(244, 240, 232, 0.9);
  font-size: 0.92rem;
}

.quote-skip-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.guess-panel {
  margin-top: 22px;
}

.input-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #0e1114;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231, 189, 89, 0.2);
}

.suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  width: calc(100% - 122px);
  max-height: 280px;
  overscroll-behavior: contain;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1114;
  box-shadow: var(--shadow);
}

.suggestion-option {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.suggestion-option:hover,
.suggestion-option:focus,
.suggestion-option.active {
  background: var(--panel-strong);
  outline: none;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
}

#guessButton {
  min-width: 112px;
  padding: 0 22px;
  background: var(--accent);
  color: #181006;
  font-weight: 850;
  cursor: pointer;
}

#guessButton:hover {
  background: var(--accent-strong);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.message {
  min-height: 0;
  margin: 14px 0 0;
  color: var(--muted);
}

.message:not(:empty) {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 32, 38, 0.72);
}

.message.success {
  border-color: rgba(103, 211, 145, 0.55);
  background: rgba(103, 211, 145, 0.1);
  color: var(--success);
}

.message.error {
  border-color: rgba(255, 125, 117, 0.55);
  background: rgba(255, 125, 117, 0.1);
  color: var(--danger);
}

.result-card.success {
  color: var(--success);
}

.result-card.error {
  color: var(--danger);
}

.result-card {
  display: grid;
  gap: 8px;
}

.result-card strong {
  color: var(--text);
  font-size: 1.04rem;
}

.result-card span {
  color: var(--muted);
}

.result-score {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 240, 232, 0.08);
  color: var(--accent-strong);
  font-weight: 900;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.result-next-button {
  min-width: 96px;
}

.history,
.archive {
  margin-top: 28px;
}

.history h2,
.archive h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#guessList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#guessList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 32, 38, 0.72);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.archive-browser {
  position: relative;
  --archive-arrow-gap: 18px;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.archive-page-arrow {
  position: absolute;
  top: min(50%, 92px);
  z-index: 2;
  width: 42px;
  min-height: 84px;
  border: 0;
  background: transparent;
  color: rgba(242, 238, 229, 0.78);
  cursor: pointer;
  font-size: 0;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-50%);
}

.archive-page-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border-top: 8px solid currentColor;
  border-right: 8px solid currentColor;
  transform-origin: center;
}

.archive-page-arrow:first-child::before {
  transform: translate(-36%, -50%) rotate(-135deg);
}

.archive-page-arrow:last-child::before {
  transform: translate(-64%, -50%) rotate(45deg);
}

.archive-page-arrow:first-child {
  right: calc(100% + var(--archive-arrow-gap));
}

.archive-page-arrow:last-child {
  left: calc(100% + var(--archive-arrow-gap));
}

.archive-page-arrow:hover {
  color: var(--accent-strong);
}

.archive-page-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.22;
}

.archive-item {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 32, 38, 0.72);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  text-align: center;
}

.archive-item:hover,
.archive-item.active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.archive-item.solved {
  border-color: rgba(103, 211, 145, 0.7);
  color: var(--success);
}

.archive-item.failed {
  border-color: rgba(255, 125, 117, 0.72);
  color: var(--danger);
}

.archive-item.locked {
  cursor: not-allowed;
  opacity: 0.5;
}

.archive-page-tile {
  border-color: rgba(242, 238, 229, 0.32);
  color: rgba(242, 238, 229, 0.8);
  font-size: 2.1rem;
}

.archive-page-tile:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.archive-gate {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 32, 38, 0.72);
}

.archive-gate p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.archive-gate button,
.auth-actions button {
  padding: 0 18px;
  background: var(--accent);
  color: #181006;
  cursor: pointer;
  font-weight: 850;
}

.result-tag {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hidden {
  display: none;
}

.modal {
  width: min(440px, calc(100% - 32px));
  max-height: min(82vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal form {
  position: relative;
  padding: 28px;
}

.modal h2 {
  margin: 0 0 14px;
}

.modal p {
  color: var(--muted);
  line-height: 1.55;
}

.modal a {
  color: var(--accent-strong);
}

#authDialog {
  width: min(620px, calc(100% - 32px));
}

.leaderboard-modal {
  width: min(560px, calc(100% - 32px));
}

.leaderboard-controls {
  display: grid;
  gap: 10px;
  margin: 16px 0 12px;
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.leaderboard-status {
  min-height: 22px;
  margin: 10px 0;
  color: var(--muted);
}

.leaderboard-status.error {
  color: var(--danger);
}

.leaderboard-rows {
  display: grid;
  gap: 8px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 32, 38, 0.72);
}

.leaderboard-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row small {
  grid-column: 2 / -1;
  color: var(--muted);
}

.leaderboard-rank {
  color: var(--accent-strong);
  font-weight: 900;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a,
.site-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  line-height: 1;
}

.site-footer a::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-left: 20px;
  border-radius: 999px;
  background: rgba(198, 207, 219, 0.44);
  pointer-events: none;
}

.site-footer a:hover,
.site-footer button:hover {
  color: var(--accent-strong);
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

#saveSettingsButton {
  background: var(--accent);
  color: #181006;
  cursor: pointer;
  font-weight: 850;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  cursor: pointer;
}

.stats-grid {
  display: grid;
  gap: 12px;
}

#accountStatsGrid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.stats-column {
  display: grid;
  gap: 10px;
}

.stats-column h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-column-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 10px;
}

.stats-column-combined {
  grid-column: 1 / -1;
}

.stats-column-combined .stats-column-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  display: grid;
  align-content: start;
  min-height: 112px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--panel-strong);
  min-width: 0;
}

.stat-card-movie {
  border-color: rgba(238, 197, 85, 0.32);
}

.stat-card-people {
  border-color: rgba(103, 211, 145, 0.32);
}

.stat-card strong {
  display: block;
  max-width: 100%;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  line-height: 1.1;
  overflow-wrap: normal;
  white-space: nowrap;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 760px);
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }

  .topbar {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 20px;
  }

  .game-type-tabs {
    margin: -4px 0 16px;
  }

  .brand h1 {
    font-size: clamp(2rem, 13vw, 2.7rem);
    white-space: nowrap;
  }

  .icon-button {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  .auth-button {
    max-width: 104px;
    min-height: 42px;
    padding: 0 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .auth-button.signed-in {
    display: grid;
    place-items: center;
    width: 42px;
    max-width: 42px;
    padding: 0;
    color: transparent;
    font-size: 0;
  }

  .auth-button.signed-in::before {
    content: "...";
    color: var(--text);
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    transform: translateY(-3px);
  }

  .game-status {
    align-items: flex-start;
    gap: 12px;
  }

  .mode-tabs {
    gap: 8px;
  }

  .mode-button {
    min-height: 44px;
    padding: 0 14px;
  }

  .attempt-dots {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 128px;
    padding-top: 4px;
  }

  .dot {
    width: 13px;
    height: 13px;
  }

  .quote-stage {
    min-height: clamp(260px, 50svh, 340px);
    gap: 16px;
    padding: 26px 22px 24px;
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.32);
  }

  .quote-stage > .attempt-dots {
    order: -1;
    justify-content: flex-start;
    max-width: none;
    padding-top: 0;
    margin-bottom: -6px;
  }

  blockquote {
    font-size: clamp(2rem, 10.6vw, 3rem);
    line-height: 1.08;
    text-wrap: pretty;
  }

  .quote-count {
    font-size: 0.78rem;
  }

  .hint-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: -2px;
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .hint-pill {
    width: 100%;
    min-height: 0;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(244, 240, 232, 0.92);
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.25;
    white-space: normal;
  }

  .hint-pill span {
    width: 82px;
    flex: 0 0 82px;
    font-size: 0.66rem;
  }

  .quote-nav {
    position: static;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
    pointer-events: auto;
  }

  .quote-nav .secondary-button {
    position: static;
    width: 64px;
    min-height: 52px;
    transform: none;
    border: 1px solid var(--line);
    background: var(--panel);
    font-size: 1.55rem;
  }

  .quote-skip-button {
    width: 100%;
    min-height: 48px;
    margin-top: 0;
    background: rgba(14, 17, 20, 0.58);
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .suggestions {
    width: 100%;
    top: auto;
    bottom: calc(100% + 8px);
    max-height: min(44svh, 320px);
  }

  #guessButton {
    width: 100%;
    min-height: 54px;
  }

  .secondary-button {
    width: 100%;
    min-height: 52px;
  }

  .section-heading {
    align-items: stretch;
  }

  .section-heading .secondary-button {
    width: auto;
    min-width: 104px;
  }

  .archive-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .archive-page-arrow {
    display: none;
  }

  .archive-item {
    min-height: 54px;
    padding: 8px;
    font-size: 1rem;
  }

  #guessList li {
    align-items: flex-start;
    gap: 12px;
  }

  .result-tag {
    flex: 0 0 auto;
    padding-top: 2px;
  }

  .modal {
    width: min(100% - 20px, 440px);
    max-height: calc(100dvh - 24px);
    margin: auto;
  }

  .modal form {
    padding: 24px 18px 20px;
  }

  .close-button {
    top: 10px;
    right: 10px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  #accountStatsGrid {
    grid-template-columns: 1fr;
  }

  .stats-column-combined {
    grid-column: auto;
  }

  .stats-column-combined .stats-column-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-column-grid {
    grid-template-columns: repeat(2, minmax(126px, 1fr));
  }

  .leaderboard-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .leaderboard-row > span:not(.leaderboard-rank) {
    justify-self: end;
  }

  .site-footer {
    margin-top: 28px;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 380px) {
  .app-shell {
    width: min(100% - 16px, 760px);
  }

  .brand h1 {
    font-size: clamp(1.75rem, 14vw, 2.25rem);
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .auth-button {
    max-width: 92px;
    min-height: 42px;
    font-size: 0.92rem;
  }

  .stats-column-grid,
  .stats-column-combined .stats-column-grid {
    grid-template-columns: 1fr;
  }

  .quote-stage {
    padding: 24px 18px;
  }

  blockquote {
    font-size: clamp(1.75rem, 10vw, 2.45rem);
  }

  .hint-pill {
    font-size: 0.8rem;
  }

  .hint-pill span {
    width: 68px;
    flex-basis: 68px;
    font-size: 0.62rem;
  }

  .archive-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .archive-page-tile {
    font-size: 1.9rem;
  }
}

@media (hover: none) {
  .icon-button:hover,
  .secondary-button:hover,
  .auth-button:hover,
  .archive-item:hover,
  #guessButton:hover {
    border-color: var(--line);
  }

  #guessButton:hover {
    background: var(--accent);
  }
}
