body {
  font-family: sans-serif;
  margin: 0;
  background: #f6f6f6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

#container {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}

#main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pairs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px; /* расстояние между странами */
  margin-bottom: 20px;
}

/* Каждая пара вертикальная (страна + кнопка) */
.pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 240px; /* шире, чтобы влезали длинные названия */
}

button {
  margin-top: 5px;
  padding: 6px 14px;
  cursor: pointer;
  border: none;
  background: #007bff;
  color: white;
  border-radius: 6px;
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #0065d1;
}

button:disabled {
  background: #999;
  cursor: default;
}

#result {
  margin-top: 15px;
  font-size: 18px;
  min-height: 60px;
}

.buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#sidebar {
  width: 560px;
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
  height: fit-content;
}

#stats {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

#historyList {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

#historyList li {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  border-left: 4px solid transparent;
  padding-left: 5px;
}

#historyList li.correct { border-color: #28a745; }
#historyList li.wrong { border-color: #dc3545; }

/* --- основной флаг (больше) --- */
.flag {
  width: 120px;        /* увеличенный размер флага для главных карточек */
  height: 84px;
  border-radius: 4px;
  object-fit: cover;
  display: block;      /* чтобы занимал свою строку */
  margin: 0 auto 8px;  /* центрируем и даём отступ снизу до названия */
}

/* --- имена стран: теперь флаг сверху, название под ним --- */
#c0_name, #c1_name {
  display: flex;
  flex-direction: column; /* флаг сверху, текст снизу */
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  max-width: 280px;      /* увеличено, чтобы влезали длинные названия */
  white-space: normal;
  word-break: break-word;
  font-size: 18px;
  min-height: 120px;     /* фиксированная высота, чтобы карточки не прыгали */
  padding: 4px;
}

.history-flag {
  width: 28px;
  height: 19px;
  margin: 0 6px;
  display: inline-block;
  vertical-align: middle;
}