:root {
  --ink: #1c1915;
  --muted: #5c564c;
  --paper: #f6f1e7;
  --card: #fffaf3;
  --line: #e4d8c4;
  --green: #143028;
  --green-2: #1e4638;
  --gold: #c4922a;
  --gold-2: #e0b35a;
  --danger: #8c2f2f;
  --shadow: 0 18px 50px rgba(20, 48, 40, 0.12);
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
  --display: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

html {
  font-size: 16px;
  background-color: var(--paper);
  background-image: radial-gradient(circle at top left, rgba(196, 146, 42, 0.16), transparent 32%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--font);
}

main {
  flex: 1;
}

a {
  color: var(--green-2);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 1080;
  padding: 0.5rem 0.8rem;
  background: #fff;
  color: var(--ink);
}

.skip-link:focus {
  top: 0.5rem;
}

.site-navbar {
  background: var(--green);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.site-navbar .navbar-brand,
.site-navbar .nav-link {
  color: rgba(255, 250, 243, 0.88);
}

.site-navbar .navbar-brand {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active,
.site-navbar .navbar-brand:hover {
  color: #fff;
}

.site-navbar .navbar-toggler {
  border-color: rgba(255, 250, 243, 0.55);
}

.site-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 250, 243, 0.92)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.theme-switch,
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.65rem;
}

.theme-switch {
  border: 0;
  background: transparent;
  color: rgba(255, 250, 243, 0.72);
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: 0.25rem;
}

.theme-switch::before {
  font-family: bootstrap-icons;
  font-style: normal;
  font-weight: normal;
  content: "\f497";
}

html[data-theme="dark"] .theme-switch::before {
  content: "\f5a2";
}

.theme-switch:hover,
.theme-switch:focus {
  color: #fff;
}

.language-switch button {
  border: 0;
  background: transparent;
  color: rgba(255, 250, 243, 0.72);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.28rem 0.38rem;
  border-radius: 0.25rem;
}

.language-switch button.is-active {
  background: var(--gold);
  color: var(--green);
}

.header-tools .nav-item {
  position: relative;
}

.desktop-account .navbar-nav {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 991.98px) {
  .site-navbar .navbar-brand { order: 1; }
  .header-tools { order: 2; }
  .theme-switch { order: 3; margin-left: 0.35rem; }
  .language-switch { order: 4; margin-left: 0.35rem; }
  .site-navbar .navbar-toggler { order: 5; margin-left: 0.45rem; }
  #anaMenu { order: 6; flex-basis: 100%; }
  .site-navbar > .container > .theme-switch { margin-left: auto; }
  .site-navbar > .container > .header-tools ~ .theme-switch { margin-left: 0.35rem; }
}

@media (min-width: 992px) {
  .site-navbar > .container { flex-wrap: nowrap; }
  .site-navbar .navbar-brand { order: 1; }
  #anaMenu { order: 2; flex-grow: 1; }
  .header-tools { order: 3; margin-left: 0.75rem; }
  .theme-switch { order: 4; }
  .language-switch { order: 5; }
  .desktop-account { order: 6; }
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.35rem;
  border-radius: 0.4rem;
  background: var(--gold);
  color: var(--green);
  font-size: 1rem;
}

.btn-gold {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #1c1508;
  font-weight: 600;
}

.btn-gold:hover,
.btn-gold:focus {
  background: var(--gold-2);
  border-color: var(--gold-2);
  color: #1c1508;
}

.btn[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn[data-icon]::before {
  font-family: bootstrap-icons;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}

.btn[data-icon="house"]::before { content: "\f425"; }
.btn[data-icon="person"]::before { content: "\f4e1"; }
.btn[data-icon="person-plus"]::before { content: "\f4dd"; }
.btn[data-icon="login"]::before { content: "\f1be"; }
.btn[data-icon="logout"]::before { content: "\f1c3"; }
.btn[data-icon="play"]::before { content: "\f4f4"; }
.btn[data-icon="plus"]::before { content: "\f64d"; }
.btn[data-icon="cpu"]::before { content: "\f2d6"; }
.btn[data-icon="board"]::before { content: "\f3f9"; }
.btn[data-icon="target"]::before { content: "\f1de"; }
.btn[data-icon="game"]::before { content: "\f2d4"; }
.btn[data-icon="cancel"]::before { content: "\f623"; }
.btn[data-icon="draw"]::before { content: "\f4c6"; }
.btn[data-icon="again"]::before { content: "\f130"; }
.btn[data-icon="search"]::before { content: "\f52a"; }
.btn[data-icon="people"]::before { content: "\f4d5"; }
.btn[data-icon="check"]::before { content: "\f633"; }
.btn[data-icon="close"]::before { content: "\f659"; }
.btn[data-icon="copy"]::before { content: "\f290"; }
.btn[data-icon="back"]::before { content: "\f12f"; }
.btn[data-icon="forward"]::before { content: "\f138"; }
.btn[data-icon="flip"]::before { content: "\f127"; }
.btn[data-icon="rotate"]::before { content: "\f116"; }
.btn[data-icon="setup"]::before { content: "\f3fc"; }
.btn[data-icon="gear"]::before { content: "\f3e5"; }
.btn[data-icon="download"]::before { content: "\f1bc"; }
.btn[data-icon="save"]::before { content: "\f525"; }
.btn[data-icon="trash"]::before { content: "\f5de"; }
.btn[data-icon="send"]::before { content: "\f6c0"; }
.btn[data-icon="start"]::before { content: "\f552"; }
.btn[data-icon="last"]::before { content: "\f277"; }
.btn[data-icon="flag"]::before { content: "\f3cc"; }
.btn[data-icon="trophy"]::before { content: "\f5e7"; }
.btn[data-icon="book"]::before { content: "\f194"; }

.profile-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
}

.profile-tab[data-icon]::before {
  font-family: bootstrap-icons;
  font-style: normal;
  font-weight: normal;
  font-size: 1rem;
  line-height: 1;
}

.profile-tab[data-icon="person"]::before { content: "\f4e1"; }
.profile-tab[data-icon="setup"]::before { content: "\f3fc"; }
.profile-tab[data-icon="people"]::before { content: "\f4d5"; }
.profile-tab[data-icon="trophy"]::before { content: "\f5e7"; }
.profile-tab[data-icon="target"]::before { content: "\f1de"; }
.profile-tab[data-icon="board"]::before { content: "\f3f9"; }

.profile-tab.is-active {
  background: #143028;
  border-color: #143028;
  color: #f6f1e7;
}

.profile-panel + .profile-panel {
  margin-top: 0;
}

.profile-panel[hidden] {
  display: none !important;
}

.btn-outline-gold {
  border: 1px solid var(--gold-2);
  color: var(--gold-2);
  background: transparent;
}

.btn-outline-gold:hover,
.btn-outline-gold:focus {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c1508;
}

.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(196, 146, 42, 0.35);
  border-color: var(--gold);
}

.form-switch .form-check-input:checked,
.form-switch .form-check-input:checked:focus {
  background-color: var(--green);
  border-color: var(--green);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:focus:not(:checked) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23143028'/%3e%3c/svg%3e");
}

.select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background: #fff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.75rem);
  padding-left: 0.75rem;
  color: var(--ink);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.75rem);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(196, 146, 42, 0.35);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--green);
  color: #fffaf3;
}

.form-select-sm + .select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.5rem + 2px);
  font-size: 0.875rem;
}

.form-select-sm + .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.5rem);
}

.form-select-sm + .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.5rem);
}

.board-select .select2-container {
  min-width: 7.5rem;
}

.choice-preview {
  display: inline-grid;
  grid-template-columns: 4.6rem auto;
  align-items: center;
  column-gap: 0.5rem;
  max-width: 100%;
}

.choice-label {
  white-space: nowrap;
}

.board-swatches {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(28, 25, 21, 0.35);
}

.board-swatches span {
  width: 0.95rem;
  height: 0.95rem;
}

.piece-swatches {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.05rem;
}

.piece-swatches img {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
}

select[data-board] + .select2-container--default .select2-selection--single,
select[data-pieces] + .select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
}

select[data-board] + .select2-container--default .select2-selection--single .select2-selection__rendered,
select[data-pieces] + .select2-container--default .select2-selection--single .select2-selection__rendered {
  display: flex;
  align-items: center;
  height: 100%;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.5rem;
}

select[data-board] + .select2-container--default .select2-selection--single .select2-selection__arrow,
select[data-pieces] + .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 0;
  height: 100%;
}

.select2-results__option:has(.choice-preview) {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.select2-results__option:has(.piece-swatches) {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.hero {
  color: #f8f3ea;
  background:
    linear-gradient(120deg, rgba(20, 48, 40, 0.94), rgba(20, 48, 40, 0.78)),
    repeating-conic-gradient(#1a3b30 0% 25%, #23493c 0% 50%);
  background-size: auto, 48px 48px;
}

.hero-inner {
  padding-top: 4.5rem;
  padding-bottom: 4rem;
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.05;
  max-width: 12ch;
}

.hero .lead {
  max-width: 38rem;
  color: rgba(248, 243, 234, 0.82);
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: min(100%, 420px);
  margin-left: auto;
  aspect-ratio: 1;
  overflow: hidden;
  border: 8px solid #2a2118;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  container-type: inline-size;
}

.mini-board span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: calc(100cqi / 8 * 0.92);
  font-variant-emoji: text;
  line-height: 1;
}

.sq-light { background: #f0d9b5; }
.sq-dark { background: #b58863; }
.p-w {
  color: #fffdf8;
  text-shadow: 0 0 1px #2a2118, 0 1px 0 #2a2118, 1px 0 0 #2a2118, -1px 0 0 #2a2118, 0 -1px 0 #2a2118;
}
.p-b { color: #1a140f; }

.section-block {
  padding: 4rem 0;
}

.feature-card,
.panel,
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.row:has(> [class*="col"] > .feature-card) > [class*="col"] {
  display: flex;
  flex-direction: column;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  padding: 1.4rem;
}

.feature-card > .btn {
  margin-top: auto;
  align-self: flex-start;
}

.feature-card h2 {
  font-family: var(--display);
  font-size: 1.45rem;
}

.live-count {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--display);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--green);
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.live-game {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.live-game:hover {
  border-color: var(--gold);
}

.live-board {
  width: 100%;
}

.live-names {
  margin: 0;
  font-weight: 600;
}

.badge-soon {
  background: #efe2c4;
  color: #6d5314;
  font-weight: 600;
}

.page-wrap {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

@media (max-width: 767.98px) {
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .row {
    --bs-gutter-x: 0.75rem;
  }
}

body:has(.board-frame),
body:has(.live-board) {
  touch-action: manipulation;
}

.auth-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.8rem;
}

.auth-card h1,
.panel h1,
.page-title {
  font-family: var(--display);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #f3ecdf;
}

.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--green);
  color: var(--gold-2);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.8rem;
}

.site-footer {
  padding: 1.2rem 0;
  color: rgba(255, 250, 243, 0.75);
  background: var(--green);
}

body:has(#chess-workspace) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body:has(#chess-workspace) main {
  min-height: 0;
  overflow: auto;
}

.opening-label {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: #143028;
}

.opening-label a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.panel .opening-label {
  margin: 0;
}

#openings-table tbody tr {
  cursor: pointer;
}

#openings-table tbody tr.is-selected > td {
  background: #143028;
  color: #f6f1e7;
}

.openings-category-wrap {
  width: 11.5rem;
  flex: 0 0 11.5rem;
}

.board-stage .dt-container:has(#openings-table) .row {
  justify-content: flex-start;
}

.dt-container:has(#openings-table) > .row:first-child {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.dt-container:has(#openings-table) .dt-layout-start,
.dt-container:has(#openings-table) .dt-layout-end,
.dt-container:has(#openings-table) .dt-search {
  display: flex;
  align-items: center;
}

.dt-container:has(#openings-table) .dt-layout-start {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.dt-container:has(#openings-table) .dt-layout-end {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
}

.dt-container:has(#openings-table) .dt-search label {
  display: none;
}

.dt-container:has(#openings-table) .dt-search,
.dt-container:has(#openings-table) .dt-search input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.dt-container:has(#openings-table) .dt-search input,
.dt-container:has(#openings-table) .select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.5rem + 2px);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--gold-2);
  text-decoration: none;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fbf7f0;
}

@media (max-width: 991.98px) {
  .mini-board {
    margin: 2rem auto 0;
  }
}

.board-frame {
  width: min(100%, 520px);
  margin: 0 auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.board-frame * {
  touch-action: none;
}

.board-b72b1 {
  border-radius: 3px;
  overflow: hidden;
}

.board-eval-host {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  width: min(100%, 520px);
  margin: 0 auto;
}

.board-eval-host.eval-hidden .eval-bar {
  display: none;
}

.board-eval-host .board-frame {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}

.eval-bar {
  position: relative;
  flex: 0 0 1.85rem;
  width: 1.85rem;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #8d8d8d;
  border-radius: 3px;
  background: #1c1c1c;
}

.eval-white {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 50%;
  background: #f3f1ea;
  transition: height 0.2s ease;
}

.eval-bar.is-flipped .eval-white {
  top: 0;
  bottom: auto;
}

.eval-score {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  padding: 0.15rem 0;
  color: #f3f1ea;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  pointer-events: none;
}

.eval-score.is-bottom {
  top: auto;
  bottom: 0;
}

.eval-score.is-on-white {
  color: #1a1a1a;
}

.eval-bar.is-pending .eval-white,
.eval-bar.is-pending .eval-score {
  opacity: 0.45;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  width: min(100%, 520px);
  margin: 0.8rem auto 0;
}

.board-toolbar:not(:has(> :not([hidden]))) {
  display: none;
}

.move-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.75rem;
}

html[data-puzzle-resume] [data-role="setup"] {
  display: none !important;
}

.puzzle-scores {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  margin: 0.75rem auto 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.puzzle-scores:empty {
  display: none;
}

.puzzle-score {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.puzzle-score.gain {
  background: #1c7c45;
}

.puzzle-score.loss {
  background: #b42318;
}

.board-stage.page-wrap {
  padding-top: 0.75rem;
  padding-bottom: 1rem;
}

.board-stage.container {
  max-width: calc(100vw - 1.5rem);
}

@media (max-width: 767.98px) {
  .board-stage.container {
    max-width: 100%;
  }
}

.board-stage {
  --board-chrome: 11.5rem;
}

.board-stage:has(.play-hud) {
  --board-chrome: 16rem;
}

.board-stage .board-frame,
.board-stage .board-eval-host,
.board-stage .play-hud,
.board-stage .board-toolbar,
.board-stage .board-flipbar,
.board-stage .play-actions,
.board-stage .puzzle-scores,
.board-stage .puzzle-solution-nav {
  width: min(calc(100dvh - var(--board-chrome)), calc(100vw - 28rem));
  max-width: none;
}

.board-stage .openings-list {
  width: 100%;
  max-width: 100%;
  margin: 0;
  margin-top: 1rem;
  min-width: 0;
}

.board-flipbar {
  display: flex;
  justify-content: flex-end;
  width: min(100%, 520px);
  margin: 0.45rem auto 0;
}

.saved-analyses .list-group-item > a {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  #chess-workspace > .row {
    flex-direction: column;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
  }

  #chess-workspace > .row > [class*="col-"] {
    display: contents;
  }

  #chess-workspace .opening-summary,
  #chess-workspace .board-panel,
  #chess-workspace .moves-panel,
  #chess-workspace .openings-list,
  #chess-workspace .saved-analyses,
  #chess-workspace > .row > .col-lg-5 > .panel {
    width: 100%;
  }

  #chess-workspace > .row > .col-lg-7 > .d-lg-none {
    display: contents;
  }

  #chess-workspace > .row > .col-lg-7 > *,
  #chess-workspace > .row > .col-lg-5 > * {
    order: 5;
  }

  #chess-workspace .opening-summary {
    order: 1;
    margin-top: 1rem;
  }

  #chess-workspace > .row > .col-lg-7 > .board-panel {
    order: 2;
  }

  #chess-workspace > .row > .col-lg-5 > .moves-panel {
    order: 3;
    margin-top: 1rem;
  }

  #chess-workspace > .row > .col-lg-7 > .openings-list {
    order: 4;
    margin-bottom: 1rem !important;
  }

  .board-stage .board-frame,
  .board-stage .board-eval-host,
  .board-stage .play-hud,
  .board-stage .board-toolbar,
  .board-stage .board-flipbar,
  .board-stage .play-actions,
  .board-stage .puzzle-scores,
  .board-stage .puzzle-solution-nav {
    width: min(100%, calc(100dvh - var(--board-chrome)));
  }
}

.board-stage .board-eval-host .board-frame {
  width: auto;
  max-width: none;
}

@media (min-width: 992px) {
  .board-stage .row {
    justify-content: center;
  }

  .board-stage .row > .col-lg-7,
  .board-stage .row > .col-lg-5 {
    width: auto;
    max-width: none;
  }

  .board-stage .row > .col-lg-7 {
    flex: 0 0 auto;
    min-width: 0;
  }

  .board-stage .row > .col-lg-7:has(.openings-list) {
    width: min(calc(100dvh - var(--board-chrome) + 3.5rem), calc(100vw - 24.5rem));
    max-width: 100%;
  }

  .board-stage .row > .col-lg-5 {
    flex: 1 1 20rem;
    min-width: 18rem;
    max-width: 26rem;
  }
}

.board-select {
  min-width: 7.5rem;
}

.board-status {
  min-height: 1.5rem;
  margin: 0.7rem 0 0;
}

.setup-panel {
  margin-top: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.promotion-picker {
  position: fixed;
  z-index: 40;
  display: flex;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.promotion-picker[hidden] {
  display: none !important;
}

.promotion-picker > p {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.promotion-choices {
  display: flex;
  gap: 0.3rem;
}

.promotion-choice {
  width: var(--promo-size, 3.2rem);
  height: var(--promo-size, 3.2rem);
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3ecdf;
}

.promotion-choice img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.moves-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.moves-settings {
  min-width: 15.5rem;
  padding: 0.35rem 0.85rem;
}

.moves-settings .form-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.45rem 0;
  min-height: 0;
}

.moves-settings .form-switch .form-check-input {
  float: none;
  margin: 0;
  order: 2;
}

.moves-settings .form-check-label {
  order: 1;
}

.move-list {
  min-height: 16rem;
  max-height: 16rem;
  overflow: auto;
}

.move-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1px;
}

.move-no,
.move-gap {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.move-variation {
  margin: 0.15rem 0 0.15rem 1.1rem;
  padding-left: 0.45rem;
  border-left: 2px solid var(--line);
}

.move-entry {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.move-token {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.05rem 0.35rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
}

.move-cut {
  display: none;
  position: absolute;
  top: 50%;
  right: calc(0.05rem + (1.5em - 1.15rem) / 2);
  z-index: 1;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  line-height: 1;
  transform: translateY(-50%);
}

.move-cut .bi {
  font-size: 1.15rem;
}

html[data-theme="dark"] .move-cut {
  color: #e07a7a;
}

.move-entry:hover .move-cut,
.move-entry:focus-within .move-cut {
  display: inline-flex;
}

.move-entry:hover .move-token,
.move-entry:focus-within .move-token {
  padding-right: 1.6rem;
  background: #efe2c4;
}

.move-piece {
  width: calc(1em + 2px);
  height: calc(1em + 2px);
  object-fit: contain;
  flex: 0 0 auto;
}

.move-token.active,
.move-token:hover {
  background: #efe2c4;
}

.variation {
  color: var(--muted);
}

.board-theme-walnut .white-1e1d7 { background-color: #f3e2c7; color: #8b5a2b; }
.board-theme-walnut .black-3c85d { background-color: #8b5a2b; color: #f3e2c7; }
.board-theme-blue .white-1e1d7 { background-color: #e7eef2; color: #6f8b99; }
.board-theme-blue .black-3c85d { background-color: #6f8b99; color: #e7eef2; }

.square-55d63.last-move,
.square-55d63.piece-selected {
  box-shadow: inset 0 0 0 999px rgba(196, 146, 42, 0.45);
}

[class*="spare-pieces"] img.piece-selected {
  box-shadow: 0 0 0 3px rgba(196, 146, 42, 0.9);
  border-radius: 6px;
}

.square-55d63.premove::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(61, 120, 180, 0.45);
  box-shadow: inset 0 0 0 3px #3d78b4;
}

.square-55d63.hint-legal {
  box-shadow: inset 0 0 0 999px rgba(20, 48, 40, 0.28);
}

.square-55d63.hint-capture {
  box-shadow: inset 0 0 3px 3px #8c2f2f;
}

.board-arrow-host {
  position: relative;
}

.move-arrows {
  position: absolute;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.move-arrow {
  stroke: none;
  opacity: 0.55;
}

.move-arrow.is-green { fill: #2f9a46; }
.move-arrow.is-red { fill: #c16d66; }
.move-arrow.is-blue { fill: #3d78b4; }
.move-arrow.is-engine-1 { fill: rgba(72, 72, 72, 0.92); opacity: 1; }
.move-arrow.is-engine-2 { fill: rgba(128, 128, 128, 0.84); opacity: 1; }
.move-arrow.is-engine-3 { fill: rgba(186, 186, 186, 0.8); opacity: 1; }

.move-ring {
  opacity: 0.8;
}

.move-ring.is-green { stroke: #2f9a46; }
.move-ring.is-red { stroke: #c16d66; }
.move-ring.is-blue { stroke: #3d78b4; }

.coord-modes {
  display: grid;
  gap: 0.6rem;
}

.memory-mode-row {
  grid-template-columns: 1fr 1fr;
}

.memory-level-row {
  grid-template-columns: 1fr 1fr 1fr;
}

.coord-mode {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  cursor: pointer;
}

.coord-mode:has(input:checked) {
  border-color: #c4922a;
  box-shadow: inset 0 0 0 1px #c4922a;
}

.coord-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.coord-mode small {
  color: var(--muted);
}

.coord-hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  max-width: 520px;
  margin: 0 auto 0.5rem;
}

.coord-prompt {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.coord-score {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
}

.coord-type {
  max-width: 520px;
  margin-inline: auto;
}

.coord-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.coord-bar {
  height: 6px;
  margin-top: 0.35rem;
  border-radius: 99px;
  background: #efe6d6;
  overflow: hidden;
}

.coord-bar span {
  display: block;
  height: 100%;
  background: #143028;
}

.site-navbar .dropdown-menu {
  background: #f6f1e7;
  border: 1px solid rgba(20, 48, 40, 0.12);
  border-radius: 12px;
  padding: 0.35rem;
  min-width: 15rem;
}

.site-navbar .dropdown-item {
  border-radius: 8px;
  color: #143028;
}

.site-navbar .dropdown-item:hover,
.site-navbar .dropdown-item:focus,
.site-navbar .dropdown-item.active {
  background: #143028;
  color: #fff;
}

#memory-board .spare-pieces-7492f {
  width: 100%;
  text-align: center;
  line-height: 0;
}

#memory-board .spare-pieces-top-4028b {
  margin-bottom: 0.35rem;
}

#memory-board .spare-pieces-bottom-ae20f {
  margin-top: 0.35rem;
}

.memory-piece-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.memory-piece-grid button {
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 8px;
  padding: 0.15rem;
}

.memory-piece-grid button img {
  width: 100%;
  height: auto;
  display: block;
}

.memory-piece-grid button.is-selected {
  border-color: #c4922a;
  box-shadow: inset 0 0 0 1px #c4922a;
}

.memory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.85rem;
}

.memory-legend span::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  border-radius: 2px;
  vertical-align: -0.05rem;
}

.memory-legend .is-exact::before { background: #1b7a43; }
.memory-legend .is-partial::before { background: #d4a017; }
.memory-legend .is-wrong::before { background: #b43333; }
.memory-legend .is-missed::before { background: #8a8175; }

.memory-detail {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.memory-detail li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  font-size: 0.92rem;
}

.memory-detail-piece {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

#memory-board .square-55d63.memory-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24%;
  height: 24%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #143028;
  pointer-events: none;
  z-index: 2;
}

#memory-board .square-55d63.memory-pick::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24%;
  height: 24%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #143028;
  pointer-events: none;
  z-index: 2;
}

#memory-board .square-55d63.memory-exact { box-shadow: inset 0 0 0 4px #1b7a43; }
#memory-board .square-55d63.memory-partial { box-shadow: inset 0 0 0 4px #d4a017; }
#memory-board .square-55d63.memory-wrong { box-shadow: inset 0 0 0 4px #b43333; }
#memory-board .square-55d63.memory-missed { box-shadow: inset 0 0 0 4px #8a8175; }

#memory-board .square-55d63.memory-exact.memory-dot::after { background: #1b7a43; }
#memory-board .square-55d63.memory-wrong.memory-dot::after { background: #b43333; }
#memory-board .square-55d63.memory-missed.memory-dot::after { background: #8a8175; }

#memory-board .square-55d63.memory-missed img {
  opacity: 0.45;
}

.play-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 520px;
  margin: 0 auto 0.6rem;
}

.player-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: default;
}

.player-chip:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

.player-flag,
.flag-option img {
  width: 1.35rem;
  height: 1rem;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(28, 25, 21, 0.18);
}

.flag-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.player-rating {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.player-pop {
  display: none;
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 0.35rem);
  min-width: 15rem;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

[data-role="bottom-hud"] .player-pop {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

[data-role="top-hud"]:has(.player-chip:hover),
[data-role="top-hud"]:has(.player-chip:focus-within),
[data-role="bottom-hud"]:has(.player-chip:hover),
[data-role="bottom-hud"]:has(.player-chip:focus-within) {
  position: relative;
  z-index: 40;
}

.player-chip[data-ready="1"]:hover .player-pop,
.player-chip[data-ready="1"]:focus-within .player-pop {
  display: grid;
  gap: 0.28rem;
}

.player-pop > span {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

#online-app .player-pop > span,
#chess-workspace .player-pop > span {
  font-size: 0.75rem;
}

.rating-up {
  color: #1b7a43;
  font-weight: 600;
}

.rating-down {
  color: #b43333;
  font-weight: 600;
}

.player-pop em {
  color: var(--muted);
  font-style: normal;
}

.play-clock {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: #e6e1d6;
  color: #3c3832;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.play-clock.is-running {
  background: #14633a;
  color: #f6f1e7;
  font-weight: 600;
}

.dt-container {
  color: var(--ink);
}

.dt-container .dt-search input {
  border-color: var(--line);
}

.dt-paging .page-item {
  display: flex;
}

.dt-container .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.45rem;
  line-height: 1;
  color: var(--green);
}

.dt-paging .page-nav-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  line-height: 1;
}

.dt-paging .page-nav-icon::before {
  font-family: bootstrap-icons;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.dt-paging .page-nav-icon[data-icon="first"]::before { content: "\f276"; }
.dt-paging .page-nav-icon[data-icon="prev"]::before { content: "\f284"; }
.dt-paging .page-nav-icon[data-icon="next"]::before { content: "\f285"; }
.dt-paging .page-nav-icon[data-icon="last"]::before { content: "\f277"; }

.dt-container .page-item.active .page-link {
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
}

.dt-container .page-item.disabled .page-link {
  color: var(--muted);
}

.recent-game {
  position: relative;
  cursor: pointer;
}

.recent-game:hover td {
  background: #efe6d6;
}

.recent-analyze {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
}

.recent-analyze::after {
  content: "";
  position: absolute;
  inset: 0;
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 520px;
  margin: 0.8rem auto 0;
}

.square-55d63.coord-ok {
  box-shadow: inset 0 0 0 999px rgba(46, 125, 82, 0.55);
}

.square-55d63.coord-bad {
  box-shadow: inset 0 0 0 999px rgba(140, 47, 47, 0.5);
}

.list-group-item {
  border-color: var(--line);
}

.nav-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid rgba(255, 250, 243, 0.35);
  border-radius: 999px;
  background: transparent;
  color: #fffaf3;
}

.nav-tool:hover,
.nav-tool:focus,
.nav-tool[aria-expanded="true"] {
  border-color: var(--gold-2);
  color: var(--gold-2);
}

.nav-tool[data-icon]::before {
  font-family: bootstrap-icons;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.nav-tool[data-icon="people"]::before { content: "\f4d5"; }
.nav-tool[data-icon="search"]::before { content: "\f52a"; }

.swords-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.btn-swords {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-swords .swords-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.nav-badge {
  position: absolute;
  top: -0.28rem;
  right: -0.28rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.22rem;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: var(--gold-2);
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.player-search {
  position: relative;
}

.player-search-panel,
.friend-menu {
  width: max-content;
  min-width: 16rem;
  max-width: min(26rem, calc(100vw - 1.5rem));
}

.player-search-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.125rem;
  z-index: 1040;
  width: max-content;
  min-width: 16rem;
  max-width: min(26rem, calc(100vw - 1.5rem));
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.player-search-panel [data-role="search-results"] {
  margin-top: 0.45rem;
}

.friend-menu {
  max-height: 22rem;
  overflow: auto;
}

.friend-menu > .hint {
  font-size: 0.92rem;
}

.friend-menu [data-role="online-list"],
.friend-menu [data-role="invite-list"],
.friend-menu [data-role="online-list"] .hint,
.friend-menu [data-role="invite-list"] .hint,
.player-search-panel [data-role="search-results"] {
  font-size: 0.8rem;
}

.btn.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  line-height: 1;
  gap: 0;
}

.btn.icon-btn .swords-icon {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
}

.hover-tip {
  position: fixed;
  z-index: 1080;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.hover-tip[hidden] {
  display: none !important;
}

.friend-row,
.friend-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.2rem;
}

.friend-menu .friend-row,
.player-search-panel .friend-row {
  flex-wrap: nowrap;
}

.friend-menu .friend-row > :first-child,
.player-search-panel .friend-row > :first-child {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.friend-menu .friend-row form,
.player-search-panel .friend-row form {
  display: inline-flex;
  margin: 0;
}

.friend-row.request-row,
.friend-list li.request-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.friend-menu .friend-row.request-row,
.player-search-panel .friend-row.request-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.friend-row.request-row > :first-child,
.friend-list li.request-row > :first-child {
  display: block;
}

.friend-row.request-row > :last-child,
.friend-list li.request-row > :last-child {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  width: 100%;
}

.friend-menu .friend-row.request-row > :last-child,
.player-search-panel .friend-row.request-row > :last-child {
  width: auto;
  flex: 0 0 auto;
}

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.friend-list li + li,
.friend-row + .friend-row {
  border-top: 1px solid var(--line);
}

.invite-dialog {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(28, 24, 20, 0.45);
}

.invite-dialog[hidden] {
  display: none !important;
}

.invite-dialog-card {
  width: min(26rem, 100%);
}

.invite-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.online-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.45rem;
  border-radius: 50%;
  background: #1b7a43;
  vertical-align: middle;
}

#friends-table td form {
  display: inline-flex;
  margin: 0;
}

.friend-row .btn,
.friend-list .btn {
  flex: 0 0 auto;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4efe6;
  --muted: #c3b6a4;
  --paper: #101614;
  --card: #1b2420;
  --line: #314039;
  --green: #143028;
  --green-2: #1e4638;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
  --display: Georgia, Palatino, "Palatino Linotype", "Book Antiqua", serif;
  --bs-body-color: #f4efe6;
  --bs-body-bg: #101614;
  --bs-border-color: #314039;
  --bs-secondary-color: #c3b6a4;
}

html[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .h5 {
  font-weight: 600;
  letter-spacing: 0.01em;
}

html[data-theme="dark"] main a:not(.btn) {
  color: #e0b35a;
}

html[data-theme="dark"] .skip-link {
  background: var(--card);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .dt-search input,
html[data-theme="dark"] .dt-input {
  background-color: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .form-control::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] .btn-outline-dark {
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-dark:focus {
  background: var(--green);
  border-color: var(--green);
  color: #f6f1e7;
}

html[data-theme="dark"] .table {
  --bs-table-color: #f4efe6;
  --bs-table-bg: transparent;
  --bs-table-border-color: #24302b;
  --bs-table-striped-bg: rgba(244, 239, 230, 0.04);
  --bs-table-hover-bg: rgba(244, 239, 230, 0.06);
  border-color: #24302b;
  color: var(--ink);
}

html[data-theme="dark"] .table > :not(caption) > * > *,
html[data-theme="dark"] .table > :not(:last-child) > :last-child > *,
html[data-theme="dark"] table.dataTable > :not(caption) > * > * {
  border-color: #24302b;
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .site-navbar .dropdown-menu,
html[data-theme="dark"] .friend-menu,
html[data-theme="dark"] .friend-menu .hint,
html[data-theme="dark"] .player-search-panel {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .site-navbar .dropdown-item {
  color: var(--ink);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .site-navbar .dropdown-item:hover,
html[data-theme="dark"] .site-navbar .dropdown-item:focus,
html[data-theme="dark"] .site-navbar .dropdown-item.active {
  background: var(--green);
  color: #f6f1e7;
}

html[data-theme="dark"] .list-group-item {
  background: transparent;
  color: var(--ink);
}

html[data-theme="dark"] .alert-success {
  background: #1a3328;
  color: #d7eadf;
  border-color: #2d5a45;
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(1);
}

html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-dropdown,
html[data-theme="dark"] .select2-search--dropdown {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .select2-container--default .select2-results__option {
  color: var(--ink);
}

html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
  background: #24302b;
  color: var(--ink);
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--green-2);
  color: #f6f1e7;
}

html[data-theme="dark"] .select2-search__field {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .page-link {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .stat,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .coord-mode,
html[data-theme="dark"] .promotion-choice,
html[data-theme="dark"] .badge-soon {
  background: #24302b;
  color: var(--ink);
}

html[data-theme="dark"] .badge-soon {
  color: var(--gold-2);
}

html[data-theme="dark"] .play-clock {
  background: #24302b;
  color: var(--ink);
}

html[data-theme="dark"] .live-count {
  color: var(--ink);
}

html[data-theme="dark"] .coord-bar {
  background: #4a5852;
}

html[data-theme="dark"] .coord-bar span {
  background: var(--gold-2);
}

html[data-theme="dark"] .dt-container .page-item.active .page-link {
  background: var(--green);
  border-color: var(--green);
  color: #f6f1e7;
}

html[data-theme="dark"] .dt-container .page-item.disabled .page-link {
  background: var(--paper);
  color: #7d8b84;
  border-color: #24302b;
}

html[data-theme="dark"] .move-token.active,
html[data-theme="dark"] .move-token:hover,
html[data-theme="dark"] .move-entry:hover .move-token,
html[data-theme="dark"] .recent-game:hover td {
  background: #24302b;
}

html[data-theme="dark"] .opening-label {
  color: var(--ink);
}

.swal2-popup {
  --swal2-width: 22em;
  width: 22em !important;
  max-width: calc(100vw - 2rem);
}

html[data-theme="dark"] .swal2-popup {
  background: var(--card);
  color: var(--ink);
}

html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container {
  color: var(--ink);
}
