/* Grid Container */
#grid-container {
  touch-action: none;
  display: flex;
  justify-content: center;
}

.nono-grid {
  display: grid;
  user-select: none;
  touch-action: none;
  background: #0f172a;
  flex-shrink: 0;
}

/* Corner cell (top-left empty space) - invisible */
.nono-corner {
  background: transparent;
}

/* Column clue cells (top header) */
.nono-col-clue {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 2px 4px;
  gap: 1px;
}

.nono-col-clue span {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  color: #94a3b8;
}

/* Row clue cells (left side) */
.nono-row-clue {
  background: transparent;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 8px;
  gap: 5px;
}

.nono-row-clue span {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  color: #94a3b8;
}

/* Game cells */
.nono-cell {
  background: #1e293b;
  position: relative;
  cursor: pointer;
  transition: background-color 0.05s;
  border: 1px solid #334155;
  box-sizing: border-box;
}

@media (hover: hover) {
  .nono-cell:hover {
    background: #2a3a50;
  }
}

/* Filled cell: inner block with ~8% margin */
.nono-cell.filled::after {
  content: '';
  position: absolute;
  inset: 8%;
  background: #3b82f6;
  border-radius: 2px;
}

/* X'd cell: red X using pseudo-elements */
.nono-cell.xd::before,
.nono-cell.xd::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 55%;
  height: clamp(2px, calc(var(--cell-size) * 0.06), 3px);
  background: #f87171;
  border-radius: 1px;
}

.nono-cell.xd::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nono-cell.xd::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Thick borders every 5 cells for 10x10 and 15x15 */
.nono-cell.border-left-thick {
  border-left: 2px solid #64748b;
}

.nono-cell.border-top-thick {
  border-top: 2px solid #64748b;
}

/* Outer edges of game grid */
.nono-cell.edge-top {
  border-top: 2px solid #64748b;
}

.nono-cell.edge-left {
  border-left: 2px solid #64748b;
}

.nono-cell.edge-right {
  border-right: 2px solid #64748b;
}

.nono-cell.edge-bottom {
  border-bottom: 2px solid #64748b;
}

/* Game selector buttons */
.game-btn {
  background: #374151;
  color: #9ca3af;
}

.game-btn:hover {
  background: #4b5563;
  color: #e5e7eb;
}

.game-btn.active {
  background: #3b82f6;
  color: #ffffff;
}

/* Responsive cell sizing - uses min(vw, vh) to fit within viewport */
.nono-grid.size-5 {
  --cell-size: clamp(40px, min(10vw, 8vh), 64px);
}

.nono-grid.size-10 {
  --cell-size: clamp(28px, min(5.5vw, 4.5vh), 48px);
}

.nono-grid.size-15 {
  --cell-size: clamp(22px, min(4vw, 3.2vh), 36px);
}

.nono-cell {
  width: var(--cell-size);
  height: var(--cell-size);
}

.nono-col-clue {
  width: var(--cell-size);
  min-height: var(--cell-size);
}

.nono-row-clue {
  height: var(--cell-size);
  min-width: var(--cell-size);
}

/* Scale clue text with cell size */
.nono-col-clue span,
.nono-row-clue span {
  font-size: clamp(0.6rem, calc(var(--cell-size) * 0.35), 0.85rem);
}

/* Modal overlay */
#completion-modal {
  backdrop-filter: blur(2px);
}
