:root {
  --accent: #6741d9;
  --higher: #2b8a3e;
  --higher-bg: #ebfbee;
  --wrong: #e03131;
  --wrong-bg: #fff5f5;
}

body {
  background:
    radial-gradient(circle at 10% 0%, #e5dbff 0, transparent 40%),
    radial-gradient(circle at 90% 10%, #d3f9d8 0, transparent 40%),
    var(--bg);
}

.logo span {
  background-image: linear-gradient(90deg, #6741d9, #2b8a3e);
}

.section-title {
  margin: 24px 0 10px;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-switch legend {
  margin-top: 0;
}

.mode-switch__option {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 3px solid transparent;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.mode-switch__option input {
  position: absolute;
  opacity: 0;
}

.mode-switch__option:has(input:checked) {
  border-color: var(--accent);
  background: #f3f0ff;
}

.mode-switch__option:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.mode-switch__title {
  font-weight: 700;
}

.mode-switch__text {
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted);
}

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

.category {
  display: grid;
  gap: 2px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s;
}

.category:active {
  transform: scale(0.97);
}

.category:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.category__icon {
  font-size: 1.6rem;
}

.category__title {
  font-weight: 700;
  line-height: 1.25;
}

.category__best {
  font-size: 0.8rem;
  color: var(--muted);
}

.topbar__title {
  font-size: 1.25rem;
}

.task {
  min-height: 2.6em;
}

.duel {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 8px;
}

.duel__vs {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted);
}

.country {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 14px 12px;
  border: 3px solid transparent;
  border-radius: 18px;
  background: #f6f5f9;
  font: inherit;
  color: var(--ink);
  transition: transform 0.1s, border-color 0.2s, background-color 0.2s;
}

button.country {
  cursor: pointer;
}

button.country:active {
  transform: scale(0.98);
}

button.country:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button.country:disabled {
  cursor: default;
}

.country--base {
  background: #f3f0ff;
}

.country__flag {
  display: flex;
  justify-content: center;
}

/* Feste Höhe statt Prozent, die Safari in Buttons nicht auflöst. */
.country__flag svg {
  display: block;
  max-width: 100%;
  width: auto;
  height: 84px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.12);
}

.country__name {
  font-size: 1.15rem;
  font-weight: 700;
}

.country__value {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.country__value--hidden {
  color: var(--muted);
}

.duel--revealed .country--higher {
  border-color: var(--higher);
  background: var(--higher-bg);
}

.duel--revealed .country--wrong {
  border-color: var(--wrong);
  background: var(--wrong-bg);
}

.country--higher .country__value::after {
  content: " ⬆️";
  font-size: 1rem;
}

.answer-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.answer {
  padding: 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.answer:active {
  transform: scale(0.97);
}

.answer:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.answer:disabled {
  opacity: 0.45;
  cursor: default;
}

.answer--more {
  background: var(--higher);
}

.answer--less {
  background: #c2255c;
}

.feedback {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-weight: 700;
  text-align: center;
}

.record {
  margin: 8px 0 0;
  font-weight: 500;
  color: var(--accent);
}

.round-list__name {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.round-list__line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.round-list__flag {
  display: flex;
  flex: none;
  width: 30px;
}

.round-list__flag svg {
  display: block;
  max-width: 30px;
  max-height: 20px;
  width: auto;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.1);
}

.source {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

svg.flag-shaped {
  box-shadow: none !important;
  border-radius: 0 !important;
  filter: drop-shadow(0 4px 8px rgb(0 0 0 / 0.2));
}

@media (max-height: 700px) {
  .country__flag svg {
    height: 64px;
  }

  .country {
    padding: 10px;
  }
}
