.lits-shell {
  --game-accent: var(--g-lits);
  /* Plain board: only the bold region lines show at first. */
  --lits-cell: #ffffff;
  --lits-grid: rgb(0 0 0 / 0.1);
  --lits-border: #2b2b2b;
  /* Shaded cells stay neutral until their region forms a piece, then take the piece colour. */
  --lits-fill: #5d6671;
  --lits-L: #f0a13a;
  --lits-I: #3b8ae0;
  --lits-T: #9a68d8;
  --lits-S: #36a868;
  --lits-mark: #3a3a3a;
}
:root[data-theme='dark'] .lits-shell {
  --lits-cell: #1a1a1a;
  --lits-grid: rgb(255 255 255 / 0.1);
  --lits-border: #e6e6e6;
  --lits-fill: #8a939e;
  --lits-L: #f2a847;
  --lits-I: #4b98ec;
  --lits-T: #a77ce2;
  --lits-S: #45b877;
  --lits-mark: #d8d8d8;
}
.lits-shell .shell-stage {
  gap: 20px;
  padding: 0 var(--space-4);
}
.lits-shell .shell-board-area {
  width: 100%;
}
.lits-shell .lits-board-wrap {
  width: min(560px, calc(100vw - 32px), calc(100dvh - 250px));
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.lits-shell .lits-board {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(var(--lits-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--lits-rows), minmax(0, 1fr));
  aspect-ratio: var(--lits-columns) / var(--lits-rows);
  /* The outer frame is a real border, so its corners stay square-joined with the inner region lines. */
  border: 3px solid var(--lits-border);
  border-radius: 6px;
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lits-shell .lits-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--lits-cell);
  color: var(--lits-mark);
  font: 700 clamp(14px, 5vw, 24px) / 1 var(--font-app);
  box-shadow: none;
  filter: none;
  cursor: pointer;
  touch-action: none;
}
.lits-shell .lits-cell:hover {
  filter: brightness(0.97);
}
.lits-shell .lits-cell:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 3px var(--text);
}
.lits-shell .lits-cell.shaded,
.lits-shell .lits-cell.shaded:hover {
  background: var(--lits-fill);
  color: #ffffff;
}
.lits-shell .lits-cell.shaded.shape-L {
  background: var(--lits-L);
}
.lits-shell .lits-cell.shaded.shape-I {
  background: var(--lits-I);
}
.lits-shell .lits-cell.shaded.shape-T {
  background: var(--lits-T);
}
.lits-shell .lits-cell.shaded.shape-S {
  background: var(--lits-S);
}
/* A clear cross: large and bold; crosses placed by assist mode are lighter. */
.lits-shell .lits-cell.empty {
  color: var(--lits-mark);
  font-size: clamp(18px, 7vw, 30px);
  font-weight: 800;
}
.lits-shell .lits-cell.empty.auto {
  color: color-mix(in srgb, var(--lits-mark) 40%, transparent);
  font-weight: 600;
}
.lits-shell .lits-cell.violation {
  box-shadow: inset 0 0 0 3px var(--danger);
}
.lits-shell .lits-cell.violation::after {
  content: none;
}
.lits-shell .lits-cell.hinted {
  box-shadow: inset 0 0 0 4px var(--hint-target);
}
.lits-shell .lits-lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  pointer-events: none;
}
.lits-shell .lits-grid-lines {
  stroke: var(--lits-grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.lits-shell .lits-region-lines {
  stroke: var(--lits-border);
  stroke-width: 3;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}
.lits-shell .lits-board.shake {
  animation: lits-shake 240ms ease-in-out;
}
@keyframes lits-shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
.lits-shell .lits-board.solved .lits-cell.shaded {
  animation: lits-solved 520ms ease-out both;
  animation-delay: calc(var(--i) * 40ms);
}
@keyframes lits-solved {
  40% {
    filter: brightness(1.35);
  }
}
.lits-shell .shell-input {
  min-height: 0;
  padding: 0;
}
.lits-shell .lits-modes {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--mambo-segment-bg);
}
.lits-shell .lits-modes button {
  display: grid;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.lits-shell .lits-modes button.selected {
  background: var(--segment-on);
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.2),
    inset 0 0 0 1.5px var(--game-accent);
}
.lits-shell .lits-mode-shade {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--lits-fill);
}
.lits-shell .lits-modes b {
  font-size: 22px;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  .lits-shell .lits-board.shake,
  .lits-shell .lits-board.solved .lits-cell.shaded {
    animation: none;
  }
}
