/* The core stabilizer: the lattice beside a side column (header, pieces with Rotate right under them, status,
   budget), or above it on upright screens. CorePuzzleUI.layout() sizes the cells and steps through the d1–d3
   densities at the end of this file until the whole panel fits on screen without scrolling. */
.vt-panel.panel-core {
  max-width: min(1200px, calc(100 * var(--vt-safe-vw) - 2 * clamp(4px, (100 * var(--vt-safe-vw) - 560px) * 0.05, 40px)));
  max-height: calc(100 * var(--vt-safe-vh) - 2 * clamp(4px, (100 * var(--vt-safe-vh) - 300px) * 0.06, 36px));
}

.vt-panel-body.core-panel {
  --side-w: 340px;
  display: grid;
  grid-template-columns: auto var(--side-w);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "lattice head" "lattice side";
  gap: 14px 22px;
  align-items: start;
  box-sizing: border-box;
  padding: 20px 22px;
}

.core-panel.stacked {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  grid-template-areas: "head" "lattice" "side";
}

/* Upright, the panel spans the screen so the pieces wrap onto as few rows as possible under the lattice. */
.vt-panel.panel-core:has(> .stacked) {
  width: 100%;
}

.core-head {
  grid-area: head;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-width: 0;
  /* Room for the close button in the corner. */
  padding-right: 44px;
}

.core-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.core-title .vt-badge {
  --badge: var(--vt-ember);
  flex: none;
}

.core-title .vt-tag {
  margin-bottom: 4px;
  color: var(--vt-ember);
}

.core-title h2 {
  white-space: nowrap;
}

.core-stats {
  display: flex;
  gap: 18px;
  white-space: nowrap;
}

.core-stat .vt-tag {
  font-size: 9.5px;
}

.core-timer,
.core-coverage {
  margin-top: 2px;
  font-family: var(--vt-font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.core-timer.critical {
  color: var(--vt-danger);
  text-shadow: 0 0 14px rgba(255, 74, 90, 0.7);
}

.core-coverage b {
  font-weight: 600;
  color: var(--vt-cyan);
}

.core-coverage small {
  font-size: 0.55em;
  color: var(--vt-muted);
}

.core-meter {
  flex: none;
}

/* --------------------------------------------------------------- Lattice */
.core-grid-wrap {
  --cell: 40px;
  --gap: 3px;
  --cut: 14px;
  --plate-line: rgba(120, 220, 255, 0.28);
  grid-area: lattice;
  align-self: center;
  justify-self: center;
  padding: 16px;
  /* Clipped for the rings, but not a scroll container, so its row can never shrink below the lattice. */
  overflow: clip;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--core, var(--vt-ember)) 22%, transparent), transparent 48%),
    radial-gradient(circle at 50% 50%, rgba(95, 246, 255, 0.05), rgba(5, 5, 20, 0.7) 72%);
}

/* Containment rings drawn behind the lattice. */
.core-grid-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc((var(--cell) + var(--gap)) * var(--lattice-span, 10.4));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(95, 246, 255, 0.16);
  box-shadow: 0 0 0 calc(var(--cell) * 0.5) rgba(95, 246, 255, 0.025);
  pointer-events: none;
}

.core-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--gap);
  grid-auto-rows: var(--cell);
  touch-action: none;
}

.core-grid .cell {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  border-radius: 3px;
  border: 1px solid rgba(95, 246, 255, 0.24);
  background:
    radial-gradient(circle, rgba(95, 246, 255, 0.34) 0 1.4px, transparent 2px),
    linear-gradient(145deg, rgba(95, 246, 255, 0.09), rgba(95, 246, 255, 0.03));
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}

.core-grid .cell:not(.void):not(.filled):hover {
  border-color: rgba(95, 246, 255, 0.6);
}

.core-grid .cell.void {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.core-grid .cell.void.anchor {
  background:
    radial-gradient(circle, rgba(170, 245, 255, 0.55) 0 9%, rgba(95, 246, 255, 0.18) 10% 24%, transparent 26%),
    radial-gradient(circle, rgba(95, 246, 255, 0.07) 0 46%, transparent 48%);
}

.core-grid .cell.filled {
  border-radius: 0;
  border-color: transparent;
}

.core-grid .cell.filled.t-metal {
  background: linear-gradient(145deg, #e2e7f3 0%, #b1bbd4 50%, #8f9ab7 100%);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.35), 0 0 10px rgba(195, 203, 224, 0.28);
}

.core-grid .cell.filled.t-water {
  background: linear-gradient(145deg, #9fd7ff 0%, #5cb2f3 50%, #3b88d4 100%);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 12px rgba(92, 184, 255, 0.42);
}

.core-grid .cell.filled.t-biomass {
  background: linear-gradient(145deg, #9cf8d8 0%, #4fe3b5 50%, #27a983 100%);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 12px rgba(79, 227, 181, 0.42);
}

.core-grid .cell.filled.t-synth {
  background: linear-gradient(145deg, #ddd3ff 0%, #b49bff 50%, #8466f2 100%);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.34), 0 0 12px rgba(180, 155, 255, 0.48);
}

/* Cells of one piece grow across the grid gap toward each other so the piece reads as one slab. */
.core-grid .cell.filled:not(.er) { margin-right: calc(-1 * var(--gap)); }
.core-grid .cell.filled:not(.eb) { margin-bottom: calc(-1 * var(--gap)); }

.core-grid .cell.filled.et { border-top: 2px solid rgba(255, 255, 255, 0.75); }
.core-grid .cell.filled.eb { border-bottom: 2px solid rgba(0, 0, 0, 0.32); }
.core-grid .cell.filled.el { border-left: 2px solid rgba(255, 255, 255, 0.45); }
.core-grid .cell.filled.er { border-right: 2px solid rgba(0, 0, 0, 0.26); }
.core-grid .cell.filled.et.el { border-top-left-radius: 4px; }
.core-grid .cell.filled.et.er { border-top-right-radius: 4px; }
.core-grid .cell.filled.eb.el { border-bottom-left-radius: 4px; }
.core-grid .cell.filled.eb.er { border-bottom-right-radius: 4px; }

.core-grid .cell.filled.removing {
  filter: brightness(1.1);
  box-shadow: inset 0 0 0 2px var(--vt-danger), 0 0 16px rgba(255, 74, 90, 0.65);
}

/* Cells no base piece can reach any more. */
.core-grid .cell.stranded {
  border-color: rgba(255, 138, 58, 0.8);
  background: repeating-linear-gradient(45deg, rgba(255, 138, 58, 0.34) 0 3px, rgba(255, 138, 58, 0.06) 3px 7px);
  animation: core-stranded 1.8s ease-in-out infinite;
}

@keyframes core-stranded {
  50% { border-color: rgba(255, 138, 58, 0.3); }
}

.core-grid .cell.hinted {
  border-color: #ffffff;
  background: color-mix(in srgb, var(--hint, var(--vt-cyan)) 38%, transparent);
  box-shadow: 0 0 14px var(--hint, var(--vt-cyan));
  animation: core-hint 1s ease-in-out infinite;
}

.core-grid .cell.filled.hint-remove {
  box-shadow: inset 0 0 0 2px var(--vt-warn), 0 0 16px rgba(255, 176, 58, 0.7);
  animation: core-hint 1s ease-in-out infinite;
}

@keyframes core-hint {
  50% { opacity: 0.55; }
}

.core-grid .cell.ghost-ok {
  background: var(--ghost);
  opacity: 0.65;
  border-color: #ffffff;
  box-shadow: 0 0 16px var(--ghost);
  transform: scale(0.94);
  animation: none;
}

.core-grid .cell.ghost-bad {
  background: rgba(255, 74, 90, 0.42);
  border-color: rgba(255, 74, 90, 0.9);
  animation: none;
}

.core-grid .cell.void.ghost-bad {
  background: rgba(255, 74, 90, 0.16);
  border: 1px dashed rgba(255, 74, 90, 0.6);
}

.core-grid .cell.filled.ghost-bad {
  filter: brightness(0.6) saturate(0.6);
  box-shadow: inset 0 0 0 2px var(--vt-danger);
}

@keyframes core-cell-pop {
  0% { transform: scale(0.55); filter: brightness(2.2); }
  60% { transform: scale(1.12); filter: brightness(1.4); }
  100% { transform: scale(1); filter: brightness(1); }
}

.core-grid .cell.pop {
  animation: core-cell-pop 0.42s ease-out;
}

/* The core itself, sitting in the lattice's central void. */
.core-nucleus {
  --core: var(--vt-ember);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: calc((var(--cell) + var(--gap)) * var(--nucleus-span, 3.9));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.core-nucleus::before {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #ffffff 0 5%, var(--core) 24%, color-mix(in srgb, var(--core) 35%, transparent) 52%, transparent 71%);
  animation: core-nucleus 4s ease-in-out infinite;
}

.core-nucleus::after {
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--core) 60%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--core) 40%, transparent), inset 0 0 22px color-mix(in srgb, var(--core) 30%, transparent);
  animation: core-spin 22s linear infinite;
}

.core-nucleus i {
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--core) 75%, transparent);
  border-top-color: transparent;
  border-bottom-color: transparent;
  animation: core-spin 5s linear infinite reverse;
}

.core-nucleus b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--vt-font-display);
  font-size: max(11px, calc(var(--cell) * 0.4));
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.85), 0 0 14px var(--core);
}

.core-nucleus.stable::before {
  inset: 14%;
}

/* A slow swell only: no change in brightness, so the core never flashes. */
@keyframes core-nucleus {
  0%, 100% { transform: scale(0.95); }
  50% { transform: scale(1.02); }
}

@keyframes core-spin {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------- Side column */
.core-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* The pieces, with Rotate and Hint directly beneath them. */
.core-tray {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.core-palette {
  /* --tile is the narrowest a tile may get; --box holds its piece drawing. */
  --tile: 100px;
  --box: 42px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
  gap: 6px;
}

.piece-card {
  --cut: 7px;
  --plate-line: rgba(120, 220, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 6px 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  color: var(--vt-text);
  font-family: var(--vt-font-body);
  text-align: center;
  cursor: grab;
  touch-action: none;
  transition: background 0.15s ease;
}

.piece-card.synth {
  --plate-line: rgba(180, 155, 255, 0.3);
}

.piece-card:hover {
  --plate-line: var(--vt-line-strong);
  background: linear-gradient(180deg, rgba(95, 246, 255, 0.1), rgba(255, 255, 255, 0.02));
}

.piece-card.selected {
  --plate-line: var(--shape-color);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--shape-color) 30%, transparent), transparent 72%),
    rgba(255, 255, 255, 0.03);
}

.piece-card.selected::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--shape-color);
  box-shadow: 0 0 10px var(--shape-color);
}

.piece-card.poor {
  opacity: 0.5;
}

.piece-shape {
  /* Cells shrink so the longest piece still fits the box. */
  --pc: min(12px, calc((var(--box) - (var(--n) - 1) * 2px) / var(--n)));
  display: grid;
  gap: 2px;
  align-content: center;
  justify-content: center;
  height: var(--box);
}

.piece-shape i {
  width: var(--pc);
  height: var(--pc);
  border-radius: 2px;
}

.piece-shape i.on {
  background: linear-gradient(145deg, color-mix(in srgb, var(--shape-color) 55%, #ffffff), var(--shape-color));
  box-shadow: 0 0 6px color-mix(in srgb, var(--shape-color) 60%, transparent);
}

.piece-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--vt-font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.piece-cost,
.piece-supply {
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  white-space: nowrap;
}

.piece-cost {
  font-size: 11px;
  color: var(--vt-muted);
}

.piece-cost .vt-icon {
  width: 12px;
  height: 12px;
  color: var(--shape-color);
}

.piece-supply {
  font-size: 10px;
  color: var(--vt-dim);
}

.piece-supply .vt-icon {
  width: 10px;
  height: 10px;
  color: var(--shape-color);
  opacity: 0.75;
}

.piece-supply.dry,
.piece-supply.dry .vt-icon {
  color: var(--vt-warn);
  opacity: 1;
}

.piece-count {
  position: absolute;
  top: 5px;
  right: 7px;
  font-family: var(--vt-font-display);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.piece-card.poor .piece-count {
  color: var(--vt-danger);
}

.piece-card kbd {
  position: absolute;
  top: 5px;
  left: 10px;
  font-size: 9px;
}

/* Marks the chosen piece: tapping it again turns it. */
.piece-turn {
  position: absolute;
  right: 9px;
  bottom: 6px;
  display: grid;
  color: var(--shape-color);
}

.piece-turn .vt-icon {
  width: 13px;
  height: 13px;
}

.core-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 6px;
}

.core-tools .vt-btn {
  min-height: 46px;
  padding: 8px 10px;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
}

.core-tools .vt-btn .vt-icon {
  flex: none;
  width: 18px;
  height: 18px;
}

.core-tools .vt-btn kbd {
  font-size: 9px;
}

.core-rotate {
  --plate-line: rgba(125, 232, 255, 0.85);
  background: linear-gradient(180deg, rgba(95, 246, 255, 0.32), rgba(95, 246, 255, 0.1));
  color: #ffffff;
}

.core-rotate .vt-icon {
  color: var(--vt-cyan);
}

.core-tools .vt-btn.core-rotate .vt-icon {
  width: 22px;
  height: 22px;
}

/* A fixed number of lines, so a longer message never pushes the column past the screen. */
.core-status {
  --lines: 3;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  height: calc(var(--lines) * 1.4em);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  color: var(--vt-muted);
}

.core-status span {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--lines);
}

.core-status .vt-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.core-status.ok { color: var(--vt-ok); }
.core-status.bad { color: var(--vt-danger); }
.core-status.warn { color: var(--vt-warn); }
.core-status.hint { color: var(--vt-cyan); }

.core-help {
  font-size: 12px;
  line-height: 1.5;
  color: var(--vt-dim);
}

/* ---------------------------------------------------------- Lattice budget */
.core-budget {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.cb-verdict {
  --tone: var(--vt-ok);
  flex: none;
  padding: 2px 7px;
  font-family: var(--vt-font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.cb-verdict.warn { --tone: var(--vt-warn); }
.cb-verdict.bad { --tone: var(--vt-danger); }

.cb-supply {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  font-size: 11px;
  color: var(--vt-dim);
  white-space: nowrap;
}

.cb-supply b {
  margin-right: 6px;
  font-family: var(--vt-font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--vt-text);
}

.cb-supply b:last-child {
  margin-right: 0;
}

.cb-supply .vt-icon,
.cb-cost .vt-icon {
  width: 12px;
  height: 12px;
}

.cb-supply .vt-icon:first-child,
.cb-cost span:first-child:not(:last-child) .vt-icon { color: var(--vt-metal); }
.cb-supply b + .vt-icon,
.cb-cost span:last-child .vt-icon { color: var(--vt-water); }

.cb-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.cb-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 6px;
  font-size: 12px;
  color: var(--vt-dim);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.08);
}

.cb-opt.ok {
  color: var(--vt-text);
  background: linear-gradient(90deg, rgba(61, 255, 197, 0.1), rgba(61, 255, 197, 0.02));
  box-shadow: inset 2px 0 0 var(--vt-ok);
}

.cb-mark {
  display: grid;
}

.cb-mark .vt-icon {
  width: 13px;
  height: 13px;
}

.cb-opt.ok .cb-mark { color: var(--vt-ok); }
.cb-opt:not(.ok) .cb-mark { color: var(--vt-danger); opacity: 0.7; }

.cb-mix {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 9px;
  min-width: 0;
}

/* One count per piece, marked with the piece's colour. */
.cb-n {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.cb-n i {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--c);
  box-shadow: 0 0 5px color-mix(in srgb, var(--c) 60%, transparent);
}

.cb-n b {
  font-family: var(--vt-font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cb-n em {
  font-style: normal;
}

.cb-cost {
  display: flex;
  gap: 8px;
  font-family: var(--vt-font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cb-cost .vt-icon {
  margin-right: 2px;
}

.cb-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--vt-dim);
}

.cb-note.guided {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: #9fe8d0;
}

.cb-note.guided .vt-icon {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--vt-teal);
}

/* ------------------------------------------------------------ Drag, solved */
.core-drag {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 0 12px rgba(95, 246, 255, 0.6));
}

.core-drag.over-grid {
  opacity: 0.3;
}

.core-solved {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(12, 70, 58, 0.8), rgba(3, 18, 22, 0.88));
  animation: core-solved-in 0.6s ease-out;
}

.core-solved.vt-hidden {
  display: none;
}

.core-solved .solved-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.core-solved .vt-badge {
  --badge: var(--vt-ok);
}

.core-solved .solved-title {
  font-family: var(--vt-font-display);
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--vt-ok);
  text-shadow: 0 0 24px var(--vt-ok);
}

.core-solved .vt-tag {
  color: #bfffee;
}

@keyframes core-solved-in {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------- Densities */
/* d1: no help text, planet supply or budget explanations; tighter spacing. */
.core-panel.d1 {
  gap: 10px 16px;
  padding: 14px 16px;
}

.core-panel.d1 .core-help,
.core-panel.d1 .piece-supply,
.core-panel.d1 .cb-note:not(.guided),
.core-panel.d1 .core-title .vt-badge,
.core-panel.d1 .core-title .vt-tag {
  display: none;
}

.core-panel.d1 .core-title h2 { font-size: 18px; }
.core-panel.d1 .core-timer,
.core-panel.d1 .core-coverage { font-size: 20px; }
.core-panel.d1 .core-grid-wrap { --cut: 10px; padding: 8px; }
.core-panel.d1 .core-side { gap: 8px; }
.core-panel.d1 .core-palette { --tile: 84px; --box: 36px; }
.core-panel.d1 .cb-n em { display: none; }

/* d2: tiles keep their shape, name and count; the budget drops its costs and pairs up its mixes. */
.core-panel.d2 {
  gap: 8px 12px;
  padding: 10px 12px;
}

.core-panel.d2 .core-meter,
.core-panel.d2 .piece-cost,
.core-panel.d2 .cb-cost,
.core-panel.d2 .core-stat .vt-tag,
.core-panel.d2 .cb-more {
  display: none;
}

.core-panel.d2 .vt-close { top: 8px; right: 8px; width: 30px; height: 30px; }
.core-panel.d2 .core-head { gap: 4px 12px; padding-right: 34px; }
.core-panel.d2 .core-title h2 { font-size: 15px; }
.core-panel.d2 .core-stats { gap: 12px; }
.core-panel.d2 .core-timer,
.core-panel.d2 .core-coverage { margin-top: 0; font-size: 17px; }
.core-panel.d2 .core-grid-wrap { --cut: 8px; padding: 4px; }
.core-panel.d2 .core-side { gap: 6px; }
.core-panel.d2 .core-tray { gap: 5px; }
.core-panel.d2 .core-palette { --tile: 70px; --box: 30px; gap: 5px; }
/* Small tiles set the count beside the drawing, with the turn mark under it, so neither covers the piece. */
.core-panel.d2 .piece-card {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "shape count" "shape turn" "name name";
  justify-content: center;
  align-items: center;
  gap: 1px 7px;
  padding: 6px 5px 5px;
}
.core-panel.d2 .piece-shape { grid-area: shape; }
.core-panel.d2 .piece-count { grid-area: count; position: static; align-self: end; font-size: 12px; }
.core-panel.d2 .piece-turn { grid-area: turn; position: static; align-self: start; }
.core-panel.d2 .piece-name { grid-area: name; justify-self: center; font-size: 10.5px; }
.core-panel.d2 .core-tools .vt-btn { min-height: 42px; }
.core-panel.d2 .core-status { --lines: 2; font-size: 12px; }
.core-panel.d2 .core-budget { gap: 4px; }
.core-panel.d2 .cb-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.core-panel.d2 .cb-opt { gap: 5px; padding: 3px 6px 3px 5px; font-size: 11px; }
.core-panel.d2 .cb-note.guided { font-size: 10.5px; }

/* d3, the shortest screens: tiles show their shape and count, the status one line, the header the clock. */
.core-panel.d3 .core-title,
.core-panel.d3 .piece-name,
.core-panel.d3 .cb-note {
  display: none;
}

.core-panel.d3 .core-palette { --tile: 54px; --box: 28px; }
.core-panel.d3 .core-status { --lines: 1; }
