:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-strong: #fff8ea;
  --ink: #16211f;
  --muted: #62706c;
  --line: #d9d2c2;
  --grid-line: #5f6863;
  --accent: #0d7f78;
  --accent-dark: #075b56;
  --danger: #b74737;
  --good: #2d7a4a;
  --warn: #b98223;
  --shadow: 0 18px 60px rgba(23, 31, 28, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(13, 127, 120, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(183, 71, 55, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--accent);
}

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

.app-shell {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  width: clamp(54px, 8vw, 76px);
  height: clamp(54px, 8vw, 76px);
  flex: 0 0 auto;
  border-radius: 50%;
  filter: drop-shadow(0 8px 12px rgba(23, 32, 28, 0.1));
}

.topbar,
.primary-nav,
.rules-panel,
.action-row,
.archive-bar,
.data-view,
.check-points-view,
.leaderboard-view,
#playView > .status-row,
#endPanel {
  width: min(100%, 820px);
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.92;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-panel {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 1px 12px;
  min-width: 190px;
  padding: 9px 12px;
  border: 1.5px solid rgba(13, 127, 120, 0.25);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
}

.score-panel span,
.score-panel small {
  color: var(--muted);
  font-size: 0.78rem;
}

.score-panel span {
  grid-column: 1 / -1;
  font-weight: 900;
}

.score-panel .grid-completion-count {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.score-panel strong {
  color: var(--accent-dark);
  font-size: 1.32rem;
}

.account-button {
  min-width: 126px;
  padding: 0 18px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(13, 127, 120, 0.18);
}

.account-button.connected {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.top-support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(7, 91, 86, 0.24);
  border-radius: 999px;
  background: #ffdd62;
  color: #2a2418;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(47, 43, 32, 0.11);
}

.top-support-link:hover {
  transform: translateY(-1px);
}

.top-support-link.disabled {
  color: var(--muted);
  cursor: default;
  background: rgba(95, 104, 99, 0.12);
  box-shadow: none;
  transform: none;
}

.primary-nav,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-nav {
  margin-bottom: 18px;
}

.primary-nav button {
  min-width: 150px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.primary-nav .owner-tool {
  min-width: auto;
  padding: 0 10px;
  border-color: rgba(98, 112, 108, 0.28);
  background: rgba(98, 112, 108, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

#trainingBtn.owner-tool {
  margin-left: auto;
}

.primary-nav .owner-tool.active {
  background: rgba(98, 112, 108, 0.18);
  border-color: rgba(98, 112, 108, 0.38);
  color: var(--ink);
}

.action-row {
  justify-content: flex-start;
  margin: 0 auto 14px;
}

.action-row .score-panel {
  flex: 0 1 210px;
}

.daily-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.daily-date[hidden] {
  display: none;
}

.archive-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 28px rgba(23, 31, 28, 0.06);
}

.archive-bar[hidden] {
  display: none;
}

.archive-bar strong {
  display: block;
  font-size: 1rem;
}

.archive-bar strong span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.archive-picker label {
  display: grid;
  gap: 5px;
  min-width: min(260px, 100%);
}

.archive-picker label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.archive-picker select {
  min-height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.archive-picker > strong {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

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

.archive-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(217, 210, 194, 0.86);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
}

.archive-stats strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-stats small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.archive-day {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: stretch;
  justify-items: center;
  gap: 0;
  min-height: 62px;
  padding: 0;
  border: 1px solid rgba(217, 210, 194, 0.95);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  text-align: center;
}

.archive-day:hover {
  transform: none;
  border-color: rgba(13, 127, 120, 0.36);
}

.archive-day.active {
  border-color: var(--accent);
  background: rgba(13, 127, 120, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(13, 127, 120, 0.24),
    0 6px 14px rgba(13, 127, 120, 0.08);
}

.archive-day.played {
  border-width: 2px;
  background: rgba(13, 127, 120, 0.08);
}

.archive-day.score-low {
  background: rgba(7, 91, 86, 0.08);
  border-color: rgba(7, 91, 86, 0.34);
}

.archive-day.score-mid {
  background: rgba(7, 91, 86, 0.11);
  border-color: rgba(7, 91, 86, 0.4);
}

.archive-day.score-high {
  background: rgba(7, 91, 86, 0.15);
  border-color: rgba(7, 91, 86, 0.48);
}

.archive-day span {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 5px 4px 3px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: capitalize;
}

.archive-day strong {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 100%;
  padding: 3px 4px 5px;
  border-top: 1px solid rgba(18, 32, 45, 0.08);
  color: var(--accent-dark);
  font-size: 0.72rem;
  line-height: 1.05;
  white-space: nowrap;
}

.archive-day strong.archive-progress {
  align-self: center;
  width: auto;
  margin: 2px 4px 5px;
  padding: 4px 7px;
  border: 1px solid rgba(13, 127, 120, 0.26);
  border-radius: 999px;
  background: rgba(13, 127, 120, 0.12);
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: lowercase;
}
.rules-panel[hidden] {
  display: none;
}

.rules-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.rules-panel > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.rules-panel p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.segmented button {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.segmented button.active {
  background: var(--accent);
  color: white;
}

.secondary {
  padding: 0 14px;
}

.danger {
  padding: 0 14px;
  border-color: rgba(183, 71, 55, 0.4);
  color: var(--danger);
}

.completed-game-button {
  padding: 0 14px;
  border-color: rgba(45, 122, 74, 0.34);
  background: #e5f6ea;
  color: #255f3a;
  font-weight: 500;
  opacity: 1;
}

.completed-game-button:disabled {
  opacity: 1;
  cursor: default;
}

.board-wrap {
  display: flex;
  justify-content: center;
  overflow: visible;
  padding-bottom: 4px;
}

.board {
  display: grid;
  grid-template-columns: 0.82fr repeat(3, 1fr);
  grid-template-rows: 0.78fr repeat(3, 1fr);
  gap: 6px;
  width: min(100%, 820px);
  min-width: 0;
  aspect-ratio: 1 / 1;
}

.corner,
.criterion,
.cell {
  border: 2px solid var(--grid-line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
}

.corner,
.criterion {
  border-width: 1px;
}

.board.archive-complete .corner,
.board.archive-complete .criterion,
.board.archive-complete .cell {
  border-color: var(--grid-line);
}

.board.archive-complete .cell {
  background: rgba(231, 248, 241, 0.72);
}

.corner {
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.criterion {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
}

.criterion strong {
  font-size: clamp(0.86rem, 1.65vw, 1.05rem);
  line-height: 1.18;
}

.criterion span {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.2;
}

.criterion.col {
  min-height: 0;
}

.criterion.row {
  min-height: 0;
}

.cell {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: hidden;
  min-height: 0;
  padding: 9px;
}

.cell:focus-within {
  overflow: visible;
  z-index: 12;
}

.cell.correct {
  border-color: rgba(45, 122, 74, 0.56);
  background: #f2fff6;
}

.cell.wrong {
  animation: shake 180ms ease-in-out 2;
  border-color: rgba(183, 71, 55, 0.7);
}

.cell.revealed .cell-form {
  display: none;
}

@keyframes shake {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.cell-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.cell-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 7px;
}

.cell input {
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 16px;
}

.cell input::placeholder {
  font-size: 0.78rem;
}

.cell input:focus {
  outline: 3px solid rgba(13, 127, 120, 0.16);
  border-color: var(--accent);
}

.cell-form.invalid-entry input {
  border-color: rgba(183, 71, 55, 0.72);
}

.cell-form button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 0.68rem;
}

.cell-form button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 5;
  display: grid;
  width: 218px;
  max-width: min(218px, calc(100vw - 24px));
  max-height: 205px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suggestions[hidden] {
  display: none;
}

.suggestions button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.suggestion-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 22px;
  overflow: hidden;
  border: 1px solid rgba(18, 32, 45, 0.12);
  border-radius: 4px;
  background: white;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

.suggestion-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.suggestion-flag span {
  display: none;
}

.suggestion-flag.flag-fallback img {
  display: none;
}

.suggestion-flag.flag-fallback span {
  display: inline;
}

.suggestion-name {
  display: inline-block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions button:hover {
  transform: none;
  background: var(--surface-strong);
}

.suggestions small {
  color: var(--muted);
  font-size: 0.72rem;
}

.answer {
  display: grid;
  gap: 6px;
  min-height: 98px;
  min-width: 0;
  overflow: hidden;
}

.answer-main,
.answer-score,
.answer-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.answer-main {
  min-width: 0;
}

.answer-score {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.answer .flag {
  font-size: 2.3rem;
  line-height: 1;
}

.flag-icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 1;
}

.flag-icon img {
  display: block;
  width: 28px;
  height: 19px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
}

.answer > .flag-icon img {
  width: 42px;
  height: 28px;
}

.flag-icon span {
  display: none;
}

.flag-icon.flag-fallback img {
  display: none;
}

.flag-icon.flag-fallback span {
  display: inline;
}

.answer .flag-icon img {
  width: 38px;
  height: 25px;
}

.answer-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 1.02rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.answer small {
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.points {
  width: fit-content;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(13, 127, 120, 0.12);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.answer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tiny-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.74rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 12px auto 0;
}

.message {
  color: var(--accent-dark);
  font-weight: 800;
}

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

.country-count {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.end-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-top: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(13, 127, 120, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.end-panel[hidden] {
  display: none;
}

.end-panel.celebration {
  border-color: rgba(45, 122, 74, 0.38);
  background: #f2fff6;
}

.end-panel h2 {
  margin-bottom: 6px;
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.end-panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}


.end-main {
  min-width: 0;
}

.end-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.end-highlights span,
.player-stats span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.62);
}

.end-highlights strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-highlights small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.player-stats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.share-end-button {
  width: fit-content;
  justify-self: end;
  min-height: 42px;
  padding: 0 18px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(13, 127, 120, 0.18);
}

.modal-share-button {
  justify-self: start;
  margin-top: 2px;
}

.end-score {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.end-score strong {
  color: var(--accent-dark);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.end-score span {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

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

.confetti span {
  position: absolute;
  width: 9px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.74;
  animation: confetti-pop 900ms ease-out both;
}

.confetti .c1 { left: 12%; top: 18%; background: var(--accent); }
.confetti .c2 { left: 28%; top: 8%; background: var(--danger); animation-delay: 80ms; }
.confetti .c3 { left: 56%; top: 12%; background: var(--warn); animation-delay: 130ms; }
.confetti .c4 { left: 78%; top: 24%; background: var(--good); animation-delay: 30ms; }
.confetti .c5 { left: 88%; top: 10%; background: var(--accent-dark); animation-delay: 170ms; }

@keyframes confetti-pop {
  0% {
    transform: translateY(-18px) rotate(0deg);
    opacity: 0;
  }
  30% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(74px) rotate(180deg);
    opacity: 0;
  }
}

.results-panel {
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.solution-card {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px;
}

.solution-card h3 {
  margin: 0 0 10px;
  font-size: 0.94rem;
  line-height: 1.25;
}

.solution-card p {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.solution-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.82rem;
}

.inline-results {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: clamp(54px, 6vw, 92px);
  overflow: auto;
  padding-right: 2px;
}

.inline-results .pill {
  font-size: 0.74rem;
}

.results-modal-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.76rem;
}

.result-details {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-details > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.mobile-results-toggle {
  display: none;
}

.result-pill {
  justify-content: space-between;
  min-width: 150px;
}

.result-country {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-country > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}


.rarity-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rarity-badge.tres-commun {
  background: rgba(127, 117, 102, 0.14);
  color: var(--muted);
}

.rarity-badge.commun {
  background: rgba(13, 127, 120, 0.1);
  color: var(--accent-dark);
}

.rarity-badge.notable {
  background: rgba(63, 127, 196, 0.12);
  color: #275f98;
}

.rarity-badge.rare {
  background: rgba(29, 105, 166, 0.14);
  color: #1d5f96;
}

.rarity-badge.tres-rare {
  background: rgba(123, 63, 152, 0.13);
  color: #63307e;
}

.rarity-badge.mythique {
  background: rgba(183, 71, 55, 0.13);
  color: #923526;
}

.rarity-badge.legendaire {
  background: rgba(244, 169, 0, 0.2);
  color: #745100;
}

.result-score {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.result-points {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-weight: 900;
}

.inline-results .selected-result {
  background: rgba(45, 122, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(45, 122, 74, 0.32);
  font-weight: 900;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.58);
}

.password-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.5);
}

.friends-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.5);
}

.leaderboard-grid-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.52);
}

.abandon-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.5);
}

.data-locked-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.5);
}

.auth-modal[hidden] {
  display: none;
}

.auth-dialog,
.password-dialog,
.friends-dialog,
.leaderboard-grid-dialog,
.abandon-confirm-dialog,
.data-locked-dialog {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(21, 28, 35, 0.28);
}

.password-dialog {
  width: min(440px, 100%);
}

.friends-dialog {
  width: min(520px, 100%);
}

.leaderboard-grid-dialog {
  width: min(780px, 100%);
}

.abandon-confirm-dialog {
  width: min(460px, 100%);
}

.data-locked-dialog {
  width: min(480px, 100%);
}

.auth-dialog h2,
.password-dialog h2,
.friends-dialog h2,
.leaderboard-grid-dialog h2,
.abandon-confirm-dialog h2,
.data-locked-dialog h2 {
  margin-right: 42px;
  font-size: 1.35rem;
}

.leaderboard-grid-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.leaderboard-grid-meta span {
  padding: 6px 9px;
  border: 1px solid rgba(13, 127, 120, 0.22);
  border-radius: 999px;
  background: rgba(13, 127, 120, 0.08);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: minmax(76px, 0.78fr) repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 560px);
}

.leaderboard-grid-corner,
.leaderboard-grid-criterion,
.leaderboard-grid-cell {
  min-width: 0;
  min-height: 66px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.86);
}

.leaderboard-grid-corner,
.leaderboard-grid-criterion {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
}

.leaderboard-grid-cell {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.leaderboard-grid-cell.filled {
  background: rgba(13, 127, 120, 0.08);
  border-color: rgba(13, 127, 120, 0.24);
}

.leaderboard-cell-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.leaderboard-cell-top strong {
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.leaderboard-cell-country {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-grid-cell .rarity-badge {
  padding: 2px 5px;
  font-size: 0.58rem;
}

.empty-cell {
  justify-content: center;
  color: var(--muted);
}

.abandon-confirm-dialog p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.data-locked-dialog p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.abandon-confirm-actions,
.data-locked-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.3rem;
}

.auth-copy,
.auth-notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-notice {
  padding: 10px 12px;
  border: 1px solid rgba(13, 127, 120, 0.24);
  border-radius: 8px;
  background: rgba(13, 127, 120, 0.08);
  color: var(--accent-dark);
  font-weight: 800;
}

.account-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.password-edit-button {
  justify-self: start;
  min-height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.friend-code-share {
  justify-self: start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.friend-code-share:hover {
  color: var(--accent-dark);
  transform: none;
}

.friends-open-button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border-color: rgba(13, 127, 120, 0.24);
  background: var(--surface-strong);
  color: var(--accent-dark);
  font-weight: 500;
}

.history-delete-button {
  justify-self: start;
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(183, 71, 55, 0.26);
  background: rgba(183, 71, 55, 0.07);
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 500;
}

.owner-tools {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding-top: 4px;
}

.owner-tools > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.owner-archive-reset-form {
  width: 100%;
}

.friend-manage-list {
  display: grid;
  gap: 7px;
  max-height: min(52vh, 420px);
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friend-manage-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(217, 210, 194, 0.75);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

.friend-manage-list li > span {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-manage-list .friend-item {
  gap: 5px 10px;
}

.friend-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.friend-line span {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-line small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.friend-manage-list small {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.friend-manage-list .friend-code-line {
  color: var(--accent-dark);
  font-weight: 800;
}

.friend-manage-list button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 32px;
  padding: 0 10px;
  border-color: rgba(183, 71, 55, 0.28);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-next-steps,
.profile-card,
.friends-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
}

.auth-next-steps span,
.profile-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.profile-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.auth-choice-list {
  display: grid;
  gap: 9px;
}

.auth-choice-list button,
.google-auth-button {
  border-color: rgba(13, 127, 120, 0.34);
  background: var(--surface-strong);
  color: var(--accent-dark);
  font-weight: 900;
}

.auth-choice-list .auth-signup-link {
  min-height: 32px;
  justify-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.auth-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.auth-form label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form input,
.auth-form select {
  min-height: 40px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.password-toggle {
  justify-self: start;
  min-height: 32px;
  padding: 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

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

.friends-panel h3 {
  margin: 0;
  font-size: 0.95rem;
}

.friends-panel ul,
.friend-score-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friends-panel li,
.friend-score-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(217, 210, 194, 0.7);
  border-radius: 8px;
  background: white;
}

.friends-panel li span,
.friend-score-list small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.friend-score-list small {
  grid-column: 1 / -1;
}

.empty-friend {
  color: var(--muted);
  font-weight: 800;
}

.logout-button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 900;
}

.results-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.58);
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 28, 35, 0.5);
}

.results-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(21, 28, 35, 0.28);
}

.results-dialog h2 {
  margin: 4px 42px 18px 0;
  font-size: 1.15rem;
}

.results-dialog .inline-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  max-height: none;
  overflow: visible;
  gap: 8px;
}

.results-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.3rem;
}

.share-dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(21, 28, 35, 0.28);
}

.share-dialog h2 {
  margin: 4px 42px 16px 0;
  font-size: 1.15rem;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.share-options a,
.share-options button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(13, 127, 120, 0.28);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.share-options a:hover,
.share-options button:hover {
  border-color: rgba(13, 127, 120, 0.48);
  background: rgba(13, 127, 120, 0.08);
}

.country-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: end center;
  padding: 12px;
  background: rgba(21, 28, 35, 0.5);
}

.country-picker-dialog {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
  max-height: min(86vh, 680px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(21, 28, 35, 0.28);
}

.country-picker-dialog h2 {
  margin: 0 42px 0 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.country-picker-search {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.country-picker-list {
  display: grid;
  gap: 5px;
  max-height: min(48vh, 360px);
  overflow: auto;
  padding-right: 2px;
}

.country-picker-list > p {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-weight: 700;
}

.country-picker-list button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.country-picker-list button.selected {
  border-color: rgba(13, 127, 120, 0.36);
  background: rgba(13, 127, 120, 0.1);
}

.country-picker-submit {
  min-height: 44px;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 900;
}

.country-picker-submit:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
}


.all-results-dialog {
  width: min(980px, 100%);
}

.all-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.all-results-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.72);
}

.all-results-cell header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.all-results-cell h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.15;
}

.all-results-cell header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.all-results-cell .inline-results {
  max-height: 210px;
  overflow: auto;
}


.giveup-dialog {
  width: min(520px, 100%);
}

.giveup-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.giveup-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.giveup-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.giveup-summary strong {
  color: var(--accent-dark);
  font-size: 1.25rem;
}

.giveup-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.data-view {
  display: grid;
  gap: 14px;
}

.data-view[hidden] {
  display: none;
}

.data-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
  gap: 10px;
}

.data-toolbar input,
.data-toolbar select {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.data-stats {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.criteria-checker {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

.criteria-checker {
  grid-template-columns: minmax(220px, 0.7fr) minmax(220px, 1fr);
  align-items: start;
}

.criteria-checker > div:first-child {
  grid-row: span 2;
}

.criteria-checker select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.criteria-results {
  display: grid;
  gap: 8px;
}

.criteria-results p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.criteria-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.table-wrap {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

th button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

th button:hover {
  transform: none;
  color: var(--accent-dark);
}

th button.active-sort {
  color: var(--accent-dark);
}

.flag-cell {
  width: 76px;
  font-size: 1.5rem;
  line-height: 1;
}

.data-flag-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}

.data-flag-button:hover {
  transform: none;
}

.flag-cell img {
  display: block;
  width: 42px;
  height: 28px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
}

.flag-cell span {
  display: none;
}

.flag-cell img:not([src]),
.flag-cell img:not([src]) + span {
  display: inline;
}

.flag-cell.flag-fallback img {
  display: none;
}

.flag-cell.flag-fallback span {
  display: inline;
}

td strong,
td small {
  display: block;
}

#countryTable td:nth-child(2) strong {
  white-space: normal;
  overflow-wrap: anywhere;
}

td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.leaderboard-view {
  display: grid;
  gap: 14px;
}

.leaderboard-view[hidden] {
  display: none;
}

.leaderboard-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(240px, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

.leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.leaderboard-summary > span,
.leaderboard-card,
.stat-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.leaderboard-summary > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
}

.leaderboard-summary strong {
  color: var(--accent-dark);
  font-size: 1.15rem;
  line-height: 1;
}

.leaderboard-summary small,
.leaderboard-panel p,
.leaderboard-card header > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.leaderboard-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.leaderboard-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.leaderboard-card.wide {
  grid-column: 1 / -1;
}

.leaderboard-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.leaderboard-card h3 {
  margin: 0;
  font-size: 1rem;
}

.leaderboard-list,
.friend-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 4px 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(217, 210, 194, 0.75);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.leaderboard-list li.me,
.stat-row.me {
  border-color: rgba(13, 127, 120, 0.34);
  background: rgba(13, 127, 120, 0.08);
}

.leaderboard-list .rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.leaderboard-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-list small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.ranking-table-wrap {
  overflow: auto;
  border: 1px solid rgba(217, 210, 194, 0.78);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
}

.ranking-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(217, 210, 194, 0.7);
  text-align: left;
  vertical-align: middle;
}

.ranking-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ranking-table td {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
}

.grid-view-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(13, 127, 120, 0.24);
  background: var(--surface-strong);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.grid-missing {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ranking-table tr:last-child td {
  border-bottom: 0;
}

.ranking-table tr.me td {
  background: rgba(13, 127, 120, 0.08);
}

.ranking-table td:nth-child(1) {
  color: var(--accent-dark);
  font-weight: 800;
}

.ranking-table td:nth-child(2) {
  color: var(--ink);
  font-weight: 500;
}

.ranking-name-text {
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.ranking-name-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ranking-name-button:hover {
  transform: none;
}

.ranking-friend-state {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.summary-login-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(13, 127, 120, 0.26);
  border-radius: 8px;
  background: rgba(13, 127, 120, 0.08);
}

.summary-login-prompt strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: 0.94rem;
}

.summary-login-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.summary-login-prompt button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border-color: rgba(13, 127, 120, 0.34);
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.leaderboard-notice {
  grid-column: 1 / -1;
  margin: 0;
}

.stats-ranking-table {
  min-width: 1280px;
}

.global-stats-ranking-table {
  min-width: 1280px;
}

.stats-ranking-table th:nth-child(2),
.stats-ranking-table td:nth-child(2) {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 140px;
  background: var(--surface-strong);
  box-shadow: 10px 0 16px rgba(37, 35, 27, 0.08);
}

.stats-ranking-table th:nth-child(2) {
  z-index: 3;
}

.stats-ranking-table tr.me td:nth-child(2) {
  background: #eefbf2;
}

.stats-ranking-table th.rarity-stat-header {
  background: rgba(13, 127, 120, 0.12);
  color: var(--accent-dark);
}

.rarity-stat-cell {
  display: grid;
  gap: 1px;
  justify-items: start;
  min-width: 42px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 500;
}

.rarity-stat-cell span {
  display: block;
}

.rarity-stat-cell small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}

.compact-card {
  padding: 10px;
}

.profile-line-card {
  gap: 10px;
}

.friend-profile-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(120px, 0.58fr) minmax(180px, 1.15fr);
  gap: 10px;
  align-items: end;
}

.profile-inline-form {
  min-width: 0;
}

.friend-code-card {
  display: grid;
  gap: 5px;
  min-height: 40px;
  padding: 0 11px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
}

.friend-code-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.friend-code-card strong {
  color: var(--accent-dark);
  font-size: 0.98rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

.friend-list li {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(217, 210, 194, 0.75);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
}

.friend-list span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.empty-leaderboard {
  justify-items: start;
}

.check-view,
.check-points-view {
  display: grid;
  gap: 14px;
}

.check-view[hidden],
.check-points-view[hidden] {
  display: none;
}

.check-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(240px, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

.check-panel > div:first-child {
  grid-row: span 2;
}

.check-panel select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.check-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.check-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.check-column header {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.check-column h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.check-column header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.check-ok header {
  box-shadow: inset 4px 0 0 var(--good);
}

.check-nok header {
  box-shadow: inset 4px 0 0 var(--danger);
}

.check-country-list {
  display: grid;
  gap: 0;
  max-height: 62vh;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.check-country-list li {
  display: grid;
  grid-template-columns: 92px 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.check-country-list li:last-child {
  border-bottom: 0;
}

.check-flag-button {
  width: 92px;
  height: 60px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}

.check-flag-button:hover {
  transform: translateY(-1px);
}

.check-flag-button img,
.check-country-list img {
  width: 92px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.check-country-list span {
  font-size: 1.8rem;
  line-height: 1;
}

.check-country-list strong {
  min-width: 0;
  overflow: hidden;
  font-size: 1.2rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-country-list small {
  grid-column: 3;
  min-width: 0;
  overflow: visible;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.check-points-results {
  display: grid;
  gap: 14px;
}

.check-points-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.check-points-card header {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.check-points-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.check-points-table-wrap {
  max-height: 64vh;
  overflow: auto;
}

.check-points-table {
  min-width: 760px;
}

.check-points-table th,
.check-points-table td {
  white-space: nowrap;
}

.check-points-table td:first-child {
  white-space: normal;
}

.check-points-table td:first-child strong {
  margin-left: 6px;
}

.check-flag-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 31, 28, 0.72);
}

.check-flag-dialog {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(92vw, 980px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.check-flag-dialog img {
  width: min(86vw, 900px);
  max-height: 68vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.check-flag-dialog strong {
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  line-height: 1.1;
  text-align: center;
}

.check-flag-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.7rem;
  line-height: 1;
}

.check-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 14px;
  width: min(100%, 820px);
  margin: 0 auto 32px;
  padding: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.contact-card,
.support-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(95, 104, 99, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}

.contact-card h2,
.support-card h2,
.support-card p,
.site-footer p {
  margin: 0;
}

.contact-card h2,
.support-card h2 {
  color: var(--ink);
  font-size: 1rem;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
}

.contact-form textarea {
  grid-column: 1 / 3;
  min-height: 76px;
  resize: vertical;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.contact-form button {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: stretch;
  min-width: 92px;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 500;
}

.hidden-field {
  display: none;
}

.contact-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.contact-status.ok {
  color: var(--good);
}

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

.support-card {
  align-content: center;
  justify-items: start;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.88), rgba(245, 241, 232, 0.72));
}

.support-copy {
  max-width: 28rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.support-card .eyebrow {
  color: var(--accent-dark);
}

.site-footer a,
.support-link {
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin-top: 4px;
  padding: 10px 13px;
  border: 1px solid rgba(7, 91, 86, 0.24);
  border-radius: 999px;
  background: #ffdd62;
  color: #2a2418;
  box-shadow: 0 8px 18px rgba(47, 43, 32, 0.11);
}

.support-link:hover {
  transform: translateY(-1px);
}

.coffee-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.support-link.disabled {
  color: var(--muted);
  cursor: default;
  background: rgba(95, 104, 99, 0.12);
  box-shadow: none;
  transform: none;
}

.footer-legal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.footer-legal .privacy-link {
  color: #7c8580;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.footer-legal .privacy-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-page {
  max-width: 860px;
}

.privacy-brand {
  color: inherit;
  text-decoration: none;
}

.privacy-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  text-decoration: none;
}

.privacy-content {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.privacy-content > div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.74);
}

.privacy-content h2,
.privacy-content p {
  margin: 0;
}

.privacy-content h2 {
  font-size: 1.05rem;
}

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 680px);
    padding: 12px 0 28px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    width: min(100vw - 18px, 680px);
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .contact-form textarea,
  .contact-form button {
    grid-column: 1;
    grid-row: auto;
  }

  .topbar,
  .results-heading,
  .status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 10px;
  }

  h1 {
    font-size: clamp(2rem, 14vw, 3.3rem);
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .score-panel {
    grid-template-columns: 1fr auto auto;
    justify-items: start;
    align-items: center;
    width: 100%;
    padding: 9px 11px;
  }

  .score-panel strong {
    font-size: 1.2rem;
  }

  .account-button {
    min-width: 84px;
    min-height: 38px;
    padding: 0 9px;
    font-size: 0.8rem;
  }

  .top-support-link {
    min-height: 38px;
    padding: 0 11px;
    font-size: 0.8rem;
  }

  .primary-nav,
  .action-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }

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

  .action-row .score-panel {
    grid-column: 1 / -1;
  }

  .primary-nav button,
  .action-row button,
  .segmented {
    min-width: 0;
    min-height: 38px;
    padding: 0 7px;
    width: 100%;
    font-size: 0.82rem;
  }

  #trainingBtn.owner-tool {
    margin-left: 0;
  }

  .rules-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .rules-panel > div {
    padding: 9px 10px;
  }

  .rules-panel p:last-child {
    font-size: 0.78rem;
  }

  .board {
    gap: 4px;
    width: min(100%, 96svw);
  }

  .archive-bar {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
    padding: 9px 10px;
  }


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

  .archive-stats span {
    padding: 6px 4px;
  }

  .archive-stats strong {
    font-size: 0.72rem;
  }

  .archive-stats small {
    font-size: 0.5rem;
    letter-spacing: 0;
  }

  .archive-days {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  }

  .archive-day {
    min-height: 50px;
  }

  .corner,
  .criterion,
  .cell {
    border-radius: 6px;
  }

  .corner {
    padding: 5px;
    font-size: 0.66rem;
  }

  .criterion {
    gap: 4px;
    padding: 6px;
  }

  .criterion strong {
    font-size: clamp(0.72rem, 2.9vw, 0.86rem);
    line-height: 1.08;
  }

  .criterion span {
    display: none;
  }

  .cell {
    gap: 5px;
    padding: 6px;
  }

  .cell.revealed .cell-form {
    display: none;
  }

  .cell-meta {
    display: grid;
    gap: 2px;
    font-size: 0.61rem;
  }

  .cell-form {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 4px;
  }

  .cell input {
    min-height: 32px;
    padding: 0 6px;
    font-size: 16px;
  }

  .cell-form button {
    width: 32px;
    min-height: 32px;
    font-size: 0.54rem;
  }

  .answer {
    gap: 4px;
    min-height: 0;
  }


  .answer-actions .tiny-button {
    min-width: 74px;
    min-height: 22px;
    padding: 0 12px;
    font-size: 0.62rem;
  }

  .results-modal-button {
    width: calc(100% - 8px);
    min-width: 0;
    min-height: 20px;
    padding: 0 6px;
    border-width: 1px;
    font-size: 0.58rem;
    font-weight: 700;
  }

  .answer .result-details {
    width: 100%;
    justify-content: center;
    gap: 0;
  }

  .answer-main,
  .answer-title {
    gap: 5px;
  }

  .answer-score {
    gap: 2px;
  }

  .answer .flag {
    font-size: 1.45rem;
  }

  .answer .flag-icon img {
    width: 32px;
    height: 21px;
  }

  .answer-name {
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .answer small {
    font-size: 0.62rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  .points {
    padding: 2px 5px;
    font-size: 0.58rem;
  }

  .points-plus {
    display: none;
  }

  .cell.correct .cell-meta {
    display: none;
  }

  .board.game-complete .cell-meta,
  .board.archive-complete .cell-meta,
  .cell.revealed .cell-meta {
    display: none;
  }

  .board.game-complete .rarity-badge,
  .cell.correct .rarity-badge,
  .cell.revealed .rarity-badge,
  .board.archive-complete .rarity-badge {
    max-width: 100%;
    padding: 1px 4px;
    font-size: 0.45rem;
    line-height: 1;
    white-space: nowrap;
  }

  .board.game-complete .rarity-badge.legendaire,
  .cell.correct .rarity-badge.legendaire,
  .cell.revealed .rarity-badge.legendaire,
  .board.archive-complete .rarity-badge.legendaire {
    font-size: 0.43rem;
  }

  .suggestions {
    max-height: 190px;
    min-width: 0;
    width: min(236px, calc(100vw - 24px));
  }

  .suggestions button {
    display: flex;
    min-height: 38px;
  }

  .suggestion-name {
    display: inline-block;
    font-size: 1rem;
  }

  table {
    min-width: 700px;
  }

  #countryTable td:nth-child(2),
  #countryTable th:nth-child(2) {
    width: 104px;
    max-width: 104px;
  }

  #countryTable td:nth-child(2) strong {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.12;
  }

  .mobile-results-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    padding: 0 8px;
    border: 1px solid rgba(13, 127, 120, 0.34);
    border-radius: 999px;
    background: rgba(13, 127, 120, 0.1);
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 900;
  }

  .result-details:not(.open) > .inline-results {
    display: none;
  }

  .result-details.open > .inline-results {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 8;
    display: flex;
    padding: 8px;
    border: 1px solid rgba(13, 127, 120, 0.28);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(23, 31, 28, 0.22);
  }

  .inline-results {
    margin-top: 6px;
    max-height: min(180px, calc(100% - 44px));
  }

  .result-pill {
    width: 100%;
    min-width: 0;
  }

  .end-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }


  .end-highlights,
  .player-stats {
    grid-template-columns: 1fr;
  }

  .end-highlights span,
  .player-stats span {
    padding: 7px;
  }

  .share-end-button {
    justify-self: start;
  }

  .end-score {
    justify-items: start;
  }

  .end-score span {
    text-align: left;
  }

  .auth-dialog {
    width: min(100%, 520px);
    padding: 18px;
  }

  .leaderboard-grid-dialog {
    width: 100%;
    padding: 14px;
  }

  .leaderboard-grid {
    width: 100%;
    grid-template-columns: minmax(58px, 0.72fr) repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .leaderboard-grid-corner,
  .leaderboard-grid-criterion,
  .leaderboard-grid-cell {
    min-height: 58px;
    padding: 4px;
    border-radius: 6px;
  }

  .leaderboard-grid-corner,
  .leaderboard-grid-criterion {
    font-size: 0.54rem;
  }

  .leaderboard-grid-cell {
    gap: 2px;
  }

  .leaderboard-cell-top {
    gap: 3px;
  }

  .leaderboard-cell-top strong,
  .leaderboard-cell-country {
    font-size: 0.58rem;
  }

  .leaderboard-grid-cell .rarity-badge {
    padding: 1px 4px;
    font-size: 0.48rem;
  }

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

  .auth-form.compact {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .auth-form.compact button {
    min-width: 86px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .friend-profile-row {
    grid-template-columns: 1fr;
  }

  .summary-login-prompt {
    display: grid;
  }

  .summary-login-prompt button {
    justify-self: start;
  }

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

  .stat-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat-row strong {
    grid-column: 1 / -1;
  }

  .stat-row span {
    justify-items: start;
  }

  .leaderboard-card.wide {
    grid-column: auto;
  }

  .leaderboard-card header {
    display: grid;
  }

  .data-toolbar {
    grid-template-columns: 1fr;
  }

  .criteria-checker,
  .check-panel,
  .check-results,
  .leaderboard-panel,
  .leaderboard-results {
    grid-template-columns: 1fr;
  }

  .criteria-checker > div:first-child,
  .check-panel > div:first-child {
    grid-row: auto;
  }

  .check-country-list {
    max-height: none;
  }

  .check-points-table-wrap {
    max-height: none;
  }

  @media (max-width: 520px) {
    .check-country-list li {
      grid-template-columns: 76px minmax(0, 1fr);
      gap: 9px;
    }

    .check-flag-button,
    .check-country-list img {
      width: 76px;
      height: 50px;
    }

    .check-country-list span {
      display: none;
    }

    .check-country-list small {
      grid-column: 2;
      font-size: 0.94rem;
    }
  }

  .solutions-grid {
    grid-template-columns: 1fr;
  }
}
