/* Logik-specific styles. shared/styles.css carries tokens + base + components. */

:root {
  --game: #9FB4D6;        /* Logik signature color */
  --game-ink: #1a1817;

  /* Sun = brand gold, Moon = brand ink: the two house accents.
     All token-driven, so both states auto-flip with the theme. */
  --tk-sun:        var(--gold);
  --tk-sun-ink:    #1a1817;            /* dark icon reads on gold in either theme */
  --tk-moon:       var(--ink);         /* dark on paper, light on dark */
  --tk-moon-ink:   var(--paper);
  --tk-cell-bg:    var(--surface);
  --tk-cell-given: var(--surface-sunken);
  --tk-violation:  var(--danger);
  --tk-grid-line:  var(--line);        /* light hairline gaps, not heavy black */
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timer { font-size: 16px; }

.tk-rules {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.4;
  padding: 0 2px;
}
.tk-rules strong {
  color: var(--ink);
  font-weight: 700;
  margin: 0 2px;
}

/* ---------- Grid ---------- */

.tk-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
  background: var(--tk-grid-line);
  padding: 4px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  width: 100%;
  user-select: none;
  touch-action: manipulation;
  box-shadow: var(--shadow-md);
}

.tk-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tk-cell-bg);
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: background 100ms ease;
  border-radius: 2px;
}
.tk-cell:hover:not(:disabled):not(.sun):not(.moon) {
  background: var(--surface-hover);
}
.tk-cell.given { background: var(--tk-cell-given); cursor: default; }
.tk-cell.sun {
  background: var(--tk-sun);
  color: var(--tk-sun-ink);
}
.tk-cell.moon {
  background: var(--tk-moon);
  color: var(--tk-moon-ink);
}
.tk-cell.violation {
  outline: 2px solid var(--tk-violation);
  outline-offset: -2px;
  z-index: 1;
}
.tk-cell svg {
  width: 60%;
  height: 60%;
  display: block;
}

/* ---------- Pair constraint badges ---------- */

.tk-constraint {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.tk-constraint svg { width: 12px; height: 12px; display: block; }
.tk-constraint-ne { color: var(--tk-violation); }

/* ---------- Actions ---------- */

.tk-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* ---------- Completion ---------- */

body.is-completed .tk-cell { cursor: default; pointer-events: none; }

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  main { padding: 14px 10px 24px; gap: 12px; }
  .tk-grid { gap: 3px; padding: 3px; }
  .tk-constraint { width: 16px; height: 16px; margin: -8px 0 0 -8px; font-size: 11px; }
}

/* ===================== Carousel (solmåne-specific bits) =====================
   Generic .puzzle-slider, .puzzle-card framework lives in shared/styles.css. */

.card-preview-logik {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 3px;
  width: 144px;
  height: 144px;
  background: #1a1817;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.card-preview-logik-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: #ffffff;
}
.card-preview-logik-cell.sun  { background: #c8a455; color: #1a1817; }
.card-preview-logik-cell.moon { background: #1a1817; color: #fbfaf7; }
.card-preview-logik-cell svg { width: 60%; height: 60%; display: block; }

@media (max-width: 480px) {
  .card-preview-logik { width: 124px; height: 124px; }
}
