/* ============================================================
   WOSA Schach, chess.css
   Ergänzt base.css (Look & Feel der übrigen WOSA-Apps).
   Boxen mit geraden Kanten, Buttons nur leicht gerundet.
   ============================================================ */

:root {
  --radius: 4px;
  --radius-lg: 0;
  --radius-xl: 0;
  --stage: #15171c;
  --stage-2: #0d0f13;
  --gold: #F2C94C;
  --go: #1f9d55;
}

.container--wide { max-width: 1440px; }

/* ---------- Hero kompakter, damit das Brett schnell sichtbar ist ---------- */
.hero--chess { padding: 40px 0 92px; }
.hero--chess .hero__lead { margin-top: 14px; }
.hero--chess .hero__facts { margin-top: 22px; }
@media (max-width: 575px) {
  .hero--chess { padding: 26px 0 70px; }
  .hero--chess h1 { font-size: 1.95rem; }
  .hero--chess .hero__lead { font-size: 1rem; }
  .hero--chess .hero__facts { gap: 8px 18px; }
  .hero--chess .hero__fact { font-size: .875rem; }
}

/* ---------- Spielbereich ---------- */
.tool--chess { margin-top: -64px; padding-bottom: 40px; }

.chess {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
  box-shadow: var(--shadow-lift);
}

@media (min-width: 1000px) {
  .chess { grid-template-columns: minmax(0, 1fr) 390px; }
}

.chess__main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 16px;
  color: var(--ink);
  background: var(--paper);
}
@media (min-width: 768px) {
  .chess__main { padding: 20px 28px 22px; }
}

/* Spieler-Leisten */
.pbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  background: var(--ground-soft);
  border: 1px solid var(--line-soft);
  transition: background-color .25s var(--ease-soft), border-color .25s var(--ease-soft);
}
.pbar.is-turn { border-color: var(--ink-dim); background: var(--paper); }
.pbar__dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink-dim);
}
.pbar__dot--white { background: #f3efe6; }
.pbar__dot--black { background: #1b1d22; }
.pbar__flag { font-size: 1.25rem; line-height: 1; }
.pbar__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pbar__name { font-weight: 600; font-size: 1rem; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar__meta { font-size: .8rem; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar__caps {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: -.1em;
  white-space: nowrap;
  text-align: right;
  color: var(--ink-mid);
}
.pbar__clock {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 6px 10px;
  font-size: 1.25rem;
  font-weight: 500;
  text-align: right;
  color: var(--ink-mid);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}
.pbar.is-running .pbar__clock { color: #fff; background: var(--ink-strong); border-color: var(--ink-strong); }
.pbar.is-running.is-low .pbar__clock { border-color: var(--red); }
.pbar.is-running.is-low .pbar__clock { color: #fff; background: var(--red); }
@media (max-width: 480px) {
  .pbar { gap: 8px; min-height: 46px; padding: 6px 8px; }
  .pbar__clock { min-width: 70px; font-size: 1.1rem; padding: 4px 8px; }
  .pbar__caps { font-size: .9rem; }
}

/* Brett */
.board3d {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: calc(100vh - 210px);
  margin: 10px auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 1000px) {
  .board3d { max-width: min(100%, calc(100vh - 220px)); min-height: 420px; }
}
.board3d__canvas { width: 100% !important; height: 100% !important; display: block; outline: none; cursor: pointer; }

.board3d__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--ink-mid);
}
.board3d__loading[hidden] { display: none; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ergebnis über dem Brett */
.board3d__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, .55);
  animation: fadeIn .3s var(--ease);
}
.board3d__overlay[hidden] { display: none; }
.ov__card {
  width: min(100%, 420px);
  padding: 26px 24px 22px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border-top: 4px solid var(--ink-dim);
  box-shadow: 0 24px 60px rgba(22, 24, 28, .22);
  animation: pop .35s var(--ease-back);
}
.board3d__overlay--win .ov__card { border-top-color: var(--go); }
.board3d__overlay--loss .ov__card { border-top-color: var(--red); }
.ov__title { margin: 0 0 6px; font-size: 1.9rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink-strong); }
.ov__sub { margin: 0; color: var(--ink-mid); }
.ov__extra { margin: 12px 0 0; padding: 10px 12px; font-weight: 600; color: var(--ink-strong); background: var(--ground); }
.ov__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.ov__buttons .btn-primary { min-width: 0; min-height: 46px; padding: 12px 22px; font-size: 1rem; }
.ov__buttons .btn-primary .btn-label::after { content: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }

/* Umwandlung */
.promo {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .55);
}
.promo[hidden] { display: none; }
.promo__card { padding: 18px; text-align: center; background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.promo__title { margin: 0 0 10px; font-weight: 600; }
.promo__list { display: flex; gap: 8px; }
.promo__btn {
  width: 64px;
  height: 64px;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--ink-strong);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color .15s, border-color .15s;
}
.promo__btn:hover, .promo__btn:focus-visible { background: var(--red-tint); border-color: var(--red); }
.promo__cancel { margin-top: 10px; font-size: .875rem; color: var(--ink-mid); text-decoration: underline; }

/* Statuszeile und Aktionen */
.chess__status {
  margin: 12px 0 0;
  min-height: 1.6em;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  color: var(--ink-mid);
}
.chess__status--go { color: var(--go); }
.chess__status--alert { color: var(--red); }
.chess__status--wait { color: var(--ink-mid); }

.chess__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.abtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-strong);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color .15s, border-color .15s, color .15s;
}
.abtn:hover { color: var(--red); border-color: var(--red); }
.abtn--danger:hover { color: #fff; background: var(--red); border-color: var(--red); }
.abtn--primary { color: #fff; background: var(--red); border-color: var(--red); }
.abtn--primary:hover { background: var(--red-hover); }
@media (max-width: 480px) {
  .abtn span { display: none; }
  .abtn--primary span, .abtn--danger span { display: inline; }
  .abtn { padding: 10px 13px; }
}

/* ---------- Seitenleiste ---------- */
.chess__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
  border-left: 1px solid var(--line-soft);
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--ground-soft);
}
.tabs__btn {
  position: relative;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-mid);
  transition: color .15s, background-color .15s;
}
.tabs__btn:hover { color: var(--red); }
.tabs__btn[aria-selected="true"] { color: var(--ink-strong); background: var(--paper); }
.tabs__btn[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: var(--red);
}
.tabs__btn:last-child { flex: 0 0 auto; padding: 14px 16px; }
.tabs__label { display: none; }
.tabs__count:empty { display: none; }
.tabs__count {
  min-width: 20px;
  padding: 1px 6px;
  font-size: .72rem;
  line-height: 1.5;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
}

.tabpanel { padding: 22px 22px 26px; }
.tabpanel[hidden] { display: none; }
@media (max-width: 480px) { .tabpanel { padding: 18px 16px 22px; } }

.side__title {
  margin: 22px 0 10px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
}
.tabpanel > .side__title:first-child,
.tabpanel > div > .side__title:first-child { margin-top: 0; }
.side__lead { margin: 0 0 16px; font-size: .95rem; color: var(--ink-mid); }
.side__tip { margin: 18px 0 0; padding: 12px 14px; font-size: .875rem; color: var(--ink-mid); background: var(--ground); }
.side__tip i { color: var(--red); margin-right: 4px; }
.side__empty { margin: 0 0 8px; font-size: .9rem; color: var(--ink-dim); }
.side__empty[hidden] { display: none; }
.side__row { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--ink-dim); font-weight: 400; font-size: .875rem; }

/* Formular */
.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form__note { margin: 0; font-size: .8rem; color: var(--ink-dim); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.form .field { margin: 0; }
.field[hidden] { display: none; }
.field__label { padding: 0; font-size: .875rem; font-weight: 600; color: var(--ink-strong); }
.field__hint { font-weight: 400; color: var(--ink-dim); }
.field input:not([type="radio"]):not([type="checkbox"]):not([type="range"]),
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 1rem;
  color: var(--ink-strong);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(211, 38, 35, .14); }

.btn-block { width: 100%; min-width: 0 !important; }
.btn.is-loading { opacity: .75; pointer-events: none; }

/* Auswahl-Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 6px 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.chip span:hover { border-color: var(--red); color: var(--red); }
.chip input:checked + span { color: #fff; background: var(--ink-strong); border-color: var(--ink-strong); }
.chip input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }

/* Segmentschalter */
.seg { display: flex; gap: 6px; margin-bottom: 20px; }
.seg--full button { flex: 1 1 0; }
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px;
  font-size: .925rem;
  font-weight: 600;
  color: var(--ink-mid);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.seg button:hover { border-color: var(--red); color: var(--red); }
.seg button.active { color: #fff; background: var(--red); border-color: var(--red); }

/* Schieberegler Level */
.range {
  --fill: 30%;
  width: 100%;
  height: 28px;
  margin: 4px 0 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--red) var(--fill), var(--line) var(--fill));
  border-radius: 3px;
}
.range::-moz-range-track { height: 6px; background: var(--line); border-radius: 3px; }
.range::-moz-range-progress { height: 6px; background: var(--red); border-radius: 3px; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  background: #fff;
  border: 2px solid var(--red);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.range::-moz-range-thumb { width: 22px; height: 22px; background: #fff; border: 2px solid var(--red); border-radius: 50%; }
.range__scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-dim); }

/* Schalter */
.toggle { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  margin-top: 1px;
  background: var(--line);
  border-radius: 999px;
  transition: background-color .2s var(--ease-soft);
}
.toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s var(--ease);
}
.toggle input:checked + .toggle__track { background: var(--red); }
.toggle input:checked + .toggle__track .toggle__knob { transform: translateX(20px); }
.toggle input:focus-visible + .toggle__track { outline: 3px solid var(--red); outline-offset: 2px; }
.toggle__text { font-size: .95rem; line-height: 1.4; color: var(--ink); }

.potbox { margin-bottom: 18px; padding: 16px 16px 2px; background: var(--ground); border: 1px solid var(--line); transition: background-color .2s, border-color .2s; }
.potbox.is-on { background: #eefaf2; border-color: #9fd9b5; }

/* Wer bin ich */
.me { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 12px 14px; background: var(--ground); }
.me[hidden] { display: none; }
.me__avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #fff; background: var(--ink-strong); }
.me__who { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me__who strong { color: var(--ink-strong); }
.me__who span { font-size: .85rem; color: var(--ink-mid); }
.me__status { color: var(--go) !important; font-weight: 600; }
.linkbtn { font-size: .875rem; font-weight: 600; color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.linkbtn[hidden] { display: none; }

/* Lobby */
.lobby { margin: 0 0 8px; padding: 0; list-style: none; }
.lobby__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.lobby__item:last-child { border-bottom: 0; }
.lobby__flag { font-size: 1.4rem; line-height: 1; }
.lobby__who { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.lobby__who strong { color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby__meta { font-size: .8rem; color: var(--ink-dim); }
.lobby__state { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-mid); }
.lobby__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.lobby__item--waiting .lobby__dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(242, 201, 76, .3); }
.lobby__item--waiting .lobby__state { color: #8a6a00; font-weight: 600; }
.lobby__item--playing .lobby__dot, .lobby__item--ai_busy .lobby__dot { background: var(--red); }
.lobby__item--ai_open .lobby__dot { background: #3b82f6; }
.lbtn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-strong);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lbtn:hover { border-color: var(--red); color: var(--red); }
.lbtn--primary { color: #fff; background: var(--red); border-color: var(--red); }
.lbtn--primary:hover { color: #fff; background: var(--red-hover); }

.outgoing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: #6a5000;
  background: #fff7dc;
  border: 1px solid #f2d98a;
}
.outgoing[hidden] { display: none; }
.outgoing .linkbtn { margin-left: auto; }

/* Zugliste */
.moves { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); }
.moves__table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .92rem; }
.moves__table th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: var(--ground-soft);
  border-bottom: 1px solid var(--line);
}
.moves__table td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.moves__table tr:nth-child(even) td { background: var(--ground-soft); }
.mv__no { width: 44px; color: var(--ink-dim); }
.mv__w, .mv__b { color: var(--ink-strong); }
.is-last { font-weight: 600; color: var(--red) !important; }
.moves .side__empty { padding: 12px; }
.moves__tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.moves__tools .btn-ghost { padding: 8px 10px; border: 1px solid var(--line); gap: 6px; }

.btn-ghost--danger:hover { color: #fff; background: var(--red); }

/* ---------- Dialoge ---------- */
.dlg {
  width: min(94vw, 440px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.dlg::backdrop { background: rgba(10, 11, 14, .6); }
.dlg[open] { animation: pop .3s var(--ease-back); }
.dlg__card { padding: 24px 22px 20px; background: var(--paper); border-top: 4px solid var(--red); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.dlg__who { margin: 0 0 16px; font-size: 1.15rem; }
.dlg__who strong { color: var(--ink-strong); font-size: 1.35rem; }
.dlg__who span { color: var(--ink-mid); }
.dlg__details { margin: 0 0 18px; padding: 10px 12px; font-weight: 600; background: var(--ground); }
.dlg__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg__buttons .btn-primary { min-width: 0; flex: 1 1 auto; min-height: 48px; }
.dlg__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  font-size: 1.5rem;
  color: #fff;
  background: var(--red);
  animation: ring 1.2s var(--ease) infinite;
}
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-12deg); }
  20% { transform: rotate(12deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .dlg__icon { animation: none; } }

/* ---------- Hinweise ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 520px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  font-size: .95rem;
  font-weight: 500;
  color: #fff;
  background: var(--ink-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  animation: rise .3s var(--ease);
  transition: opacity .4s, transform .4s;
}
.toast--error { background: var(--red-deep); }
.toast--ok { background: #157a42; }
.toast.is-out { opacity: 0; transform: translateY(8px); }

/* ---------- Rangliste und Level-Tabelle ---------- */
.ranking { padding: 56px 0 88px; }
.lb, .levels { background: var(--paper); border: 1px solid var(--line); overflow-x: auto; }
.lb__table, .levels__table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.lb__table th, .levels__table th {
  padding: 12px 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: var(--ground-soft);
  border-bottom: 1px solid var(--line);
}
.lb__table td, .levels__table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.lb__table tr:last-child td, .levels__table tr:last-child td { border-bottom: 0; }
.lb__rank { width: 56px; font-family: var(--mono); font-weight: 500; color: var(--ink-dim); }
.lb__table tbody tr:nth-child(1) .lb__rank { color: #b8860b; font-weight: 700; }
.lb__table tbody tr:nth-child(2) .lb__rank { color: #8a8f99; font-weight: 700; }
.lb__table tbody tr:nth-child(3) .lb__rank { color: #a0522d; font-weight: 700; }
.lb__flag { font-size: 1.1rem; }
.lb__city { font-size: .85rem; color: var(--ink-dim); }
.lb__empty { margin: 0; padding: 18px 14px; color: var(--ink-mid); }
.lb__empty[hidden] { display: none; }
.lvl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 500;
  color: var(--red);
  background: var(--red-tint);
}
/* Stärke als Balken mit zehn Stufen */
.lvl-bar { display: inline-flex; gap: 3px; margin-left: 10px; vertical-align: middle; }
.lvl-bar i { width: 6px; height: 12px; background: var(--line); }
.lvl-bar i.on { background: var(--red); }
@media (max-width: 640px) { .lvl-bar { display: none; } }
.levels__table td:first-child { width: 150px; white-space: nowrap; }
.levels__table td:nth-child(2) { width: 170px; color: var(--ink-strong); }
.levels__table td:last-child { color: var(--ink-mid); }
@media (max-width: 640px) {
  .lb__hideS { display: none; }
  .lb__table td, .lb__table th { padding: 10px 8px; }
  .levels__table td:nth-child(2) { width: auto; }
}

.guide-section--alt { padding-bottom: 0; }
.site-footer__credits { margin-top: 10px; padding-top: 0; border-top: 0; font-size: .75rem; }

/* Beim Spielen auf kleinen Bildschirmen die Seite nicht verrutschen lassen */
@media (max-width: 999px) {
  .chess__side { border-left: 0; border-top: 1px solid var(--line-soft); }
  .board3d { max-height: none; }
}

@media (max-width: 480px) {
  .seg button { font-size: .85rem; padding: 10px 6px; white-space: nowrap; gap: 6px; }
}

.clockbox[hidden] { display: none; }
.toggle-row { display: flex; align-items: flex-start; gap: 8px; }
.toggle-row .toggle { flex: 1 1 auto; }
.infobtn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-top: -3px;
  font-size: 1.15rem;
  color: var(--ink-dim);
  border-radius: 50%;
  transition: color .15s;
}
.infobtn:hover, .infobtn[aria-expanded="true"] { color: var(--red); }
.infobox { margin: -4px 0 16px; padding: 12px 14px; font-size: .9rem; color: var(--ink-mid); background: var(--ground); border: 1px solid var(--line); }
.infobox[hidden] { display: none; }
.infobox p { margin: 0 0 8px; }
.infobox p:last-child { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 2D-Brett ---------- */
.board2d {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 10px solid #3b3f47;
  box-shadow: 0 10px 30px rgba(22, 24, 28, .18);
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  touch-action: manipulation;
}
.board2d[hidden] { display: none; }
.board2d__squares, .board2d__marks, .board2d__pieces { position: absolute; inset: 0; }
.board2d__marks { pointer-events: none; }
.board2d__pieces { pointer-events: none; }
.sq, .mk, .pc { position: absolute; width: 12.5%; height: 12.5%; }
.sq--light { background: #ECEAE6; }
.sq--dark { background: #8C939E; }
.sq__file, .sq__rank {
  position: absolute;
  font-size: clamp(9px, 1.6vw, 13px);
  font-weight: 600;
  line-height: 1;
}
.sq__file { right: 4%; bottom: 4%; }
.sq__rank { left: 5%; top: 5%; }
.sq--light .sq__file, .sq--light .sq__rank { color: #8C939E; }
.sq--dark .sq__file, .sq--dark .sq__rank { color: #ECEAE6; }
.board2d--nocoords .sq__file, .board2d--nocoords .sq__rank { display: none; }
.pc { transition-property: left, top; transition-timing-function: cubic-bezier(.22, 1, .36, 1); }
.pc svg { display: block; width: 100%; height: 100%; }
.pc.is-moving { z-index: 2; }
.pc.is-captured { opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.mk--last { background: rgba(242, 201, 76, .55); }
.mk--select { background: rgba(31, 157, 85, .45); }
.mk--hint { background: rgba(211, 38, 35, .5); }
.mk--check { background: radial-gradient(circle, rgba(211, 38, 35, .95) 0%, rgba(211, 38, 35, .5) 45%, rgba(211, 38, 35, 0) 75%); }
.mk--dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 28%;
  background: rgba(224, 32, 28, .85);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.mk--capture::after {
  content: '';
  position: absolute;
  inset: 5%;
  border: 5px solid rgba(224, 32, 28, .85);
  border-radius: 50%;
}

/* Umschalter 2D / 3D */
.viewswitch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewswitch__btn { padding: 9px 14px; font-size: .9rem; font-weight: 700; color: var(--ink-mid); background: var(--paper); }
.viewswitch__btn + .viewswitch__btn { border-left: 1px solid var(--line); }
.viewswitch__btn:hover { color: var(--red); }
.viewswitch__btn.is-on { color: #fff; background: var(--ink-strong); }

/* Weitere Einstellungen (aufklappbar) */
.more { margin: 0 0 16px; border: 1px solid var(--line); }
.more__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: .925rem;
  font-weight: 600;
  color: var(--ink-strong);
  cursor: pointer;
  list-style: none;
}
.more__toggle::-webkit-details-marker { display: none; }
.more__toggle:hover { color: var(--red); }
.more__chev { margin-left: auto; transition: transform .2s var(--ease); color: var(--ink-dim); }
.more[open] .more__chev { transform: rotate(180deg); }
.more__body { padding: 4px 14px 2px; border-top: 1px solid var(--line-soft); }
.more__body .settings { padding-top: 12px; }
.settings .linkbtn { display: inline-block; margin: -4px 0 14px; }
