/* Isolated CNVCS white/brown board trial. Grain is original CSS, not copied art. */
.studio {
  --board-light: #e5d5b2;
  --board-dark: #a96d40;
}

.studio .lab-board-frame {
  background: #6a3f24;
  border-color: #4b2918;
}

.studio .lab-board-wrap {
  background-color: #6b3b1f;
  background-image:
    repeating-linear-gradient(91deg, transparent 0 7px, #ffffff06 8px 9px, transparent 10px 19px, #1509000b 20px 21px),
    linear-gradient(90deg, #5a311b, #774623 42%, #5d321d);
}

.studio .position-lab-board {
  box-shadow: 0 0 0 2px #e4d1a2, 0 0 0 3px #4f2a18;
}

.studio .lab-square.light {
  --board-square-color: var(--board-light);
  --board-square-grain: repeating-linear-gradient(94deg, transparent 0 9px, #ffffff0d 10px 12px, transparent 13px 21px, #79563608 22px 23px);
  background-color: var(--board-square-color);
  background-image: var(--board-square-grain);
}

.studio .lab-square.dark {
  --board-square-color: var(--board-dark);
  --board-square-grain: repeating-linear-gradient(93deg, transparent 0 8px, #f3c8910b 9px 10px, transparent 11px 18px, #3a1a0d0d 19px 20px);
  background-color: var(--board-square-color);
  background-image: var(--board-square-grain);
}

/* Shared whole-cell fill and optional inset frame. Selected/premove priority
   remains above the independently persisted last-move Appearance choices. */
:root{--last-move-frame-color:rgba(69,65,63,.60);--last-move-fill:rgba(168,175,170,.32);--last-move-layer:linear-gradient(var(--last-move-fill),var(--last-move-fill));--last-move-shadow:none}
.studio .lab-square:is(.is-from,.is-to):is(.light,.dark):not(.is-selected,.is-premove) {
  background-color: var(--board-square-color) !important;
  background-image: var(--last-move-layer), var(--board-square-grain) !important;
  box-shadow: var(--last-move-shadow) !important;
}

/* Soft translucent light-cell emphasis uses the same palette and preserves
   the native alternating field colors and grain underneath. */
.studio .lab-square:is(.is-from,.is-to).light:not(.is-selected,.is-premove) {
  background-image: var(--last-move-light-layer,var(--last-move-layer)), var(--board-square-grain) !important;
}

/* Selected retains its accepted contour and the underlying approved square,
   rather than inheriting older lastmove fills through the cascade. */
.studio .lab-square:is(.is-from,.is-to).is-selected.light:not(.is-premove) {background-color:var(--board-square-color)!important;background-image:var(--board-square-grain)!important}
.studio .lab-square:is(.is-from,.is-to).is-selected.dark:not(.is-premove) {background-color:var(--board-square-color)!important;background-image:var(--board-square-grain)!important}

.studio .lab-square:is(.light,.dark).is-selected {
  box-shadow: inset 0 0 0 3px #694125 !important;
}

.studio .lab-square:is(.light,.dark).is-premove {
  background: #b89c77 !important;
  box-shadow: inset 0 0 0 4px #6d4b31 !important;
}

.studio {
  --spark-field-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none'%3E%3Cpath d='M8 30V8h22M70 8h22v22M92 70v22H70M30 92H8V70' stroke='%23F2D2A6' stroke-width='5'/%3E%3C/svg%3E");
  --spark-field-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none'%3E%3Cpath d='M8 30V8h22M70 8h22v22M92 70v22H70M30 92H8V70' stroke='%23704727' stroke-width='5'/%3E%3C/svg%3E");
  --spark-field-key: var(--spark-field-dark);
}
