/* © 2026 pluvius.dev. All rights reserved. */
@import url("../../css/theme.css");

.game {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat {
  flex: 1;
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.board-wrap {
  position: relative;
  width: 100%;
}

.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid var(--box-border);
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 4.2vw, 22px);
  font-weight: 500;
  color: var(--cell-user);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  line-height: 1;
}

.cell.given { color: var(--cell-given); font-weight: 700; }
.cell.hinted { color: var(--accent); font-weight: 700; }
.cell.peer { background: var(--cell-peer); }
.cell.same-num { background: var(--cell-same); }
.cell.selected { background: var(--cell-selected); }
.cell.conflict { background: var(--cell-conflict); color: var(--cell-conflict-text); }
.cell.hint-flash { animation: hintFlash 0.9s ease; }

@keyframes hintFlash {
  0% { background: var(--accent); }
  100% { background: var(--surface); }
}

.cell:nth-child(3n) { border-right: 2px solid var(--box-border); }
.cell:nth-child(9n+1) { border-left: 2px solid var(--box-border); }
.cell:nth-child(n+19):nth-child(-n+27) { border-bottom: 2px solid var(--box-border); }
.cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--box-border); }

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.notes-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(7px, 1.8vw, 10px);
  color: var(--text-dim);
  font-weight: 600;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 36, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pause-overlay.hidden { display: none; }

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-buttons {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.ctrl-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 4px;
  font-size: 17px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
}

.ctrl-btn span {
  font-size: 10px;
  color: var(--text-dim);
}

.ctrl-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}
.ctrl-btn.active span { color: var(--accent-text); }

.ctrl-btn .badge {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 9px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0 4px;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}

.num-btn {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.num-btn .count {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 8px;
  color: var(--text-dim);
}

.num-btn.exhausted {
  opacity: 0.35;
  pointer-events: none;
}

.bottom-actions {
  display: flex;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.diff-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.diff-btn:active { background: var(--cell-selected); }

.win-stats {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 18px;
  white-space: pre-line;
}
