/* Chess tactics trainer */

.chess-trainer {
  max-width: 1100px;
}

.chess-trainer__panel {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 1rem 1.25rem;
}

.chess-trainer__groups {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .chess-trainer__groups {
    grid-template-columns: 1fr 1fr;
  }
}

.chess-trainer__group h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #007bff;
  margin-bottom: 0.5rem;
}

.chess-trainer__tactic {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.chess-trainer__tactic input {
  margin-top: 0.3rem;
  margin-right: 0.5rem;
}

.chess-trainer__tactic-name {
  font-weight: 600;
}

.chess-trainer__tactic-desc {
  display: block;
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.3;
}

.chess-trainer__elo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  gap: 0.35rem 0.5rem;
}

.chess-trainer__elo {
  display: flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.chess-trainer__elo input {
  margin-right: 0.35rem;
}

.chess-trainer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.chess-trainer__session-toolbar {
  padding: 0;
  background: transparent;
  border: none;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.chess-trainer__actions--center {
  justify-content: center;
  margin-top: 0.75rem;
}

@media (max-width: 767.98px) {
  .chess-trainer__session-toolbar .chess-trainer__actions {
    flex-wrap: nowrap;
    width: 100%;
    gap: 0.25rem;
  }

  .chess-trainer__session-toolbar .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.28rem 0.15rem;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
  }
}

.chess-trainer__session-toolbar .chess-trainer__status {
  text-align: center;
}

.chess-trainer__status-link {
  font-weight: 600;
  text-decoration: underline;
}

.chess-trainer__board-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.65rem;
  max-width: 520px;
  margin: 0 auto;
}

.chess-trainer__board-wrap {
  flex: 1 1 auto;
  max-width: 480px;
  min-width: 0;
}

#chess-board {
  width: 100%;
}

.chess-trainer__eval {
  flex: 0 0 28px;
  width: 28px;
  align-self: flex-start;
}

.chess-trainer__eval-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #1b1b1b;
  border: 1px solid #343a40;
}

.chess-trainer__eval-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: #f0f0f0;
  transition: height 0.18s ease-out;
}

.chess-trainer__eval[data-orientation="black"] .chess-trainer__eval-fill {
  bottom: auto;
  top: 0;
}

.chess-trainer__eval-score {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  color: #212529;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
  pointer-events: none;
  padding: 0 1px;
  word-break: break-all;
}

.chess-trainer__session.is-review #chess-review-btn {
  background: #17a2b8;
  border-color: #17a2b8;
  color: #fff;
}

.chess-trainer__status {
  min-height: 3rem;
  font-size: 1.05rem;
}

.chess-trainer__status.is-error {
  color: #dc3545;
  font-weight: 600;
}

.chess-trainer__status.is-success {
  color: #28a745;
  font-weight: 600;
}

.chess-trainer__status.is-info {
  color: #004085;
}

.chess-trainer__meta {
  font-size: 0.95rem;
  color: #495057;
}

.chess-trainer__session {
  display: none;
}

.chess-trainer__session.is-active {
  display: block;
}

/* Highlight last move squares lightly via chessboard.js classes if present */
.chess-trainer .highlight-correct {
  box-shadow: inset 0 0 0 4px rgba(40, 167, 69, 0.55);
}

.chess-trainer .highlight-wrong {
  box-shadow: inset 0 0 0 4px rgba(220, 53, 69, 0.55);
}

.chess-trainer__selected {
  box-shadow: inset 0 0 0 4px rgba(255, 213, 0, 0.9);
  background-color: rgba(255, 213, 0, 0.35) !important;
}

.chess-trainer__selected img {
  filter: drop-shadow(0 0 6px rgba(255, 200, 0, 0.95));
  transform: scale(1.06);
  transition: transform 0.12s ease-out;
}
