@import '/css/global.css';

.kakuro-board {
  display: grid;
  grid-template-columns: repeat(var(--kak-cols, 4), 1fr);
  gap: 2px;
  padding: 12px;
  background: var(--background-color-light);
  border-radius: var(--border-radius-md);
}

.kak-black {
  background: #1e293b;
  border-radius: 3px;
  aspect-ratio: 1;
}

.kak-clue {
  background: #1e293b;
  border-radius: 3px;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

.kak-clue-inner {
  position: absolute;
  inset: 0;
  display: flex;
}

.kak-diagonal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 0.5px),
    rgba(255, 255, 255, 0.3) calc(50% - 0.5px),
    rgba(255, 255, 255, 0.3) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}

.kak-down {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: clamp(0.55rem, 2cqw, 0.75rem);
  font-weight: bold;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

.kak-across {
  position: absolute;
  bottom: 3px;
  left: 4px;
  font-size: clamp(0.55rem, 2cqw, 0.75rem);
  font-weight: bold;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

.kak-fill {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.85rem, 3cqw, 1.3rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-color);
  cursor: pointer;
  transition:
    background 0.1s,
    border-color 0.1s;
  outline: none;
}

.kak-fill:hover,
.kak-fill:focus {
  background: rgba(255, 255, 255, 0.12);
}

/* Keyboard focus needs a real ring — the subtle background tint alone (same as
   hover) isn't a visible focus indicator. */
.kak-fill:focus-visible {
  outline: 2px solid var(--warning);
  outline-offset: 1px;
}

.kak-fill.is-selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.kak-fill.is-error {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.kak-fill.kak-pop {
  animation: cellPop 0.18s ease-out;
}
