.t8-page {
  --t8-bg: #06090d;
  --t8-panel: #121923;
  --t8-line: #252d38;
  --t8-text: #f4f7fb;
  --t8-muted: #96a1b1;
  --t8-lime: #b7ff24;
  --t8-shadow: rgba(0, 0, 0, 0.38);
  --t8-accent: #b7ff24;
  --t8-accent-border: rgba(183, 255, 36, 0.22);
  --t8-accent-soft: rgba(183, 255, 36, 0.16);
  --t8-accent-hover: rgba(183, 255, 36, 0.6);
  --t8-accent-clear: rgba(183, 255, 36, 0.86);
  --t8-accent-glow: rgba(183, 255, 36, 0.44);
  --t8-cell-bg: rgba(10, 15, 24, 0.88);
  --t8-board-inner-bg: rgba(3, 6, 9, 0.88);
  --t8-cell-border: rgba(255, 255, 255, 0.06);
  --t8-block-highlight: rgba(255, 255, 255, 0.2);
  --t8-block-shadow: rgba(0, 0, 0, 0.15);

  position: relative;
  z-index: 1;
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 52px) clamp(24px, 4vw, 52px);
}

.t8-page[data-t8-accent="blue"] {
  --t8-accent: #5c8dff;
  --t8-accent-border: rgba(92, 141, 255, 0.32);
  --t8-accent-soft: rgba(92, 141, 255, 0.16);
  --t8-accent-hover: rgba(92, 141, 255, 0.62);
  --t8-accent-clear: rgba(92, 141, 255, 0.86);
  --t8-accent-glow: rgba(92, 141, 255, 0.44);
  --t8-lime: #5c8dff;
}

.t8-page[data-t8-accent="orange"] {
  --t8-accent: #ff9f1a;
  --t8-accent-border: rgba(255, 159, 26, 0.32);
  --t8-accent-soft: rgba(255, 159, 26, 0.16);
  --t8-accent-hover: rgba(255, 159, 26, 0.62);
  --t8-accent-clear: rgba(255, 159, 26, 0.86);
  --t8-accent-glow: rgba(255, 159, 26, 0.44);
  --t8-lime: #ff9f1a;
}

.t8-page[data-t8-accent="purple"] {
  --t8-accent: #c77dff;
  --t8-accent-border: rgba(199, 125, 255, 0.32);
  --t8-accent-soft: rgba(199, 125, 255, 0.16);
  --t8-accent-hover: rgba(199, 125, 255, 0.62);
  --t8-accent-clear: rgba(199, 125, 255, 0.86);
  --t8-accent-glow: rgba(199, 125, 255, 0.44);
  --t8-lime: #c77dff;
}

.t8-page[data-t8-accent="pink"] {
  --t8-accent: #ff4d9d;
  --t8-accent-border: rgba(255, 77, 157, 0.32);
  --t8-accent-soft: rgba(255, 77, 157, 0.16);
  --t8-accent-hover: rgba(255, 77, 157, 0.62);
  --t8-accent-clear: rgba(255, 77, 157, 0.86);
  --t8-accent-glow: rgba(255, 77, 157, 0.44);
  --t8-lime: #ff4d9d;
}

.t8-board-shell[data-t8-bg="light"],
.t8-page[data-t8-bg="light"] .t8-board-shell {
  --t8-cell-bg: rgba(238, 242, 248, 0.96);
  --t8-board-inner-bg: rgba(228, 233, 242, 0.96);
  --t8-cell-border: rgba(15, 23, 42, 0.08);
  --t8-block-highlight: rgba(255, 255, 255, 0.55);
  --t8-block-shadow: rgba(15, 23, 42, 0.12);
}

.t8-board-shell[data-t8-bg="classic"],
.t8-page[data-t8-bg="classic"] .t8-board-shell {
  --t8-cell-bg: rgba(24, 24, 32, 0.92);
  --t8-board-inner-bg: rgba(16, 16, 24, 0.94);
  --t8-cell-border: rgba(255, 255, 255, 0.05);
}

.t8-board-shell[data-t8-accent="blue"] {
  --t8-accent-border: rgba(92, 141, 255, 0.32);
  --t8-accent-soft: rgba(92, 141, 255, 0.16);
  --t8-accent-hover: rgba(92, 141, 255, 0.62);
  --t8-accent-clear: rgba(92, 141, 255, 0.86);
  --t8-accent-glow: rgba(92, 141, 255, 0.44);
}

.t8-board-shell[data-t8-accent="orange"] {
  --t8-accent-border: rgba(255, 159, 26, 0.32);
  --t8-accent-soft: rgba(255, 159, 26, 0.16);
  --t8-accent-hover: rgba(255, 159, 26, 0.62);
  --t8-accent-clear: rgba(255, 159, 26, 0.86);
  --t8-accent-glow: rgba(255, 159, 26, 0.44);
}

.t8-board-shell[data-t8-accent="purple"] {
  --t8-accent-border: rgba(199, 125, 255, 0.32);
  --t8-accent-soft: rgba(199, 125, 255, 0.16);
  --t8-accent-hover: rgba(199, 125, 255, 0.62);
  --t8-accent-clear: rgba(199, 125, 255, 0.86);
  --t8-accent-glow: rgba(199, 125, 255, 0.44);
}

.t8-board-shell[data-t8-accent="pink"] {
  --t8-accent-border: rgba(255, 77, 157, 0.32);
  --t8-accent-soft: rgba(255, 77, 157, 0.16);
  --t8-accent-hover: rgba(255, 77, 157, 0.62);
  --t8-accent-clear: rgba(255, 77, 157, 0.86);
  --t8-accent-glow: rgba(255, 77, 157, 0.44);
}

.t8-main {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(360px, 560px) minmax(240px, 320px);
  justify-content: center;
  align-items: start;
  gap: clamp(18px, 2vw, 36px);
}

.t8-panel,
.t8-board-shell {
  border: 2px solid var(--t8-line);
  background: rgba(18, 25, 35, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.t8-panel {
  min-width: 0;
  border-radius: 28px;
  padding: clamp(18px, 2vw, 26px);
}

.t8-label {
  color: var(--t8-muted);
  font-size: clamp(15px, 1.3vw, 20px);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.t8-pieces {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.t8-piece-slot {
  min-height: 130px;
  border: 2px solid transparent;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: grab;
  touch-action: none;
  transition: opacity 160ms ease;
}

.t8-piece-slot:active {
  cursor: grabbing;
}

.t8-piece-slot--empty {
  cursor: default;
  opacity: 0.32;
}

.t8-piece {
  --block: 30px;
  display: grid;
  gap: 5px;
  pointer-events: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
  transition: transform 150ms ease;
}

.t8-piece:active,
.t8-piece-slot:has(.t8-piece--selected) {
  border-color: var(--t8-accent-border);
  background: var(--t8-accent-soft);
}

.t8-piece--selected {
  transform: scale(1.06);
}

.t8-mini-cell {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: var(--piece-color);
  box-shadow:
    inset 0 2px 0 var(--t8-block-highlight),
    inset 0 -3px 0 var(--t8-block-shadow),
    0 0 18px color-mix(in srgb, var(--piece-color), transparent 72%);
}

.t8-mini-cell {
  width: var(--block);
  height: var(--block);
}

.t8-mini-cell--blank {
  opacity: 0;
  box-shadow: none;
  border-color: transparent;
}

.t8-board-zone {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 18px;
  min-width: 0;
}

.t8-board-shell {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: clamp(10px, 1.5vw, 18px);
  border-radius: 28px;
  overflow: hidden;
  background: var(--t8-board-inner-bg);
  border-color: var(--t8-accent-border);
}

.t8-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: clamp(4px, 0.75vw, 8px);
  aspect-ratio: 1;
}

.t8-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--t8-cell-border);
  border-radius: clamp(6px, 0.8vw, 10px);
  background: var(--t8-cell-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.018);
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease, opacity 220ms ease;
}

.t8-cell.t8-cell--placed {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: clamp(6px, 0.8vw, 10px);
  background: var(--piece-color);
  box-shadow:
    inset 0 2px 0 var(--t8-block-highlight),
    inset 0 -3px 0 var(--t8-block-shadow),
    0 0 18px color-mix(in srgb, var(--piece-color), transparent 72%);
}

.t8-cell--hover-ok {
  border-color: var(--t8-accent-hover);
  background: var(--t8-accent-soft);
}

.t8-cell--hover-bad {
  border-color: rgba(255, 89, 77, 0.62);
  background: rgba(255, 89, 77, 0.14);
}

.t8-cell--clear {
  z-index: 1;
  animation: t8ClearPop 520ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
  border-color: var(--t8-accent-clear);
}

.t8-board-shell[data-t8-style="flat"] .t8-cell--placed,
.t8-page[data-t8-style="flat"] .t8-mini-cell,
.t8-page[data-t8-style="flat"] .t8-cell--placed {
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.t8-board-shell[data-t8-style="outline"] .t8-cell--placed,
.t8-page[data-t8-style="outline"] .t8-mini-cell,
.t8-page[data-t8-style="outline"] .t8-cell--placed {
  background: color-mix(in srgb, var(--piece-color), transparent 72%);
  border: 2px solid var(--piece-color);
  box-shadow: none;
}

.t8-board-shell--lost {
  animation: t8LoseShake 620ms ease both;
  border-color: rgba(255, 89, 77, 0.58);
}

.t8-status {
  min-height: 28px;
  color: var(--t8-muted);
  text-align: center;
  font-size: clamp(15px, 1.3vw, 20px);
  font-weight: 650;
}

.t8-status strong {
  color: var(--t8-lime);
}

.t8-stats {
  display: grid;
  gap: 12px;
}

.t8-stat-row {
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(6, 12, 20, 0.82);
}

.t8-stat-row span {
  color: var(--t8-muted);
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 650;
}

.t8-stat-row strong {
  color: var(--t8-lime);
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1;
  font-weight: 1000;
}

.t8-controls {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--t8-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--t8-text);
  font: inherit;
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tool-btn:hover {
  border-color: var(--t8-accent-border);
  background: rgba(255, 255, 255, 0.06);
}

.tool-btn__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.t8-drag-copy {
  --block: 44px;
  position: fixed;
  z-index: 20;
  pointer-events: none;
  filter:
    drop-shadow(0 22px 34px rgba(0, 0, 0, 0.56))
    drop-shadow(0 0 22px color-mix(in srgb, var(--piece-color), transparent 44%));
  opacity: 0.98;
}

.t8-hidden-source {
  opacity: 0.34;
}

.t8-sidebar-stack {
  display: grid;
  gap: 18px;
}

.t8-sidebar-stack .leaderboard {
  margin-top: 4px;
}

.t8-sidebar-stack .leaderboard-list {
  max-height: 220px;
}

@keyframes t8ClearPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  32% {
    transform: scale(1.08);
    opacity: 1;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.34),
      inset 0 -3px 0 rgba(0, 0, 0, 0.18),
      0 0 34px var(--t8-accent-glow);
  }

  72% {
    transform: scale(0.22) rotate(8deg);
    opacity: 0.18;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes t8LoseShake {
  0%,
  100% {
    transform: translateX(0);
  }

  18% {
    transform: translateX(-10px) rotate(-1deg);
  }

  36% {
    transform: translateX(9px) rotate(1deg);
  }

  54% {
    transform: translateX(-7px) rotate(-0.7deg);
  }

  72% {
    transform: translateX(5px) rotate(0.5deg);
  }
}

@media (max-width: 1100px) {
  .t8-main {
    grid-template-columns: minmax(280px, 620px);
  }

  .t8-panel {
    width: min(620px, 100%);
    justify-self: center;
  }

  .t8-pieces {
    grid-template-columns: repeat(3, 1fr);
  }

  .t8-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .t8-page {
    padding-inline: 16px;
  }

  .t8-main {
    grid-template-columns: 1fr;
    max-width: min(560px, 100%);
    margin: 0 auto;
  }

  .t8-board-zone {
    order: 0;
  }

  .t8-main > .t8-panel:first-child {
    order: 1;
  }

  .t8-sidebar-stack {
    order: 2;
  }

  .t8-pieces {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .t8-piece-slot {
    min-height: 96px;
    touch-action: manipulation;
  }

  .t8-piece {
    --block: clamp(18px, 5vw, 24px);
  }

  .t8-board-shell {
    width: min(100%, calc(100vw - 32px));
  }

  .t8-status {
    font-size: 0.88rem;
    padding-inline: 8px;
  }
}

@media (max-width: 700px) {
  .t8-pieces,
  .t8-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .t8-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .t8-piece {
    --block: clamp(16px, 4.5vw, 22px);
  }

  .t8-board-shell {
    border-radius: 22px;
  }

  .t8-sidebar-stack .leaderboard-list {
    max-height: none;
  }
}

@media (max-width: 420px) {
  .t8-piece-slot {
    min-height: 82px;
  }

  .t8-piece {
    --block: 16px;
  }
}

#tetris-8x8-settings-modal {
  z-index: 10100;
}

.t8-board-shell[data-t8-model="electronika"],
.t8-page[data-t8-model="electronika"] .t8-board-shell {
  --t8-cell-bg: rgba(8, 18, 6, 0.96);
  --t8-board-inner-bg: rgba(6, 12, 4, 0.98);
  --t8-cell-border: rgba(110, 240, 110, 0.14);
  --t8-accent: #7ef07e;
  --t8-accent-clear: rgba(126, 240, 126, 0.86);
  --t8-accent-glow: rgba(126, 240, 126, 0.44);
  --t8-block-highlight: rgba(180, 255, 160, 0.22);
  --t8-block-shadow: rgba(0, 0, 0, 0.35);
}

.t8-board-shell[data-t8-model="electronika"] .t8-cell,
.t8-page[data-t8-model="electronika"] .t8-cell,
.t8-page[data-t8-model="electronika"] .t8-mini-cell {
  border-radius: 2px;
}

.t8-board-shell[data-t8-model="electronika"] .t8-cell--placed,
.t8-page[data-t8-model="electronika"] .t8-cell--placed {
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(8, 20, 6, 0.45);
}

.t8-board-shell[data-t8-model="electronika"] {
  position: relative;
}

.t8-board-shell[data-t8-model="electronika"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.12) 0,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.35;
}

.t8-board-shell[data-t8-model="famicom"],
.t8-page[data-t8-model="famicom"] .t8-board-shell {
  --t8-cell-bg: rgba(26, 16, 40, 0.92);
  --t8-board-inner-bg: rgba(20, 12, 32, 0.96);
  --t8-cell-border: rgba(188, 124, 252, 0.12);
  --t8-block-highlight: rgba(255, 255, 255, 0.34);
  --t8-block-shadow: rgba(0, 0, 0, 0.22);
}

.t8-board-shell[data-t8-model="famicom"] .t8-cell--placed,
.t8-page[data-t8-model="famicom"] .t8-cell--placed,
.t8-page[data-t8-model="famicom"] .t8-mini-cell {
  border-radius: clamp(8px, 1vw, 12px);
}

.t8-board-shell[data-t8-model="orbita"],
.t8-page[data-t8-model="orbita"] .t8-board-shell {
  --t8-cell-bg: rgba(6, 10, 18, 0.96);
  --t8-board-inner-bg: radial-gradient(circle at 18% 12%, rgba(92, 141, 255, 0.12), transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(32, 242, 242, 0.06), transparent 42%),
    #060810;
  --t8-cell-border: rgba(92, 141, 255, 0.16);
  --t8-accent: #5c8dff;
  --t8-accent-clear: rgba(92, 141, 255, 0.86);
  --t8-accent-glow: rgba(92, 141, 255, 0.44);
  --t8-block-highlight: rgba(77, 171, 247, 0.35);
  --t8-block-shadow: rgba(61, 79, 106, 0.55);
}

.t8-board-shell[data-t8-model="orbita"]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 44% 24%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 58% 74%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 72% 36%, rgba(255, 255, 255, 0.42), transparent),
    radial-gradient(1.5px 1.5px at 86% 58%, rgba(255, 255, 255, 0.38), transparent),
    radial-gradient(1px 1px at 22% 84%, rgba(255, 255, 255, 0.32), transparent),
    radial-gradient(1px 1px at 92% 14%, rgba(255, 255, 255, 0.4), transparent);
  opacity: 0.85;
}

.t8-board-shell[data-t8-model="orbita"] .t8-cell--placed,
.t8-page[data-t8-model="orbita"] .t8-cell--placed,
.t8-page[data-t8-model="orbita"] .t8-mini-cell {
  border-radius: 4px;
  border: 1px solid rgba(61, 79, 106, 0.75);
  background:
    linear-gradient(180deg, rgba(77, 171, 247, 0.38) 0%, transparent 18%),
    var(--piece-color);
  box-shadow:
    inset 0 0 0 1px rgba(92, 141, 255, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.22),
    0 0 16px color-mix(in srgb, var(--piece-color), transparent 68%);
}

.t8-board-shell[data-t8-model="orbita"] .t8-cell--placed::after,
.t8-page[data-t8-model="orbita"] .t8-cell--placed::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.48);
  pointer-events: none;
}

.t8-board-shell[data-t8-model="bezdna"],
.t8-page[data-t8-model="bezdna"] .t8-board-shell {
  --t8-cell-bg: rgba(4, 16, 32, 0.96);
  --t8-board-inner-bg: radial-gradient(circle at 50% 100%, rgba(32, 242, 242, 0.1), transparent 55%),
    #041020;
  --t8-cell-border: rgba(32, 242, 242, 0.12);
  --t8-accent: #20f2f2;
  --t8-accent-clear: rgba(32, 242, 242, 0.92);
  --t8-accent-glow: rgba(32, 242, 242, 0.58);
  --t8-block-highlight: rgba(123, 220, 181, 0.38);
  --t8-block-shadow: rgba(13, 40, 64, 0.55);
}

.t8-board-shell[data-t8-model="bezdna"]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(2px 2px at 16% 72%, rgba(123, 220, 181, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 34% 48%, rgba(72, 202, 228, 0.3), transparent),
    radial-gradient(2px 2px at 52% 82%, rgba(255, 212, 59, 0.28), transparent),
    radial-gradient(1.5px 1.5px at 68% 36%, rgba(123, 220, 181, 0.32), transparent),
    radial-gradient(2px 2px at 84% 64%, rgba(72, 202, 228, 0.28), transparent);
  opacity: 0.75;
}

.t8-board-shell[data-t8-model="bezdna"] .t8-cell--placed,
.t8-page[data-t8-model="bezdna"] .t8-cell--placed,
.t8-page[data-t8-model="bezdna"] .t8-mini-cell {
  border-radius: clamp(7px, 0.9vw, 11px);
  box-shadow:
    inset 0 2px 0 var(--t8-block-highlight),
    inset 0 -3px 0 var(--t8-block-shadow),
    0 0 22px color-mix(in srgb, var(--piece-color), transparent 58%);
}

.t8-board-shell[data-t8-model="bezdna"] .t8-cell--clear,
.t8-page[data-t8-model="bezdna"] .t8-cell--clear {
  animation: t8BezdnaClearPop 520ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

@keyframes t8BezdnaClearPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  32% {
    transform: scale(1.1);
    opacity: 1;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.42),
      inset 0 -3px 0 rgba(0, 0, 0, 0.18),
      0 0 48px rgba(32, 242, 242, 0.75),
      0 0 18px rgba(123, 220, 181, 0.55);
  }

  72% {
    transform: scale(0.22) rotate(8deg);
    opacity: 0.18;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

.t8-board-shell[data-t8-model="arcade"],
.t8-page[data-t8-model="arcade"] .t8-board-shell {
  --t8-cell-bg: rgba(24, 16, 8, 0.94);
  --t8-board-inner-bg:
    radial-gradient(ellipse at 50% 18%, rgba(126, 240, 126, 0.16) 0%, transparent 52%),
    linear-gradient(180deg, #2a2010 0%, #181008 52%, #080404 100%);
  --t8-cell-border: rgba(126, 240, 126, 0.18);
  --t8-accent: #7ef07e;
  --t8-accent-clear: rgba(126, 240, 126, 0.92);
  --t8-accent-glow: rgba(126, 240, 126, 0.52);
  --t8-block-highlight: rgba(255, 255, 255, 0.55);
  --t8-block-shadow: rgba(18, 8, 24, 0.65);
  border-color: rgba(126, 240, 126, 0.34);
  box-shadow:
    inset 0 0 72px rgba(126, 240, 126, 0.05),
    0 0 36px rgba(126, 240, 126, 0.14),
    0 24px 80px rgba(0, 0, 0, 0.38);
}

.t8-board-shell[data-t8-model="arcade"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.55;
}

.t8-board-shell[data-t8-model="arcade"] .t8-cell--placed,
.t8-page[data-t8-model="arcade"] .t8-cell--placed,
.t8-page[data-t8-model="arcade"] .t8-mini-cell {
  border-radius: 3px;
  border: 2px solid #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, transparent 22%),
    var(--piece-color);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 12px color-mix(in srgb, var(--piece-color), transparent 62%);
}

.t8-board-shell[data-t8-model="arcade"] .t8-cell--clear,
.t8-page[data-t8-model="arcade"] .t8-cell--clear {
  animation: t8ArcadeClearPop 520ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

@keyframes t8ArcadeClearPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  32% {
    transform: scale(1.08);
    opacity: 1;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.42),
      0 0 40px rgba(126, 240, 126, 0.72),
      0 0 16px rgba(255, 255, 255, 0.35);
  }

  72% {
    transform: scale(0.22) rotate(8deg);
    opacity: 0.18;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

.t8-board-shell[data-t8-model="crystal"],
.t8-page[data-t8-model="crystal"] .t8-board-shell {
  --t8-cell-bg: rgba(12, 8, 40, 0.94);
  --t8-board-inner-bg:
    radial-gradient(ellipse at 50% 0%, rgba(199, 125, 255, 0.22) 0%, transparent 46%),
    radial-gradient(ellipse at 82% 92%, rgba(77, 171, 247, 0.12) 0%, transparent 42%),
    linear-gradient(155deg, #16082e 0%, #08061a 48%, #040210 100%);
  --t8-cell-border: rgba(157, 78, 221, 0.18);
  --t8-accent: #c77dff;
  --t8-accent-clear: rgba(199, 125, 255, 0.92);
  --t8-accent-glow: rgba(199, 125, 255, 0.58);
  --t8-block-highlight: rgba(255, 255, 255, 0.42);
  --t8-block-shadow: rgba(8, 10, 24, 0.62);
  border-color: rgba(199, 125, 255, 0.36);
  box-shadow:
    inset 0 0 72px rgba(199, 125, 255, 0.06),
    0 0 40px rgba(199, 125, 255, 0.16),
    0 24px 80px rgba(0, 0, 0, 0.38);
}

.t8-board-shell[data-t8-model="crystal"]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(199, 125, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 48% 34%, rgba(92, 225, 255, 0.42), transparent),
    radial-gradient(1px 1px at 68% 72%, rgba(255, 255, 255, 0.34), transparent),
    radial-gradient(1px 1px at 84% 28%, rgba(199, 125, 255, 0.38), transparent),
    radial-gradient(1.5px 1.5px at 56% 84%, rgba(255, 255, 255, 0.36), transparent);
  opacity: 0.82;
}

.t8-board-shell[data-t8-model="crystal"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    125deg,
    rgba(199, 125, 255, 0.03) 0,
    rgba(199, 125, 255, 0.03) 1px,
    transparent 1px,
    transparent 18px
  );
  opacity: 0.7;
}

.t8-board-shell[data-t8-model="crystal"] .t8-cell--placed,
.t8-page[data-t8-model="crystal"] .t8-cell--placed,
.t8-page[data-t8-model="crystal"] .t8-mini-cell {
  border-radius: clamp(7px, 0.9vw, 11px);
  border: 2px solid rgba(8, 10, 24, 0.72);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--piece-color), white 28%) 0%, var(--piece-color) 48%, color-mix(in srgb, var(--piece-color), black 24%) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    0 0 24px color-mix(in srgb, var(--piece-color), transparent 54%);
}

.t8-board-shell[data-t8-model="crystal"] .t8-cell--clear,
.t8-page[data-t8-model="crystal"] .t8-cell--clear {
  animation: t8CrystalClearPop 520ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

@keyframes t8CrystalClearPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  32% {
    transform: scale(1.12);
    opacity: 1;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.48),
      inset 0 -3px 0 rgba(0, 0, 0, 0.18),
      0 0 52px rgba(199, 125, 255, 0.78),
      0 0 22px rgba(255, 255, 255, 0.42);
  }

  72% {
    transform: scale(0.22) rotate(10deg);
    opacity: 0.18;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}
