/* Base styles */
body {
  font-family: 'Nunito', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  font-size: 5rem medium;
}

/* Header */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header-image {
  height: 45px;
}


/* Score box inside header, aligned right */
.score-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}
.score-box .score-line {
  margin: 0;
  font-size: 0.9rem;
  color: #333;
}

/* Instruction area with restart button */
.instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.3rem;
  margin: 1rem 0;
  color: #333;
}

.restart-button,
.nextbutton {
  display: inline-block;
  min-width: 120px;      /* одинаковая минимальная ширина */
  height: 40px;          /* одинаковая высота */
  padding: 0;            /* убираем разницу из-за padding */
  text-align: center;
  line-height: 40px;     /* выравнивание текста по вертикали */
  font-size: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
}

.restart-button {
  background-color: #cc7300;; /* красная */
}

.nextbutton {
  background-color: green; /* синяя */
}

/* Game board layout */
.match-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem;
}
.images-column,
.words-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* Unified card style – default: mobile */
.image-item,
.word-item {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  border: 3px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  transition: border 0.2s;
}
.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

/* Hover, selected and feedback states */
.image-item:hover,
.word-item:hover {
  border-color: #e68a00;
}
.selected {
  border-color: #e68a00 !important;
}
.correct {
  border-color: green !important;
}
.incorrect {
  border-color: red !important;
}

/* Result and status */
.result-box {
  text-align: center;
  font-size: 1.5rem;
  margin-top: 1rem;
  color: #333;
}
.image-box {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}
.status-image {
  width: 60px;
  height: 60px;
}

/* Hint button (orange) */
.hint-button {
  background-color: #e68a00;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.hint-button:hover {
  background-color: #cc7300;
}

/* Hint highlight */
.hinted {
  outline: 3px dashed orange !important;
}

.status-image.large {
  width: 140px;
  height: auto;
  transition: transform 0.3s ease;
  transform: scale(1.3);
}

.word-item {
  text-align: center;
  line-height: 1.2;
  white-space: normal;
}

/* Desktop layout */
@media (min-width: 768px) {
  .match-container {
    flex-direction: column;
    align-items: center;
    padding: 3rem;
  }

  .images-column {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .words-column {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
  }

  .image-item,
  .word-item {
    width: 150px;
    height: 150px;
  }

  .image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .score-box .score-line {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
  }

  .hint-button {
    font-size: 1rem;
  }

  .header-image {
    height: 55px;
  }
}

.footer-button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: default;
  opacity: 0.4;
  background-color: #4CAF50;
  color: white;
  transition: opacity 0.3s;
}

.footer-button.active {
  opacity: 1;
  cursor: pointer;
}

.footer-button.inactive {
  opacity: 0.4;
  cursor: default;
}

/* Mobile layout */
@media (max-width: 768px) {

  .instruction {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 1rem auto;
    width: 100%;
  }

  .nextbutton,
  .restart-button {
    width: 30vw;
    max-width: 200px;
    min-width: 100px;
    box-sizing: border-box;
    display: block;
    text-align: center;
  }

  .match-container {
    padding: 1rem;
    gap: 1rem;
  }

  .images-column,
  .words-column {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .word-item {
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
  }

  .score-box {
    font-size: 0.7rem;
  }
}









/* === Round 2: разные цвета для слов и определений === */
.word-item.r2-word {
  background: #fff9e7;       /* мягкий светло-жёлтый */
  border-color: #ead78c;     /* жёлтый бордер */
}

.word-item.r2-def {
  background: #eff7ff;       /* мягкий светло-голубой */
  border-color: #9ec0f0;     /* голубой бордер */
}

/* (опционально) немного усилить контраст при наведении */
.word-item.r2-word:hover,
.word-item.r2-def:hover {
  filter: brightness(0.98);
}
