.cg-wrap {
  box-sizing: content-box;
  position: relative;
  display: block;
}

cg-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  top: 0;
}

cg-board {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  line-height: 0;
  background-size: cover;
}

.cg-wrap.manipulable cg-board {
  cursor: pointer;
}

cg-board square {
  position: absolute;
  top: 0;
  left: 0;
  width: 12.5%;
  height: 12.5%;
  pointer-events: none;
}

cg-board square.move-dest {
  pointer-events: auto;
}

cg-board square.last-move {
  will-change: transform;
}

.cg-wrap piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 12.5%;
  height: 12.5%;
  background-size: cover;
  z-index: 2;
  will-change: transform;
  pointer-events: none;
}

cg-board piece.dragging {
  cursor: move;
  /* !important to override z-index from 3D piece inline style */
  z-index: 11 !important;
}

piece.anim {
  z-index: 8;
}

piece.fading {
  z-index: 1;
  opacity: 0.5;
}

.cg-wrap piece.ghost {
  opacity: 0.3;
}

.cg-wrap piece svg {
  overflow: hidden;
  position: relative;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

.cg-wrap cg-auto-pieces,
.cg-wrap .cg-shapes,
.cg-wrap .cg-custom-svgs,
.cg-wrap .cg-shapes-below,
.cg-wrap .cg-custom-below {
  overflow: visible;
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cg-wrap cg-auto-pieces {
  z-index: 2;
}

.cg-wrap cg-auto-pieces piece {
  opacity: 0.3;
}

.cg-wrap .cg-shapes {
  overflow: hidden;
  opacity: 0.6;
  z-index: 2;
}

.cg-wrap .cg-shapes-below {
  overflow: hidden;
  z-index: 1;
}

.cg-wrap .cg-custom-below {
  z-index: 1;
}

.cg-wrap .cg-custom-svgs {
  /* over piece.anim = 8, but under piece.dragging = 11 */
  z-index: 9;
}

.cg-wrap .cg-custom-svgs svg,
.cg-wrap .cg-custom-below svg {
  overflow: visible;
}

.cg-wrap coords {
  position: absolute;
  display: flex;
  pointer-events: none;
  opacity: 0.8;
  font-family: sans-serif;
  font-size: 9px;
}

.cg-wrap coords.ranks {
  left: 4px;
  top: -20px;
  flex-flow: column-reverse;
  height: 100%;
  width: 12px;
}

.cg-wrap coords.ranks.black {
  flex-flow: column;
}

.cg-wrap coords.ranks.left {
  left: -15px;
  align-items: flex-end;
}

.cg-wrap coords.files {
  bottom: -4px;
  left: 24px;
  flex-flow: row;
  width: 100%;
  height: 16px;
  text-transform: uppercase;
  text-align: center;
}

.cg-wrap coords.files.black {
  flex-flow: row-reverse;
}

.cg-wrap coords coord {
  flex: 1 1 auto;
}

.cg-wrap coords.ranks coord {
  transform: translateY(39%);
}

.cg-wrap coords.squares {
  bottom: 0;
  left: 0;
  text-transform: uppercase;
  text-align: right;
  flex-flow: column-reverse;
  height: 100%;
  width: 12.5%;
}

.cg-wrap coords.squares.black {
  flex-flow: column;
}

.cg-wrap coords.squares.left {
  text-align: left;
}

.cg-wrap coords.squares coord {
  padding: 6% 4%;
}

.cg-wrap coords.squares.rank2 {
  transform: translateX(100%);
}

.cg-wrap coords.squares.rank3 {
  transform: translateX(200%);
}

.cg-wrap coords.squares.rank4 {
  transform: translateX(300%);
}

.cg-wrap coords.squares.rank5 {
  transform: translateX(400%);
}

.cg-wrap coords.squares.rank6 {
  transform: translateX(500%);
}

.cg-wrap coords.squares.rank7 {
  transform: translateX(600%);
}

.cg-wrap coords.squares.rank8 {
  transform: translateX(700%);
}

/** Colored board squares as an embedded SVG */
cg-board {
  background-color: #f0d9b5;
  background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4PSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIgogICAgIHZpZXdCb3g9IjAgMCA4IDgiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyI+CjxnIGlkPSJhIj4KICA8ZyBpZD0iYiI+CiAgICA8ZyBpZD0iYyI+CiAgICAgIDxnIGlkPSJkIj4KICAgICAgICA8cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBpZD0iZSIgb3BhY2l0eT0iMCIvPgogICAgICAgIDx1c2UgeD0iMSIgeT0iMSIgaHJlZj0iI2UiIHg6aHJlZj0iI2UiLz4KICAgICAgICA8cmVjdCB5PSIxIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBpZD0iZiIgb3BhY2l0eT0iMC4yIi8+CiAgICAgICAgPHVzZSB4PSIxIiB5PSItMSIgaHJlZj0iI2YiIHg6aHJlZj0iI2YiLz4KICAgICAgPC9nPgogICAgICA8dXNlIHg9IjIiIGhyZWY9IiNkIiB4OmhyZWY9IiNkIi8+CiAgICA8L2c+CiAgICA8dXNlIHg9IjQiIGhyZWY9IiNjIiB4OmhyZWY9IiNjIi8+CiAgPC9nPgogIDx1c2UgeT0iMiIgaHJlZj0iI2IiIHg6aHJlZj0iI2IiLz4KPC9nPgo8dXNlIHk9IjQiIGhyZWY9IiNhIiB4OmhyZWY9IiNhIi8+Cjwvc3ZnPg==');
}

/** Interactive board square colors */
cg-board square.move-dest {
  background: radial-gradient(rgba(20, 85, 30, 0.5) 22%, #208530 0, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0) 0);
}
cg-board square.premove-dest {
  background: radial-gradient(rgba(20, 30, 85, 0.5) 22%, #203085 0, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0) 0);
}
cg-board square.oc.move-dest {
  background: radial-gradient(transparent 0%, transparent 80%, rgba(20, 85, 0, 0.3) 80%);
}
cg-board square.oc.premove-dest {
  background: radial-gradient(transparent 0%, transparent 80%, rgba(20, 30, 85, 0.2) 80%);
}
cg-board square.move-dest:hover,
cg-board square.move-dest.hover {
  background: rgba(20, 85, 30, 0.3);
}
cg-board square.premove-dest:hover,
cg-board square.premove-dest.hover {
  background: rgba(20, 30, 85, 0.2);
}
cg-board square.last-move {
  background-color: rgba(155, 199, 0, 0.41);
}
cg-board square.selected {
  background-color: rgba(20, 85, 30, 0.5);
}
cg-board square.check {
  background: radial-gradient(
    ellipse at center,
    rgba(255, 0, 0, 1) 0%,
    rgba(231, 0, 0, 1) 25%,
    rgba(169, 0, 0, 0) 89%,
    rgba(158, 0, 0, 0) 100%
  );
}
cg-board square.current-premove {
  background-color: rgba(20, 30, 85, 0.5);
}

/** Alternating colors in rank/file/square labels */
.orientation-white .ranks :nth-child(odd),
.orientation-white .files :nth-child(even),
.orientation-black .ranks :nth-child(even),
.orientation-black .files :nth-child(odd),
coords.squares:nth-of-type(odd) :nth-child(even),
coords.squares:nth-of-type(even) :nth-child(odd) {
  color: rgba(72, 72, 72, 0.8);
}

.orientation-white .ranks :nth-child(even),
.orientation-white .files :nth-child(odd),
.orientation-black .ranks :nth-child(odd),
.orientation-black .files :nth-child(even),
coords.squares:nth-of-type(odd) :nth-child(odd),
coords.squares:nth-of-type(even) :nth-child(even) {
  color: rgba(255, 255, 255, 0.8);
}

/** Embedded SVGs for all chess pieces */
.cg-wrap piece.pawn.white {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PHBhdGggZD0iTTIyLjUgOWMtMi4yMSAwLTQgMS43OS00IDQgMCAuODkuMjkgMS43MS43OCAyLjM4QzE3LjMzIDE2LjUgMTYgMTguNTkgMTYgMjFjMCAyLjAzLjk0IDMuODQgMi40MSA1LjAzLTMgMS4wNi03LjQxIDUuNTUtNy40MSAxMy40N2gyM2MwLTcuOTItNC40MS0xMi40MS03LjQxLTEzLjQ3IDEuNDctMS4xOSAyLjQxLTMgMi40MS01LjAzIDAtMi40MS0xLjMzLTQuNS0zLjI4LTUuNjIuNDktLjY3Ljc4LTEuNDkuNzgtMi4zOCAwLTIuMjEtMS43OS00LTQtNHoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg==');
}
.cg-wrap piece.bishop.white {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxnIGZpbGw9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJidXR0Ij48cGF0aCBkPSJNOSAzNmMzLjM5LS45NyAxMC4xMS40MyAxMy41LTIgMy4zOSAyLjQzIDEwLjExIDEuMDMgMTMuNSAyIDAgMCAxLjY1LjU0IDMgMi0uNjguOTctMS42NS45OS0zIC41LTMuMzktLjk3LTEwLjExLjQ2LTEzLjUtMS0zLjM5IDEuNDYtMTAuMTEuMDMtMTMuNSAxLTEuMzU0LjQ5LTIuMzIzLjQ3LTMtLjUgMS4zNTQtMS45NCAzLTIgMy0yeiIvPjxwYXRoIGQ9Ik0xNSAzMmMyLjUgMi41IDEyLjUgMi41IDE1IDAgLjUtMS41IDAtMiAwLTIgMC0yLjUtMi41LTQtMi41LTQgNS41LTEuNSA2LTExLjUtNS0xNS41LTExIDQtMTAuNSAxNC01IDE1LjUgMCAwLTIuNSAxLjUtMi41IDQgMCAwLS41LjUgMCAyeiIvPjxwYXRoIGQ9Ik0yNSA4YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAxIDEgNSAweiIvPjwvZz48cGF0aCBkPSJNMTcuNSAyNmgxME0xNSAzMGgxNW0tNy41LTE0LjV2NU0yMCAxOGg1IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIi8+PC9nPjwvc3ZnPg==');
}
.cg-wrap piece.knight.white {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yMiAxMGMxMC41IDEgMTYuNSA4IDE2IDI5SDE1YzAtOSAxMC02LjUgOC0yMSIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0yNCAxOGMuMzggMi45MS01LjU1IDcuMzctOCA5LTMgMi0yLjgyIDQuMzQtNSA0LTEuMDQyLS45NCAxLjQxLTMuMDQgMC0zLTEgMCAuMTkgMS4yMy0xIDItMSAwLTQuMDAzIDEtNC00IDAtMiA2LTEyIDYtMTJzMS44OS0xLjkgMi0zLjVjLS43My0uOTk0LS41LTItLjUtMyAxLTEgMyAyLjUgMyAyLjVoMnMuNzgtMS45OTIgMi41LTNjMSAwIDEgMyAxIDMiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNOS41IDI1LjVhLjUuNSAwIDEgMS0xIDAgLjUuNSAwIDEgMSAxIDB6bTUuNDMzLTkuNzVhLjUgMS41IDMwIDEgMS0uODY2LS41LjUgMS41IDMwIDEgMSAuODY2LjV6IiBmaWxsPSIjMDAwIi8+PC9nPjwvc3ZnPg==');
}
.cg-wrap piece.rook.white {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik05IDM5aDI3di0zSDl2M3ptMy0zdi00aDIxdjRIMTJ6bS0xLTIyVjloNHYyaDVWOWg1djJoNVY5aDR2NSIgc3Ryb2tlLWxpbmVjYXA9ImJ1dHQiLz48cGF0aCBkPSJNMzQgMTRsLTMgM0gxNGwtMy0zIi8+PHBhdGggZD0iTTMxIDE3djEyLjVIMTRWMTciIHN0cm9rZS1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIi8+PHBhdGggZD0iTTMxIDI5LjVsMS41IDIuNWgtMjBsMS41LTIuNSIvPjxwYXRoIGQ9Ik0xMSAxNGgyMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIvPjwvZz48L3N2Zz4=');
}
.cg-wrap piece.queen.white {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik04IDEyYTIgMiAwIDEgMS00IDAgMiAyIDAgMSAxIDQgMHptMTYuNS00LjVhMiAyIDAgMSAxLTQgMCAyIDIgMCAxIDEgNCAwek00MSAxMmEyIDIgMCAxIDEtNCAwIDIgMiAwIDEgMSA0IDB6TTE2IDguNWEyIDIgMCAxIDEtNCAwIDIgMiAwIDEgMSA0IDB6TTMzIDlhMiAyIDAgMSAxLTQgMCAyIDIgMCAxIDEgNCAweiIvPjxwYXRoIGQ9Ik05IDI2YzguNS0xLjUgMjEtMS41IDI3IDBsMi0xMi03IDExVjExbC01LjUgMTMuNS0zLTE1LTMgMTUtNS41LTE0VjI1TDcgMTRsMiAxMnoiIHN0cm9rZS1saW5lY2FwPSJidXR0Ii8+PHBhdGggZD0iTTkgMjZjMCAyIDEuNSAyIDIuNSA0IDEgMS41IDEgMSAuNSAzLjUtMS41IDEtMS41IDIuNS0xLjUgMi41LTEuNSAxLjUuNSAyLjUuNSAyLjUgNi41IDEgMTYuNSAxIDIzIDAgMCAwIDEuNS0xIDAtMi41IDAgMCAuNS0xLjUtMS0yLjUtLjUtMi41LS41LTIgLjUtMy41IDEtMiAyLjUtMiAyLjUtNC04LjUtMS41LTE4LjUtMS41LTI3IDB6IiBzdHJva2UtbGluZWNhcD0iYnV0dCIvPjxwYXRoIGQ9Ik0xMS41IDMwYzMuNS0xIDE4LjUtMSAyMiAwTTEyIDMzLjVjNi0xIDE1LTEgMjEgMCIgZmlsbD0ibm9uZSIvPjwvZz48L3N2Zz4=');
}
.cg-wrap piece.king.white {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yMi41IDExLjYzVjZNMjAgOGg1IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIi8+PHBhdGggZD0iTTIyLjUgMjVzNC41LTcuNSAzLTEwLjVjMCAwLTEtMi41LTMtMi41cy0zIDIuNS0zIDIuNWMtMS41IDMgMyAxMC41IDMgMTAuNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9ImJ1dHQiIHN0cm9rZS1saW5lam9pbj0ibWl0ZXIiLz48cGF0aCBkPSJNMTEuNSAzN2M1LjUgMy41IDE1LjUgMy41IDIxIDB2LTdzOS00LjUgNi0xMC41Yy00LTYuNS0xMy41LTMuNS0xNiA0VjI3di0zLjVjLTMuNS03LjUtMTMtMTAuNS0xNi00LTMgNiA1IDEwIDUgMTBWMzd6IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjUgMzBjNS41LTMgMTUuNS0zIDIxIDBtLTIxIDMuNWM1LjUtMyAxNS41LTMgMjEgMG0tMjEgMy41YzUuNS0zIDE1LjUtMyAyMSAwIi8+PC9nPjwvc3ZnPg==');
}
.cg-wrap piece.pawn.black {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PHBhdGggZD0iTTIyLjUgOWMtMi4yMSAwLTQgMS43OS00IDQgMCAuODkuMjkgMS43MS43OCAyLjM4QzE3LjMzIDE2LjUgMTYgMTguNTkgMTYgMjFjMCAyLjAzLjk0IDMuODQgMi40MSA1LjAzLTMgMS4wNi03LjQxIDUuNTUtNy40MSAxMy40N2gyM2MwLTcuOTItNC40MS0xMi40MS03LjQxLTEzLjQ3IDEuNDctMS4xOSAyLjQxLTMgMi40MS01LjAzIDAtMi40MS0xLjMzLTQuNS0zLjI4LTUuNjIuNDktLjY3Ljc4LTEuNDkuNzgtMi4zOCAwLTIuMjEtMS43OS00LTQtNHoiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjwvc3ZnPg==');
}
.cg-wrap piece.bishop.black {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxnIGZpbGw9IiMwMDAiIHN0cm9rZS1saW5lY2FwPSJidXR0Ij48cGF0aCBkPSJNOSAzNmMzLjM5LS45NyAxMC4xMS40MyAxMy41LTIgMy4zOSAyLjQzIDEwLjExIDEuMDMgMTMuNSAyIDAgMCAxLjY1LjU0IDMgMi0uNjguOTctMS42NS45OS0zIC41LTMuMzktLjk3LTEwLjExLjQ2LTEzLjUtMS0zLjM5IDEuNDYtMTAuMTEuMDMtMTMuNSAxLTEuMzU0LjQ5LTIuMzIzLjQ3LTMtLjUgMS4zNTQtMS45NCAzLTIgMy0yeiIvPjxwYXRoIGQ9Ik0xNSAzMmMyLjUgMi41IDEyLjUgMi41IDE1IDAgLjUtMS41IDAtMiAwLTIgMC0yLjUtMi41LTQtMi41LTQgNS41LTEuNSA2LTExLjUtNS0xNS41LTExIDQtMTAuNSAxNC01IDE1LjUgMCAwLTIuNSAxLjUtMi41IDQgMCAwLS41LjUgMCAyeiIvPjxwYXRoIGQ9Ik0yNSA4YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAxIDEgNSAweiIvPjwvZz48cGF0aCBkPSJNMTcuNSAyNmgxME0xNSAzMGgxNW0tNy41LTE0LjV2NU0yMCAxOGg1IiBzdHJva2U9IiNlY2VjZWMiIHN0cm9rZS1saW5lam9pbj0ibWl0ZXIiLz48L2c+PC9zdmc+');
}
.cg-wrap piece.knight.black {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yMiAxMGMxMC41IDEgMTYuNSA4IDE2IDI5SDE1YzAtOSAxMC02LjUgOC0yMSIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yNCAxOGMuMzggMi45MS01LjU1IDcuMzctOCA5LTMgMi0yLjgyIDQuMzQtNSA0LTEuMDQyLS45NCAxLjQxLTMuMDQgMC0zLTEgMCAuMTkgMS4yMy0xIDItMSAwLTQuMDAzIDEtNC00IDAtMiA2LTEyIDYtMTJzMS44OS0xLjkgMi0zLjVjLS43My0uOTk0LS41LTItLjUtMyAxLTEgMyAyLjUgMyAyLjVoMnMuNzgtMS45OTIgMi41LTNjMSAwIDEgMyAxIDMiIGZpbGw9IiMwMDAiLz48cGF0aCBkPSJNOS41IDI1LjVhLjUuNSAwIDEgMS0xIDAgLjUuNSAwIDEgMSAxIDB6bTUuNDMzLTkuNzVhLjUgMS41IDMwIDEgMS0uODY2LS41LjUgMS41IDMwIDEgMSAuODY2LjV6IiBmaWxsPSIjZWNlY2VjIiBzdHJva2U9IiNlY2VjZWMiLz48cGF0aCBkPSJNMjQuNTUgMTAuNGwtLjQ1IDEuNDUuNS4xNWMzLjE1IDEgNS42NSAyLjQ5IDcuOSA2Ljc1UzM1Ljc1IDI5LjA2IDM1LjI1IDM5bC0uMDUuNWgyLjI1bC4wNS0uNWMuNS0xMC4wNi0uODgtMTYuODUtMy4yNS0yMS4zNC0yLjM3LTQuNDktNS43OS02LjY0LTkuMTktNy4xNmwtLjUxLS4xeiIgZmlsbD0iI2VjZWNlYyIgc3Ryb2tlPSJub25lIi8+PC9nPjwvc3ZnPg==');
}
.cg-wrap piece.rook.black {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik05IDM5aDI3di0zSDl2M3ptMy41LTdsMS41LTIuNWgxN2wxLjUgMi41aC0yMHptLS41IDR2LTRoMjF2NEgxMnoiIHN0cm9rZS1saW5lY2FwPSJidXR0Ii8+PHBhdGggZD0iTTE0IDI5LjV2LTEzaDE3djEzSDE0eiIgc3Ryb2tlLWxpbmVjYXA9ImJ1dHQiIHN0cm9rZS1saW5lam9pbj0ibWl0ZXIiLz48cGF0aCBkPSJNMTQgMTYuNUwxMSAxNGgyM2wtMyAyLjVIMTR6TTExIDE0VjloNHYyaDVWOWg1djJoNVY5aDR2NUgxMXoiIHN0cm9rZS1saW5lY2FwPSJidXR0Ii8+PHBhdGggZD0iTTEyIDM1LjVoMjFtLTIwLTRoMTltLTE4LTJoMTdtLTE3LTEzaDE3TTExIDE0aDIzIiBmaWxsPSJub25lIiBzdHJva2U9IiNlY2VjZWMiIHN0cm9rZS13aWR0aD0iMSIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIvPjwvZz48L3N2Zz4=');
}
.cg-wrap piece.queen.black {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxnIHN0cm9rZT0ibm9uZSI+PGNpcmNsZSBjeD0iNiIgY3k9IjEyIiByPSIyLjc1Ii8+PGNpcmNsZSBjeD0iMTQiIGN5PSI5IiByPSIyLjc1Ii8+PGNpcmNsZSBjeD0iMjIuNSIgY3k9IjgiIHI9IjIuNzUiLz48Y2lyY2xlIGN4PSIzMSIgY3k9IjkiIHI9IjIuNzUiLz48Y2lyY2xlIGN4PSIzOSIgY3k9IjEyIiByPSIyLjc1Ii8+PC9nPjxwYXRoIGQ9Ik05IDI2YzguNS0xLjUgMjEtMS41IDI3IDBsMi41LTEyLjVMMzEgMjVsLS4zLTE0LjEtNS4yIDEzLjYtMy0xNC41LTMgMTQuNS01LjItMTMuNkwxNCAyNSA2LjUgMTMuNSA5IDI2eiIgc3Ryb2tlLWxpbmVjYXA9ImJ1dHQiLz48cGF0aCBkPSJNOSAyNmMwIDIgMS41IDIgMi41IDQgMSAxLjUgMSAxIC41IDMuNS0xLjUgMS0xLjUgMi41LTEuNSAyLjUtMS41IDEuNS41IDIuNS41IDIuNSA2LjUgMSAxNi41IDEgMjMgMCAwIDAgMS41LTEgMC0yLjUgMCAwIC41LTEuNS0xLTIuNS0uNS0yLjUtLjUtMiAuNS0zLjUgMS0yIDIuNS0yIDIuNS00LTguNS0xLjUtMTguNS0xLjUtMjcgMHoiIHN0cm9rZS1saW5lY2FwPSJidXR0Ii8+PHBhdGggZD0iTTExIDM4LjVhMzUgMzUgMSAwIDAgMjMgMCIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9ImJ1dHQiLz48cGF0aCBkPSJNMTEgMjlhMzUgMzUgMSAwIDEgMjMgMG0tMjEuNSAyLjVoMjBtLTIxIDNhMzUgMzUgMSAwIDAgMjIgMG0tMjMgM2EzNSAzNSAxIDAgMCAyNCAwIiBmaWxsPSJub25lIiBzdHJva2U9IiNlY2VjZWMiLz48L2c+PC9zdmc+');
}
.cg-wrap piece.king.black {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0NSIgaGVpZ2h0PSI0NSI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yMi41IDExLjYzVjYiIHN0cm9rZS1saW5lam9pbj0ibWl0ZXIiLz48cGF0aCBkPSJNMjIuNSAyNXM0LjUtNy41IDMtMTAuNWMwIDAtMS0yLjUtMy0yLjVzLTMgMi41LTMgMi41Yy0xLjUgMyAzIDEwLjUgMyAxMC41IiBmaWxsPSIjMDAwIiBzdHJva2UtbGluZWNhcD0iYnV0dCIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIvPjxwYXRoIGQ9Ik0xMS41IDM3YzUuNSAzLjUgMTUuNSAzLjUgMjEgMHYtN3M5LTQuNSA2LTEwLjVjLTQtNi41LTEzLjUtMy41LTE2IDRWMjd2LTMuNWMtMy41LTcuNS0xMy0xMC41LTE2LTQtMyA2IDUgMTAgNSAxMFYzN3oiIGZpbGw9IiMwMDAiLz48cGF0aCBkPSJNMjAgOGg1IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIi8+PHBhdGggZD0iTTMyIDI5LjVzOC41LTQgNi4wMy05LjY1QzM0LjE1IDE0IDI1IDE4IDIyLjUgMjQuNWwuMDEgMi4xLS4wMS0yLjFDMjAgMTggOS45MDYgMTQgNi45OTcgMTkuODVjLTIuNDk3IDUuNjUgNC44NTMgOSA0Ljg1MyA5IiBzdHJva2U9IiNlY2VjZWMiLz48cGF0aCBkPSJNMTEuNSAzMGM1LjUtMyAxNS41LTMgMjEgMG0tMjEgMy41YzUuNS0zIDE1LjUtMyAyMSAwbS0yMSAzLjVjNS41LTMgMTUuNS0zIDIxIDAiIHN0cm9rZT0iI2VjZWNlYyIvPjwvZz48L3N2Zz4=');
}

@charset "UTF-8";
@font-face {
  font-family: "lichess";
  src: url("/font/lichess.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
:root {
  --bg: #1a1a1a;
  --text: #e8e8e8;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: 1;
  height: 1.4em;
}
input[type=range]:focus {
  outline: none;
}
input[type=range]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 0.5em;
  cursor: pointer;
  background: #3a3a3a;
  border-radius: 0.5em;
  border: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid #777;
  height: 1.1em;
  width: 1.1em;
  border-radius: 50%;
  background: #999;
  cursor: pointer;
  margin-top: -0.3em;
}
input[type=range]::-moz-range-track {
  width: 100%;
  height: 0.5em;
  cursor: pointer;
  background: #3a3a3a;
  border-radius: 0.5em;
  border: none;
}
input[type=range]::-moz-range-thumb {
  appearance: none;
  border: 2px solid #777;
  height: 1.1em;
  width: 1.1em;
  border-radius: 50%;
  background: #999;
  cursor: pointer;
  margin-top: -0.3em;
}
input[type=range]:hover::-webkit-slider-thumb {
  border-color: #4a9;
  background: #bbb;
}
input[type=range]:hover::-moz-range-thumb {
  border-color: #4a9;
  background: #bbb;
}
input[type=range]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid #4a9;
  outline-offset: 1px;
}

body ::-webkit-scrollbar,
body ::-webkit-scrollbar-corner {
  width: 0.5rem;
  background: #1a1a1a;
}

body ::-webkit-scrollbar-thumb {
  background: #3a3a3a;
}

body ::-webkit-scrollbar-thumb:hover,
body ::-webkit-scrollbar-thumb:active {
  background: #555;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #1a1a1a;
}

html,
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.app-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #222;
  background: #111;
  color: #8b8b8b;
  font-size: 0.78rem;
}
.app-legal a {
  color: #9fc7ff;
  text-decoration: none;
}
.app-legal a:hover {
  text-decoration: underline;
}
.app-legal__sep {
  color: #555;
}

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 52px;
  background: #111;
  border-bottom: 1px solid #222;
  position: relative;
}
.header__brand {
  font-size: 1rem;
  font-weight: 700;
  color: #e8e8e8;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.header__search {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 546px;
}
.header__bar {
  display: flex;
  align-items: center;
  gap: 0;
  height: 34px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}
.header__platform-toggle {
  flex-shrink: 0;
  padding: 0 12px;
  height: 34px;
  background: transparent;
  color: #e8e8e8;
  border: none;
  border-right: 1px solid #333;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.header__platform-toggle:hover {
  background: #222;
  color: #fff;
}
.header__input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  background: transparent;
  color: #e8e8e8;
  border: none;
  outline: none;
  font-size: 0.875rem;
}
.header__input::placeholder {
  color: #555;
}
.header__input:disabled {
  opacity: 0.5;
}
.header__input::-webkit-credentials-auto-fill-button, .header__input::-webkit-contacts-auto-fill-button, .header__input::-webkit-search-cancel-button, .header__input::-webkit-search-decoration {
  display: none;
}
.header__import {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  background: #2a4a2a;
  color: #8f8;
  border: none;
  border-left: 1px solid #333;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.1s;
}
.header__import:hover:not(:disabled) {
  background: #335533;
}
.header__import:disabled {
  opacity: 0.45;
  cursor: default;
}
.header__count {
  flex-shrink: 0;
  padding: 0 8px;
  font-size: 0.75rem;
  color: #6a9;
  cursor: pointer;
  white-space: nowrap;
  border-left: 1px solid #2a2a2a;
  height: 34px;
  display: flex;
  align-items: center;
}
.header__count:hover {
  color: #8fc;
}
.header__error {
  flex-shrink: 0;
  padding: 0 8px;
  font-size: 0.85rem;
  color: #f84;
  cursor: help;
  height: 34px;
  display: flex;
  align-items: center;
}
.header__toggle {
  flex-shrink: 0;
  width: 28px;
  height: 34px;
  background: transparent;
  color: #666;
  border: none;
  border-left: 1px solid #2a2a2a;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s;
}
.header__toggle:hover, .header__toggle.active {
  color: #aaa;
}
.header__toggle--filtered {
  color: #6a9;
}
.header__toggle--filtered::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6a9;
  position: absolute;
  top: 6px;
  right: 4px;
}
.header__nav {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.header__nav a {
  padding: 6px 10px;
  color: #888;
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.1s, background 0.1s;
}
.header__nav a:hover {
  color: #ccc;
  background: #1a1a1a;
}
.header__nav a.active {
  color: #e8e8e8;
}
.header__login {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 0.8rem;
  font: inherit;
  background: transparent;
  color: #6a9;
  text-decoration: none;
  border: 1px solid #2a4a2a;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.header__login:hover {
  color: #8fc;
  border-color: #3a6a3a;
}
.header__user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header__username {
  font-size: 0.8rem;
  color: #8a8;
  white-space: nowrap;
}
.header__logout {
  width: 20px;
  height: 20px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 3px;
  color: #666;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s, border-color 0.1s;
}
.header__logout:hover {
  color: #f66;
  border-color: #633;
}
.header__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 340px;
  max-width: 480px;
  background: #181818;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  z-index: 200;
  padding: 4px 0;
}
.header__backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
}
.header__panel-section {
  padding: 10px 14px;
}
.header__panel-divider {
  height: 1px;
  background: #252525;
  margin: 0;
}
.header__panel-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  flex-shrink: 0;
  margin-right: 2px;
}
.header__panel-label.--mt {
  margin-top: 14px;
}
.header__panel-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.header__panel-row + .header__panel-row {
  margin-top: 8px;
}
.header__panel-row.--mt {
  margin-top: 10px;
}
.header__date-input {
  height: 26px;
  padding: 0 6px;
  background: #222;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
}
.header__date-input:focus {
  border-color: #555;
}
.header__date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}
.header__panel-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #aaa;
  cursor: pointer;
  user-select: none;
}
.header__panel-hint {
  font-size: 0.75rem;
  color: #555;
  margin-right: 2px;
  flex-shrink: 0;
}
.header__panel-warn {
  font-size: 0.75rem;
  color: #c9a227;
  margin: 4px 0 0;
  line-height: 1.35;
}
.header__panel-btn {
  padding: 4px 12px;
  background: #222;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}
.header__panel-btn:hover {
  background: #2a2a2a;
  color: #e8e8e8;
}
.header__panel-error {
  font-size: 0.78rem;
  color: #f84;
}
.header__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  background: #222;
  color: #888;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.header__pill:hover {
  background: #2a2a2a;
  color: #ccc;
}
.header__pill.active {
  background: #1e3a1e;
  color: #6f6;
  border-color: #3a7a3a;
}
.header__pill[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
  font-size: 1em;
  line-height: 1;
}
.header__text-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  background: #111;
  border: 1px solid #383838;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-top: 6px;
}
.header__text-input::placeholder {
  color: #444;
}
.header__text-input:focus {
  border-color: #5a9a5a;
  box-shadow: 0 0 0 2px rgba(90, 154, 90, 0.15);
}
.header__text-input--short {
  width: 80px;
}
.header__pgn-input {
  width: 100%;
  background: #111;
  color: #ccc;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-family: monospace;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 6px;
}
.header__pgn-input::placeholder {
  color: #444;
}
.header__pgn-input:focus {
  border-color: #555;
}
.header__games-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 0 -14px;
  padding: 0 0 2px;
}
.header__game-item {
  display: flex;
  align-items: center;
}
.header__game-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  padding: 6px 14px;
  background: transparent;
  color: #aaa;
  border: none;
  border-radius: 0;
  text-align: left;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.1s;
}
.header__game-row:hover {
  background: #222;
  color: #e8e8e8;
}
.header__game-row.active {
  background: #1a2a1a;
  color: #8f8;
}
.header__game-badge {
  font-size: 0.75em;
  font-weight: 700;
  flex-shrink: 0;
}
.header__game-badge.--ok {
  color: #4a8;
}
.header__game-badge.--warn {
  color: #f84;
}
.header__game-badge.--missed-mate {
  color: #a855f7;
}
.header__mobile-nav {
  display: none;
  position: relative;
  flex-shrink: 0;
}
.header__hamburger {
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}
.header__hamburger:hover, .header__hamburger.active {
  background: #1e1e1e;
  color: #e8e8e8;
}
.header__mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
}
.header__mobile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: #181818;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  z-index: 300;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}
.header__mobile-link {
  padding: 11px 18px;
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.header__mobile-link:hover {
  background: #222;
  color: #e8e8e8;
}
.header__mobile-link.active {
  color: #e8e8e8;
  background: #1a2a1a;
}
@media (max-width: 600px) {
  .header {
    padding: 0 10px;
    gap: 6px;
  }
  .header__brand {
    display: none;
  }
  .header__nav {
    display: none;
  }
  .header__mobile-nav {
    display: block;
  }
  .header__search {
    max-width: none;
    flex: 1;
  }
  .header__platform-toggle {
    display: none;
  }
  .header__import {
    padding: 0 10px;
    font-size: 0.75rem;
  }
  .header__panel {
    left: -48px;
    right: 0;
    min-width: 0;
    max-width: none;
    border-radius: 0 0 8px 8px;
  }
}

@media (max-width: 600px) {
  .review-menu__trigger {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 0.82rem;
  }
}
@media (max-width: 600px) {
  .global-menu__dropdown.board-open {
    width: min(264px, 100vw - 20px);
  }
  .board-settings__slider-row {
    grid-template-columns: 68px 1fr 32px;
    gap: 4px;
  }
}
.dev-reset {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 0.75rem;
  background: #2a1a1a;
  color: #f66;
  border: 1px solid #4a2a2a;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.7;
}
.dev-reset:hover {
  opacity: 1;
  background: #3a1a1a;
}

.auth-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(0, 0, 0, 0.66);
}
.auth-modal__card {
  position: fixed;
  z-index: 261;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  background: #1b1b1b;
  border: 1px solid #3b3b3b;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.72);
  padding: 22px 24px 24px;
}
.auth-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.auth-modal__header h2 {
  margin: 0;
  color: #e8e8e8;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}
.auth-modal__close {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 9px;
}
.auth-modal__close:hover {
  color: #eee;
  background: #252525;
  border-color: #444;
}
.auth-modal__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.auth-modal__body p {
  margin: 0;
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.45;
}
.auth-modal__error {
  color: #f08f8f !important;
}
.auth-modal__success {
  color: #8fd7a2 !important;
}
.auth-modal__dev-link {
  color: #bbb !important;
}
.auth-modal__dev-link a {
  color: #8fc;
  text-decoration: none;
}
.auth-modal__dev-link a:hover {
  text-decoration: underline;
}
.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 2px;
}
.auth-modal__label {
  color: #cfcfcf;
  font-size: 0.78rem;
  font-weight: 600;
}
.auth-modal__email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.auth-modal__input {
  min-width: 0;
  border: 1px solid #3b3b3b;
  border-radius: 4px;
  background: #111;
  color: #eee;
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 10px;
}
.auth-modal__input:focus {
  outline: none;
  border-color: #4f8f6a;
  box-shadow: 0 0 0 2px rgba(79, 143, 106, 0.18);
}
.auth-modal__input:disabled {
  color: #777;
  background: #181818;
}
.auth-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.auth-modal__primary, .auth-modal__secondary {
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 14px;
}
.auth-modal__primary {
  background: #2b5c43;
  border: 1px solid #3e7c5c;
  color: #e9fff0;
}
.auth-modal__primary:hover {
  background: #346c50;
  border-color: #58a173;
}
.auth-modal__primary:disabled {
  cursor: default;
  opacity: 0.58;
}
.auth-modal__primary:disabled:hover {
  background: #2b5c43;
  border-color: #3e7c5c;
}
.auth-modal__secondary {
  background: #242424;
  border: 1px solid #3b3b3b;
  color: #ccc;
}
.auth-modal__secondary:hover {
  background: #2d2d2d;
  color: #eee;
}

@media (max-width: 520px) {
  .auth-modal__email-row {
    grid-template-columns: 1fr;
  }
  .auth-modal__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}
.detection-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.65);
}
.detection-modal__card {
  position: fixed;
  z-index: 200;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(580px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: #1c1c1c;
  border: 1px solid #484848;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
}
.detection-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.detection-modal__header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #e8e8e8;
}
.detection-modal__close {
  background: transparent;
  border: 1px solid transparent;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1;
}
.detection-modal__close:hover {
  color: #fff;
  border-color: #555;
  background: #2a2a2a;
}
.detection-modal__body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.detection-modal__row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.detection-modal__label {
  font-size: 1rem;
  font-weight: 600;
  color: #ddd;
}
.detection-modal__value {
  font-size: 0.9rem;
  color: #aaa;
  font-variant-numeric: tabular-nums;
  min-width: 5em;
  text-align: right;
}
.detection-modal__desc {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.5;
}
.detection-modal__slider-wrap {
  position: relative;
  padding-bottom: 18px;
}
.detection-modal input[type=range] {
  width: 100%;
}
.detection-modal__severity-slider {
  position: relative;
  padding-bottom: 26px;
}
.detection-modal__severity-slider .severity-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #4caf50, #f0a500, #e53935);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.detection-modal__severity-slider .severity-range::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(to right, #4caf50, #f0a500, #e53935);
  border-radius: 3px;
}
.detection-modal__severity-slider .severity-range::-moz-range-track {
  height: 6px;
  background: linear-gradient(to right, #4caf50, #f0a500, #e53935);
  border-radius: 3px;
  border: none;
}
.detection-modal__severity-slider .severity-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #e8e8e8;
  border: 2px solid #555;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s;
}
.detection-modal__severity-slider .severity-range::-webkit-slider-thumb:hover {
  border-color: #aaa;
}
.detection-modal__severity-slider .severity-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8e8e8;
  border: 2px solid #555;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.detection-modal .severity-divider--inaccuracy,
.detection-modal .severity-divider--mistake,
.detection-modal .severity-divider--blunder {
  position: absolute;
  top: 0;
  width: 2px;
  height: 6px;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%);
  pointer-events: none;
  border-radius: 1px;
}
.detection-modal .severity-divider--inaccuracy {
  left: 16.7%;
}
.detection-modal .severity-divider--mistake {
  left: 37.5%;
  background: rgba(255, 255, 255, 0.85);
}
.detection-modal .severity-divider--blunder {
  left: 58.3%;
}
.detection-modal__severity-ticks {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.detection-modal__severity-ticks span {
  font-size: 0.72rem;
  color: #777;
}
.detection-modal__default-mark {
  position: absolute;
  bottom: 2px;
  width: 2px;
  height: 10px;
  background: #c44;
  transform: translateX(-50%);
  border-radius: 1px;
  pointer-events: none;
}
.detection-modal__default-mark::after {
  content: "L";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: #c44;
  margin-top: 2px;
  white-space: nowrap;
}

.global-menu {
  position: relative;
  margin-left: auto;
}
.global-menu__trigger {
  padding: 4px 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid #444;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.global-menu__trigger:hover, .global-menu__trigger.active {
  background: #2a2a2a;
  border-color: #666;
}
.global-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
}
.global-menu__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 4px;
  min-width: 210px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.global-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  gap: 8px;
  box-sizing: border-box;
}
.global-menu__item:hover {
  background: #2a2a2a;
}
.global-menu__item--has-sub {
  user-select: none;
}
.global-menu__item--logout {
  color: #c77;
  border-top: 1px solid #2a2a2a;
  margin-top: 4px;
}
.global-menu__item--logout:hover {
  background: #2a1a1a;
  color: #f88;
}
.global-menu__item--toggle {
  cursor: default;
  padding-top: 7px;
  padding-bottom: 7px;
}
.global-menu__item--toggle .settings-toggle-row {
  width: 100%;
}
.global-menu__arrow {
  color: #888;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.global-menu__submenu {
  background: #161616;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
}
.global-menu__submenu .global-menu__item {
  padding-left: 28px;
  font-size: 0.825rem;
  color: #bbb;
}

.review-menu {
  position: relative;
}
.review-menu__trigger {
  padding: 4px 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid #444;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  line-height: 1.6;
}
.review-menu__trigger:hover, .review-menu__trigger.active {
  background: #1e3020;
  border-color: #5a8a5a;
  color: #9dca9d;
}
.review-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
}
.review-menu__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 4px;
  min-width: 200px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.review-menu__section {
  padding: 6px 14px;
  border-bottom: 1px solid #2a2a2a;
}
.review-menu__section:last-child {
  border-bottom: none;
}
.review-menu__label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 5px;
}
.review-menu__row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.review-menu__btn {
  padding: 3px 10px;
  background: #2a2a2a;
  color: var(--text);
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
}
.review-menu__btn:hover {
  background: #3a3a3a;
}
.review-menu__btn.--cancel {
  border-color: #7a3a3a;
  color: #c88;
}
.review-menu__btn.--cancel:hover {
  background: #3a1a1a;
}
.review-menu__pill {
  padding: 2px 8px;
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.78rem;
  cursor: pointer;
}
.review-menu__pill.active {
  background: #1e3020;
  border-color: #5a8a5a;
  color: #9dca9d;
}
.review-menu__pill:hover {
  background: #333;
}
.review-menu__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: default;
  gap: 8px;
}
.review-menu__toggle input {
  cursor: pointer;
  margin: 0;
}

body {
  ---zoom: 70;
  ---board-scale: calc((var(---zoom) / 100) * 0.75 + 0.25);
}

.analyse {
  display: grid;
  grid-template-columns: min((100vw - 32px - 34px - 240px) * var(---board-scale), (100vh - 5rem) * var(---board-scale)) 34px minmax(240px, 380px);
  grid-template-areas: "board  gauge  tools" "under  .      controls";
  align-items: start;
  padding: 24px 16px;
  gap: 0 0;
}

cg-resize {
  display: block;
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  z-index: 100;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
cg-resize::before, cg-resize::after {
  content: "";
  position: absolute;
  height: 2px;
  background: #aaa;
  border-radius: 1px;
  transition: background 0.12s;
}
cg-resize::before {
  width: 5px;
  transform: translate(7px, 8px) rotate(-45deg);
}
cg-resize::after {
  width: 12px;
  transform: translate(1px, 6px) rotate(-45deg);
}
cg-resize:hover {
  border-radius: 50%;
  background: rgba(74, 136, 136, 0.35);
}
cg-resize:hover::before, cg-resize:hover::after {
  background: #6bbfbf;
}
.resizing cg-resize {
  border-radius: 50%;
  background: rgba(74, 136, 136, 0.55);
}
.resizing cg-resize::before, .resizing cg-resize::after {
  background: #8dd4d4;
}

body.resizing {
  user-select: none;
  cursor: nwse-resize;
}

.eval-bar {
  grid-area: gauge;
  width: 26px;
  align-self: stretch;
  background: #333;
  display: flex;
  flex-direction: column-reverse;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5) inset;
}
.eval-bar--off {
  background: transparent;
  box-shadow: none;
}
.eval-bar__fill {
  background: #c8c8c8;
  width: 100%;
  transition: height 0.3s;
}
.eval-bar__tick {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0.35;
  border-bottom: 1px solid #888;
  pointer-events: none;
}
.eval-bar__tick.zero {
  opacity: 0.7;
  border-bottom: 2px solid #aaa;
}
.eval-bar__score {
  position: absolute;
  left: 0;
  right: 0;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  pointer-events: none;
  line-height: 1;
  transform: translateY(-2px);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9), 0 0 3px rgba(0, 0, 0, 0.9);
  z-index: 1;
}

.analyse__board {
  grid-area: board;
  display: flex;
  flex-direction: column;
}

.analyse__tools {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
  position: relative;
}

.action-menu {
  position: absolute;
  z-index: 10;
  inset: 0;
  background: #1a1a1a;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  gap: 6px;
  border-bottom: 2px solid #2e2e2e;
}
.action-menu h2 {
  font-size: 0.8em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  display: table;
  width: 100%;
  color: #666;
  margin: 4px 0 2px;
}
.action-menu h2::before, .action-menu h2::after {
  border-top: 1px solid #2e2e2e;
  content: "";
  display: table-cell;
  position: relative;
  top: 0.5em;
  width: 45%;
}
.action-menu h2::before {
  padding-inline-end: 8px;
}
.action-menu h2::after {
  padding-inline-start: 8px;
}
.action-menu__close-btn {
  align-self: flex-end;
  background: none;
  border: none;
  color: #666;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.action-menu__close-btn:hover {
  color: #ccc;
}
.action-menu__tools {
  display: grid;
  gap: 0 0.8em;
  grid-template-columns: repeat(auto-fill, minmax(14ch, 1fr));
}
.action-menu__tools button, .action-menu__tools > a {
  color: #ccc;
  display: flex;
  align-items: center;
  line-height: 1.2em;
  min-height: 3em;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 4px 0;
  font-size: 0.9em;
}
.action-menu__tools button::before, .action-menu__tools > a::before {
  padding-inline-end: 8px;
  font-size: 1.5em;
}
.action-menu__tools button:hover, .action-menu__tools > a:hover {
  color: #9cc9f5;
}
.action-menu__display {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.action-menu__display .settings-toggle-row {
  padding: 5px 0;
  border-bottom: 1px solid #222;
  font-size: 0.9em;
}
.action-menu__display .settings-toggle-row:last-of-type {
  border-bottom: none;
}
.action-menu__display .settings-toggle-row:hover .settings-toggle-row__label {
  color: #9cc9f5;
}
.action-menu__coming {
  color: #444;
  font-size: 0.8em;
  font-style: italic;
  padding: 6px 0;
}
.action-menu__slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #222;
  font-size: 0.9em;
  color: #ccc;
}
.action-menu__slider-row:last-child {
  border-bottom: none;
}
.action-menu__slider-row label {
  flex: 0 0 auto;
}
.action-menu__slider-row input[type=range] {
  flex: 1 1 auto;
  accent-color: #3893e8;
  min-width: 0;
}
.action-menu__val {
  flex: 0 0 auto;
  font-size: 0.85em;
  color: #888;
  min-width: 3ch;
  text-align: right;
}
.action-menu__back-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: #888;
  font-size: 0.85em;
  cursor: pointer;
  padding: 2px 0 6px;
  text-align: left;
}
.action-menu__back-btn:hover {
  color: #ccc;
}
.action-menu__subpanel {
  overflow-y: auto;
  flex: 1 1 0;
  min-height: 0;
  padding: 0 2px;
}
.action-menu__subpanel .detection-modal__row {
  border-bottom: 1px solid #222;
  padding: 8px 0;
}
.action-menu__subpanel .detection-modal__row:last-child {
  border-bottom: none;
}
.action-menu__subpanel .detection-modal__row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.action-menu__subpanel .detection-modal__label {
  font-size: 0.85em;
  color: #ccc;
}
.action-menu__subpanel .detection-modal__value {
  font-size: 0.8em;
  color: #888;
}
.action-menu__subpanel .detection-modal__desc {
  font-size: 0.75em;
  color: #666;
  margin: 0 0 6px;
  line-height: 1.4;
}
.action-menu__subpanel .detection-modal__slider-wrap,
.action-menu__subpanel .detection-modal__severity-slider {
  position: relative;
  padding-bottom: 4px;
}
.action-menu__subpanel input[type=range] {
  width: 100%;
  accent-color: #3893e8;
}
.action-menu__subpanel .settings-toggle-row {
  padding: 4px 0;
  font-size: 0.85em;
}

.analyse__moves {
  flex: 2 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 8px;
}

.move-list-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.retro-box {
  display: flex;
  flex-direction: column;
  flex: 0 0 50%;
  border-top: 1px solid #333;
  background: #1e1e1e;
  min-height: 0;
  overflow: hidden;
}
.retro-box .retro-box__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88em;
  line-height: 2em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0 8px;
  flex-shrink: 0;
  border-bottom: 1px solid #2a2a2a;
  color: #ccc;
}
.retro-box .retro-box__progress {
  color: #888;
  font-size: 0.95em;
}
.retro-box .retro-tone-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.retro-box .retro-tone-toggle input {
  display: none;
}
.retro-box .retro-tone-toggle__track {
  width: 28px;
  height: 16px;
  border-radius: 8px;
  background: #444;
  position: relative;
  transition: background 0.2s;
}
.retro-box .retro-tone-toggle__track::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: #ccc;
  transition: transform 0.2s, background 0.2s;
}
input:checked + .retro-box .retro-tone-toggle__track {
  background: #e06c4e;
}
input:checked + .retro-box .retro-tone-toggle__track::after {
  transform: translateX(12px);
  background: #fff;
}
.retro-box .retro-box__close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1em;
  padding: 0 2px;
  line-height: 1;
}
.retro-box .retro-box__close:hover {
  color: #ccc;
}
.retro-box .retro-feedback {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(50px, 10vh, 120px);
  overflow-y: auto;
}
.retro-box .retro-feedback.win, .retro-box .retro-feedback.view {
  flex-direction: row;
}
.retro-box .retro-player {
  display: flex;
  align-items: center;
  margin: 0 1em;
  flex: 1;
}
.retro-box .retro-player.retro-player--center {
  justify-content: center;
}
.retro-box .retro-king {
  font-size: 48px;
  line-height: 1;
  width: 56px;
  text-align: center;
  flex-shrink: 0;
  margin-inline-end: 10px;
  opacity: 0.85;
}
.retro-box .retro-icon {
  font-size: 52px;
  line-height: 1;
  width: 56px;
  text-align: center;
  flex-shrink: 0;
  margin-inline-end: 10px;
}
.retro-box .retro-icon.retro-icon--win {
  color: #759900;
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 1;
}
.retro-box .retro-icon.retro-icon--fail {
  color: #dc322f;
}
.retro-box .retro-icon.retro-icon--off {
  color: #e0a030;
}
.retro-box .retro-instruction {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.retro-box .retro-instruction strong {
  font-weight: normal;
  font-size: 1.1em;
  line-height: 1.35;
}
.retro-box .retro-instruction em {
  font-style: normal;
  font-size: 0.88em;
  color: #aaa;
  margin-top: clamp(0px, 0.3vh, 2px);
}
.retro-box .retro-choices {
  display: flex;
  justify-content: space-between;
  margin-top: clamp(2px, 0.8vh, 8px);
  line-height: 1.6em;
  font-size: 0.85em;
}
.retro-box .retro-choices a {
  color: #7cb5e8;
  cursor: pointer;
}
.retro-box .retro-choices a:hover {
  color: #aad4f5;
}
.retro-box .retro-choices.retro-choices--off {
  justify-content: flex-start;
}
.retro-box .retro-progress {
  margin-top: clamp(1px, 0.6vh, 6px);
  width: 100%;
  height: 4px;
  background: #2a2a2a;
}
.retro-box .retro-progress div {
  background: #759900;
  height: 4px;
  transition: width 0.5s;
  max-width: 100%;
}
.retro-box .retro-half {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
}
.retro-box .retro-half.retro-half--top {
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.retro-box .retro-continue {
  display: flex;
  flex: 0 1 30%;
  align-items: center;
  justify-content: center;
  background: rgba(56, 147, 232, 0.85);
  color: #fff;
  font-size: 1.2em;
  text-transform: uppercase;
  gap: 8px;
  cursor: pointer;
  padding: 0 12px;
  min-height: 60px;
  user-select: none;
}
.retro-box .retro-continue:hover {
  background: rgb(56, 147, 232);
}
.retro-box .retro-continue .retro-continue__icon {
  font-size: 1.6em;
}
.retro-box .retro-engine-reveal {
  text-align: center;
  padding: 6px 0 8px;
  border-top: 1px solid #2a2a2a;
  font-size: 0.82em;
}
.retro-box .retro-engine-reveal a {
  color: #888;
  cursor: pointer;
}
.retro-box .retro-engine-reveal a:hover {
  color: #aaa;
}
.retro-box .retro-vindication {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #759900;
  background: rgba(117, 153, 0, 0.1);
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.retro-box .retro-vindication__icon {
  font-size: 1.2rem;
  color: #759900;
}
.retro-box .retro-vindication__msg {
  margin: 0;
  font-size: 0.82rem;
  color: #aaa;
  line-height: 1.5;
}
.retro-box .retro-eval-boxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.retro-box .retro-eval-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.retro-box .retro-eval-box__label {
  font-size: 0.78rem;
  color: #888;
}
.retro-box .retro-eval-box__value {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 2.5em;
  text-align: right;
}
.retro-box .retro-eval-box.retro-eval-box--best {
  border-color: rgba(117, 153, 0, 0.45);
  background: rgba(117, 153, 0, 0.08);
}
.retro-box .retro-eval-box.retro-eval-box--best .retro-eval-box__value {
  color: #759900;
}
.retro-box .retro-eval-box.retro-eval-box--near {
  border-color: rgba(240, 165, 0, 0.45);
  background: rgba(240, 165, 0, 0.08);
}
.retro-box .retro-eval-box.retro-eval-box--near .retro-eval-box__value {
  color: #f0a500;
}
.retro-box .retro-eval-box.retro-eval-box--ok {
  border-color: rgba(122, 173, 223, 0.45);
  background: rgba(122, 173, 223, 0.08);
}
.retro-box .retro-eval-box.retro-eval-box--ok .retro-eval-box__value {
  color: #7aaddf;
}
.retro-box .retro-eval-box.retro-eval-box--bad {
  border-color: rgba(220, 50, 47, 0.45);
  background: rgba(220, 50, 47, 0.08);
}
.retro-box .retro-eval-box.retro-eval-box--bad .retro-eval-box__value {
  color: #dc322f;
}
.retro-box .retro-reason {
  margin-top: 10px;
  padding: 7px 10px;
  border-left: 3px solid #3a5a8a;
  background: rgba(56, 100, 160, 0.1);
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.retro-box .retro-reason__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7aaddf;
}
.retro-box .retro-reason__detail {
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid;
  border-radius: 0 3px 3px 0;
}
.retro-box .retro-reason__summary {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.4;
  margin-top: 4px;
  font-style: italic;
}
.retro-box .retro-save {
  margin-top: 10px;
}
.retro-box .retro-save__btn {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #3a5a8a;
  background: transparent;
  color: #7aaddf;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.retro-box .retro-save__btn:hover {
  background: rgba(56, 100, 160, 0.2);
  color: #a8ccee;
}
.retro-box .retro-save__done {
  font-size: 0.8rem;
  color: #666;
}
.retro-box .retro-save__confirm {
  font-size: 0.8rem;
  color: #759900;
  font-weight: 600;
}
.retro-box .retro-feedback {
  position: relative;
}
.retro-box .retro-engine-reveal {
  position: absolute;
  right: 10px;
  bottom: 8px;
  text-align: right;
  padding: 0;
  border-top: none;
  font-size: 0.82em;
  z-index: 1;
}
.retro-box .retro-engine-reveal a {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(30, 30, 30, 0.88);
  color: #888;
  cursor: pointer;
}
.retro-box .retro-engine-reveal a:hover {
  color: #aaa;
}

.fbt {
  background: transparent;
  color: #bbb;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.fbt[data-icon]::before {
  font-family: "lichess";
  font-style: normal;
  font-weight: normal;
  text-transform: none;
  speak: never;
  content: attr(data-icon);
  unicode-bidi: isolate;
  font-size: 1.3em;
  opacity: 0.9;
  vertical-align: middle;
}
@media (hover: hover) {
  .fbt:hover:not([disabled]) {
    background: rgba(56, 147, 232, 0.15);
    color: #e0e0e0;
  }
}
.fbt.active {
  background: rgba(56, 147, 232, 0.22);
  color: #9cc9f5;
}
.fbt[disabled] {
  opacity: 0.35;
  cursor: default;
}

.jumps {
  display: flex;
  padding: 3px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  gap: 2px;
}
.jumps .fbt {
  font-size: 1.25rem;
  flex: 1;
  border-radius: 5px;
  padding: 5px 10px;
  text-align: center;
  min-width: 44px;
}
.jumps .fbt[data-icon] {
  letter-spacing: 0;
  text-transform: none;
}
.jumps .fbt:first-child, .jumps .fbt:last-child {
  font-size: 0.9rem;
  min-width: 32px;
  padding: 5px 7px;
}

.analyse__controls .analyse-review-controls__row > button {
  background: #1e1e1e;
  color: #bbb;
  border: 1px solid #303030;
  border-radius: 6px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}
@media (hover: hover) {
  .analyse__controls .analyse-review-controls__row > button:hover:not([disabled]) {
    background: rgba(56, 147, 232, 0.15);
    border-color: rgba(56, 147, 232, 0.35);
    color: #e0e0e0;
  }
}
.analyse__controls .analyse-review-controls__row > button[disabled] {
  opacity: 0.35;
  cursor: default;
}
.analyse__controls .analyse-review-controls__row > button.active {
  background: rgba(56, 147, 232, 0.2);
  border-color: rgba(56, 147, 232, 0.5);
  color: #9cc9f5;
}

.move-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  column-gap: 4px;
  row-gap: 10px;
}
.move-nav-bar__left {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
}
.move-nav-bar__middle {
  flex: 0 0 auto;
}
.move-nav-bar__right {
  flex: 0 0 auto;
  margin-inline-start: 2px;
}

.analyse__controls {
  grid-area: controls;
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}
.analyse__controls .eval-graph--bg {
  display: none;
}

.analyse__underboard {
  grid-area: under;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
  min-width: 0;
}

@media (max-width: 800px) {
  .analyse {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "board" "controls" "tools" "under";
    grid-template-rows: auto auto auto auto;
    padding: 12px 10px 18px;
    gap: 8px 0;
    overflow-x: hidden;
  }
  .analyse__board,
  .analyse__tools,
  .analyse__controls,
  .analyse__underboard {
    min-width: 0;
  }
  .analyse__underboard .eval-graph {
    display: none;
  }
  .analyse__controls {
    padding: 4px 4px 0;
    gap: 4px;
    height: 5rem;
    align-items: stretch;
    touch-action: pan-y;
    position: relative;
    overflow: hidden;
    flex-wrap: nowrap;
  }
  .analyse__controls .move-nav-bar {
    height: 100%;
    gap: 2px;
    flex-wrap: nowrap;
  }
  .analyse__controls .move-nav-bar__left {
    flex: 0 0 auto;
    height: 100%;
  }
  .analyse__controls .move-nav-bar__left .analyse-review-controls {
    display: flex;
    height: 100%;
  }
  .analyse__controls .move-nav-bar__left .analyse-review-controls__row {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 2px;
    flex-wrap: nowrap;
  }
  .analyse__controls .move-nav-bar__left .analyse-review-controls__status {
    display: none;
  }
  .analyse__controls .move-nav-bar__left button {
    height: 100%;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 6px 6px 0 0;
    border: 1px solid #2e2e2e;
    border-bottom: none;
    background: #1a1a1a;
    color: #bbb;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.2;
  }
  .analyse__controls .move-nav-bar__left button.active {
    color: #9cc9f5;
    background: rgba(56, 147, 232, 0.15);
    border-color: rgba(56, 147, 232, 0.35);
  }
  .analyse__controls .move-nav-bar__left button[disabled] {
    opacity: 0.35;
    cursor: default;
  }
  .analyse__controls .move-nav-bar__middle {
    flex: 1 1 auto;
    height: 100%;
  }
  .analyse__controls .move-nav-bar__middle .jumps {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    gap: 2px;
  }
  .analyse__controls .move-nav-bar__middle .jumps .fbt {
    font-size: 1.4rem;
    padding: 6px 4px;
    border-radius: 6px 6px 0 0;
    border: 1px solid #2e2e2e;
    border-bottom: none;
    background: #1a1a1a;
    height: 100%;
  }
  .analyse__controls .move-nav-bar__right {
    flex: 0 0 auto;
    height: 100%;
    margin-inline-start: 0;
  }
  .analyse__controls .move-nav-bar__right .fbt {
    font-size: 1.4rem;
    height: 100%;
    padding: 6px 8px;
    border-radius: 6px 6px 0 0;
    border: 1px solid #2e2e2e;
    border-bottom: none;
    background: #1a1a1a;
  }
  .analyse__controls .jumps {
    flex: unset;
  }
  .analyse__controls .jumps .fbt:last-child {
    display: none;
  }
  .analyse__controls .eval-graph--bg {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .analyse__controls .eval-graph--bg svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  .analyse__controls > :not(.eval-graph--bg) {
    position: relative;
    z-index: 1;
  }
  .eval-bar,
  .analyse__player_strip,
  cg-resize {
    display: none !important;
  }
  .analyse__tools {
    align-self: start;
    min-height: 0;
    overflow: visible;
  }
  .ceval {
    min-height: 40px;
    column-gap: 4px;
  }
  .analyse__moves {
    flex: 0 0 auto;
    min-height: max(18em, 40vh);
    overflow-y: auto;
  }
  .retro-box {
    flex: 0 0 auto;
  }
  .retro-box .retro-icon {
    font-size: 38px;
    width: 42px;
    margin-inline-end: 8px;
  }
  .retro-box .retro-player {
    margin: 0 0.6em;
  }
  .retro-box .retro-feedback {
    min-height: 88px;
  }
  .retro-box .retro-instruction strong {
    font-size: 1em;
  }
  .retro-box .retro-continue {
    min-height: 52px;
    font-size: 1.05em;
  }
}
@media (max-height: 520px) {
  .retro-box .retro-player {
    margin: 0 6px;
  }
  .retro-box .retro-continue {
    flex: 0 1 18%;
    font-size: 0;
    gap: 0;
    padding: 0 8px;
    min-height: 52px;
  }
  .retro-box .retro-continue .retro-continue__icon {
    font-size: 1.5em;
  }
}
@media (max-height: 380px) {
  .retro-box .retro-box__title {
    line-height: 1.6em;
  }
  .retro-box .retro-feedback {
    min-height: 40px;
  }
  .retro-box .retro-continue {
    position: absolute;
    bottom: 0;
    right: 0;
    flex: none;
    width: auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0;
  }
  .retro-box .retro-continue .retro-continue__icon {
    font-size: 1.1em;
  }
}
@media (max-width: 800px) {
  .analyse__underboard {
    gap: 8px;
    padding-top: 0;
    overflow-x: hidden;
  }
  .game-list ul,
  .game-list__row,
  .games-view__table-wrap {
    min-width: 0;
  }
  .eval-graph,
  .game-list {
    width: 100%;
    max-width: 100%;
  }
}
.analyse__board-inner {
  position: relative;
  flex: 1;
}

.skeleton-board {
  aspect-ratio: 1;
  background: #1a1a2e;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.9rem;
}

.skeleton-block {
  height: 200px;
  background: #1a1a2e;
  border-radius: 4px;
}

.promotion-wrap {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  aspect-ratio: unset !important;
}

#promotion-choice {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
#promotion-choice square {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  background: #222;
  border: 1px solid #555;
  cursor: pointer;
  box-sizing: border-box;
}
#promotion-choice square:hover {
  background: #3a3a3a;
}
#promotion-choice piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
}

.analyse__player_strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px;
  min-height: 26px;
  font-size: 0.85rem;
  color: #ccc;
  width: 100%;
}

.player-strip__identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #454545;
}
.player-strip__identity--winner {
  border-color: #2f7f52;
}
.player-strip__identity--loser {
  border-color: #9a3d44;
}
.player-strip__identity--draw {
  border-color: #505050;
}

.analyse__clock {
  margin-left: auto;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #aaa;
  white-space: nowrap;
  padding: 1px 5px;
  background: #1e1e1e;
  border-radius: 3px;
}

.player-strip__color-icon {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.player-strip__color-icon--white {
  background: #e8e8e8;
  border: 1px solid #999;
}
.player-strip__color-icon--black {
  background: #222;
  border: 1px solid #777;
}

.player-strip__name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.material {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}
.material div {
  display: inline-block;
  margin-inline-start: 10px;
}
.material mpiece {
  margin-inline-start: -10px;
  background-size: cover;
  display: inline-block;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.material mpiece.pawn {
  background-image: url("../piece/mono/P.svg");
}
.material mpiece.bishop {
  background-image: url("../piece/mono/B.svg");
}
.material mpiece.knight {
  background-image: url("../piece/mono/N.svg");
}
.material mpiece.rook {
  background-image: url("../piece/mono/R.svg");
}
.material mpiece.queen {
  background-image: url("../piece/mono/Q.svg");
}
.material mpiece.king {
  background-image: url("../piece/mono/K.svg");
}
.material score {
  font-size: 0.75rem;
  color: #888;
  font-variant-numeric: tabular-nums;
  margin-top: -2px;
  margin-inline-start: 2px;
}

.cg-wrap piece.pawn.white {
  background-image: var(---white-pawn);
}

.cg-wrap piece.knight.white {
  background-image: var(---white-knight);
}

.cg-wrap piece.bishop.white {
  background-image: var(---white-bishop);
}

.cg-wrap piece.rook.white {
  background-image: var(---white-rook);
}

.cg-wrap piece.queen.white {
  background-image: var(---white-queen);
}

.cg-wrap piece.king.white {
  background-image: var(---white-king);
}

.cg-wrap piece.pawn.black {
  background-image: var(---black-pawn);
}

.cg-wrap piece.knight.black {
  background-image: var(---black-knight);
}

.cg-wrap piece.bishop.black {
  background-image: var(---black-bishop);
}

.cg-wrap piece.rook.black {
  background-image: var(---black-rook);
}

.cg-wrap piece.queen.black {
  background-image: var(---black-queen);
}

.cg-wrap piece.king.black {
  background-image: var(---black-king);
}

cg-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  border-radius: inherit;
  pointer-events: none;
}

body:not(.simple-board) cg-board::before {
  filter: brightness(calc(var(---board-brightness) / 100)) contrast(calc(var(---board-contrast) / 100)) hue-rotate(calc(var(---board-hue) * 3.6deg));
}

body[data-board=brown] cg-board::before {
  background-image: url("/images/board/brown.png");
}

body[data-board=horsey] cg-board::before {
  background-image: url("/images/board/horsey.png");
}

body[data-board=blue] cg-board::before {
  background-image: url("/images/board/blue.png");
}

body[data-board=green] cg-board::before {
  background-image: url("/images/board/green.png");
}

body[data-board=purple] cg-board::before {
  background-image: url("/images/board/purple.png");
}

body[data-board=purple-diag] cg-board::before {
  background-image: url("/images/board/purple-diag.png");
}

body[data-board=wood4] cg-board::before {
  background-image: url("/images/board/wood4.jpg");
}

body[data-board=maple] cg-board::before {
  background-image: url("/images/board/maple.jpg");
}

body[data-board=blue2] cg-board::before {
  background-image: url("/images/board/blue2.jpg");
}

body[data-board=blue3] cg-board::before {
  background-image: url("/images/board/blue3.jpg");
}

body[data-board=marble] cg-board::before {
  background-image: url("/images/board/marble.jpg");
}

body[data-board=olive] cg-board::before {
  background-image: url("/images/board/olive.jpg");
}

body[data-board=grey] cg-board::before {
  background-image: url("/images/board/grey.jpg");
}

body[data-board=metal] cg-board::before {
  background-image: url("/images/board/metal.jpg");
}

body[data-board=newspaper] cg-board::before {
  background-image: url("/images/board/svg/newspaper.svg");
}

.global-menu__dropdown.board-open {
  width: 264px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.board-settings {
  padding: 8px 10px 12px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.board-settings__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #666;
  margin: 10px 0 5px;
}
.board-settings__label:first-of-type {
  margin-top: 2px;
}
.board-settings__slider-row {
  display: grid;
  grid-template-columns: 80px 1fr 38px;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.board-settings__slider-row label {
  font-size: 0.78rem;
  color: #aaa;
  white-space: nowrap;
}
.board-settings__slider-row input[type=range] {
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.board-settings__slider-val {
  font-size: 0.72rem;
  color: #888;
  text-align: right;
  white-space: nowrap;
}
.board-settings__reset {
  align-self: flex-end;
  margin-top: 2px;
  padding: 2px 8px;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid #444;
  border-radius: 3px;
  color: #888;
  cursor: pointer;
}
.board-settings__reset:hover {
  border-color: #666;
  color: #ccc;
}
.board-settings__theme-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.board-settings__theme-tile {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  line-height: 0;
}
.board-settings__theme-tile span {
  display: block;
  width: 58px;
  height: 29px;
  background-size: cover;
  background-position: center;
  border-radius: 1px;
}
.board-settings__theme-tile:hover {
  border-color: #777;
}
.board-settings__theme-tile.active {
  border-color: #6a9;
}
.board-settings__piece-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  background: #1a1a1a;
  padding: 3px;
  border-radius: 3px;
}
.board-settings__piece-tile {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
}
.board-settings__piece-tile piece {
  position: absolute;
  inset: 4px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
.board-settings__piece-tile:hover {
  background: rgba(255, 255, 255, 0.08);
}
.board-settings__piece-tile.active {
  border-color: #6a9;
}

.cg-wrap coords {
  font-weight: bold;
  color: #fff;
  font-size: clamp(8px, 1.5cqw, 12px);
  text-shadow: var(---cg-cs, 0 1px 2px #000);
  user-select: none;
}
.cg-wrap coords .coord-light {
  color: var(---cg-ccb, #fff);
}
.cg-wrap coords .coord-dark {
  color: var(---cg-ccw, #fff);
}

.cg-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  container-type: inline-size;
}

.tview2 {
  white-space: normal;
}
.tview2 move {
  display: inline-block;
  padding: 0.25em 0.17em;
  cursor: pointer;
  color: #ccc;
}
.tview2 move.active {
  background: #2a6644;
  color: #fff;
}
.tview2 move.active index, .tview2 move.active eval {
  color: #fff;
}
.tview2 move:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
}
.tview2 move.context-active:not(.active) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: 1px solid rgba(255, 255, 255, 0.25);
}
.tview2 move.worst-miss {
  outline: 1px solid #9a3d44;
  border-radius: 2px;
}
.tview2 move index {
  font-size: 90%;
  color: #888;
  padding-inline-end: 0.15em;
}
.tview2 move glyph {
  margin-inline-start: 0.08em;
  vertical-align: bottom;
  font-size: 0.85em;
  user-select: none;
}
.tview2 move eval {
  margin-inline-start: 0.3em;
  font-size: 0.75em;
  color: #c084fc;
  user-select: none;
}
.tview2 inline {
  display: inline;
  font-style: italic;
  font-size: 0.9em;
  opacity: 0.8;
}
.tview2 inline move {
  margin-inline-start: 0;
}
.tview2 inline::before {
  content: "(";
  vertical-align: 0.7em;
  opacity: 0.7;
  font-size: 1.1em;
  margin-inline: 2px -2px;
}
.tview2 inline::after {
  content: ")";
  vertical-align: 0.7em;
  opacity: 0.7;
  font-size: 1.1em;
  margin-inline: -1px 1px;
}

.tview2-column {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  align-content: flex-start;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.tview2-column > index {
  flex: 0 0 13%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-inline-end: 6px;
  border-inline-end: 1px solid #222;
  background: #141414;
  color: #666;
  font-size: 0.82em;
  line-height: 1.75em;
  user-select: none;
}
.tview2-column > move {
  flex: 0 0 43.5%;
  box-sizing: border-box;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 0.3em 0 0.5em;
  font-size: 1.185em;
  line-height: 1.75em;
  border-radius: 0;
  margin-inline-end: 0;
  white-space: nowrap;
  overflow: hidden;
}
.tview2-column > move.empty {
  pointer-events: none;
  color: #444;
}
.tview2-column > interrupt {
  flex: 0 0 100%;
  background: #141414;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}
.tview2-column > interrupt lines {
  display: block;
  padding: 3px 4px 3px 8px;
}
.tview2-column > interrupt line {
  display: block;
  padding-inline-start: 7px;
  position: relative;
}
.tview2-column > interrupt line > button.variation-remove {
  background: transparent;
  border: none;
  padding: 0 4px 0 0;
  color: #555;
  font-size: 0.85em;
  cursor: pointer;
  vertical-align: middle;
  line-height: inherit;
  user-select: none;
}
.tview2-column > interrupt line > button.variation-remove:hover {
  color: #c66;
}
.tview2-column > interrupt line > branch {
  border-inline-start: 2px solid rgba(255, 255, 255, 0.12);
  margin-inline-start: -9px;
  position: absolute;
  width: 8px;
  height: 100%;
}
.tview2-column > interrupt line > branch::after {
  margin-top: 0.8em;
  content: " ";
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  position: absolute;
  width: 7px;
}
.tview2-column > interrupt move {
  font-size: 13px;
}

.btn-review {
  min-width: 90px;
  text-align: center;
}
.btn-review--complete {
  font-size: 0.7rem !important;
  letter-spacing: 0 !important;
  background: #1b3d28 !important;
  border-color: #2d6644 !important;
  color: #72c494 !important;
}
@media (hover: hover) {
  .btn-review--complete:hover:not([disabled]) {
    background: #244e34 !important;
    border-color: #3a8055 !important;
  }
}

.analyse-review-controls {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.analyse-review-controls__row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.analyse-review-controls__status {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.2;
}

.pgn-import {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pgn-import__input {
  width: 100%;
  box-sizing: border-box;
  background: #111;
  color: var(--text);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 8px;
  font-family: monospace;
  font-size: 0.8rem;
  resize: vertical;
}
.pgn-import__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pgn-import__error {
  color: #f66;
  font-size: 0.8rem;
}
.pgn-import__status {
  font-size: 0.78rem;
  color: #888;
  padding: 0 2px;
}

.game-list {
  width: 100%;
}
.game-list__header {
  font-size: 0.8rem;
  color: #888;
  padding: 4px 0;
}
.game-list__toolbar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 0 6px;
}
.game-list__toolbar .games-view__search {
  width: 100%;
  box-sizing: border-box;
}
.game-list__filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.game-list__filter-pills .games-view__pill {
  padding: 2px 7px;
  font-size: 0.75rem;
}
.game-list__filter-pills .games-view__clear {
  padding: 2px 7px;
  font-size: 0.75rem;
}
.game-list__no-results {
  font-size: 0.85rem;
  color: #888;
  padding: 8px 10px;
  font-style: italic;
}
.game-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}
.game-list li {
  display: flex;
  align-items: center;
}
.game-list li + li {
  border-top: 1px solid #2a2a2a;
}
.game-list__row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
.game-list__row:hover {
  background: #2a2a2a;
}
.game-list__row.active {
  background: #1e3a1e;
  color: #6f6;
}
.game-list__row.selected {
  background: #1a2035;
  outline: 1px inset #3a5a9a;
}
.game-list__row.analyzing {
  background: #1a2a18;
}
.game-list__progress {
  margin-left: auto;
  font-size: 0.72rem;
  color: #5a9a5a;
  min-width: 3ch;
  text-align: right;
}
.game-list__queue-status {
  font-size: 0.75rem;
  color: #7ab;
  padding: 3px 0 4px;
  font-style: italic;
}
.game-list__row-review {
  flex-shrink: 0;
  padding: 2px 8px;
  background: #1e3a1e;
  color: #6a9;
  border: 1px solid #2a5a2a;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.game-list__row-review:hover {
  background: #2a4a2a;
  color: #8fc;
}
.game-list__row-queue-split {
  flex-shrink: 0;
  display: flex;
  border: 1px solid #2a5a2a;
  border-radius: 3px;
  overflow: hidden;
}
.game-list__row-queue-btn {
  flex: 1;
  padding: 2px 6px;
  background: #1e3a1e;
  color: #6a9;
  border: none;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.game-list__row-queue-btn:hover {
  background: #2a4a2a;
  color: #8fc;
}
.game-list__row-queue-btn.--top {
  border-right: 1px solid #2a5a2a;
}
.game-list__row-progress {
  flex-shrink: 0;
  padding: 0 8px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: #5a9a5a;
  white-space: nowrap;
  min-width: 4ch;
  text-align: right;
}
.game-list__row-progress.--queued {
  color: #666;
  font-style: italic;
}
.game-list__row-progress.--accuracy {
  color: #7ab;
}
@media (max-width: 600px) {
  .game-list .grl__badge.--new {
    display: none;
  }
}

.games-view__analyzing-progress {
  font-size: 0.8rem;
  color: #5a9a5a;
  font-variant-numeric: tabular-nums;
}

.games-view__select-toggle {
  padding: 2px 9px;
  background: transparent;
  color: #888;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.games-view__select-toggle:hover {
  background: #222;
  color: #ccc;
}
.games-view__select-toggle.active {
  background: #2a3a2a;
  color: #8f8;
  border-color: #4a7a4a;
}

.games-view__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: #999;
}

.games-view__page-btn {
  padding: 3px 10px;
  background: #1e3a6e;
  color: #7ab;
  border: 1px solid #2a5a9a;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}
.games-view__page-btn:hover:not(:disabled) {
  background: #2a4a8e;
  color: #9cf;
}
.games-view__page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.games-view__page-info {
  font-size: 0.8rem;
  color: #999;
}

.games-view__review-all-btn {
  padding: 2px 9px;
  background: #1e3a6e;
  color: #7ab;
  border: 1px solid #2a5a9a;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.games-view__review-all-btn:hover {
  background: #2a4a8e;
  color: #9cf;
}

.grl__result {
  font-size: 0.6em;
  flex-shrink: 0;
  line-height: 1;
}
.grl__result--win {
  color: #4a8;
}
.grl__result--loss {
  color: #f66;
}
.grl__result--draw {
  color: #888;
}
.grl__result--unknown {
  color: #3a3a3a;
}
.grl__opponent {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grl__date {
  flex-shrink: 0;
  font-size: 0.75em;
  color: #555;
}
.grl__tc {
  flex-shrink: 0;
  font-size: 0.8em;
  color: #555;
  line-height: 1;
}
.grl__tc[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
}
.grl__badges {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.grl__badge {
  font-size: 0.7em;
  font-weight: 700;
}
.grl__badge.--new {
  color: #8fd36b;
}
.grl__badge.--ok {
  color: #4a8;
}
.grl__badge.--warn {
  color: #f84;
}
.grl__badge.--missed-mate {
  color: #a855f7;
}
.grl__opp-accuracy {
  font-size: 0.72em;
  color: #555;
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.color-chip {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 5px;
  flex-shrink: 0;
}
.color-chip.--white {
  background: #d8d8d8;
  border: 1px solid #888;
}
.color-chip.--black {
  background: #333;
  border: 1px solid #666;
}

.game-ext-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #3a3a3a;
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}
.game-ext-link::before {
  font-family: "lichess";
  content: "\e00f";
  font-size: 0.8rem;
  line-height: 1;
}
.game-ext-link:hover {
  color: #888;
  background: #2a2a2a;
}

.ceval {
  display: flex;
  align-items: stretch;
  column-gap: 6px;
  padding-top: 3px;
  background: #111;
  position: relative;
  min-height: 44px;
}
.ceval__progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #1a1a1a;
  overflow: hidden;
  pointer-events: none;
}
.ceval__progress-fill {
  position: relative;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4a9, #5cb);
  transition: width 0.4s linear;
}
.ceval__progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: -20px;
  width: 24px;
  height: 100%;
  background: linear-gradient(90deg, #7de, rgba(100, 230, 210, 0.6), transparent);
}
.ceval__progress-fill--done {
  background: #4a9;
  transition: none;
}
.ceval__progress-fill--done::after {
  display: none;
}
.ceval .cmn-toggle {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-inline-start: 6px;
}
.ceval .cmn-toggle.active {
  color: #6f6;
}
.ceval .cmn-toggle:hover {
  color: #ccc;
}
.ceval pearl {
  display: block;
  flex: 1 0 auto;
  line-height: 38px;
  font-size: 1.6em;
  text-align: center;
  font-weight: bold;
  color: #e8e8e8;
  font-variant-numeric: tabular-nums;
}
.ceval pearl.ceval__ko {
  color: #a855f7;
}
.ceval .engine {
  flex: 2 1 auto;
  font-size: 12px;
  line-height: 16px;
  margin-top: 3px;
  color: #888;
  overflow: hidden;
  white-space: nowrap;
  align-self: center;
}
.ceval .engine .info {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ceval .settings-gear {
  color: #888;
  font-size: 16px;
  padding: 0 8px;
  margin-inline-end: 4px;
  background: none;
  border: none;
  cursor: pointer;
  align-self: center;
}
.ceval .settings-gear:hover {
  color: #ccc;
}
.ceval .settings-gear.active {
  color: #fff;
  background: #2a6644;
  border-radius: 3px;
}

.pv_box {
  width: 100%;
  background: #111;
  font-size: 13px;
  position: relative;
}

.pv {
  font-size: 0.82rem;
  color: #aaa;
}
.pv--nowrap {
  display: block;
  height: 2em;
  line-height: 2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid #222;
  padding-inline-end: 6px;
}
.pv strong {
  display: inline-block;
  width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.pv__score--white {
  color: #d4d4a0;
}
.pv__score--black {
  color: #8fb8d4;
}
.pv__score--ko {
  color: #a855f7;
  font-weight: 700;
}
.pv__score--massive {
  color: hsl(129, 71%, 55%);
  font-weight: 700;
}
.pv--empty {
  color: transparent;
}

.pv-num {
  color: #555;
  font-size: 0.78rem;
  margin-inline-start: 4px;
  user-select: none;
}

.pv-san {
  cursor: pointer;
  margin-inline-start: 4px;
  border-radius: 2px;
}
.pv-san:hover {
  color: #e8e8e8;
  background: #2a2a2a;
  padding: 0 1px;
}

.pv-first {
  margin-inline-start: 4px;
  margin-inline-end: 8px;
}
.pv-first .pv-num {
  color: #888;
}
.pv-first .pv-san {
  color: #e8e8e8;
  font-weight: 700;
  font-size: 0.92rem;
}

.pv-cont {
  color: #666;
}
.pv-cont .pv-num {
  color: #444;
}
.pv-cont .pv-san {
  color: #666;
}
.pv-cont .pv-san:hover {
  color: #e8e8e8;
}

.pv-board-float {
  position: fixed;
  z-index: 50;
  pointer-events: none;
}
@media (max-width: 600px) {
  .pv-board-float {
    display: none;
  }
}
.pv-board-float {
  width: 384px;
  height: 384px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
.pv-board-float .cg-wrap {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.ceval__score {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  color: #e8e8e8;
}
.ceval__score--white {
  color: #d4d4a0;
}
.ceval__score--black {
  color: #8fb8d4;
}

.ceval__best {
  font-family: monospace;
  font-size: 0.85rem;
  color: #aaa;
  letter-spacing: 0.02em;
}

.ceval__info {
  font-size: 0.8rem;
  color: #555;
}

.ceval-settings {
  width: 100%;
  max-width: 600px;
  background: #111;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}
.ceval-settings__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ceval-settings__row--disabled {
  opacity: 0.35;
  pointer-events: none;
}
.ceval-settings__label {
  font-size: 0.8rem;
  color: #888;
  min-width: 46px;
}
.ceval-settings__val {
  font-size: 0.8rem;
  color: #aaa;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ceval-settings input[type=range] {
  flex: 1;
}
.ceval-settings input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.eval-graph {
  position: relative;
  width: 100%;
  padding-bottom: 18px;
}
.eval-graph svg {
  display: block;
  border-radius: 3px;
  overflow: hidden;
  background: #111;
  cursor: default;
}
.eval-graph rect[fill=transparent] {
  cursor: pointer;
}
.eval-graph circle {
  cursor: pointer;
}
.eval-graph__empty {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.8rem;
  background: #111;
  border-radius: 3px;
}
.eval-graph__resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  cursor: ns-resize;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.eval-graph__resize-handle::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(to right, #555 0px, #555 6px, transparent 6px, transparent 10px);
  transition: background 0.15s;
}
.eval-graph__resize-handle:hover {
  background: rgba(74, 136, 136, 0.12);
}
.eval-graph__resize-handle:hover::before {
  background: repeating-linear-gradient(to right, #4a8888 0px, #4a8888 6px, transparent 6px, transparent 10px);
}
.eval-graph__resize-handle:active::before {
  background: repeating-linear-gradient(to right, #6bbfbf 0px, #6bbfbf 6px, transparent 6px, transparent 10px);
}

.analysis-summary {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 600px;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

.summary__col {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.summary__col + .summary__col {
  border-left: 1px solid #333;
}

.summary__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary__color-icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.summary__color-icon--white {
  background: #e8e8e8;
  border: 1px solid #999;
}
.summary__color-icon--black {
  background: #333;
  border: 1px solid #888;
}

.summary__accuracy {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e8e8e8;
}

.summary__breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.75rem;
  color: #888;
}

.summary__blunder {
  color: hsl(0, 69%, 60%);
}

.summary__mistake {
  color: hsl(41, 100%, 45%);
}

.summary__inaccuracy {
  color: hsl(202, 78%, 62%);
}

.keyboard-help {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.keyboard-help__box {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 20px 24px;
  min-width: 320px;
  position: relative;
}
.keyboard-help__box h2 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: #e8e8e8;
}
.keyboard-help__box table {
  width: 100%;
  border-collapse: collapse;
}
.keyboard-help__box td {
  padding: 4px 8px 4px 0;
  font-size: 0.82rem;
  color: #aaa;
  vertical-align: middle;
}
.keyboard-help__box td:first-child {
  font-family: monospace;
  color: #e8e8e8;
  white-space: nowrap;
  padding-right: 16px;
}
.keyboard-help__box tr + tr td {
  border-top: 1px solid #2a2a2a;
}
.keyboard-help__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #666;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
}
.keyboard-help__close:hover {
  color: #e8e8e8;
}

.games-view {
  padding: 16px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.games-view__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #181818;
  border: 1px solid #282828;
  border-radius: 6px;
}
.games-view__filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.games-view__filter-group.--right {
  margin-left: auto;
  gap: 10px;
}
.games-view__filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.games-view__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #222;
  color: #888;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.games-view__pill:hover {
  background: #2a2a2a;
  color: #ccc;
}
.games-view__pill.active {
  background: #1e3a1e;
  color: #6f6;
  border-color: #3a7a3a;
}
.games-view__pill.--tactics {
  color: #f84;
  font-weight: 600;
}
.games-view__pill.--tactics:hover {
  background: #2a1a0a;
  color: #ffa060;
}
.games-view__pill.--tactics.active {
  background: #2e1500;
  color: #ffa060;
  border-color: #8b3a00;
}
.games-view__pill[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
  font-size: 0.9em;
  line-height: 1;
}
.games-view__search {
  height: 26px;
  padding: 0 8px;
  background: #222;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.8rem;
  outline: none;
  width: 130px;
}
.games-view__search:focus {
  border-color: #555;
}
.games-view__search::placeholder {
  color: #444;
}
.games-view__search::-webkit-search-cancel-button {
  display: none;
}
.games-view__summary {
  font-size: 0.78rem;
  color: #555;
  white-space: nowrap;
}
.games-view__clear {
  padding: 3px 10px;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.games-view__clear:hover {
  color: #ccc;
  border-color: #555;
}
.games-view__table-wrap {
  overflow-x: auto;
}
.games-view__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.games-view__table thead tr {
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}
.games-view__table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.games-view__table th:hover {
  color: #999;
}
.games-view__table--active {
  color: #aaa !important;
}
.games-view__th--active {
  color: #aaa !important;
}
.games-view__row {
  border-bottom: 1px solid #222;
  cursor: pointer;
  transition: background 0.08s;
}
.games-view__row td {
  padding: 8px 10px;
  vertical-align: middle;
}
.games-view__row:hover {
  background: #1e1e1e;
}
.games-view__row.active {
  background: #1a2a1a;
}
.games-view__row.selected {
  background: #1a2035;
  outline: 1px inset #3a5a9a;
}
.games-view__review-all-btn {
  padding: 4px 12px;
  background: #1e3a6e;
  color: #7ab;
  border: 1px solid #2a5a9a;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.games-view__review-all-btn:hover {
  background: #2a4a8e;
  color: #9cf;
}
.games-view__result {
  font-size: 0.65rem;
}
.games-view__result.--win {
  color: #4c8;
}
.games-view__result.--loss {
  color: #e44;
}
.games-view__result.--draw {
  color: #aa6;
}
.games-view__opponent {
  color: #ccc;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.games-view__rating-th {
  white-space: nowrap;
}
.games-view__rating {
  color: #666;
  font-size: 0.78rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.games-view__date {
  color: #666;
  white-space: nowrap;
}
.games-view__tc {
  color: #888;
  white-space: nowrap;
}
.games-view__tc [data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
  font-size: 0.9em;
}
.games-view__opening {
  color: #666;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.games-view__new-import {
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #8fd36b;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.games-view__link-cell {
  width: 32px;
  text-align: center;
  padding: 4px !important;
}
.games-view__review-th {
  white-space: nowrap;
}
.games-view__review-cell {
  white-space: nowrap;
  text-align: center;
  padding: 4px 8px !important;
}
.games-view__reviewed {
  color: #4c8;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 2px;
  cursor: default;
}
.games-view__missed {
  color: #f84;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: default;
}
.games-view__accuracy {
  font-size: 0.75rem;
  color: #8c8;
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.games-view__puzzles-th {
  white-space: nowrap;
}
.games-view__puzzles-cell {
  text-align: center;
  padding: 4px 8px !important;
}
.games-view__puzzle-count {
  font-size: 0.8rem;
  color: #88c;
  font-weight: 600;
  cursor: default;
}
.games-view__puzzle-none {
  color: #3a3a3a;
  font-size: 0.8rem;
  cursor: default;
}
.games-view__review-btn {
  padding: 2px 8px;
  font-size: 0.75rem;
  background: #1a1a1a;
  color: #888;
  border: 1px solid #333;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.games-view__review-btn:hover {
  background: #222;
  color: #ccc;
  border-color: #555;
}
.games-view__review-split {
  display: inline-flex;
  border: 1px solid #333;
  border-radius: 3px;
  overflow: hidden;
}
.games-view__review-queue-btn {
  flex: 1;
  padding: 2px 7px;
  background: #1a1a1a;
  color: #888;
  border: none;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.games-view__review-queue-btn:hover {
  background: #222;
  color: #ccc;
}
.games-view__review-queue-btn.--top {
  border-right: 1px solid #333;
}
.games-view__empty {
  padding: 48px 0;
  text-align: center;
  color: #555;
}
.games-view__empty p {
  margin: 4px 0;
}
.games-view__empty-hint {
  font-size: 0.82rem;
  color: #444;
}

#move-ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  min-width: 180px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  display: none;
}
#move-ctx-menu.visible {
  display: block;
}
#move-ctx-menu p.title {
  margin: 0;
  padding: 6px 12px 4px;
  font-size: 0.85em;
  font-weight: bold;
  color: #aaa;
  border-bottom: 1px solid #3a3a3a;
}
#move-ctx-menu a {
  display: block;
  padding: 6px 12px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: none;
}
#move-ctx-menu a:hover {
  background: #383838;
  color: #fff;
}
#move-ctx-menu a.ctx-puzzle {
  border-top: 1px solid #3a3a3a;
}
#move-ctx-menu a.ctx-puzzle + .ctx-puzzle {
  border-top: none;
}

.puzzle-create-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px 18px;
  color: #ddd;
  font-size: 0.9em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.puzzle-page {
  padding: 24px 16px 24px 8px;
}

.puzzle-library__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
}
.puzzle-library__resume {
  background: rgba(68, 170, 153, 0.1);
  border: 1px solid rgba(68, 170, 153, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.puzzle-library__resume-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a9;
  margin-bottom: 8px;
}
.puzzle-library__resume-count {
  font-size: 0.78rem;
  font-weight: 400;
  color: #888;
}
.puzzle-library__resume-actions {
  display: flex;
  gap: 6px;
}
.puzzle-library__resume-btn {
  flex: 1;
  padding: 6px 12px;
  background: #4a9;
  color: #111;
  border: none;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.puzzle-library__resume-btn:hover {
  background: #5cb;
}
.puzzle-library__resume-end {
  padding: 6px 10px;
  background: none;
  color: #888;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}
.puzzle-library__resume-end:hover {
  color: #ccc;
  border-color: #666;
}
.puzzle-library__card {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.puzzle-library__card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.puzzle-library__card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}
.puzzle-library__card-count {
  font-size: 0.78rem;
  color: #888;
}
.puzzle-library__card-desc {
  font-size: 0.78rem;
  color: #666;
  margin: 0;
  line-height: 1.3;
}
.puzzle-library__card-action {
  align-self: flex-start;
  margin-top: 2px;
  padding: 4px 12px;
  background: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.puzzle-library__card-action:hover:not(:disabled) {
  background: #4a9;
  color: #111;
  border-color: #4a9;
}
.puzzle-library__card-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.puzzle-library__section {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.puzzle-library__section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.puzzle-library__section-header h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
}
.puzzle-library__count {
  font-size: 0.82rem;
  color: #888;
  font-weight: 600;
}
.puzzle-library__action {
  padding: 5px 14px;
  background: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.puzzle-library__action:hover:not(:disabled) {
  background: #4a9;
  color: #111;
  border-color: #4a9;
}
.puzzle-library__action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.puzzle-list__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.puzzle-list__back {
  font-size: 0.82rem;
  color: #888;
  text-decoration: none;
  cursor: pointer;
}
.puzzle-list__back:hover {
  color: #4a9;
}
.puzzle-list__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
}
.puzzle-list__count {
  font-size: 0.78rem;
  color: #888;
}
.puzzle-list__filters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.puzzle-list__filter-label {
  color: #888;
  font-size: 0.78rem;
  font-weight: 500;
}
.puzzle-list__filter-input {
  width: 60px;
  padding: 3px 6px;
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.78rem;
}
.puzzle-list__filter-input::placeholder {
  color: #555;
}
.puzzle-list__filter-sep {
  color: #555;
  font-size: 0.78rem;
}
.puzzle-list__filter-select {
  padding: 3px 6px;
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.78rem;
  max-width: 140px;
}
.puzzle-list__filter-count {
  color: #888;
  font-size: 0.75rem;
  margin-left: auto;
}
.puzzle-list__scroll {
  overflow-y: auto;
  max-height: calc(100vh - 14rem);
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a1a;
}
.puzzle-list__row {
  display: grid;
  grid-template-columns: 1fr 50px 1fr 46px;
  gap: 4px 8px;
  padding: 5px 8px;
  font-size: 0.78rem;
  cursor: pointer;
  border-bottom: 1px solid #262626;
  transition: background 0.1s;
}
.puzzle-list__row:hover {
  background: #252525;
}
.puzzle-list__row--header {
  background: #222;
  color: #888;
  font-weight: 600;
  cursor: default;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #333;
}
.puzzle-list__row--header:hover {
  background: #222;
}
.puzzle-list__row-id {
  color: #4a9;
  font-family: monospace;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.puzzle-list__row-rating {
  color: #ccc;
  text-align: right;
}
.puzzle-list__row-themes {
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.puzzle-list__row-moves {
  color: #666;
  text-align: right;
}
.puzzle-list__empty {
  padding: 16px;
  color: #666;
  font-size: 0.85rem;
  text-align: center;
}
.puzzle-list__loading {
  color: #888;
  font-style: italic;
  padding: 12px;
}
.puzzle-list__load-more {
  width: 100%;
  padding: 6px;
  margin-top: 4px;
  font-size: 0.78rem;
  background: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
}
.puzzle-list__load-more:hover {
  background: #4a9;
  color: #111;
  border-color: #4a9;
}
.puzzle-list__load-shards {
  width: 100%;
  margin-top: 6px;
  font-size: 0.78rem;
}

.puzzle-session__rating {
  margin-bottom: 10px;
}
.puzzle-session__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 4px;
}
.puzzle-session__range-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.puzzle-session__range-label {
  font-size: 0.72rem;
  color: #666;
  width: 26px;
  flex-shrink: 0;
}
.puzzle-session__range {
  flex: 1;
  cursor: pointer;
}
.puzzle-session__range-val {
  font-size: 0.78rem;
  color: #ccc;
  font-family: monospace;
  width: 52px;
  text-align: right;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 2px 4px;
  -moz-appearance: textfield;
}
.puzzle-session__range-val::-webkit-inner-spin-button, .puzzle-session__range-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.puzzle-session__range-val:focus {
  outline: 1px solid #4a9;
  border-color: #4a9;
}
.puzzle-session__themes {
  overflow-y: auto;
  max-height: calc(100vh - 20rem);
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a1a;
  margin-bottom: 10px;
}
.puzzle-session__category:not(:first-child) {
  border-top: 1px solid #333;
}
.puzzle-session__category-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  padding: 6px 10px 2px;
  position: sticky;
  top: 0;
  background: #1a1a1a;
  z-index: 1;
}
.puzzle-session__category-label--clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
  user-select: none;
}
.puzzle-session__category-label--clickable:hover {
  color: #aaa;
}
.puzzle-session__category-label--clickable.active {
  color: #4a9;
}
.puzzle-session__category-label--clickable.partial {
  color: #888;
}
.puzzle-session__theme-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.puzzle-session__theme-row:hover {
  background: #252525;
}
.puzzle-session__theme-row.active {
  background: rgba(68, 170, 153, 0.15);
  color: #fff;
}
.puzzle-session__theme-row.active:hover {
  background: rgba(68, 170, 153, 0.22);
}
.puzzle-session__checkbox {
  font-size: 0.95rem;
  color: #666;
  line-height: 1;
  flex-shrink: 0;
}
.active > .puzzle-session__checkbox {
  color: #4a9;
}
.puzzle-session__theme-name {
  color: #ccc;
}
.active > .puzzle-session__theme-name {
  color: #fff;
}
.puzzle-session__tabs {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}
.puzzle-session__tab {
  flex: 1;
  padding: 6px 8px;
  background: #1a1a1a;
  color: #888;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.puzzle-session__tab:not(:last-child) {
  border-right: 1px solid #333;
}
.puzzle-session__tab:hover {
  background: #252525;
  color: #ccc;
}
.puzzle-session__tab.active {
  background: #333;
  color: #fff;
}
.puzzle-session__search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 8px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}
.puzzle-session__search-input {
  width: 100%;
  padding: 5px 8px;
  background: #222;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.82rem;
}
.puzzle-session__search-input::placeholder {
  color: #555;
}
.puzzle-session__search-input:focus {
  outline: 1px solid #4a9;
  border-color: #4a9;
}
.puzzle-session__start-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  margin-bottom: 4px;
}
.puzzle-session__start-bar .puzzle-session__selection-hint {
  flex: 1;
  font-size: 0.78rem;
  color: #888;
}
.puzzle-session__start-bar .puzzle-session__start {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.82rem;
}
.puzzle-session__error {
  background: rgba(224, 85, 85, 0.15);
  border: 1px solid rgba(224, 85, 85, 0.3);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #e05555;
  margin-bottom: 6px;
}
.puzzle-session__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.puzzle-session__selection-hint {
  font-size: 0.78rem;
  color: #888;
  text-align: center;
}
.puzzle-session__start {
  padding: 8px 16px;
  background: #4a9;
  color: #111;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.puzzle-session__start:hover:not(:disabled) {
  background: #5cb;
}
.puzzle-session__start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.puzzle__session-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}

.puzzle__side {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
  background: #1a1a1a;
  position: relative;
}
.puzzle__side .analyse__moves {
  flex: 2 1 0;
  overflow-y: auto;
  border-bottom: 1px solid #2a2a2a;
}
.puzzle__side .puzzle__feedback {
  flex: 1 0 auto;
  overflow-y: auto;
}

.session-info {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
}
.session-info__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.session-info__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a9;
}
.session-info__actions {
  display: flex;
  gap: 6px;
}
.session-info__retry {
  background: none;
  border: 1px solid #e8a040;
  border-radius: 3px;
  color: #e8a040;
  font-size: 0.72rem;
  padding: 2px 8px;
  cursor: pointer;
}
.session-info__retry:hover {
  background: #e8a040;
  color: #111;
}
.session-info__end {
  background: none;
  border: 1px solid #444;
  border-radius: 3px;
  color: #888;
  font-size: 0.72rem;
  padding: 2px 8px;
  cursor: pointer;
}
.session-info__end:hover {
  color: #ccc;
  border-color: #666;
}
.session-info__themes {
  font-size: 0.82rem;
  color: #ccc;
  line-height: 1.4;
  margin-bottom: 4px;
}
.session-info__rating {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 8px;
}
.session-info__stats {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
}
.session-info__stat {
  color: #888;
}
.session-info__stat--clean {
  color: #4a9;
  font-weight: 600;
}
.session-info__stat--assisted {
  color: #e8a040;
  font-weight: 600;
}
.session-info__stat--failed {
  color: #e05555;
  font-weight: 600;
}
.session-info__auto-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  color: #888;
  user-select: none;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.settings-toggle-row__label {
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: #ccc;
}

.settings-toggle {
  flex-shrink: 0;
  position: relative;
  width: 36px;
  height: 20px;
}
.settings-toggle input[type=checkbox] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.settings-toggle label {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #444;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.settings-toggle label::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ccc;
  transition: transform 0.2s, background 0.2s;
}
.settings-toggle input[type=checkbox]:checked + label {
  background: #4a9;
}
.settings-toggle input[type=checkbox]:checked + label::after {
  transform: translateX(16px);
  background: #fff;
}
.settings-toggle input[type=checkbox]:disabled + label {
  opacity: 0.4;
  cursor: not-allowed;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #444;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch__knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ccc;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch--on {
  background: #4a9;
}
.toggle-switch--on .toggle-switch__knob {
  transform: translateX(16px);
  background: #fff;
}

.session-history {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
}
.session-history__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin-bottom: 8px;
}
.session-history__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 22px);
  gap: 4px;
}
.session-history__cell {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: #333;
  border: 1px solid #444;
  transition: background 0.2s;
}
.session-history__cell--clean {
  background: #2d8a5e;
  border-color: #3a9;
}
.session-history__cell--assisted {
  background: #8a7a2d;
  border-color: #bb4;
}
.session-history__cell--failed {
  background: #a03030;
  border-color: #c44;
}
.session-history__cell--active {
  background: #8a7a2d;
  border-color: #bb4;
  animation: pulse-active 1.5s ease-in-out infinite;
}
.session-history__cell--current {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.session-history__continue {
  margin-top: 8px;
  width: 100%;
  padding: 6px 12px;
  background: #4a9;
  color: #111;
  border: none;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.session-history__continue:hover {
  background: #5cb;
}

@keyframes pulse-active {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
.puzzle {
  display: grid;
  grid-template-columns: min((100vw - 32px - 240px) * var(---board-scale), (100vh - 5rem) * var(---board-scale)) minmax(240px, 380px);
  gap: 0 16px;
  align-items: start;
}
.puzzle--with-session {
  grid-template-columns: minmax(280px, 320px) min((100vw - 32px - 280px - 280px) * var(---board-scale), (100vh - 5rem) * var(---board-scale)) minmax(240px, 340px);
}
.puzzle--library {
  grid-template-columns: minmax(280px, 320px) min((100vw - 32px - 320px) * var(---board-scale), (100vh - 5rem) * var(---board-scale));
}
.puzzle--library-preview {
  grid-template-columns: minmax(280px, 320px) min((100vw - 32px - 320px - 280px) * var(---board-scale), (100vh - 5rem) * var(---board-scale)) minmax(240px, 320px);
}
.puzzle__board {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: visible;
}
.puzzle__board-inner {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: visible;
  flex-shrink: 0;
}
.puzzle__board-inner .cg-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.puzzle__board-inner .cg-wrap cg-container {
  overflow: visible !important;
}
.puzzle__side {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  align-self: stretch;
  overflow: hidden;
  max-height: calc(100vh - 5rem);
}
.puzzle__side-top {
  display: flex;
  flex-direction: column;
  flex: 1 1 50%;
  min-height: 0;
  border-bottom: 1px solid #333;
}
.puzzle__side-bottom {
  display: flex;
  flex-direction: column;
  flex: 1 1 50%;
  min-height: 0;
  overflow-y: auto;
  gap: 8px;
  padding-top: 8px;
}

.puzzle-round__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.puzzle-round__back {
  font-size: 0.82rem;
  color: #888;
  text-decoration: none;
}
.puzzle-round__back:hover {
  color: #4a9;
}
.puzzle-round__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.puzzle-round__info {
  font-size: 0.85rem;
  border-collapse: collapse;
  width: 100%;
}
.puzzle-round__info td {
  padding: 3px 8px 3px 0;
  vertical-align: top;
}
.puzzle-round__label {
  color: #888;
  white-space: nowrap;
  font-weight: 500;
  width: 1%;
}
.puzzle-round__fen {
  font-family: monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: #aaa;
}
.puzzle-round__loading {
  color: #888;
  font-style: italic;
}
.puzzle-round__error {
  color: #e05555;
  font-weight: 500;
  margin-bottom: 8px;
}

.puzzle-moves {
  background: #222;
  border: 1px solid #333;
  border-radius: 0 0 6px 6px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  align-items: baseline;
  min-height: 32px;
  font-size: 0.85rem;
  flex: 1;
  overflow-y: auto;
  align-content: flex-start;
}
.puzzle-moves__empty {
  color: #666;
  font-style: italic;
  font-size: 0.82rem;
}
.puzzle-moves__num {
  color: #666;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 1px;
}
.puzzle-moves__move {
  padding: 1px 4px;
  border-radius: 3px;
  cursor: default;
}
.puzzle-moves__move--opponent {
  color: #aaa;
}
.puzzle-moves__move--user {
  color: #fff;
  font-weight: 600;
}
.puzzle-moves__move--current {
  background: rgba(68, 170, 153, 0.25);
}
.puzzle-moves__move--future {
  color: #555;
}

.puzzle-engine {
  background: #1e2228;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
}
.puzzle-engine__header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.puzzle-engine__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6ba3d6;
}
.puzzle-engine__score {
  font-size: 1rem;
  font-weight: 700;
  font-family: monospace;
  color: #ccc;
}
.puzzle-engine__score.positive {
  color: #4a9;
}
.puzzle-engine__score.negative {
  color: #e05555;
}
.puzzle-engine__depth {
  font-size: 0.72rem;
  color: #555;
  margin-left: auto;
}
.puzzle-engine__toggle {
  margin-left: auto;
  background: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}
.puzzle-engine__toggle:hover {
  background: #4a9;
  color: #111;
  border-color: #4a9;
}
.puzzle-engine__hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
}
.puzzle-engine__close {
  background: none;
  border: none;
  color: #666;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.puzzle-engine__close:hover {
  color: #ccc;
}
.puzzle-engine__pv {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  padding: 4px 0;
  font-size: 0.82rem;
}
.puzzle-engine__pv-move {
  color: #ccc;
  padding: 1px 3px;
  border-radius: 2px;
}
.puzzle-engine__pv-move:nth-child(odd) {
  color: #fff;
}
.puzzle-engine__pv-move:nth-child(even) {
  color: #999;
}
.puzzle-engine__pv-loading {
  color: #666;
  font-style: italic;
  font-size: 0.78rem;
}
.puzzle-engine--off {
  opacity: 0.7;
}
.puzzle-engine--on {
  border-color: rgba(107, 163, 214, 0.3137254902);
  background: #1e2228;
}

.puzzle-info {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 10px;
}
.puzzle-info__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.puzzle-info__summary:hover {
  color: #fff;
}
.puzzle-info__rating {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ccc;
}
.puzzle-info__expand {
  margin-left: auto;
  font-size: 0.65rem;
  color: #666;
}
.puzzle-info .puzzle-round__info {
  margin-top: 8px;
}

.puzzle__analyse {
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.puzzle__analyse.active {
  background: #4a9 !important;
  color: #111 !important;
  border-color: #4a9 !important;
}
.puzzle__analyse svg {
  display: block;
  color: inherit;
}

.puzzle-ceval {
  border-bottom: 1px solid #333;
}

.puzzle__feedback {
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px 16px;
}
.puzzle__feedback__player {
  display: flex;
  align-items: center;
  gap: 10px;
}
.puzzle__feedback__icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.puzzle__feedback__icon--turn {
  color: #888;
}
.puzzle__feedback__icon--success {
  color: #22c55e;
  font-size: 1.8rem;
}
.puzzle__feedback__icon--fail {
  color: #ef4444;
  font-size: 1.8rem;
}
.puzzle__feedback__instruction {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.puzzle__feedback__instruction strong {
  font-size: 0.95rem;
}
.puzzle__feedback__instruction em {
  font-size: 0.82rem;
  color: #999;
  font-style: normal;
}
.puzzle__feedback__result {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.puzzle__feedback__message {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.puzzle__feedback__message strong {
  font-size: 1rem;
}
.puzzle__feedback__message em {
  font-size: 0.82rem;
  color: #999;
  font-style: normal;
}
.puzzle__feedback__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.puzzle__feedback__nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #333;
}
.puzzle__feedback__revealed {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #eab308;
}
.puzzle__feedback__revealed em {
  font-style: normal;
}
.puzzle__feedback.good {
  border-color: rgba(34, 197, 94, 0.2509803922);
  background: rgba(34, 197, 94, 0.062745098);
}
.puzzle__feedback.fail {
  border-color: rgba(239, 68, 68, 0.1882352941);
  background: rgba(239, 68, 68, 0.062745098);
}
.puzzle__feedback.solved {
  border-color: rgba(34, 197, 94, 0.1882352941);
}
.puzzle__feedback.failed {
  border-color: rgba(239, 68, 68, 0.1882352941);
}

.puzzle__hint,
.puzzle__reveal,
.puzzle__skip,
.puzzle__engine-lines,
.puzzle__engine-arrows,
.puzzle__analyse {
  padding: 5px 12px;
  background: #333;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.puzzle__hint:hover:not(:disabled),
.puzzle__reveal:hover:not(:disabled),
.puzzle__skip:hover:not(:disabled),
.puzzle__engine-lines:hover:not(:disabled),
.puzzle__engine-arrows:hover:not(:disabled),
.puzzle__analyse:hover:not(:disabled) {
  background: #444;
}
.puzzle__hint:disabled,
.puzzle__reveal:disabled,
.puzzle__skip:disabled,
.puzzle__engine-lines:disabled,
.puzzle__engine-arrows:disabled,
.puzzle__analyse:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.puzzle__next,
.puzzle__retry {
  padding: 6px 16px;
  background: #4a9;
  color: #111;
  border: 1px solid #4a9;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.puzzle__next:hover,
.puzzle__retry:hover {
  background: #5cb;
}

.puzzle__retry {
  background: #333;
  color: #ccc;
  border-color: #444;
  font-weight: 400;
}
.puzzle__retry:hover {
  background: #444;
}

.puzzle__back-link {
  font-size: 0.82rem;
  color: #888;
  text-decoration: none;
  margin-left: auto;
}
.puzzle__back-link:hover {
  color: #4a9;
}

.puzzle__mq-summary {
  margin-top: 10px;
  border-top: 1px solid #333;
  padding-top: 8px;
}

.puzzle__mq-header {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 4px;
}

.puzzle__mq-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font-size: 0.85rem;
}

.puzzle__mq-move {
  font-family: monospace;
  color: #ccc;
  min-width: 48px;
}

.puzzle__mq-badge {
  display: inline-block;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.puzzle__mq-check {
  color: #22c55e;
  font-size: 0.9rem;
}

.puzzle__mq-note {
  font-size: 0.78rem;
  color: #999;
  font-style: italic;
}

.puzzle__mq-cp {
  font-size: 0.78rem;
  color: #888;
  font-family: monospace;
}

.puzzle-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #333;
}
.puzzle-meta__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.puzzle-meta__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.puzzle-meta__favorite {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.puzzle-meta__fav-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #555;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.puzzle-meta__fav-btn:hover {
  color: #e05555;
}
.puzzle-meta__fav-btn--active {
  color: #e05555;
}
.puzzle-meta__fav-label {
  font-size: 0.85rem;
  color: #999;
}
.puzzle-meta__notes {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.85rem;
  padding: 6px 8px;
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
}
.puzzle-meta__notes::placeholder {
  color: #555;
}
.puzzle-meta__notes:focus {
  outline: 1px solid #4a9;
  border-color: #4a9;
}
.puzzle-meta__tags {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.85rem;
  padding: 5px 8px;
}
.puzzle-meta__tags::placeholder {
  color: #555;
}
.puzzle-meta__tags:focus {
  outline: 1px solid #4a9;
  border-color: #4a9;
}
.puzzle-meta__folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.puzzle-meta__folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #333;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 0.78rem;
  color: #ccc;
}
.puzzle-meta__folder-remove {
  background: none;
  border: none;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.puzzle-meta__folder-remove:hover {
  color: #e05555;
}
.puzzle-meta__folder-empty {
  font-size: 0.78rem;
  color: #555;
  font-style: italic;
}
.puzzle-meta__folder-input {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.82rem;
  padding: 4px 8px;
  margin-top: 4px;
}
.puzzle-meta__folder-input::placeholder {
  color: #555;
}
.puzzle-meta__folder-input:focus {
  outline: 1px solid #4a9;
  border-color: #4a9;
}

@media (max-width: 800px) {
  .puzzle-page {
    padding: 12px 10px 18px;
  }
  .puzzle,
  .puzzle--with-session,
  .puzzle--library {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .puzzle__board {
    order: 1;
    width: 100%;
  }
  .puzzle__session-sidebar {
    order: 2;
    max-height: none;
    overflow-y: visible;
  }
  .puzzle-library__sidebar {
    order: 2;
  }
  .puzzle__side {
    order: 2;
    max-height: none;
    padding: 0 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .puzzle__side .puzzle__feedback {
    order: 1;
    flex: none;
    overflow-y: visible;
  }
  .puzzle__side .puzzle-ceval,
  .puzzle__side .analyse__moves {
    order: 2;
    flex: none;
    overflow-y: visible;
    border-bottom: none;
  }
  .puzzle__session-sidebar {
    order: 3;
    max-height: none;
    overflow-y: visible;
  }
  .puzzle__feedback {
    padding: 8px 10px;
  }
  .puzzle__feedback__actions {
    flex-wrap: wrap;
  }
  .puzzle__feedback__actions button {
    min-height: 40px;
    font-size: 0.85rem;
  }
  .session-info {
    padding: 8px 10px;
  }
  .session-info__stats {
    flex-wrap: wrap;
    gap: 6px;
  }
  .session-info__header {
    flex-wrap: wrap;
    gap: 6px;
  }
  .session-history__grid {
    grid-template-columns: repeat(auto-fill, 18px);
    gap: 3px;
  }
  .session-history__cell {
    width: 18px;
    height: 18px;
  }
  .puzzle-moves {
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.82rem;
    padding: 6px 8px;
    border-radius: 4px;
  }
  .puzzle-ceval .ceval {
    min-height: auto;
    padding: 4px 8px;
    font-size: 0.82rem;
  }
  .puzzle-ceval .ceval pearl {
    font-size: 1.3em;
  }
  .puzzle-ceval .ceval .engine {
    font-size: 0.78rem;
  }
  .puzzle-ceval .pv {
    font-size: 0.78rem;
    padding: 4px 8px;
  }
  .puzzle-engine {
    padding: 6px 8px;
  }
  .puzzle-engine__pv {
    font-size: 0.78rem;
  }
  .puzzle-session__themes {
    max-height: 50vh;
  }
  .session-info__themes {
    font-size: 0.8rem;
  }
  .session-info__rating {
    font-size: 0.75rem;
  }
  .session-info__auto-next {
    font-size: 0.8rem;
  }
  .session-history__label {
    font-size: 0.7rem;
  }
  .session-history__continue {
    min-height: 40px;
    font-size: 0.85rem;
  }
  .puzzle-session__start-bar {
    flex-wrap: wrap;
  }
  .puzzle-session__start-bar .puzzle-session__start {
    width: 100%;
    min-height: 44px;
    font-size: 0.9rem;
  }
  .puzzle-session__tab {
    padding: 10px 8px;
    font-size: 0.85rem;
  }
  .puzzle-session__theme-row {
    padding: 8px 10px;
    min-height: 40px;
    font-size: 0.85rem;
  }
  .puzzle-session__category-label {
    padding: 8px 10px 4px;
    font-size: 0.75rem;
  }
  .puzzle-session__range {
    height: 24px;
  }
  .puzzle-session__range-val {
    width: 56px;
    font-size: 0.82rem;
    padding: 4px 6px;
  }
  .puzzle-session__range-label {
    font-size: 0.75rem;
  }
  .puzzle-session__search-input {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .puzzle-library__card-action {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .puzzle-library__action {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .puzzle-library__card {
    padding: 10px;
  }
  .puzzle-info {
    padding: 6px 8px;
  }
  .puzzle-meta {
    padding: 6px 8px;
  }
  .puzzle-library__resume {
    padding: 8px 10px;
  }
  .puzzle-library__resume .puzzle-library__resume-btn {
    min-height: 44px;
    font-size: 0.9rem;
  }
  .puzzle-round__back {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
  }
  .puzzle__feedback__nav {
    gap: 6px;
  }
  .puzzle__feedback__nav button {
    min-height: 44px;
    font-size: 0.85rem;
    padding: 8px 14px;
  }
  .puzzle__feedback__nav a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .puzzle__next, .puzzle__retry {
    min-height: 44px;
    font-size: 0.9rem;
  }
  .toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 11px;
  }
  .toggle-switch__knob {
    width: 18px;
    height: 18px;
  }
  .toggle-switch--on .toggle-switch__knob {
    transform: translateX(18px);
  }
  .puzzle-info__summary {
    min-height: 36px;
    padding: 4px 0;
  }
  .session-info__end, .session-info__retry {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.75rem;
  }
  .puzzle__feedback,
  .session-info,
  .session-history,
  .puzzle-info,
  .puzzle-meta,
  .puzzle-library__card,
  .puzzle-library__section,
  .puzzle-library__resume {
    border-radius: 4px;
  }
}
.puzzle-library__preview-side {
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  position: relative;
}

.puzzle-library__preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #2e2e2e;
  flex-wrap: wrap;
}
.puzzle-library__preview-header h2 {
  font-size: 0.85rem;
  color: #ccc;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.puzzle-library__preview-play {
  font-size: 0.8rem;
  padding: 4px 10px;
  white-space: nowrap;
}

.puzzle-library__preview-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.puzzle-library__preview-close:hover {
  color: #ccc;
}

.puzzle-list__row--selected {
  background: #2a3a2a;
  color: #4a9;
}

.openings {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.openings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.openings__title {
  font-size: 1.4em;
  margin: 0;
}

.openings__new-btn,
.openings__start-btn {
  padding: 8px 16px;
  background: #2a4a2a;
  color: #8f8;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
}
.openings__new-btn:hover,
.openings__start-btn:hover {
  background: #335533;
}

.openings__empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}
.openings__empty p {
  margin: 8px 0;
}

.openings__hint {
  font-size: 0.9em;
  color: #777;
}

.openings__empty-icon {
  font-size: 3em;
  opacity: 0.3;
  margin-bottom: 8px;
}

.openings__empty-title {
  margin: 0 0 8px;
  font-size: 1.3em;
}

.openings__loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

.openings--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.openings__loading-card {
  text-align: center;
  padding: 40px 60px;
  background: #1e1e1e;
  border-radius: 8px;
  min-width: 360px;
}

.openings__loading-pct {
  font-size: 3.5rem;
  font-weight: 700;
  color: #4a9;
  text-align: center;
  line-height: 1;
  margin-bottom: 12px;
  font-family: monospace;
  letter-spacing: -2px;
  width: 4.5ch;
  margin-left: auto;
  margin-right: auto;
}

.openings__loading-title {
  margin: 0 0 8px;
  font-size: 1.1em;
  color: #ccc;
}

.openings__loading-bar {
  width: 100%;
  height: 22px;
  background: #252525;
  border-radius: 11px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.openings__loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d7a3a, #4a9);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78em;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(74, 153, 74, 0.3);
}

.openings__loading-detail {
  margin: 0;
  font-size: 0.9em;
  color: #888;
}

.openings__transfer {
  margin: 16px 0;
  text-align: center;
}

.openings__transfer-track {
  position: relative;
  height: 6px;
  background: #252525;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.openings__transfer-pulse {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #4a9, transparent);
  border-radius: 3px;
  animation: transfer-slide 1.5s ease-in-out infinite;
}

.openings__transfer-pulse--delayed {
  animation-delay: 0.75s;
  background: linear-gradient(90deg, transparent, #6ba3d6, transparent);
}

@keyframes transfer-slide {
  0% {
    left: -30%;
  }
  100% {
    left: 100%;
  }
}
.openings__transfer-count {
  font-size: 0.9rem;
  color: #ccc;
  font-weight: 600;
}

.openings__collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

.openings__collection-row {
  display: block;
  padding: 14px 16px;
  background: #202020;
  border: 1px solid #2d2d2d;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.openings__collection-row:hover {
  background: #252525;
  border-color: #3a3a3a;
}

.openings__card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
}

.openings__collection-name {
  font-weight: 700;
  font-size: 1rem;
  color: #ddd;
  letter-spacing: 0.01em;
}

.openings__collection-meta {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.openings__collection-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.openings__col-rename,
.openings__col-delete {
  background: none;
  border: none;
  color: #4a4a4a;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  transition: color 0.1s, background 0.1s;
}
.openings__col-rename:hover,
.openings__col-delete:hover {
  color: #ccc;
  background: #333;
}

.openings__col-delete:hover {
  color: #d05050;
  background: #321818;
}

.openings__card-wdl {
  margin-bottom: 12px;
}

.openings__card-wdl-bar {
  display: flex;
  width: 100%;
  height: 7px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.openings__card-wdl-bar span {
  display: inline-block;
  height: 100%;
  font-size: 0.6rem;
  line-height: 7px;
  text-align: center;
  overflow: hidden;
  transition: width 0.3s;
}
.openings__card-wdl-bar .wdl-w {
  background: #3a6e46;
}
.openings__card-wdl-bar .wdl-d {
  background: #3a3a3a;
}
.openings__card-wdl-bar .wdl-l {
  background: #5c2e2e;
}

.openings__card-wdl-labels {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.openings__card-wdl-labels .wdl-w {
  color: #5a9a6a;
}
.openings__card-wdl-labels .wdl-d {
  color: #555;
}
.openings__card-wdl-labels .wdl-l {
  color: #8a4a4a;
}

.openings__card-speeds {
  display: grid;
  gap: 1px;
  background: #2a2a2a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  overflow: hidden;
}

.openings__card-speed-col {
  background: #1c1c1c;
  padding: 8px 10px;
}

.openings__card-speed-hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #242424;
}

.openings__card-speed-icon {
  font-size: 0.8rem;
  color: #666;
}
.openings__card-speed-icon[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
  font-style: normal;
  font-weight: normal;
}

.openings__card-speed-name {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #666;
  flex: 1;
}

.openings__card-speed-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #444;
  font-variant-numeric: tabular-nums;
}

.openings__card-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}
.openings__card-stat span:first-child {
  color: #444;
}
.openings__card-stat span:last-child {
  color: #888;
  font-weight: 600;
}
.openings__card-stat.muted span:first-child {
  color: #383838;
}
.openings__card-stat.muted span:last-child {
  color: #585858;
  font-weight: 400;
}

.openings__save-line-row {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.openings__save-line-btn {
  font-size: 0.68rem;
  padding: 3px 12px;
  background: transparent;
  border: 1px solid #383838;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}
.openings__save-line-btn:hover {
  background: #222;
  color: #aaa;
}

.openings__save-feedback {
  font-size: 0.68rem;
  color: #629924;
  font-weight: 600;
}

.openings__pr-recency-toggle {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.openings__pr-recency-btn {
  font-size: 0.65rem;
  padding: 2px 8px;
  border: 1px solid #333;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}
.openings__pr-recency-btn:first-child {
  border-radius: 3px 0 0 3px;
}
.openings__pr-recency-btn:last-child {
  border-radius: 0 3px 3px 0;
}
.openings__pr-recency-btn.active {
  background: #282828;
  color: #aaa;
  border-color: #444;
}
.openings__pr-recency-btn:hover:not(.active) {
  color: #888;
}

.openings__pr-traps {
  margin-top: 16px;
}

.openings__pr-traps-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.openings__pr-trap-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1a1a1a;
  border: 1px solid #282828;
  border-left: 3px solid #ac3232;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.openings__pr-trap-card:hover {
  background: #222;
}

.openings__pr-trap-moves {
  font-size: 0.75rem;
  font-weight: 600;
  color: #bbb;
  flex: 1;
}

.openings__pr-trap-detail {
  display: flex;
  gap: 8px;
  font-size: 0.68rem;
  color: #777;
  flex: 2;
}

.openings__pr-trap-losses {
  color: #ac3232;
  font-weight: 600;
}

.openings__deviation-panel {
  padding: 8px 0;
}

.openings__deviation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.openings__deviation-scan-btn {
  font-size: 0.68rem;
  padding: 3px 10px;
  background: #282828;
  border: 1px solid #383838;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  transition: background 0.15s;
}
.openings__deviation-scan-btn:hover {
  background: #333;
  color: #ccc;
}

.openings__deviation-progress {
  font-size: 0.68rem;
  color: #666;
}

.openings__deviation-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.openings__deviation-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #1a1a1a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: background 0.15s;
}
.openings__deviation-row:hover {
  background: #222;
}

.openings__deviation-moves {
  font-weight: 600;
  color: #bbb;
  min-width: 80px;
}

.openings__deviation-detail {
  display: flex;
  gap: 6px;
  flex: 1;
  color: #777;
  font-size: 0.68rem;
}

.openings__deviation-opp {
  color: #c89b3c;
}

.openings__deviation-theory {
  color: #629924;
}

.openings__deviation-count {
  font-size: 0.62rem;
  color: #555;
}

.openings__deviation-empty {
  font-size: 0.7rem;
  color: #555;
  padding: 8px 0;
}

.openings__pr-term-section {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.openings__pr-term-grid,
.openings__pr-length-grid {
  background: #1a1a1a;
  border-radius: 6px;
  padding: 12px 14px;
}

.openings__pr-term-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.openings__pr-term-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.openings__pr-term-label {
  font-size: 0.65rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.openings__pr-term-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

.openings__pr-term-stat--highlight .openings__pr-term-value {
  color: #c89b3c;
}

.openings__pr-term-flag {
  font-size: 0.65rem;
  color: #c89b3c;
}

.openings__pr-recs {
  margin-top: 16px;
}

.openings__pr-recs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.openings__pr-rec-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1a1a1a;
  border: 1px solid #282828;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.openings__pr-rec-card:hover {
  background: #222;
}

.openings__pr-rec-action {
  font-size: 0.78rem;
  font-weight: 600;
  color: #bbb;
  flex: 1;
}

.openings__pr-rec-reason {
  font-size: 0.68rem;
  color: #666;
  flex: 2;
}

.openings__pr-rec--high {
  border-left: 3px solid #629924;
}

.openings__pr-rec--medium {
  border-left: 3px solid #c89b3c;
}

.openings__pr-rec--low {
  border-left: 3px solid #555;
}

.openings__practice-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.openings__practice-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.openings__practice-setup-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e0e0e0;
}

.openings__practice-setup-desc {
  font-size: 0.875rem;
  color: #999;
  line-height: 1.5;
}

.openings__practice-color-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.openings__practice-color-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
}

.openings__practice-color-btns {
  display: flex;
  gap: 8px;
}

.openings__practice-color-btn {
  flex: 1;
  padding: 9px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: #aaa;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.openings__practice-color-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}
.openings__practice-color-btn--active {
  background: #2a4a2a;
  border-color: #5a9a5a;
  color: #97c847;
  font-weight: 600;
}

.openings__practice-strength {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
}

.openings__practice-strength-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.strength-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strength-selector__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.strength-selector__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 8px;
  min-width: 52px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  color: #ccc;
  font-size: 0.7rem;
  transition: background 0.15s, border-color 0.15s;
}
.strength-selector__btn:hover {
  background: #333;
  border-color: #666;
}
.strength-selector__btn.active {
  background: #1565a8;
  border-color: #2196f3;
  color: #fff;
}

.strength-selector__num {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.strength-selector__lbl {
  font-size: 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

.strength-selector__info {
  font-size: 0.72rem;
  color: #888;
  font-style: italic;
}

@media (max-width: 600px) {
  .strength-selector__buttons {
    gap: 3px;
  }
  .strength-selector__btn {
    min-width: 38px;
    padding: 4px 5px;
  }
  .strength-selector__lbl {
    display: none;
  }
}
.openings__practice-setup-note {
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
}

.openings__practice-active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.openings__practice-source-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.openings__practice-source-banner.openings__practice-source--repertoire {
  background: rgba(97, 200, 71, 0.1);
  border: 1px solid rgba(97, 200, 71, 0.25);
  color: #97c847;
}
.openings__practice-source-banner.openings__practice-source--engine {
  background: rgba(90, 159, 212, 0.1);
  border: 1px solid rgba(90, 159, 212, 0.25);
  color: #5a9fd4;
}
.openings__practice-source-banner.openings__practice-source--exhausted {
  background: rgba(200, 100, 60, 0.1);
  border: 1px solid rgba(200, 100, 60, 0.25);
  color: #d48060;
}

.openings__practice-source-icon {
  font-size: 0.75rem;
  opacity: 0.9;
}

.openings__practice-source-text {
  font-size: 0.82rem;
  line-height: 1.4;
}

.openings__practice-freq-note {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}

.openings__practice-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.openings__practice-stat {
  font-size: 0.8rem;
  color: #888;
}

.openings__practice-stop-btn {
  margin-top: 8px;
  padding: 8px 0;
  background: rgba(180, 60, 60, 0.15);
  border: 1px solid rgba(180, 60, 60, 0.3);
  border-radius: 4px;
  color: #d48080;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s;
}
.openings__practice-stop-btn:hover {
  background: rgba(180, 60, 60, 0.25);
}

.openings__style {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
  max-width: 720px;
}

.openings__style-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.openings__style-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e0e0e0;
}

.openings__style-context {
  font-size: 0.85rem;
  color: #888;
}

.openings__style-confidence {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #888;
}
.openings__style-confidence.openings__style-conf--high {
  color: #97c847;
  background: rgba(151, 200, 71, 0.12);
}
.openings__style-confidence.openings__style-conf--medium {
  color: #c89b3c;
  background: rgba(200, 155, 60, 0.12);
}
.openings__style-confidence.openings__style-conf--low {
  color: #888;
}
.openings__style-confidence.openings__style-conf--insufficient {
  color: #666;
}

.openings__style-loading {
  color: #888;
  font-size: 0.9rem;
  padding: 12px 0;
}

.openings__style-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 10px;
}

.openings__style-signals {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.openings__style-signals-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.openings__style-signals-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 4px;
}

.openings__style-signal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}
.openings__style-signal--descriptive {
  border-left: 3px solid #555;
}
.openings__style-signal--interpretive {
  border-left: 3px solid #c89b3c;
}
.openings__style-signal--cautious {
  border-left: 3px solid #e06060;
}
.openings__style-signal--insufficient {
  opacity: 0.5;
}

.openings__style-signal-label {
  font-size: 0.875rem;
  color: #d4d4d4;
}

.openings__style-signal-caveat {
  font-size: 0.72rem;
  color: #666;
  font-style: italic;
}

.openings__style-first-moves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 540px) {
  .openings__style-first-moves {
    grid-template-columns: 1fr;
  }
}

.openings__style-fm-col {
  display: flex;
  flex-direction: column;
}

.openings__style-move-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.openings__style-move-row {
  display: grid;
  grid-template-columns: 40px 1fr 36px 46px;
  align-items: center;
  gap: 6px;
}

.openings__style-move-san {
  font-family: monospace;
  font-size: 0.875rem;
  color: #e0e0e0;
  font-weight: 600;
}

.openings__style-move-bar-wrap {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  height: 6px;
  overflow: hidden;
}

.openings__style-move-bar {
  height: 100%;
  background: #5a9fd4;
  border-radius: 2px;
  max-width: 100%;
}

.openings__style-move-pct {
  font-size: 0.8rem;
  color: #aaa;
  text-align: right;
}

.openings__style-move-count {
  font-size: 0.72rem;
  color: #666;
  text-align: right;
}

.openings__style-empty {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.openings__style-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.openings__style-form-periods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.openings__style-form-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 10px;
}

.openings__style-form-label {
  font-size: 0.75rem;
  color: #888;
  text-align: right;
}

.openings__style-wdl-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.openings__style-wdl-bar {
  display: flex;
  height: 7px;
  border-radius: 3px;
  overflow: hidden;
}

.openings__style-wdl-counts {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
}

.openings__style-wdl-total {
  color: #555;
  margin-left: auto;
}

.openings__style-trend {
  font-size: 0.85rem;
  color: #c89b3c;
  padding: 4px 0;
}

.openings__style-form-caveat {
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
}

.openings__style-player-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.openings__style-archetype {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.openings__style-archetype-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0e0e0;
}

.openings__style-archetype-qualifier {
  font-size: 0.78rem;
  color: #888;
}

.openings__style-card-wdl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.openings__style-axes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.openings__style-axes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.openings__style-axis-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.openings__style-axis-label {
  font-size: 0.72rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.openings__style-axis-track {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
  gap: 6px;
}

.openings__style-axis-pole {
  font-size: 0.72rem;
  color: #666;
}
.openings__style-axis-pole:first-child {
  text-align: right;
}
.openings__style-axis-pole:last-child {
  text-align: left;
}

.openings__style-axis-bar-wrap {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.openings__style-axis-bar {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #5a9fd4;
  border-radius: 50%;
}

.openings__style-behavioral {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.openings__style-behavioral-caveat-banner {
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
  padding: 4px 0;
}

.openings__style-behavioral-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.openings__style-behavioral-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.openings__style-behavioral-label {
  font-size: 0.875rem;
  color: #c8c8c8;
  font-weight: 600;
}

.openings__style-behavioral-detail {
  font-size: 0.8rem;
  color: #888;
}

.openings__style-behavioral-caveat {
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
}

.openings__small-sample-badge {
  display: inline-block;
  font-size: 0.65rem;
  color: #c89b3c;
  background: rgba(200, 155, 60, 0.12);
  border: 1px solid rgba(200, 155, 60, 0.25);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  white-space: nowrap;
}

.openings__pr-sparse-banner {
  background: rgba(200, 155, 60, 0.1);
  border: 1px solid rgba(200, 155, 60, 0.25);
  border-radius: 4px;
  color: #c89b3c;
  font-size: 0.75rem;
  padding: 6px 12px;
  margin-bottom: 12px;
}

.openings__sparkline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
}

.openings__sparkline-svg {
  flex-shrink: 0;
}

.openings__sparkline-current {
  font-size: 0.75rem;
  font-weight: 600;
  color: #999;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.openings__sparkline-trend {
  font-size: 0.7rem;
}
.openings__sparkline-trend.trend-up {
  color: #629924;
}
.openings__sparkline-trend.trend-down {
  color: #ac3232;
}
.openings__sparkline-trend.trend-flat {
  color: #666;
}

.openings__import {
  max-width: 500px;
  margin: 0 auto;
}

.openings__import-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.openings__import-header h2 {
  margin: 0;
  font-size: 1.2em;
}

.openings__cancel-btn,
.openings__back-btn {
  padding: 6px 14px;
  background: #444;
  color: #ccc;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.openings__cancel-btn:hover,
.openings__back-btn:hover {
  background: #555;
}

.openings__step h3 {
  margin: 0 0 12px;
  font-size: 1.05em;
}

.openings__source-options {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.openings__source-btn {
  padding: 8px 16px;
  background: #333;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
}
.openings__source-btn.active {
  background: #629924;
  color: #fff;
  border-color: #629924;
}
.openings__source-btn:hover:not(.active) {
  background: #444;
}

.openings__field {
  margin-bottom: 14px;
}
.openings__field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9em;
  color: #bbb;
}

.openings__input,
.openings__textarea {
  width: 100%;
  padding: 8px 10px;
  background: #2a2a2a;
  color: #e8e8e8;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 0.95em;
  box-sizing: border-box;
}

.openings__color-options {
  display: flex;
  gap: 8px;
}

.openings__filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.openings__filter-pill {
  padding: 5px 12px;
  background: #333;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88em;
  font-family: "lichess", sans-serif;
}
.openings__filter-pill.active {
  background: #629924;
  color: #fff;
  border-color: #629924;
}
.openings__filter-pill:hover:not(.active) {
  background: #444;
}

.openings__custom-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.88em;
  color: #999;
}

.openings__date-input {
  padding: 4px 8px;
  background: #2a2a2a;
  color: #e8e8e8;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 0.88em;
}

.openings__check-label {
  font-size: 0.92em;
  color: #ccc;
  cursor: pointer;
}
.openings__check-label input {
  margin-right: 6px;
}

.openings__input--short {
  width: 80px;
}

.openings__error {
  color: #e05050;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.openings__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.openings__import-btn, .openings__done-btn {
  display: block;
  width: 100%;
  padding: 13px 20px;
  margin-top: 4px;
  background: #629924;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  transition: background 0.12s;
}
.openings__import-btn:disabled, .openings__done-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.openings__import-btn:hover:not(:disabled), .openings__done-btn:hover:not(:disabled) {
  background: #4e7e1e;
}

.openings__next-btn {
  padding: 8px 20px;
  background: #629924;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
}
.openings__next-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.openings__next-btn:hover:not(:disabled) {
  background: #4e7e1e;
}

.openings__cancel-import-btn {
  padding: 3px 10px;
  background: #803030;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75em;
  flex-shrink: 0;
}
.openings__cancel-import-btn:hover {
  background: #993838;
}

.openings__done-summary {
  margin: 0 0 16px;
  color: #8c8;
}

.openings__progress {
  color: #bbb;
  margin-bottom: 8px;
}

.openings--session {
  max-width: 1400px;
}

.openings__session-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.openings__back-lib-btn {
  padding: 6px 12px;
  background: #444;
  color: #ccc;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.openings__back-lib-btn:hover {
  background: #555;
}

.openings__session-title {
  margin: 0;
  font-size: 1.15em;
}

.openings__session-meta {
  font-size: 0.85em;
  color: #999;
}

.openings__flip-btn {
  padding: 4px 10px;
  background: #333;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1.1em;
}
.openings__flip-btn:hover {
  background: #444;
}

.openings__session-body {
  display: grid;
  grid-template-columns: 72px min((100vw - 32px - 72px - 300px) * var(---board-scale), (100vh - 5rem) * var(---board-scale)) 1fr;
  gap: 16px;
  align-items: start;
}

.openings__tool-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  align-self: start;
}

.openings__tool-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.openings__tool-rail-btn:hover {
  background: #222;
  color: #aaa;
}
.openings__tool-rail-btn--active {
  background: #1a1a2e;
  color: #8b9fe8;
  border-left: 2px solid #8b9fe8;
}

.openings__tool-rail-icon {
  font-size: 1.4rem;
}
.openings__tool-rail-icon[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
}

.openings__tool-rail-label {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
}

.openings__board-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.openings__tool-content {
  grid-column: 2/-1;
  min-width: 0;
}
.openings__tool-content--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.openings__tool-placeholder-inner {
  text-align: center;
  color: #666;
}
.openings__tool-placeholder-inner h3 {
  font-size: 1.2em;
  margin: 0 0 8px;
  color: #888;
}
.openings__tool-placeholder-inner p {
  font-size: 0.9em;
  margin: 0;
}

.openings__session-panel {
  min-width: 0;
  overflow-x: hidden;
  position: relative;
}

.openings__repertoire-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 8px;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 6px;
}

.openings__repertoire-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b9fe8;
}

.openings__repertoire-context {
  font-size: 0.78rem;
  color: #666;
}

.openings__repertoire-overview {
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #222;
}

.openings__overview-wdl {
  margin-bottom: 6px;
}

.openings__overview-wdl-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
}
.openings__overview-wdl-bar .wdl-w {
  background: #5b9b5b;
}
.openings__overview-wdl-bar .wdl-d {
  background: #666;
}
.openings__overview-wdl-bar .wdl-l {
  background: #9b5b5b;
}

.openings__overview-wdl-counts {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
}
.openings__overview-wdl-counts .wdl-w {
  color: #5b9b5b;
}
.openings__overview-wdl-counts .wdl-d {
  color: #888;
}
.openings__overview-wdl-counts .wdl-l {
  color: #9b5b5b;
}

.openings__overview-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.openings__overview-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.openings__overview-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
}

.openings__overview-stat-value {
  font-size: 0.82rem;
  color: #ccc;
  font-weight: 500;
}

.openings__overview-caveat {
  font-size: 0.68rem;
  color: #555;
  margin-top: 5px;
  font-style: italic;
}

.openings__repertoire-summary {
  margin-bottom: 10px;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}

.openings__sum-section {
  margin-bottom: 8px;
}

.openings__sum-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin-bottom: 4px;
}

.openings__sum-perspective {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.openings__sum-color {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #aaa;
}
.openings__sum-color .white-dot {
  color: #ccc;
}
.openings__sum-color .black-dot {
  color: #777;
}

.openings__mini-wdl {
  display: flex;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
}
.openings__mini-wdl .wdl-w {
  background: #5b9b5b;
}
.openings__mini-wdl .wdl-d {
  background: #555;
}
.openings__mini-wdl .wdl-l {
  background: #9b5b5b;
}

.openings__sum-speeds {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.openings__sum-speed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  cursor: pointer;
  min-width: 52px;
  transition: background 0.1s, border-color 0.1s;
}
.openings__sum-speed-card:hover {
  background: #222;
  border-color: #444;
}
.openings__sum-speed-card--active {
  background: #1a1a2e;
  border-color: #8b9fe8;
}

.openings__sum-speed-name {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.04em;
}

.openings__sum-speed-count {
  font-size: 0.85rem;
  color: #ccc;
  font-weight: 500;
}

.openings__sum-recency {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #888;
}

.openings__line-insights {
  margin-bottom: 10px;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}

.openings__insights-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin-bottom: 6px;
}

.openings__insight-group {
  margin-bottom: 6px;
}

.openings__insight-group-label {
  font-size: 0.63rem;
  color: #666;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.openings__insight-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 8px;
  margin-bottom: 2px;
  background: #161616;
  border: 1px solid #252525;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.openings__insight-card:hover {
  background: #1e1e1e;
  border-color: #333;
}

.openings__insight-moves {
  font-size: 0.75rem;
  color: #ccc;
  font-family: monospace;
}

.openings__insight-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.openings__insight-freq {
  font-size: 0.68rem;
  color: #666;
}

.openings__insight-pct {
  font-size: 0.68rem;
  color: #8b9fe8;
}

.openings__prep-zone {
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 10px;
}
.openings__prep-zone .openings__repertoire-overview {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.openings__prep-zone .openings__repertoire-overview:not(:last-child) {
  border-bottom: 1px solid #1e1e1e;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.openings__prep-zone .openings__repertoire-summary {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.openings__prep-zone .openings__repertoire-summary:not(:last-child) {
  border-bottom: 1px solid #1e1e1e;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.openings__prep-zone .openings__line-insights {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.openings__prep-zone-loading {
  font-size: 0.75rem;
  color: #555;
  padding: 4px 0;
  font-style: italic;
}

.openings__zone-divider {
  height: 1px;
  background: #252525;
  margin: 6px 0 8px;
}

.openings__prep-report {
  padding: 8px 12px;
  max-width: 900px;
}

.openings__pr-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0 10px;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 12px;
}

.openings__pr-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7ba4d4;
}

.openings__pr-context {
  font-size: 0.8rem;
  color: #666;
}

.openings__pr-loading {
  font-size: 0.8rem;
  color: #555;
  padding: 16px 0;
  font-style: italic;
}

.openings__pr-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.openings__pr-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 4px;
  flex: 1;
  min-width: 180px;
  max-width: 300px;
}
.openings__pr-note--low {
  opacity: 0.7;
}

.openings__pr-note-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
}

.openings__pr-note-body {
  font-size: 0.78rem;
  color: #bbb;
  line-height: 1.4;
}

.openings__pr-overview {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.openings__pr-wdl {
  flex-shrink: 0;
  min-width: 160px;
}

.openings__pr-wdl-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.openings__pr-wdl-bar .wdl-w {
  background: #5b9b5b;
}
.openings__pr-wdl-bar .wdl-d {
  background: #666;
}
.openings__pr-wdl-bar .wdl-l {
  background: #9b5b5b;
}

.openings__pr-wdl-counts {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
}
.openings__pr-wdl-counts .wdl-w {
  color: #5b9b5b;
}
.openings__pr-wdl-counts .wdl-d {
  color: #888;
}
.openings__pr-wdl-counts .wdl-l {
  color: #9b5b5b;
}

.openings__pr-ecos {
  flex: 1;
  min-width: 0;
}

.openings__pr-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin-bottom: 6px;
}

.openings__pr-eco-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.75rem;
  color: #aaa;
  padding: 2px 0;
}
.openings__pr-eco-row:not(:last-child) {
  border-bottom: 1px solid #1a1a1a;
}

.openings__pr-eco-code {
  font-size: 0.68rem;
  color: #555;
  font-family: monospace;
  flex-shrink: 0;
}

.openings__pr-eco-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

.openings__pr-eco-count {
  font-size: 0.68rem;
  color: #666;
  flex-shrink: 0;
}

.openings__pr-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.openings__pr-col {
  min-width: 0;
}

.openings__pr-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.openings__pr-line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 8px;
  background: #161616;
  border: 1px solid #222;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.openings__pr-line-row:hover {
  background: #1e1e1e;
  border-color: #333;
}

.openings__pr-line-moves {
  font-size: 0.75rem;
  color: #ccc;
  font-family: monospace;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.openings__pr-line-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 8px;
}

.openings__pr-line-freq {
  font-size: 0.68rem;
  color: #555;
}

.openings__pr-line-pct {
  font-size: 0.68rem;
  color: #7ba4d4;
}

.openings__pr-line-recent {
  font-size: 0.63rem;
  color: #5b9b5b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.openings__pr-weaknesses {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.openings__pr-weakness-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px;
  background: #161616;
  border: 1px solid #222;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.openings__pr-weakness-row:hover {
  background: #1e1e1e;
  border-color: #333;
}
.openings__pr-weakness-row.openings__pr-weakness--low-score {
  border-left: 2px solid #9b5b5b;
}
.openings__pr-weakness-row.openings__pr-weakness--drift {
  border-left: 2px solid #7a6a4a;
}
.openings__pr-weakness-row.openings__pr-weakness--fresh-risk {
  border-left: 2px solid #5b7b9b;
}
.openings__pr-weakness-row.openings__pr-weakness--narrow {
  border-left: 2px solid #7a5b9b;
}

.openings__pr-weakness-label {
  font-size: 0.65rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  min-width: 60px;
}

.openings__pr-weakness-moves {
  font-size: 0.75rem;
  color: #bbb;
  font-family: monospace;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.openings__pr-weakness-freq {
  font-size: 0.68rem;
  color: #555;
  flex-shrink: 0;
}

.openings__pr-empty {
  font-size: 0.75rem;
  color: #444;
  padding: 8px 0;
  font-style: italic;
}

.openings__pr-caveat {
  font-size: 0.68rem;
  color: #555;
  margin-top: 6px;
  font-style: italic;
}

.openings__pr-section-hint {
  font-size: 0.68rem;
  color: #444;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
}

.openings__pr-line-nav {
  font-size: 0.75rem;
  color: #3a3a3a;
  flex-shrink: 0;
  margin-left: 4px;
  transition: color 0.1s;
}
.openings__pr-line-row:hover .openings__pr-line-nav, .openings__pr-target-row:hover .openings__pr-line-nav, .openings__pr-weakness-row:hover .openings__pr-line-nav {
  color: #7ba4d4;
}

.openings__pr-line-caveat {
  font-size: 0.63rem;
  color: #444;
  font-style: italic;
}

.openings__pr-boost-badge {
  font-size: 0.63rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.openings__pr-boost-badge.openings__pr-boost--hot {
  color: #d4a44a;
  background: rgba(212, 164, 74, 0.1);
  border: 1px solid rgba(212, 164, 74, 0.2);
}
.openings__pr-boost-badge.openings__pr-boost--fresh {
  color: #5b9b7a;
  background: rgba(91, 155, 122, 0.1);
  border: 1px solid rgba(91, 155, 122, 0.2);
}

.openings__pr-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 8px;
  background: #161616;
  border: 1px solid #222;
  border-left: 2px solid #5b7b5b;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.openings__pr-target-row:hover {
  background: #1e1e1e;
  border-color: #333;
  border-left-color: #7ba47a;
}

.openings__pr-target-score {
  font-size: 0.68rem;
  color: #5b9b7a;
  flex-shrink: 0;
}

.openings__pr-risk-strip {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #1e1e1e;
}

.openings__board-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: visible;
}
.openings__board-wrap .openings__board {
  position: absolute;
  inset: 0;
}

.openings__color-toggle {
  display: flex;
  border: 1px solid #303030;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 0;
}
.openings__color-toggle button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 0;
  min-height: 46px;
  background: #222;
  color: #666;
  border: none;
  border-right: 1px solid #303030;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.12s, color 0.12s;
}
.openings__color-toggle button:last-child {
  border-right: none;
}
.openings__color-toggle button:hover:not(.active) {
  background: #2a2a2a;
  color: #aaa;
}
.openings__color-toggle button.white-btn.active {
  background: #d0d0d0;
  color: #111;
  box-shadow: inset 0 0 0 4px rgba(35, 110, 35, 0.75), inset 0 5px 8px -4px rgba(0, 0, 0, 0.28);
}
.openings__color-toggle button.black-btn.active {
  background: #181818;
  color: #ccc;
  box-shadow: inset 0 0 0 2px rgba(80, 160, 80, 0.55), inset 0 3px 8px -2px rgba(0, 0, 0, 0.6);
}
.openings__color-toggle .openings__color-dot {
  font-size: 0.72rem;
  line-height: 1;
}
.openings__color-toggle .openings__color-username {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.55;
  line-height: 1;
  min-height: 0.75em;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.openings__color-toggle .openings__color-label {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.openings__color-toggle .openings__color-flip {
  flex: 0 0 36px;
  letter-spacing: 0;
  text-transform: none;
}
.openings__color-toggle .openings__color-flip[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
  font-style: normal;
  font-weight: normal;
  font-size: 1rem;
}

.openings__board {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.openings__board cg-container {
  overflow: visible !important;
}

.openings__player-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 0.82rem;
  color: #888;
  min-height: 24px;
}
.openings__player-strip--target {
  color: #ccc;
  font-weight: 600;
}
.openings__player-strip--top {
  border-bottom: 1px solid #2a2a2a;
}
.openings__player-strip--bottom {
  border-top: 1px solid #2a2a2a;
}

.openings__player-dot {
  font-size: 0.9rem;
  line-height: 1;
}

.openings__player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.openings__ceval {
  margin-top: 4px;
}

.openings__path {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 0.88em;
}

.openings__path-start {
  color: #999;
  cursor: pointer;
}
.openings__path-start:hover {
  color: #ccc;
}

.openings__path-move {
  color: #bbb;
  cursor: pointer;
}
.openings__path-move:hover {
  color: #fff;
  text-decoration: underline;
}
.openings__path-move::before {
  content: "›";
  color: #666;
}

.openings__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.openings__nav-btn {
  padding: 4px 10px;
  background: #333;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1em;
}
.openings__nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.openings__nav-btn:hover:not(:disabled) {
  background: #444;
}

.openings__nav-depth {
  font-size: 0.85em;
  color: #888;
  margin-left: 8px;
}

.openings__tree-build {
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #1a2520;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.openings__tree-build-bar {
  height: 6px;
  background: #252525;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.openings__tree-build-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d7a3a, #4a9);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

.openings__tree-build-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.openings__tree-build-label {
  font-size: 0.75em;
  color: #8a8;
}

.openings__fetch-label {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

.openings__lines-panel {
  background: #1e1e1e;
  border-radius: 4px;
  padding: 10px;
}

.openings__pos-header {
  padding: 7px 6px;
  margin-bottom: 8px;
  background: #272727;
  border: 1px solid #383838;
  border-radius: 4px;
}

.openings__pos-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.openings__pos-label {
  font-size: 0.78rem;
  color: #666;
}

.openings__pos-total {
  font-weight: 600;
  font-size: 0.95em;
}

.openings__moves-empty {
  text-align: center;
  color: #777;
  padding: 16px;
  font-size: 0.9em;
}

.openings__move-row {
  padding: 5px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.12s;
}
.openings__move-row:hover {
  background: #2a2a2a;
}

.openings__move-san {
  font-weight: 700;
  font-size: 0.88em;
  color: #e8e8e8;
  margin-right: 10px;
}

.openings__deviation-badge {
  display: inline-block;
  margin-left: 4px;
  color: #e6a520;
  font-size: 0.75em;
  vertical-align: super;
}

.openings__move-row--deviation {
  border-left: 2px solid #e6a520;
  padding-left: 6px;
}

.openings__move-count {
  font-size: 0.85em;
  color: #bbb;
}

.openings__result-bar {
  display: block;
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  font-size: 0;
  white-space: nowrap;
  margin-top: 3px;
}

.openings__bar-w,
.openings__bar-d,
.openings__bar-b {
  display: inline-block;
  height: 18px;
  line-height: 18px;
  text-align: center;
  overflow: hidden;
  font-size: 11px;
  vertical-align: top;
  transition: width 0.3s;
}

.openings__bar-w {
  background: #ccc;
  color: #222;
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.2);
}

.openings__bar-d {
  background: #666;
  color: #ddd;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.08);
  min-width: 3px;
}

.openings__bar-b {
  background: #333;
  color: #ddd;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.08);
}

.openings__speed-filter {
  border-top: 1px solid #282828;
  margin-top: 8px;
  padding-top: 8px;
}

.openings__speed-label-row {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 6px;
}

.openings__speed-chips {
  display: flex;
  gap: 6px;
}

.openings__speed-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  background: #1a1a1a;
  color: #484848;
  border: 1px solid #252525;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.openings__speed-chip:hover:not(.active) {
  background: #222;
  color: #666;
  border-color: #303030;
}
.openings__speed-chip.active {
  background: #2a2a2a;
  color: #b0b0b0;
  border-color: #404040;
}
.openings__speed-chip.active:hover {
  background: #313131;
  color: #c8c8c8;
}
.openings__speed-chip.no-games {
  opacity: 0.45;
}

.openings__speed-icon {
  font-size: 0.85rem;
  line-height: 1;
}
.openings__speed-icon[data-icon]::before {
  font-family: "lichess";
  content: attr(data-icon);
  font-style: normal;
  font-weight: normal;
}

.openings__speed-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: #3a3a3a;
  background: #141414;
  border-radius: 3px;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0;
}
.active .openings__speed-count {
  background: #1e1e1e;
  color: #666;
}

.openings__date-range-row {
  position: relative;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #1e1e1e;
}

.openings__date-range-btn-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.openings__date-range-btn {
  flex: 1;
  padding: 5px 8px;
  background: #2a2a2a;
  color: #b0b0b0;
  border: 1px solid #404040;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: left;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.openings__date-range-btn:hover {
  background: #313131;
  color: #c8c8c8;
  border-color: #505050;
}
.openings__date-range-btn.active {
  background: #2a2a2a;
  color: #b0b0b0;
  border-color: #404040;
}

.openings__date-range-clear {
  flex-shrink: 0;
  padding: 4px 7px;
  background: #1a1a1a;
  color: #555;
  border: 1px solid #252525;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.openings__date-range-clear:hover {
  background: #282828;
  color: #aaa;
  border-color: #404040;
}

.openings__date-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.openings__date-range-popup {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 51;
  min-width: 160px;
  background: #222;
  border: 1px solid #333;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.openings__date-range-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  color: #aaa;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  gap: 8px;
  text-align: left;
}
.openings__date-range-option:hover {
  background: #2a2a2a;
  color: #ddd;
}
.openings__date-range-option.active {
  color: #e0e0e0;
  background: #2e2e2e;
}

.openings__date-range-count {
  font-size: 0.7rem;
  color: #555;
  font-weight: 700;
  background: #1a1a1a;
  border-radius: 3px;
  padding: 1px 4px;
}
.active .openings__date-range-count {
  color: #777;
}

.openings__filter-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 0 6px;
}

.openings__filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  background: #2a2a2a;
  color: #b0b0b0;
  border: 1px solid #404040;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
}

.openings__filter-badge-clear {
  padding: 0 3px;
  background: transparent;
  color: #666;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.openings__filter-badge-clear:hover {
  color: #c8c8c8;
}

.openings__move-list {
  margin-top: 12px;
}
.openings__move-list .analyse__moves {
  flex: 0 0 auto;
  max-height: 16em;
  overflow-y: auto;
  background: #1e1e1e;
  border-radius: 4px 4px 0 0;
  padding: 6px 4px;
}
.openings__move-list .move-nav-bar {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 0;
}

.openings__samples {
  margin-top: 12px;
  background: #1e1e1e;
  border-radius: 4px;
  padding: 10px;
}

.openings__samples-title {
  margin: 0 0 8px;
  font-size: 0.95em;
  color: #bbb;
}

.openings__samples-empty {
  color: #777;
  font-size: 0.88em;
  text-align: center;
  padding: 8px;
}

.openings__sample-row {
  padding: 6px;
  border-radius: 3px;
}
.openings__sample-row:hover {
  background: #2a2a2a;
}
.openings__sample-row + .openings__sample-row {
  border-top: 1px solid #2a2a2a;
}
.openings__sample-row--clickable {
  cursor: pointer;
}
.openings__sample-row--clickable:hover {
  background: #2a3a2a;
}

.openings__sample-players {
  display: flex;
  justify-content: space-between;
  font-size: 0.92em;
}

.openings__sample-result {
  font-weight: 600;
  color: #999;
}

.openings__sample-info {
  font-size: 0.8em;
  color: #777;
  margin-top: 2px;
}

.openings__sample-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.openings__sample-copy,
.openings__sample-link {
  font-size: 0.78em;
  padding: 2px 8px;
  background: #333;
  color: #bbb;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
}
.openings__sample-copy:hover,
.openings__sample-link:hover {
  background: #444;
  color: #fff;
}

.openings__explorer {
  margin-top: 12px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.9em;
}

.openings__explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 0;
}

.openings__explorer-label {
  font-size: 0.9em;
  color: #bbb;
  cursor: pointer;
}
.openings__explorer-label input {
  margin-right: 6px;
}

.openings__explorer-gear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  padding: 0 2px;
  opacity: 0.6;
}
.openings__explorer-gear:hover {
  opacity: 1;
}

.openings__explorer-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 10px 0;
}

.openings__explorer-tab {
  flex: 1;
  background: #252525;
  border: none;
  color: #888;
  font-size: 0.82em;
  padding: 4px 0;
  border-radius: 3px;
  cursor: pointer;
}
.openings__explorer-tab:hover {
  color: #bbb;
  background: #2c2c2c;
}
.openings__explorer-tab.active {
  background: #333;
  color: #ddd;
  font-weight: 600;
}

.openings__explorer-config {
  padding: 8px 10px;
}

.openings__explorer-config-section {
  margin-bottom: 10px;
}
.openings__explorer-config-section label {
  display: block;
  font-size: 0.8em;
  color: #999;
  margin-bottom: 4px;
}

.openings__explorer-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.openings__explorer-filter-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #888;
  font-size: 0.78em;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.openings__explorer-filter-btn:hover {
  color: #bbb;
}
.openings__explorer-filter-btn.active {
  background: #3a5a3a;
  border-color: #4a8;
  color: #8d8;
}

.openings__explorer-date-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82em;
  color: #999;
  margin-bottom: 4px;
}
.openings__explorer-date-label input {
  background: #222;
  border: 1px solid #444;
  color: #ccc;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  width: 90px;
}

.openings__explorer-player-input {
  width: 100%;
  background: #222;
  border: 1px solid #444;
  color: #ccc;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.88em;
  margin-bottom: 6px;
  box-sizing: border-box;
}

.openings__explorer-player-prev {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 6px;
}

.openings__explorer-prev-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #aaa;
  font-size: 0.78em;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.openings__explorer-prev-btn:hover {
  color: #ddd;
  border-color: #666;
}

.openings__explorer-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.openings__explorer-color-row label {
  margin-bottom: 0;
}

.openings__explorer-config-close {
  display: block;
  width: 100%;
  background: #2a3a2a;
  border: 1px solid #4a8;
  color: #8d8;
  padding: 5px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.88em;
  margin-top: 4px;
}
.openings__explorer-config-close:hover {
  background: #3a4a3a;
}

.openings__explorer-loading,
.openings__explorer-empty {
  color: #777;
  font-size: 0.88em;
  text-align: center;
  padding: 10px 8px;
}

.openings__explorer-error {
  color: #e05050;
  font-size: 0.88em;
  padding: 8px 10px;
}

.openings__explorer-box {
  position: relative;
  min-height: 48px;
  transition: opacity 0.3s;
}
.openings__explorer-box.reduced {
  opacity: 0.5;
}
.openings__explorer-box.loading .overlay {
  opacity: 1;
  pointer-events: all;
}
.openings__explorer-box .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1;
}
.openings__explorer-box .overlay::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid #555;
  border-top-color: #6bbfbf;
  border-radius: 50%;
  animation: explorer-spin 0.6s linear infinite;
}

@keyframes explorer-spin {
  to {
    transform: rotate(360deg);
  }
}
.openings__explorer-message {
  padding: 16px 10px;
  text-align: center;
  color: #aaa;
}
.openings__explorer-message strong {
  display: block;
  font-size: 1em;
  color: #ccc;
  margin-bottom: 6px;
}

.openings__explorer-explanation {
  font-size: 0.85em;
  color: #888;
  margin: 4px 0 0;
}

.openings__explorer-retry {
  margin-top: 10px;
  padding: 4px 14px;
  background: #1e2e1e;
  color: #8c8;
  border: 1px solid #3a5a3a;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.88em;
}
.openings__explorer-retry:hover {
  background: #2a3e2a;
}

.tablebase-view {
  padding: 0;
}

.tablebase__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 0.78rem;
}
.tablebase__header .tablebase__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5cb;
}
.tablebase__header .tablebase__pieces {
  color: #666;
}

.tablebase__body {
  padding: 4px 0;
}

.tablebase__section {
  margin-bottom: 2px;
}

.tablebase__section-title {
  padding: 4px 10px 2px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.tablebase {
  width: 100%;
  border-collapse: collapse;
}
.tablebase .tablebase__row {
  cursor: pointer;
}
.tablebase .tablebase__row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.tablebase .tablebase__row td {
  padding: 3px 10px;
}
.tablebase .tablebase__san {
  font-weight: 600;
  color: #ddd;
  width: 4em;
}
.tablebase .tablebase__result {
  text-align: right;
}

result {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 700;
}
result.white {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
result.black {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
result.draws {
  background: rgba(156, 163, 175, 0.12);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.18);
}

.openings__explorer-connect-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 18px;
  background: #1a3a5c;
  color: #7bc;
  border: 1px solid #2a5a8c;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.9em;
  cursor: pointer;
}
.openings__explorer-connect-btn:hover {
  background: #244d78;
  color: #9cd;
}

.openings__explorer-opening {
  font-size: 0.88em;
  color: #8c8;
  padding: 4px 10px;
}

.openings__explorer-data {
  padding-bottom: 4px;
}

table.explorer-moves {
  width: 100%;
  border-collapse: collapse;
  will-change: transform, opacity;
}
table.explorer-moves th {
  font-size: 0.78rem;
  line-height: 1.8em;
  background: #252525;
  padding-left: 7px;
  color: #999;
  font-weight: normal;
  text-align: left;
}
table.explorer-moves th:last-child {
  padding-right: 7px;
}
table.explorer-moves td {
  cursor: pointer;
  padding: 3px 0 3px 7px;
}
table.explorer-moves td:last-child {
  padding-right: 7px;
}
table.explorer-moves td:first-child {
  font-weight: 600;
  line-height: 28px;
}
table.explorer-moves td:nth-child(2),
table.explorer-moves td:nth-child(3) {
  font-size: 0.78em;
  text-align: right;
  color: #aaa;
  white-space: nowrap;
}
table.explorer-moves td:last-child {
  width: 100%;
}
table.explorer-moves tr:nth-child(even) {
  background: #1f1f1f;
}
table.explorer-moves tr:hover {
  background: rgba(74, 136, 136, 0.12);
}
table.explorer-moves tr.sum {
  background: #222;
  font-weight: bold;
}
table.explorer-moves tr.sum td {
  cursor: default;
}

.openings__explorer-data .bar {
  display: flex;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
}
.openings__explorer-data .bar span {
  display: inline-block;
  overflow: hidden;
  text-align: center;
  height: 16px;
  line-height: 14px;
  font-size: 0.82em;
  transition: width 1s;
  vertical-align: middle;
}
.openings__explorer-data .bar span.white {
  background: #ccc;
  color: #222;
  box-shadow: 0 -3px 5px rgba(0, 0, 0, 0.2) inset;
}
.openings__explorer-data .bar span.draws {
  background: #666;
  color: #ddd;
  box-shadow: 0 3px 5px rgba(255, 255, 255, 0.08) inset;
}
.openings__explorer-data .bar span.black {
  background: #333;
  color: #ddd;
  box-shadow: 0 3px 5px rgba(255, 255, 255, 0.08) inset;
}

table.explorer-games {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 0.85em;
}
table.explorer-games thead th {
  text-align: left;
  padding: 4px 6px;
  color: #aaa;
  font-weight: normal;
  border-bottom: 1px solid #444;
}
table.explorer-games tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
table.explorer-games tbody tr:hover {
  background: #2a2a2a;
}
table.explorer-games td {
  padding: 3px 5px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 0;
}
table.explorer-games td.ratings {
  width: 64px;
  text-align: right;
}
table.explorer-games td.ratings span {
  display: block;
  color: #999;
  font-size: 0.9em;
}
table.explorer-games td.players {
  width: auto;
  max-width: 140px;
}
table.explorer-games td.players span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.explorer-games td result {
  display: inline-block;
  padding: 1px 3px;
  border-radius: 2px;
  font-size: 0.85em;
  font-weight: bold;
}
table.explorer-games td result.white {
  background: #ccc;
  color: #222;
}
table.explorer-games td result.black {
  background: #333;
  color: #eee;
  border: 1px solid #555;
}
table.explorer-games td result.draws {
  background: #666;
  color: #eee;
}
table.explorer-games td.date {
  color: #999;
  font-size: 0.85em;
  width: 60px;
}
table.explorer-games td.speed {
  width: 28px;
  text-align: center;
}
table.explorer-games td.speed span {
  cursor: default;
}

@media (max-width: 700px) {
  .openings__session-body {
    grid-template-columns: 1fr;
  }
  .openings__board-wrap {
    max-width: min(400px, 40vh);
    margin: 0 auto;
  }
  .openings__collections {
    grid-template-columns: 1fr;
  }
}
.puzzle__rated-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border, #3a3a3a);
  font-size: 0.82rem;
}
.puzzle__rated-badge--practice-only {
  color: #999;
  font-style: italic;
}
.puzzle__rated-badge__mode {
  display: flex;
  gap: 4px;
}
.puzzle__rated-badge__btn {
  padding: 3px 10px;
  border: 1px solid #555;
  background: transparent;
  color: #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}
.puzzle__rated-badge__btn.active {
  background: var(--color-accent, #629924);
  border-color: var(--color-accent, #629924);
  color: #fff;
}
.puzzle__rated-badge__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.puzzle__rated-badge__rating {
  font-weight: bold;
  color: #e0c060;
  font-size: 0.9rem;
  min-width: 36px;
  text-align: right;
}
.puzzle__rated-badge__difficulty {
  background: #2a2a2a;
  border: 1px solid #555;
  color: #ccc;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.puzzle__rating-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  color: #bbb;
  border-top: 1px solid var(--color-border, #3a3a3a);
}
.puzzle__rating-display__label {
  color: #888;
}
.puzzle__rating-display__value {
  font-weight: bold;
  color: #e0c060;
}
.puzzle__rating-display__delta {
  font-weight: bold;
  font-size: 0.8rem;
}
.puzzle__rating-display__delta.positive {
  color: #5ca85c;
}
.puzzle__rating-display__delta.negative {
  color: #c05050;
}

.puzzle__solved-repeat-notice {
  padding: 6px 8px;
  background: #2a2a1a;
  border-left: 3px solid #c08030;
  color: #c0a060;
  font-size: 0.8rem;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.puzzle__solved-repeat-notice__icon {
  font-style: normal;
}

.puzzle__assistance-warning {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}
.puzzle__assistance-warning__modal {
  background: #222;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 16px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.puzzle__assistance-warning__title {
  font-size: 0.95rem;
  font-weight: bold;
  color: #eee;
  margin: 0;
}
.puzzle__assistance-warning__body {
  font-size: 0.82rem;
  color: #bbb;
  margin: 0;
}
.puzzle__assistance-warning__remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #999;
  cursor: pointer;
}
.puzzle__assistance-warning__buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.puzzle__rated-stream-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #1e2a1e;
  border: 1px solid var(--color-accent, #629924);
  border-radius: 5px;
  font-size: 0.85rem;
}
.puzzle__rated-stream-entry__rating {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.puzzle__rated-stream-entry__rating-label {
  color: #999;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.puzzle__rated-stream-entry__rating-value {
  font-weight: bold;
  font-size: 1.15rem;
  color: #e0c060;
}
.puzzle__rated-stream-entry__rating-dev {
  font-size: 0.78rem;
  color: #888;
}
.puzzle__rated-stream-entry__difficulty {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.puzzle__rated-stream-entry__difficulty-label {
  font-size: 0.78rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.puzzle__rated-stream-entry__difficulty-select {
  width: 100%;
  background: #2a2a2a;
  border: 1px solid #555;
  color: #ccc;
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 0.85rem;
  cursor: pointer;
}
.puzzle__rated-stream-entry__difficulty-select:focus {
  outline: none;
  border-color: var(--color-accent, #629924);
}
.puzzle__rated-stream-entry__count {
  font-size: 0.78rem;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.03em;
}
.puzzle__rated-stream-entry__empty {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 4px 0;
}
.puzzle__rated-stream-entry__start {
  width: 100%;
  padding: 8px 0;
  background: var(--color-accent, #629924);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 0.03em;
}
.puzzle__rated-stream-entry__start:hover {
  background: #7ab830;
}
.puzzle__rated-stream-entry__start:active {
  background: #518020;
}
.puzzle__rated-stream-entry__stop {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 1px solid #888;
  border-radius: 4px;
  color: #aaa;
  font-size: 0.9rem;
  cursor: pointer;
}
.puzzle__rated-stream-entry__stop:hover {
  border-color: #ccc;
  color: #ccc;
}

.pp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 40, 40, 0.95);
  color: #e0e0e0;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.25s ease;
}
.pp-toast--visible {
  opacity: 1;
}
.pp-toast--hidden {
  opacity: 0;
}

.study-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}
.study-page__header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.study-page__header h1 {
  margin: 0;
  font-size: 1.4rem;
}
.study-page__header-actions {
  margin-left: auto;
}
.study-page__empty {
  color: #888;
  text-align: center;
  padding: 48px 0;
}
.study-page__empty p {
  margin: 4px 0;
}
.study-page__loading {
  color: #888;
  padding: 32px;
  text-align: center;
}

.study-btn {
  padding: 6px 14px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.study-btn--import {
  background: #4a90d9;
  color: #fff;
}
.study-btn--import:hover {
  background: #3a7fc9;
}

.study-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.study-filter-bar__search {
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #1e1e1e;
  color: #e0e0e0;
  font-size: 0.9rem;
  width: 180px;
}

.study-filter-btn {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #555;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
}
.study-filter-btn.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
}
.study-filter-btn:hover:not(.active) {
  border-color: #888;
  color: #ddd;
}

.study-sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.study-sort-bar__label {
  color: #888;
  font-size: 0.85rem;
}

.study-sort-btn {
  padding: 3px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
  border-radius: 4px;
}
.study-sort-btn.active {
  color: #ddd;
  border-color: #555;
}
.study-sort-btn:hover {
  color: #ddd;
}
.study-sort-btn__dir {
  font-size: 0.8rem;
}

.study-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.study-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #1e1e1e;
  border-radius: 6px;
  border: 1px solid #333;
  cursor: grab;
}
.study-row:hover {
  border-color: #555;
}
.study-row:active {
  cursor: grabbing;
}
.study-row__fav {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  flex-shrink: 0;
}
.study-row__fav.active {
  color: #f5c518;
}
.study-row__fav:hover {
  color: #f5c518;
}
.study-row__main {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}
.study-row__title {
  font-size: 1rem;
  font-weight: 500;
  color: #e0e0e0;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.study-row__title:hover {
  color: #4a90d9;
  text-decoration: underline;
}
.study-row__title-input {
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #4a90d9;
  background: #111;
  color: #e0e0e0;
  width: 100%;
  margin-bottom: 4px;
  box-sizing: border-box;
}
.study-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 6px;
}
.study-row__source {
  color: #aaa;
}
.study-row__sep {
  color: #555;
}
.study-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.study-row__delete {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  flex-shrink: 0;
  align-self: flex-start;
}
.study-row__delete:hover {
  color: #e44;
}

.study-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: #2a3a4a;
  border-radius: 10px;
  font-size: 0.78rem;
  color: #9bb;
}
.study-tag__remove {
  background: transparent;
  border: none;
  color: #778;
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
}
.study-tag__remove:hover {
  color: #e44;
}
.study-tag__add {
  background: transparent;
  border: 1px dashed #555;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.78rem;
  color: #888;
  cursor: pointer;
}
.study-tag__add:hover {
  border-color: #888;
  color: #ccc;
}
.study-tag__input {
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #4a90d9;
  background: #111;
  color: #e0e0e0;
  font-size: 0.78rem;
  width: 90px;
}

.study-back {
  color: #888;
  text-decoration: none;
  font-size: 0.9rem;
}
.study-back:hover {
  color: #ddd;
}

.study-row__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.study-row__open {
  color: #4a90d9;
  text-decoration: none;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.study-row__open:hover {
  color: #7ab8f5;
}
.study-row__expand {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  flex-shrink: 0;
  margin-left: auto;
}
.study-row__expand:hover {
  color: #ddd;
}
.study-row__expanded {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.study-row__notes-label, .study-row__folder-label {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 2px;
  display: block;
}
.study-row__notes {
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #444;
  background: #141414;
  color: #e0e0e0;
  font-size: 0.85rem;
  resize: vertical;
  box-sizing: border-box;
}
.study-row__notes:focus {
  border-color: #4a90d9;
  outline: none;
}
.study-row__folder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.study-row__folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.study-folder {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: #2a3a2a;
  border-radius: 10px;
  font-size: 0.78rem;
  color: #8c8;
}
.study-folder__remove {
  background: transparent;
  border: none;
  color: #778;
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
}
.study-folder__remove:hover {
  color: #e44;
}
.study-folder__input {
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #4a90d9;
  background: #111;
  color: #e0e0e0;
  font-size: 0.78rem;
  width: 110px;
}

.study-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  height: 100%;
  box-sizing: border-box;
}
.study-detail__header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.study-detail__title {
  margin: 0;
  font-size: 1.1rem;
}
.study-detail__layout {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.study-detail__board-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: min(45vh, 45vw);
  position: relative;
}
.study-detail__tools-col {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
.study-detail__loading, .study-detail__empty {
  color: #888;
  padding: 24px;
  text-align: center;
}

.study-nav-bar {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.study-nav-btn {
  padding: 5px 10px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.85rem;
}
.study-nav-btn:hover {
  background: #3a3a3a;
  color: #fff;
}

.annotation-panel {
  margin-top: 12px;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.annotation-panel__title {
  margin: 0;
  font-size: 0.85rem;
  color: #888;
  font-weight: normal;
}
.annotation-panel__text {
  font-size: 0.9rem;
  color: #ddd;
  cursor: pointer;
  white-space: pre-wrap;
}
.annotation-panel__text:hover {
  color: #4a90d9;
}
.annotation-panel__add {
  background: transparent;
  border: 1px dashed #555;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.85rem;
}
.annotation-panel__add:hover {
  border-color: #888;
  color: #ccc;
}
.annotation-panel__textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #4a90d9;
  background: #111;
  color: #e0e0e0;
  font-size: 0.88rem;
  resize: vertical;
  box-sizing: border-box;
}
.annotation-panel__textarea:focus {
  outline: none;
}
.annotation-panel__actions {
  display: flex;
  gap: 6px;
}

.glyph-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.glyph-toolbar__label {
  font-size: 0.78rem;
  color: #888;
  margin-right: 4px;
}

.glyph-btn {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid #555;
  border-radius: 4px;
  background: #1e1e1e;
  color: #ccc;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
}
.glyph-btn.active {
  background: #2a4a2a;
  border-color: #4a8a4a;
  color: #8f8;
}
.glyph-btn:hover:not(.active) {
  border-color: #888;
  color: #fff;
}

.glyph-quick-select {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e1e;
  border: 1px solid #4a90d9;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 100;
}
.glyph-quick-select__label {
  font-size: 0.78rem;
  color: #888;
}

.study-header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

move-wrap {
  display: contents;
}

.bookmark-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 0.7rem;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
move-wrap:hover .bookmark-btn {
  opacity: 0.7;
}
.bookmark-btn:hover {
  opacity: 1 !important;
  color: #f5a623;
}
.bookmark-btn--active {
  opacity: 1 !important;
  color: #f5a623;
}

move.bookmarked {
  background: rgba(245, 166, 35, 0.12);
  border-radius: 3px;
}

.study-tools-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid #2a2a2a;
}

.study-bookmark-indicator {
  color: #f5a623;
  font-size: 0.85rem;
}

.study-btn--active {
  background: rgba(74, 144, 217, 0.15);
  color: #4a90d9;
}

.study-engine-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  font-size: 0.82rem;
  background: #1a1a1a;
  border-top: 1px solid #333;
}
.study-engine-bar__score {
  color: #9bc;
  font-weight: bold;
  min-width: 40px;
}
.study-engine-bar__depth {
  color: #666;
}

.study-nav-btn--active {
  color: #4a90d9;
  background: rgba(74, 144, 217, 0.12);
}

.variation-fold {
  background: none;
  border: none;
  color: #888;
  font-size: 0.65rem;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  opacity: 0.7;
}
.variation-fold:hover {
  opacity: 1;
  color: #ccc;
}
.variation-fold--open {
  color: #aaa;
}

.study-ctx-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
}

.study-ctx-menu {
  position: fixed;
  background: #1e1e1e;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 4px 0;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 501;
}

.study-ctx-item {
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #ddd;
}
.study-ctx-item:hover {
  background: #2d2d2d;
}
.study-ctx-item--danger {
  color: hsl(0, 69%, 60%);
}
.study-ctx-item--danger:hover {
  background: rgba(180, 50, 50, 0.2);
}

.study-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.study-modal {
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 20px;
  width: min(560px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.study-modal__header {
  display: flex;
  align-items: center;
}
.study-modal__header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.study-modal__close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
}
.study-modal__close:hover {
  color: #ddd;
}
.study-modal__pgn {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #444;
  background: #141414;
  color: #e0e0e0;
  font-family: monospace;
  font-size: 0.82rem;
  resize: vertical;
  box-sizing: border-box;
}
.study-modal__pgn:focus {
  border-color: #4a90d9;
  outline: none;
}
.study-modal__file-label {
  font-size: 0.85rem;
  color: #aaa;
}
.study-modal__status {
  font-size: 0.85rem;
  color: #8c8;
}
.study-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.drill-session {
  display: flex;
  gap: 16px;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.drill-board-wrap {
  flex: 0 0 auto;
  width: 400px;
  height: 400px;
  position: relative;
}
.drill-board-wrap.drill-flash--correct {
  animation: drill-flash-green 0.35s ease;
}
.drill-board-wrap.drill-flash--incorrect {
  animation: drill-flash-red 0.35s ease;
}

@keyframes drill-flash-green {
  0% {
    box-shadow: 0 0 0 0 rgba(80, 200, 100, 0);
  }
  30% {
    box-shadow: 0 0 0 8px rgba(80, 200, 100, 0.6);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(80, 200, 100, 0);
  }
}
@keyframes drill-flash-red {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 60, 60, 0);
  }
  30% {
    box-shadow: 0 0 0 8px rgba(220, 60, 60, 0.6);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 60, 60, 0);
  }
}
.drill-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drill-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drill-sequence-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0e0e0;
}

.drill-move-counter {
  font-size: 0.8rem;
  color: #888;
}

.drill-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drill-progress-bar {
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
}

.drill-progress-fill {
  height: 100%;
  background: #4a90d9;
  transition: width 0.3s ease;
}

.drill-progress-label {
  font-size: 0.78rem;
  color: #888;
}

.drill-feedback {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #1e1e1e;
  color: #aaa;
}
.drill-feedback--correct {
  background: #1a3a1a;
  color: #8c8;
}
.drill-feedback--incorrect {
  background: #3a1a1a;
  color: #c88;
}
.drill-feedback--answer {
  background: #1e2a3a;
  color: #8af;
}

.drill-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drill-btn {
  padding: 7px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
.drill-btn--next {
  background: #4a90d9;
  color: #fff;
}
.drill-btn--end {
  background: #2a2a2a;
  color: #aaa;
}
.drill-btn--again {
  background: #4a90d9;
  color: #fff;
}
.drill-btn--back {
  background: #2a2a2a;
  color: #aaa;
}
.drill-btn:hover {
  filter: brightness(1.1);
}

.drill-summary {
  max-width: 480px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.drill-summary__title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0;
}
.drill-summary__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.drill-summary__stat {
  background: #1e1e1e;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drill-summary__val {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4a90d9;
}
.drill-summary__key {
  font-size: 0.8rem;
  color: #888;
}
.drill-summary__actions {
  display: flex;
  gap: 10px;
}

.study-color-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.study-color-picker {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 260px;
}
.study-color-picker__title {
  font-size: 1rem;
  font-weight: 600;
  color: #e0e0e0;
  text-align: center;
}
.study-color-picker__buttons {
  display: flex;
  gap: 10px;
}
.study-color-picker__btn {
  flex: 1;
  padding: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}
.study-color-picker__btn--white {
  background: #e0e0e0;
  color: #111;
}
.study-color-picker__btn--black {
  background: #222;
  color: #e0e0e0;
  border: 1px solid #444;
}
.study-color-picker__btn:hover {
  filter: brightness(1.1);
}
.study-color-picker__cancel {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.85rem;
  text-align: center;
  padding: 4px;
}
.study-color-picker__cancel:hover {
  color: #ccc;
}

.study-scope-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.study-scope-selector__label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.study-scope-selector__buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.study-scope-btn {
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #ccc;
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.study-scope-btn:hover {
  background: #333;
  border-color: #555;
}
.study-scope-btn--active {
  background: #1a3a5a;
  border-color: #4a90d9;
  color: #e0e0e0;
}

.study-btn--practice {
  background: #4a90d9;
  color: #fff;
  border-color: transparent;
}

.study-practice-dashboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.study-practice-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a2a3a;
  border: 1px solid #2a4a6a;
  border-radius: 6px;
  padding: 10px 14px;
}
.study-practice-banner__text {
  color: #8af;
  font-size: 0.9rem;
  flex: 1;
}

.study-practice-learn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  border-radius: 6px;
  padding: 10px 14px;
}
.study-practice-learn__label {
  color: #8c8;
  font-size: 0.9rem;
  flex: 1;
}

.study-row__due {
  font-size: 0.75rem;
  color: #8af;
  background: #1a2a3a;
  border-radius: 3px;
  padding: 1px 5px;
}

.study-btn--review {
  background: #4a90d9;
  color: #fff;
}

.study-practice-lines {
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid #2a2a2a;
}
.study-practice-lines__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.study-practice-lines__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.study-practice-lines--empty {
  font-size: 0.82rem;
  color: #666;
}

.study-practice-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #1a1a1a;
  border-radius: 4px;
  font-size: 0.82rem;
}
.study-practice-line__label {
  flex: 1;
  color: #ddd;
  cursor: default;
}
.study-practice-line__rename {
  flex: 1;
  background: #111;
  border: 1px solid #444;
  color: #ddd;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.82rem;
}
.study-practice-line__color {
  color: #888;
}
.study-practice-line__status {
  color: #4c4;
  font-size: 0.7rem;
}
.study-practice-line__status--paused {
  color: #888;
}
.study-practice-line__count {
  color: #666;
  font-size: 0.75rem;
}
.study-practice-line__due {
  font-size: 0.72rem;
  color: #8af;
  background: #1a2a3a;
  border-radius: 3px;
  padding: 1px 4px;
}
.study-practice-line__actions {
  display: flex;
  gap: 3px;
}
.study-practice-line__btn {
  background: #2a2a2a;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.78rem;
}
.study-practice-line__btn:hover {
  background: #3a3a3a;
}
.study-practice-line__btn--danger:hover {
  background: #4a1a1a;
  color: #f88;
}

.study-library-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.study-library-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.study-sidebar {
  flex-shrink: 0;
  width: 160px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}
.study-sidebar__header {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #2a2a2a;
}
.study-sidebar__title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.study-sidebar__toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0 2px;
  font-size: 1rem;
  line-height: 1;
}
.study-sidebar__toggle:hover {
  color: #aaa;
}
.study-sidebar__folders {
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 2px;
}
.study-sidebar__folder {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.study-sidebar__folder:hover {
  background: #1e1e1e;
  color: #ddd;
}
.study-sidebar__folder.active {
  background: #1a2a3a;
  color: #4a90d9;
}
.study-sidebar__folder.drag-over {
  background: #1a3a2a;
  border: 1px dashed #4a9d6f;
  color: #4a9d6f;
}
.study-sidebar__folder-row {
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.study-sidebar__folder-row:hover .study-sidebar__folder-actions {
  opacity: 1;
}
.study-sidebar__folder-row .study-sidebar__folder {
  flex: 1;
  min-width: 0;
}
.study-sidebar__folder-rename {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ddd;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 0.83rem;
  width: 100%;
}
.study-sidebar__folder-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.1s;
  flex-shrink: 0;
}
.study-sidebar__folder-action {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.75rem;
  border-radius: 3px;
}
.study-sidebar__folder-action:hover {
  color: #aaa;
  background: #2a2a2a;
}
.study-sidebar__folder-action--danger:hover {
  color: #f88;
}
.study-sidebar__new-folder {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ddd;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.83rem;
  margin-top: 2px;
}
.study-sidebar__new-folder-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: #556;
  cursor: pointer;
  font-size: 0.8rem;
  margin-top: 4px;
}
.study-sidebar__new-folder-btn:hover {
  color: #4a90d9;
  background: #1a1a1a;
}

.study-view-toggle {
  display: flex;
  gap: 2px;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}
.study-view-toggle__btn {
  padding: 4px 8px;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1rem;
}
.study-view-toggle__btn:hover {
  background: #1e1e1e;
  color: #aaa;
}
.study-view-toggle__btn.active {
  background: #2a2a2a;
  color: #ddd;
}

.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.study-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.1s;
}
.study-card:hover {
  border-color: #555;
}
.study-card--selected {
  border-color: #4a90d9;
  background: #141e2a;
}
.study-card__board {
  width: 100%;
  padding-top: 100%;
  position: relative;
}
.study-card__board .cg-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
}
.study-card__body {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.study-card__title {
  font-size: 0.82rem;
  color: #ddd;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.study-card__title:hover {
  color: #4a90d9;
}
.study-card__meta {
  font-size: 0.72rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.study-card__sep {
  margin: 0 3px;
}
.study-card__fav {
  font-size: 0.75rem;
  color: #f0c040;
  margin-top: 1px;
}

.study-row--selected {
  border-color: #4a90d9 !important;
  background: #141e2a !important;
}
.study-row__checkbox {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: #4a90d9;
  cursor: pointer;
  margin-top: 2px;
}

.study-bulk-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #1a2a3a;
  border: 1px solid #3a6090;
  border-radius: 5px;
  flex-wrap: wrap;
}
.study-bulk-bar__count {
  font-size: 0.85rem;
  color: #8af;
  font-weight: 600;
}
.study-bulk-bar__btn {
  padding: 3px 10px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1e1e1e;
  color: #ccc;
  cursor: pointer;
  font-size: 0.82rem;
}
.study-bulk-bar__btn:hover {
  background: #2a2a2a;
}
.study-bulk-bar__btn--danger {
  border-color: #6a2a2a;
  color: #f88;
}
.study-bulk-bar__btn--danger:hover {
  background: #3a1a1a;
}
.study-bulk-bar__folder-wrap {
  position: relative;
}
.study-bulk-bar__folder-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
.study-bulk-bar__folder-item {
  padding: 4px 8px;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 0.82rem;
  text-align: left;
  border-radius: 3px;
}
.study-bulk-bar__folder-item:hover {
  background: #2a2a2a;
}