/* Spellbound RTX Chess. Loaded by the chess block only (never part of the site bundle). Uses the site's
   tokens and button classes, so it changes with the rest of the site. */
.chs {
  --panel-w: 344px;
  --glass: rgba(20, 19, 18, .7);
  position: relative; height: 100svh; min-height: 520px; margin-top: calc(var(--tb-h) * -1);
  overflow: hidden; background: var(--bg-0); color: var(--tx-1); isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.chs__stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.chs__gl { display: block; width: 100%; height: 100%; outline: none; }
.chs__gl[hidden] { display: none; }
.chs__ui { position: absolute; inset: 0; pointer-events: none; }
.chs__ui > * { pointer-events: auto; }
.chs__ui > [hidden] { display: none !important; }
.chs__noscript { display: none; }
/* (the loading screen's styles are in the block's style.css, part of the site bundle, so they're there
   before this file arrives) */
.chs-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }
.chs-ico svg { display: block; }

/* ---------------------------------------------------------------- glass surfaces */
.chs-card, .chs-panel, .chs-toast {
  background: url("/assets/tex/noise.png") 0 0 / 128px repeat, var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
  border: var(--px) solid var(--outline);
  box-shadow: inset 2px 2px 0 rgba(255, 238, 214, .07), inset -2px -2px 0 rgba(0, 0, 0, .35), 0 24px 60px -24px #000;
}

/* ---------------------------------------------------------------- menu */
.chs-menu {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; align-items: start; justify-items: start;
  padding: calc(var(--tb-h) + 60px) clamp(16px, 6vw, 96px) 20px;
  background: linear-gradient(90deg, rgba(10, 9, 8, .82), rgba(10, 9, 8, .45) 45%, transparent 75%);
}
.chs-menu > * { margin-block: auto; }
.chs-home { display: grid; gap: 18px; width: min(100%, 500px); }
.chs-hero { display: grid; gap: 8px; justify-items: start; }
.chs-hero__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.chs-hero__how { padding: 0; font-size: 13.5px; }
.chs-title {
  font: 700 clamp(1.7rem, 2.65vw, 2.2rem)/1.05 var(--f-pixel); white-space: nowrap; color: var(--lamp-hi); letter-spacing: .01em;
  text-shadow: 0 0 18px rgba(var(--lamp-rgb), .45), 0 0 60px rgba(var(--lamp-rgb), .2);
  animation: chs-in .9s var(--ease-out) backwards;
}
.chs-tagline { font-size: 15.5px; line-height: 1.5; color: var(--tx-2); animation: chs-in .9s .08s var(--ease-out) backwards; }
@keyframes chs-in { from { opacity: 0; transform: translateY(14px); } }
.chs-card { display: grid; gap: 14px; width: min(100%, 600px); padding: clamp(18px, 2.4vw, 26px); animation: chs-in .7s .12s var(--ease-out) backwards; }
.chs-card--small { width: min(100%, 380px); }
.chs-card__head { display: grid; gap: 6px; }
.chs-card h2 { font: 700 clamp(1.3rem, 2.4vw, 1.7rem)/1.15 var(--f-pixel); color: var(--tx-0); }
.chs-card__sub { font-size: 15px; color: var(--tx-2); }
.chs-h { display: flex; align-items: center; gap: 8px; margin-top: 4px; font: 600 11.5px/1 var(--f-pixel); letter-spacing: .14em; text-transform: uppercase; color: var(--tx-2); }
.chs-h .chs-ico { color: var(--lamp); }
.chs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chs-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.chs-grid .pxb { min-height: 62px; min-width: 0; font-size: 14px; }
.chs-grid .pxb__face { min-width: 0; }
.chs-grid .pxb__label { min-width: 0; overflow-wrap: anywhere; }
.chs-grid .pxb__label small { line-height: 1.3; }
@media (max-width: 520px) { .chs-grid { grid-template-columns: 1fr; } .chs-title { white-space: normal; } }
.chs-grid .pxb__face { justify-content: flex-start; padding-inline: 14px; }
.chs-grid .pxb__label small { font-size: 12px; }
.chs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chs-row--wrap { flex-wrap: wrap; justify-content: flex-start; }
.chs-row--center { justify-content: center; flex-wrap: wrap; }
.chs-note { font-size: 13.5px; color: var(--tx-3); }
.chs-note strong { color: var(--tx-1); font-weight: 600; }
.chs-note strong em, .chs-note em strong { font-style: normal; color: var(--redstone); text-shadow: 0 0 10px rgba(var(--redstone-rgb), .35); }
.chs-note a { color: var(--tx-1); }
.chs-warn { padding: 10px 12px; border: var(--px) solid rgba(var(--redstone-rgb), .45); background: rgba(var(--redstone-rgb), .07); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .04); color: var(--tx-2); }
.chs-link { justify-self: start; padding: 4px 0; font: 14px var(--f-body); color: var(--tx-2); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chs-link:hover { color: var(--lamp-hi); }
.chs-siteback { justify-self: center; text-decoration: none; }
.chs-field { display: grid; gap: 6px; font: 600 11.5px var(--f-pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--tx-2); }
.chs-input {
  width: 100%; padding: 10px 12px; font: 16px/1.3 var(--f-body); color: var(--tx-0);
  background: var(--bg-0); border: 2px solid var(--outline); border-radius: 0; outline: none;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5);
}
.chs-input:focus { border-color: rgba(var(--lamp-rgb), .6); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5), 0 0 0 1px rgba(var(--lamp-rgb), .3), 0 0 18px rgba(var(--lamp-rgb), .15); }
.chs-input--code { font: 700 30px/1 var(--f-pixel); letter-spacing: .32em; text-align: center; text-transform: uppercase; color: var(--lamp-hi); padding: 14px 8px 14px calc(8px + .32em); }
.chs-invitebox { display: grid; gap: 14px; }
.chs-invitebox.has-qr { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; }
.chs-invitebox__side { display: grid; gap: 10px; min-width: 0; }
.chs-qr { line-height: 0; border: var(--px) solid var(--outline); box-shadow: 0 0 22px rgba(255, 238, 214, .08); }
.chs-qr canvas { display: block; width: 168px; height: 168px; image-rendering: pixelated; }
@media (max-width: 520px) { .chs-invitebox.has-qr { grid-template-columns: minmax(0, 1fr); justify-items: center; } .chs-invitebox__side { width: 100%; } }
.chs-invite { font-size: 14px; color: var(--lamp-hi); text-overflow: ellipsis; }
.chs-input--sdp { font: 12px/1.35 ui-monospace, monospace; resize: vertical; word-break: break-all; }
.chs-sdp { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.chs-step { display: flex; align-items: center; gap: 10px; font: 600 12px var(--f-pixel); color: var(--tx-2); }

.chs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chs-chip {
  display: grid; gap: 3px; justify-items: center; min-width: 64px; padding: 8px 10px; cursor: pointer;
  font: 500 14px/1.1 var(--f-body); color: var(--tx-1); background: var(--bg-1); border: 2px solid var(--outline);
  box-shadow: inset 2px 2px 0 var(--bevel-hi), inset -2px -2px 0 var(--bevel-lo); transition: color .2s, box-shadow .25s, background .25s;
}
.chs-chip small { font: 11px var(--f-body); color: var(--tx-3); }
.chs-chip:hover { color: var(--lamp-hi); }
.chs-chip.is-on {
  color: var(--lamp-hi); background: color-mix(in srgb, var(--bg-1), var(--lamp) 10%);
  box-shadow: inset 2px 2px 0 rgba(var(--lamp-rgb), .3), inset -2px -2px 0 var(--bevel-lo), 0 0 0 1px rgba(var(--lamp-rgb), .45), 0 0 18px rgba(var(--lamp-rgb), .22);
}
.chs-chips--color .chs-chip { flex: 1; }

.chs-code { display: flex; justify-content: center; gap: clamp(4px, 1vw, 8px); margin: 6px 0; user-select: all; -webkit-user-select: all; }
.chs-code span {
  display: grid; place-items: center; width: clamp(38px, 9vw, 54px); aspect-ratio: 4 / 5;
  font: 700 clamp(24px, 5.5vw, 34px)/1 var(--f-pixel); color: var(--lamp-hi); text-shadow: 0 0 14px rgba(var(--lamp-rgb), .6);
  background: var(--bg-0); border: 2px solid var(--outline); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .5), 0 0 22px -6px rgba(var(--lamp-rgb), .35);
  animation: chs-tile .5s var(--ease-out) backwards;
}
.chs-code span:nth-child(2) { animation-delay: .05s; } .chs-code span:nth-child(3) { animation-delay: .1s; }
.chs-code span:nth-child(4) { animation-delay: .15s; } .chs-code span:nth-child(5) { animation-delay: .2s; } .chs-code span:nth-child(6) { animation-delay: .25s; }
@keyframes chs-tile { from { opacity: 0; transform: translateY(-10px); } }
.chs-signal { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--tx-2); }
.chs-dot { display: inline-block; width: 8px; height: 8px; flex: none; background: var(--lamp); box-shadow: 0 0 8px rgba(var(--lamp-rgb), .7); animation: led 1.4s steps(1) infinite; }
.chs-dot.is-on, .is-on > .chs-dot { background: var(--rtx); box-shadow: 0 0 8px rgba(var(--rtx-rgb), .8); animation: none; }
.chs-dot.is-off, .is-off > .chs-dot { background: var(--redstone); box-shadow: 0 0 8px rgba(var(--redstone-rgb), .8); animation: none; }
.chs-wait { display: flex; align-items: center; gap: 12px; font: 600 13px var(--f-pixel); color: var(--tx-1); }
.chs-spinner { width: 14px; height: 14px; background: var(--lamp); box-shadow: 0 0 12px rgba(var(--lamp-rgb), .7); animation: chs-spin 1.2s steps(4) infinite; }
@keyframes chs-spin { to { transform: rotate(360deg); } }
.chs-search { display: flex; gap: 10px; justify-content: center; padding: 14px 0; }
.chs-search i { width: 14px; height: 14px; background: var(--lamp); box-shadow: 0 0 14px rgba(var(--lamp-rgb), .6); animation: chs-hop .9s ease-in-out infinite; }
.chs-search i:nth-child(2) { animation-delay: .15s; } .chs-search i:nth-child(3) { animation-delay: .3s; }
@keyframes chs-hop { 50% { transform: translateY(-12px); opacity: .5; } }

/* ---------------------------------------------------------------- the game panel */
.chs-panel {
  position: absolute; top: calc(var(--tb-h) + 14px); right: 14px; bottom: 14px; width: var(--panel-w);
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  animation: chs-panel .6s var(--ease-out) backwards;
}
@keyframes chs-panel { from { opacity: 0; transform: translateX(24px); } }
.chs.in-menu .chs-panel { display: none; }
.chs-player { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; background: rgba(0, 0, 0, .22); border: 2px solid rgba(0, 0, 0, .35); }
.chs-player.is-turn::before {
  content: ""; position: absolute; left: -2px; top: -2px; bottom: -2px; width: 3px;
  background: linear-gradient(180deg, rgba(var(--lamp-rgb), .5), var(--lamp) 3px, var(--lamp) calc(100% - 3px), rgba(var(--lamp-rgb), .5));
  filter: drop-shadow(0 0 1px rgba(var(--lamp-rgb), .85)) drop-shadow(0 0 5px rgba(var(--lamp-rgb), .45)) drop-shadow(0 0 14px rgba(var(--lamp-rgb), .24));
}
.chs-avatar { width: 38px; height: 38px; image-rendering: pixelated; object-fit: contain; background: var(--bg-0); border: 2px solid var(--outline); }
.side-black .chs-avatar { box-shadow: 0 0 0 1px rgba(var(--amethyst-rgb), .25); }
.chs-player__info { display: grid; gap: 4px; min-width: 0; }
.chs-player__name { display: flex; align-items: center; gap: 7px; font: 600 14px var(--f-pixel); color: var(--tx-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chs-thinking { font: 400 11px var(--f-body); color: var(--tx-3); animation: led 1.2s steps(1) infinite; }
.chs-taken { display: flex; flex-wrap: wrap; align-items: center; gap: 0; min-height: 16px; }
.chs-taken img { height: 16px; image-rendering: pixelated; margin-right: -3px; }
/* Revive choosing: the fallen it can call back breathe in its light, and are buttons */
.chs-fallen { all: unset; cursor: pointer; display: inline-flex; margin-right: -3px; animation: chs-breathe 2.4s ease-in-out infinite; }
.chs-fallen img { height: 16px; image-rendering: pixelated; display: block; }
.chs-fallen:hover, .chs-fallen:focus-visible, .chs-fallen.is-picked { animation: none; filter: brightness(1.25) drop-shadow(0 0 2px rgba(var(--a), 1)) drop-shadow(0 0 6px rgba(var(--a), .8)); }
.chs-fallen.is-dim { animation: none; filter: saturate(.4) brightness(.7); }
@keyframes chs-breathe {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(var(--a), .3)); }
  50% { filter: brightness(1.2) drop-shadow(0 0 2px rgba(var(--a), .95)) drop-shadow(0 0 7px rgba(var(--a), .6)); }
}
@media (prefers-reduced-motion: reduce) { .chs-fallen { animation: none; filter: drop-shadow(0 0 2px rgba(var(--a), .9)); } }
.chs-adv { margin-left: 8px; font: 600 11.5px var(--f-pixel); color: var(--tx-2); }
.chs-clock {
  min-width: 82px; padding: 7px 10px; text-align: right; font: 700 21px/1 var(--f-pixel); color: var(--tx-2);
  background: var(--bg-0); border: 2px solid var(--outline); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums;
  transition: color .3s, box-shadow .3s;
}
.chs-clock.is-on { color: var(--lamp-hi); text-shadow: 0 0 12px rgba(var(--lamp-rgb), .55); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5), 0 0 0 1px rgba(var(--lamp-rgb), .35), 0 0 16px rgba(var(--lamp-rgb), .18); }
.chs-clock.is-low { color: color-mix(in srgb, var(--redstone), #fff 25%); }
.chs-clock.is-on.is-low { text-shadow: 0 0 12px rgba(var(--redstone-rgb), .7); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5), 0 0 0 1px rgba(var(--redstone-rgb), .45), 0 0 18px rgba(var(--redstone-rgb), .25); }
.chs-status { padding: 2px 4px; font-size: 14px; color: var(--tx-1); min-height: 1.4em; }
.chs-status.is-check { color: color-mix(in srgb, var(--redstone), #fff 30%); text-shadow: 0 0 12px rgba(var(--redstone-rgb), .5); }
.chs-movebox { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 90px; }
.chs-moves {
  flex: 1 1 auto; min-height: 0; margin: 0; padding: 4px; list-style: none; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(0, 0, 0, .25); border: 2px solid rgba(0, 0, 0, .35); scrollbar-width: thin; scrollbar-color: var(--bg-5) transparent;
}
.chs-moves li { display: grid; grid-template-columns: 2.6em 1fr 1fr; align-items: center; }
.chs-moves__n { font: 12px var(--f-pixel); color: var(--tx-3); padding-left: 4px; }
.chs-mv { padding: 5px 6px; text-align: left; font: 600 13.5px var(--f-pixel); color: var(--tx-1); background: none; border: 0; cursor: pointer; }
.chs-mv:hover { color: var(--lamp-hi); }
.chs-mv.is-cur { color: #2a1a05; background: var(--lamp); box-shadow: 0 0 12px rgba(var(--lamp-rgb), .4); }
.chs-moves__result { display: block !important; padding: 8px 6px; font: 700 14px var(--f-pixel); color: var(--lamp-hi); text-align: center; }
.chs-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.chs-nav .pxb__face { padding-inline: 4px; }
.chs-nav__tool { margin-left: 6px; }
.chs-nav .pxb { width: 100%; }
.chs-nav__first .chs-ico, .chs-nav__last .chs-ico { box-shadow: -4px 0 0 -1px currentColor; }
.chs.is-review .chs-nav__last { animation: led 1.6s steps(1) infinite; }
.chs-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.chs-actions .pxb:not(.pxb--icon) { flex: 1 1 auto; }
/* Redo: Undo's arrow, turned the other way */
.chs-redo .chs-ico { transform: scaleX(-1); }
.chs-net { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx-3); }
.chs-net:empty { display: none; }

/* ---------------------------------------------------------------- corner, toasts, modals */
.chs-corner { position: absolute; top: calc(var(--tb-h) + 14px); left: 14px; display: flex; gap: 6px; }
.chs-corner .pxb { min-height: 40px; }
.chs-corner__book .chs-ico { color: var(--amethyst); filter: drop-shadow(0 0 5px rgba(var(--amethyst-rgb), .65)); }
.chs:not(.is-spell):not(.in-menu) .chs-corner__book { display: none; }
.chs-corner .pxb__face { padding: 8px 11px; }
.chs.in-menu .chs-corner .pxb:last-child { display: none; }
.chs-toasts { position: absolute; top: calc(var(--tb-h) + 14px); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: min(92vw, 440px); pointer-events: none; }
.chs-toast { display: grid; gap: 8px; padding: 10px 14px; font-size: 14.5px; color: var(--tx-0); pointer-events: auto; animation: chs-in .35s var(--ease-out); transition: opacity .4s, transform .4s; }
.chs-toast.is-bad { border-color: rgba(var(--redstone-rgb), .5); }
.chs-toast.is-out { opacity: 0; transform: translateY(-8px); }
.chs-toast .chs-row { justify-content: flex-start; }
.chs-modal { position: absolute; inset: 0; display: grid; place-items: start center; padding: calc(var(--tb-h) + 12px) 16px 16px; background: rgba(6, 5, 5, .5); overflow-y: auto; }
.chs-modal > * { margin-block: auto; }   /* (centred, but a tall card still scrolls from its top) */
.chs-modal .chs-card { justify-items: stretch; }
.chs-promo img { height: 40px; image-rendering: pixelated; }
.chs-over { text-align: center; justify-items: center !important; }
.chs-over__title { font-size: clamp(1.9rem, 5vw, 2.8rem) !important; }
.chs-over.is-win .chs-over__title { color: var(--lamp-hi); text-shadow: 0 0 20px rgba(var(--lamp-rgb), .55), 0 0 60px rgba(var(--lamp-rgb), .25); }
.chs-over.is-loss .chs-over__title { color: var(--tx-2); }
.chs-over.is-draw .chs-over__title { color: var(--diamond); text-shadow: 0 0 18px rgba(var(--diamond-rgb), .4); }
.chs-range { width: 100%; accent-color: var(--lamp); }
.chs-toggles { display: grid; gap: 8px; }
.chs-toggle { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.chs-toggle input { width: 18px; height: 18px; accent-color: var(--lamp); }

/* ---------------------------------------------------------------- the flat board */
.chs2d { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(var(--tb-h) + 16px) calc(var(--panel-w) + 32px) 16px 16px; }
.chs.in-menu .chs2d { padding-right: 16px; opacity: .35; }
.chs2d__board {
  position: relative;
  width: min(100%, calc(100svh - var(--tb-h) - 40px)); aspect-ratio: 1;
  box-shadow: 0 30px 80px -20px #000, 0 0 90px -30px rgba(var(--lamp-rgb), .35);
}
/* the board's picture: one pixel per voxel, scaled up crisp; it turns with the board */
.chs2d__pic { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: crisp-edges; image-rendering: pixelated; }
.chs2d__board.is-flipped .chs2d__pic { transform: rotate(180deg); }
/* the squares, inside the frame (8 of the picture's 112 pixels on each side) */
.chs2d__grid { position: absolute; inset: 7.142857%; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); }
.chs2d__sq { position: relative; min-width: 0; min-height: 0; }
/* pieces: pixel sprites at one pixel size, standing up out of their squares (front rows over back rows) */
.chs2d__sq img {
  position: absolute; max-width: none; image-rendering: crisp-edges; image-rendering: pixelated; pointer-events: none; will-change: transform;
  filter: brightness(var(--lit, 1)) drop-shadow(0 .35vmin 0 rgba(0, 0, 0, .45));
}
.chs2d__sq.is-sel img { filter: brightness(calc(var(--lit, 1) * 1.12)) drop-shadow(0 .35vmin 0 rgba(0, 0, 0, .45)); }
.chs2d__sq img.is-lifted { z-index: 4; filter: brightness(1.1) drop-shadow(0 1.6vmin 0 rgba(0, 0, 0, .35)); }

/* ---------------------------------------------------------------- phones and narrow windows
   One column: opponent, board, you, then the moves, buttons and chat. The panel's pieces join the
   page's own flow (display: contents) so they can sit above and below the board. */
@media (max-width: 899px) {
  .chs { --panel-w: 0px; height: auto; min-height: 100svh; overflow: visible; display: flex; flex-direction: column; padding-bottom: 14px; }
  .chs__ui, .chs-panel { display: contents; }
  .chs.in-menu { height: 100svh; overflow: hidden; }
  .chs.in-menu .chs-panel { display: none; }
  .chs__stage { position: relative; inset: auto; order: 2; height: min(112vw, 58svh); min-height: 300px; flex: none; }
  .chs-player { order: 1; margin: calc(var(--tb-h) + 6px) 10px 6px; }
  .chs-player--bottom { order: 3; margin: 6px 10px 4px; }
  .chs-status { order: 4; margin: 2px 14px; }
  .chs-movebox { order: 5; margin: 4px 10px; min-height: 0; }
  .chs-moves { max-height: 112px; min-height: 40px; }
  .chs-actions { order: 6; margin: 6px 10px; }
  .chs-net { order: 8; margin: 4px 14px; }
  .chs-menu { position: absolute; inset: 0; justify-items: center; padding-top: calc(var(--tb-h) + 64px); background: linear-gradient(180deg, rgba(10, 9, 8, .55), rgba(10, 9, 8, .85) 55%); }
  .chs-corner { position: absolute; top: calc(var(--tb-h) + 76px); left: 10px; flex-direction: column; z-index: 3; }
  .chs.in-menu .chs-corner { top: calc(var(--tb-h) + 10px); flex-direction: row; }
  .chs-corner .pxb { min-height: 36px; }
  .chs-corner .pxb__face { padding: 6px 9px; }
  .chs-toasts { position: fixed; top: calc(var(--tb-h) + 8px); z-index: 30; }
  .chs-modal { position: fixed; z-index: 40; }
  .chs2d { position: absolute; inset: 0; padding: 8px; }
  .chs2d__board { width: min(100%, 100% - 0px); height: auto; max-height: 100%; }
  .chs-clock { font-size: 19px; min-width: 74px; }
  .chs-player.is-turn::before { top: -2px; }
}
@media (prefers-reduced-motion: reduce) {
  .chs-title, .chs-tagline, .chs-card, .chs-panel, .chs-code span { animation: none; }
}


/* ---------------------------------------------------------------- the home menu */
.chs-setup { gap: 18px; padding: 22px 24px 24px; }
.chs-set { display: grid; gap: 9px; }
.chs-label { font: 400 11.5px/1 var(--f-pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); }
/* a row of joined options, with one lit */
.chs-seg { display: flex; flex-wrap: nowrap; gap: 0; }
.chs-seg .chs-chip { flex: 1 1 0; min-width: 0; min-height: 38px; align-content: center; padding: 8px 4px; color: var(--tx-2); background: rgba(0, 0, 0, .22); border: 2px solid rgba(0, 0, 0, .35); box-shadow: none; }
.chs-seg .chs-chip + .chs-chip { margin-left: -2px; }
.chs-seg .chs-chip:hover { color: var(--tx-0); }
.chs-seg .chs-chip.is-on { position: relative; color: var(--lamp-hi); background: rgba(var(--lamp-rgb), .1); border-color: rgba(var(--lamp-rgb), .55); box-shadow: 0 0 14px rgba(var(--lamp-rgb), .14); }
.chs-seg--wide .chs-chip { min-height: 42px; font-size: 14.5px; }
.chs-bots { display: grid; }
.chs-bot {
  position: relative; display: grid; gap: 0; padding: 5px 14px 6px; text-align: left; cursor: pointer; background: none; border: 0; color: var(--tx-1);
  border-top: 1px solid rgba(255, 238, 214, .06); transition: background .2s;
}
.chs-bot:first-child { border-top: 0; }
.chs-bot__name { font: 400 15px/1.3 var(--f-body); color: var(--tx-1); transition: color .2s; }
.chs-bot small { font-size: 13px; line-height: 1.35; color: var(--tx-3); }
.chs-bot:hover { background: rgba(255, 238, 214, .025); }
.chs-bot:hover .chs-bot__name { color: var(--tx-0); }
.chs-bot::before { /* a strip light beside the chosen mob */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; opacity: 0; transition: opacity .25s;
  background: linear-gradient(180deg, rgba(var(--lamp-rgb), .5), var(--lamp) 3px, var(--lamp) calc(100% - 3px), rgba(var(--lamp-rgb), .5));
  filter: drop-shadow(0 0 1px rgba(var(--lamp-rgb), .85)) drop-shadow(0 0 5px rgba(var(--lamp-rgb), .45)) drop-shadow(0 0 14px rgba(var(--lamp-rgb), .24));
}
.chs-bot.is-on { background: rgba(var(--lamp-rgb), .06); }
.chs-bot.is-on::before { opacity: 1; }
.chs-bot.is-on .chs-bot__name { color: var(--lamp-hi); }
.chs-bot.is-on small { color: var(--tx-2); }
/* the Spellbound switch */
.chs-spellrow { position: relative; display: grid; padding-top: 16px; border-top: 1px solid rgba(255, 238, 214, .07); }
.chs-switchrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 0; text-align: left; cursor: pointer; background: none; border: 0; color: inherit; }
.chs-switchrow__text { display: grid; gap: 2px; }
.chs-switchrow__name { font: 400 15px/1.3 var(--f-body); color: var(--tx-1); transition: color .2s, text-shadow .2s; }
.chs-switchrow small { font-size: 13px; line-height: 1.35; color: var(--tx-3); }
.chs-switch { position: relative; display: block; width: 42px; height: 22px; flex: none; background: rgba(0, 0, 0, .35); border: 2px solid var(--outline); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .35); transition: background .2s, box-shadow .2s, border-color .2s; }
.chs-switch i { position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; background: var(--tx-3); transition: left .16s var(--ease-out), background .2s, box-shadow .2s; }
.chs-spellrow.is-on .chs-switch { background: rgba(var(--lamp-rgb), .2); border-color: rgba(var(--lamp-rgb), .65); box-shadow: 0 0 14px rgba(var(--lamp-rgb), .22); }
.chs-spellrow.is-on .chs-switch i { left: 22px; background: var(--lamp); box-shadow: 0 0 10px rgba(var(--lamp-rgb), .8); }
.chs-spellrow.is-on .chs-switchrow__name { color: var(--lamp-hi); }
.chs-play { position: sticky; bottom: 0; z-index: 1; justify-self: stretch; width: 100%; }
.chs-play .pxb__face { justify-content: center; }
.chs-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; padding-inline: 2px; }
.chs-foot .chs-note { font-size: 12.5px; }
.chs-device { font-size: 12.5px; line-height: 1.4; color: var(--tx-3); padding-inline: 2px; }
.chs-foot__back { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; text-decoration: none; color: var(--tx-2); }

/* ---------------------------------------------------------------- Spellbound: the spell bar */
.chs-spellbox { display: none; flex-direction: column; gap: 7px; }
.chs.is-spell .chs-spellbox { display: flex; }
.chs-spellbox__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chs-spellbox__head .chs-h { margin: 0; }
.chs-spellbox__head .chs-link { padding: 0; font-size: 12.5px; color: var(--tx-3); }
.chs-spells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.chs-spell {
  --a: 255, 255, 255;
  position: relative; display: grid; place-items: center; height: 40px; padding: 0; cursor: pointer; color: rgb(var(--a));
  background: radial-gradient(closest-side, rgba(var(--a), .12), transparent), var(--bg-1);
  border: 2px solid var(--outline); box-shadow: inset 2px 2px 0 var(--bevel-hi), inset -2px -2px 0 var(--bevel-lo); transition: box-shadow .2s, background .2s;
}
.chs-spell svg { filter: drop-shadow(0 0 4px rgba(var(--a), .6)); }
.chs-spell__cost { position: absolute; right: 2px; bottom: 1px; font: 400 10.5px/1 var(--f-pixel); color: var(--tx-1); text-shadow: 0 1px 0 #000; }
.chs-spell:not(.is-off):hover, .chs-spell:focus-visible { outline: none; box-shadow: inset 2px 2px 0 var(--bevel-hi), inset -2px -2px 0 var(--bevel-lo), 0 0 0 1px rgba(var(--a), .6), 0 0 14px rgba(var(--a), .35); }
.chs-spell.is-on { background: rgba(var(--a), .22); box-shadow: 0 0 0 1px rgb(var(--a)), 0 0 18px rgba(var(--a), .5); }
.chs-spell.is-off { color: var(--tx-3); background: var(--bg-1); cursor: default; }
.chs-spell.is-off svg { filter: none; opacity: .45; }
.chs-spell.is-off .chs-spell__cost { color: var(--tx-3); }
.chs-spelltip { min-height: 4.05em; font-size: 12.5px; line-height: 1.35; color: var(--tx-2); }
.chs-spelltip__name { font-weight: 500; color: rgb(var(--a)); }
/* mana: the number, then every slot in plain view: full, filling next turn, spent by the hovered spell, empty */
.chs-mana { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.chs-mana__n { min-width: 1.6em; text-align: center; font: 700 15px/1 var(--f-pixel); color: var(--amethyst); text-shadow: 0 0 10px rgba(var(--amethyst-rgb), .55); }
.chs-mana__pips { flex: 1 1 auto; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; min-width: 0; }
.chs-mana__pips i { display: block; height: 12px; background: rgba(0, 0, 0, .38); border: 1px solid rgba(var(--amethyst-rgb), .28); box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .4); transition: background .25s, box-shadow .25s, border-color .25s; }
.chs-mana__pips i.is-on { background: var(--amethyst); border-color: color-mix(in srgb, var(--amethyst), #fff 35%); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .35), 0 0 7px rgba(var(--amethyst-rgb), .7); }
.chs-mana__pips i.is-next { background: rgba(var(--amethyst-rgb), .3); border-color: rgba(var(--amethyst-rgb), .75); animation: chs-mana-next 1.6s ease-in-out infinite; }
.chs-mana__pips i.is-spend { background: color-mix(in srgb, var(--redstone), var(--amethyst) 20%); border-color: var(--redstone); box-shadow: 0 0 8px rgba(var(--redstone-rgb), .75); animation: none; }
@keyframes chs-mana-next { 50% { background: rgba(var(--amethyst-rgb), .55); } }
.chs-mana__crystal { display: inline-flex; align-items: center; gap: 4px; flex: none; font: 600 11.5px/1 var(--f-pixel); color: var(--amethyst); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .chs-mana__pips i.is-next { animation: none; } }
.chs-mv__spell { display: inline-flex; vertical-align: -1px; margin-right: 5px; color: rgb(var(--a)); }
.chs-mv.is-cur .chs-mv__spell { color: inherit; }
/* the spellbook */
.chs-book { width: min(100%, 940px); gap: 18px; }
.chs-book__rules { margin: 0; padding: 0 0 0 18px; display: grid; gap: 7px; font-size: 14.5px; line-height: 1.45; color: var(--tx-1); }
.chs-book__spells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
@media (max-width: 760px) { .chs-book__spells { grid-template-columns: minmax(0, 1fr); } }
.chs-book__spell { --a: 255, 255, 255; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255, 238, 214, .07); }
.chs-book__icon { display: grid; place-items: center; width: 34px; height: 34px; color: rgb(var(--a)); background: radial-gradient(closest-side, rgba(var(--a), .16), transparent), var(--bg-0); border: 2px solid var(--outline); }
.chs-book__icon svg { filter: drop-shadow(0 0 4px rgba(var(--a), .6)); }
.chs-book__name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 500; color: rgb(var(--a)); }
.chs-book__cost { font-size: 12.5px; font-weight: 400; color: var(--tx-3); white-space: nowrap; }
.chs-book__spell p { margin-top: 2px; font-size: 13.5px; line-height: 1.42; color: var(--tx-2); }
/* the flat board's take on the same effects */
.chs2d__sq.is-frozen img { filter: brightness(1.05) saturate(.5) drop-shadow(0 0 .8vmin rgb(130, 225, 255)); }
.chs2d__sq.is-frozen::after { content: ""; position: absolute; inset: auto 6% 4% 6%; height: 26%; background: rgba(205, 235, 255, .85); box-shadow: 0 0 1.4vmin rgb(130, 225, 255); pointer-events: none; }
.chs2d__sq.is-zapped img { filter: drop-shadow(0 0 .9vmin rgb(90, 170, 255)) drop-shadow(0 0 .3vmin #fff); }
.chs2d__sq.is-warded img { filter: drop-shadow(0 0 .9vmin rgb(255, 214, 90)); }
.chs2d__sq.is-warded::after { content: ""; position: absolute; inset: 4%; border: .35vmin solid rgb(255, 214, 90); box-shadow: 0 0 1vmin rgb(255, 214, 90); pointer-events: none; }
.chs2d__sq.is-powered img { filter: drop-shadow(0 0 1vmin rgb(255, 60, 40)) saturate(1.5); }
.chs2d__sq.is-poly img { filter: drop-shadow(0 0 .9vmin rgb(110, 240, 110)); }
.chs2d__crystal { position: absolute; background-size: 100% 100%; image-rendering: crisp-edges; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 .35vmin 0 rgba(0, 0, 0, .45)); }
.chs2d__sq.is-charmed img { filter: drop-shadow(0 0 1vmin rgb(255, 60, 210)); }
.chs2d__sq.is-wall::after { content: ""; position: absolute; inset: 3%; background: repeating-linear-gradient(0deg, #2a2629 0 22%, rgb(255, 140, 60) 22% 26%); border: .3vmin solid #171416; box-shadow: 0 0 1.2vmin rgba(255, 140, 60, .7); pointer-events: none; }
@media (max-width: 899px) {
  .chs-spellbox { order: 4; margin: 4px 10px; }
  .chs-spell { height: 46px; }
}
