[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.language-picker {
  display: flex;
  align-items: center;
}

.language-picker select {
  max-width: 10.5rem;
  height: 40px;
  padding: 0 2rem 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

[dir="rtl"] .header-actions {
  margin-right: auto;
  margin-left: 0;
}

[dir="rtl"] .clue-strip > div + div {
  border-right: 1px solid var(--line);
  border-left: 0;
}

[dir="rtl"] .suggestions button,
[dir="rtl"] .stat {
  text-align: right;
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 1rem;
}

[dir="rtl"] .auth-illustration span {
  right: 2rem;
  left: auto;
}

body {
  overflow-x: hidden;
}

.mobile-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mobile-nav a,
.site-header > *,
.header-actions {
  min-inline-size: 0;
}

.game-layout > *,
.game-card,
.results-panel,
.guess-zone,
.search-combo,
.game-actions,
.mobile-nav a {
  min-width: 0;
}

.search-combo {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.query-clear {
  inline-size: 52px;
  min-inline-size: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.query-clear:hover,
.query-clear:focus-visible {
  border-color: var(--aqua);
  color: var(--deep);
}

.query-clear[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .header-actions > .button-quiet {
    display: none;
  }

  .site-header {
    gap: 0.55rem;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .language-picker select {
    width: 4.9rem;
    max-width: 4.9rem;
    padding-right: 1.35rem;
    text-overflow: ellipsis;
  }

  .page-heading,
  .game-heading {
    min-width: 0;
  }

  .lede {
    overflow-wrap: anywhere;
  }

  .search-combo {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-actions .button {
    min-width: 0;
    padding-inline: 0.45rem;
    font-size: 0.74rem;
  }
}

/* Long translated names and facts should wrap instead of widening the page. */
.guess-entry-head > span,
.guess-entry-head .scientific-name,
.archive-info,
.archive-day-body,
.archive-mode-links a,
.mode-game-meta > div,
.fact-clue-list li > div,
.fish-facts,
.fish-facts li,
.completion-card-dialog,
.completion-card-dialog section,
.completion-card-dialog .completion-card-fact,
.fishdex-card,
.fishdex-card-body,
.fishdex-card-body h3,
.field-fact,
.lede,
.status-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.suggestions button strong,
.suggestions button small,
.archive-mode-links strong,
.archive-mode-links small,
.clue-strip strong,
.trait-cell strong {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.modal,
.result-modal,
.completion-card-dialog {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.answer-photo,
.answer-photo img,
.answer-photo figure,
.fish-facts img {
  max-width: 100%;
}

@media (max-width: 640px) {
  .clue-strip {
    min-width: 0;
  }

  .clue-strip > div {
    min-width: 0;
  }

  .archive-mode-links a {
    min-width: 0;
  }

  .modal,
  .result-modal,
  .completion-card-dialog {
    max-height: calc(100dvh - 1rem);
  }
}
