/* === Сопоставь время — игровое поле, циферблаты и цифровое время === */
/* Используется в: time1.html */

/* Игровая доска-контейнер с двумя колонками — time1.html */
.match-board {
  display: flex;
  gap: 16px;
  position: relative;
  justify-content: space-between;
  padding: 8px 0;
  min-height: 360px;
}

/* Левая/правая колонка — time1.html */
.match-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  flex: 1;
}

/* Ячейка с циферблатом / цифровым временем — time1.html */
.clock-cell, .time-cell {
  cursor: pointer;
  border-radius: 16px;
  padding: 8px;
  transition: all .2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 3;
}

/* Холст аналоговых часов — time1.html */
.clock-cell canvas {
  display: block;
  width: min(20vw, 90px);
  height: min(20vw, 90px);
  pointer-events: none;
}

/* Центрирование ячейки цифрового времени — time1.html */
.time-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: min(20vw, 90px);
  min-height: calc(min(20vw, 90px) + 16px);
}

/* Цифровое время — time1.html */
.digital-time {
  font-size: min(5.5vw, 1.8rem);
  font-weight: 900;
  color: var(--accent2);
  background: var(--glass-bg);
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  transition: all .2s;
  line-height: 1;
}

/* Наведение на ячейку — time1.html */
.clock-cell:hover, .time-cell:hover {
  transform: scale(1.05);
}

/* Нажатие на ячейку — time1.html */
.clock-cell:active, .time-cell:active {
  transform: scale(.95);
}

/* Выделенный циферблат (первый клик) — time1.html */
.clock-cell.selected canvas {
  box-shadow: 0 0 0 4px var(--accent1);
  border-radius: 50%;
}

/* Выделенное цифровое время (первый клик) — time1.html */
.time-cell.selected .digital-time {
  border-color: var(--accent1);
  background: rgba(var(--help-btn-shadow),.1);
  box-shadow: 0 0 0 4px rgba(var(--help-btn-shadow),.25);
}

/* Сопоставленная пара (заблокирована) — time1.html */
.clock-cell.matched, .time-cell.matched {
  pointer-events: none;
  cursor: default;
}

/* Затемнение циферблата после сопоставления — time1.html */
.clock-cell.matched canvas {
  opacity: .6;
}

/* Затемнение и зелёная рамка цифрового времени — time1.html */
.time-cell.matched .digital-time {
  opacity: .6;
  border-color: var(--success-start);
  background: #e8faf0;
}

/* Тряска при ошибке — time1.html */
.clock-cell.shake canvas {
  animation: shake .4s ease;
}

.time-cell.shake .digital-time {
  animation: shake .4s ease;
}

/* Красная рамка на цифровом времени при ошибке — time1.html */
.time-cell.shake-wrong .digital-time {
  border-color: var(--error);
  background: #fff0f0;
}

/* Соединительная линия между парой — time1.html */
.match-line-css {
  position: absolute;
  height: 3px;
  background: var(--accent1);
  transform-origin: 0 50%;
  pointer-events: none;
  z-index: 2;
  border-radius: 2px;
  opacity: .6;
}

/* Отступ под заголовком игры — time1.html */
.glass-header {
  margin-bottom: 8px;
}

/* Счётчик раундов — time1.html */
.round-notice {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--help-color);
}

/* Сообщение на доске (по центру) — time1.html */
.board-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent1);
  z-index: 1;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity .3s;
}

.board-message.show {
  opacity: 1;
}

/* ——— Телефон ≤480px — time1.html ——— */
@media (max-width: 480px) {
  .match-board {
    gap: 8px;
    min-height: 280px;
  }
  .match-column { gap: 8px; }
  .clock-cell, .time-cell { padding: 4px; }
  .clock-cell canvas {
    width: min(30vw, 70px);
    height: min(30vw, 70px);
  }
  .time-cell {
    min-width: min(30vw, 70px);
    min-height: calc(min(30vw, 70px) + 8px);
  }
  .digital-time {
    font-size: min(6vw, 1.3rem);
    padding: 8px 10px;
  }
}

/* ——— Десктоп ≥769px — time1.html ——— */
@media (min-width: 769px) {
  .clock-cell canvas {
    width: 110px;
    height: 110px;
  }
  .time-cell {
    min-width: 110px;
    min-height: 126px;
  }
  .digital-time {
    font-size: 2rem;
    padding: 16px 20px;
  }
  .match-board { gap: 32px; }
}
