/* ==========================================
   Scanner — Surveyor's Instrument
   ========================================== */

.scanner-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Camera / upload area */
.scanner-capture {
  text-align: center;
}

.capture-area {
  position: relative;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl) var(--space-lg);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-inset);
}

.capture-area.dragging {
  border-color: var(--accent-gold);
  background: rgba(184, 134, 11, 0.05);
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.capture-area-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  color: var(--text-muted);
  opacity: 0.6;
}

.capture-area-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-size: 0.92rem;
}

.capture-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.capture-preview {
  position: relative;
  max-width: 100%;
  margin: 0 auto var(--space-lg);
}

.capture-preview img,
.capture-preview canvas {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.capture-preview video {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: #000;
  box-shadow: var(--shadow-md);
}

/* OpenCV loading */
.opencv-loading {
  text-align: center;
  padding: var(--space-2xl);
}

.opencv-loading .spinner {
  margin: 0 auto var(--space-md);
}

/* Grid detection overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-overlay-line {
  stroke: var(--accent-gold);
  stroke-width: 2;
  opacity: 0.8;
}

.grid-overlay-cell {
  fill: none;
  stroke: var(--accent-gold-light);
  stroke-width: 1;
  stroke-dasharray: 4;
}

/* Review grid */
.review-container {
  max-width: 600px;
  margin: 0 auto;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: var(--space-lg);
}

.review-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-color);
  transition: all var(--transition-fast);
}

.review-cell:hover {
  transform: scale(1.05);
  z-index: 1;
  box-shadow: var(--shadow-md);
}

.review-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-cell-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.review-cell-type {
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.review-cell-confidence {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.8);
}

.review-cell.low-confidence {
  border-color: var(--warning);
}

.review-cell.corrected {
  border-color: var(--success);
}

/* Multi-board scanner flow */
.scanner-player-progress {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.scanner-player-badge {
  padding: var(--space-xs) var(--space-md);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.scanner-player-badge.current {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-dark));
  color: #fff;
  border-color: var(--accent-gold-dark);
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.25);
}

.scanner-player-badge.done {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* Score results */
.score-results {
  max-width: 700px;
  margin: 0 auto;
}

.score-city-card {
  margin-bottom: var(--space-lg);
}

.score-city-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.score-city-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.score-city-total {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-gold-dark);
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

@media (min-width: 480px) {
  .score-breakdown {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .score-breakdown {
    grid-template-columns: repeat(6, 1fr);
  }
}

.score-category {
  text-align: center;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  transition: box-shadow var(--transition-fast);
}

.score-category:hover {
  box-shadow: var(--shadow-sm);
}

.score-category-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto var(--space-xs);
}

.score-category-icon .tile-img-wrap {
  width: 28px;
  height: 28px;
}

.score-category-icon .tile-badge {
  width: 12px;
  height: 12px;
}

.score-category-name {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.score-category-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading, var(--text-primary));
}

.score-category-detail {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}
