/* Warcaby - część specyficzna dla gry. Skóra wspólna (pasek, karty, przyciski,
   pola, czat, stopka) siedzi w gb-play.css i stamtąd biorą się wszystkie kolory. */

:root {
  --wb-sq-light: #3a3f4d;
  --wb-sq-dark: #23262f;
}

/* ================================================================== stół */

.wb-room {
  display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px;
  gap: 18px; padding: 22px 24px 10px; align-items: start;
  max-width: 1360px; margin: 0 auto;
}
.wb-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wb-center { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }

/* ---------------------------------------------------------- panele graczy */

.wb-seat { transition: border-color .15s, box-shadow .15s; }
.wb-seat.is-turn { border-color: var(--gp-accent); box-shadow: 0 0 0 3px rgba(255, 194, 51, .1); }
.wb-seat-head { display: flex; align-items: center; gap: 11px; }
.wb-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #2b3040; border: 1px solid var(--gp-line2);
}
.wb-avatar.is-you { background: var(--gp-accent); border-color: var(--gp-accent); }
.wb-avatar.is-bot { background: var(--gp-blue); border-color: var(--gp-blue); }
.wb-seat-id { flex: 1; min-width: 0; }
.wb-seat-nick {
  font-size: 14.5px; font-weight: 700; color: var(--gp-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-seat-nick .you { font-size: 11px; color: var(--gp-accent); font-weight: 600; }
.wb-seat-meta { font-size: 12.5px; color: var(--gp-muted); font-weight: 600; }
.wb-disc {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  background: #2b2f3a; border: 2px solid #6b7386;
}
.wb-disc.is-white { background: var(--gp-accent); border-color: var(--gp-accent); }

.wb-clock {
  margin-top: 12px; background: var(--gp-panel); border-radius: 8px;
  padding: 9px; text-align: center; border: 1px solid transparent;
}
.wb-seat.is-turn .wb-clock { border-color: rgba(255, 194, 51, .3); }
.wb-clock-time {
  font-family: var(--gb-mono); font-size: 25px; font-weight: 700; color: var(--gp-text2);
  font-variant-numeric: tabular-nums;
}
.wb-seat.is-turn .wb-clock-time { color: var(--gp-accent); }
.wb-clock-time.is-low { color: var(--gp-red); }
.wb-clock-note {
  font-size: 11px; color: var(--gp-accent); font-weight: 600;
  letter-spacing: 1px; margin-top: 2px; min-height: 14px; text-transform: uppercase;
}
.wb-taken { font-size: 12px; color: var(--gp-muted); font-weight: 600; margin-top: 9px; }
.wb-taken .wb-dots { color: var(--gp-text2); letter-spacing: 2px; }
.wb-taken b { color: var(--gp-text2); }
.wb-sit { margin-top: 11px; }

/* ------------------------------------------------------------- historia */

.wb-moves {
  display: grid; grid-template-columns: 30px 1fr 1fr; gap: 3px 8px;
  font-family: var(--gb-mono); font-size: 12.5px; color: var(--gp-text2);
  max-height: 190px; overflow-y: auto;
}
.wb-moves .no { color: var(--gp-muted); }
.wb-moves .last {
  background: rgba(255, 194, 51, .12); color: var(--gp-accent);
  border-radius: 3px; padding: 0 3px;
}
/* KRÓJ MASZYNOWY JEST DLA RUCHÓW, NIE DLA ZDAŃ.
   Lista ruchów musi mieć stałą szerokość znaku, żeby numery i notacja stały
   w równych kolumnach - i tak zostaje. Ale komunikat o pustej liście to całe
   zdanie po polsku, a zdanie złożone krojem maszynowym czyta się jak wydruk
   z terminala, a nie jak tekst serwisu. Bierze więc krój portalu. */
.wb-moves .gp-empty, .wb-moves .wb-empty {
  grid-column: 1 / -1;
  font-family: var(--gb-font);
  font-size: 12.5px;
  color: var(--gp-muted);
}
.wb-moves::-webkit-scrollbar { width: 7px; }
.wb-moves::-webkit-scrollbar-thumb { background: var(--gp-line2); border-radius: 4px; }

/* -------------------------------------------------------------- plansza */

.wb-status {
  width: 100%; text-align: center;
  font-size: 13.5px; font-weight: 700; letter-spacing: .2px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--gp-card); border: 1px solid var(--gp-line); color: var(--gp-text2);
}
.wb-status.is-you { border-color: var(--gp-accent); color: var(--gp-accent); }
.wb-status.is-watch { color: var(--gp-text2); }
.wb-status .hint { color: var(--gp-muted); font-weight: 600; }

.wb-board-wrap { position: relative; max-width: 100%; }
.wb-board {
  display: grid;
  border: 6px solid #2b2f3a; border-radius: 10px; overflow: hidden;
  --cell: 58px;
}
.wb-cell {
  width: var(--cell); height: var(--cell);
  display: grid; place-items: center; position: relative;
}
.wb-cell.light { background: var(--wb-sq-light); }
.wb-cell.dark { background: var(--wb-sq-dark); }
.wb-cell.is-target { outline: 3px solid rgba(61, 220, 132, .75); outline-offset: -3px; cursor: pointer; }
.wb-cell.is-from { outline: 3px solid rgba(255, 194, 51, .85); outline-offset: -3px; }
.wb-cell.is-last { background: #2b3040; }
.wb-cell .num {
  position: absolute; top: 2px; left: 4px;
  font-size: 9px; color: rgba(255, 255, 255, .2); font-family: var(--gb-mono);
}

.wb-piece {
  width: calc(var(--cell) * .66); height: calc(var(--cell) * .66);
  border-radius: 50%; position: relative;
  display: grid; place-items: center;
  transition: transform .12s ease;
}
.wb-piece.black { background: #3a4050; border: 3px solid #6b7386; }
.wb-piece.white { background: var(--gp-accent); border: 3px solid #ffd76a; }
.wb-piece.is-movable { cursor: pointer; }
.wb-piece.is-movable:hover { transform: scale(1.08); }
.wb-piece.is-selected { outline: 3px solid var(--gp-accent); outline-offset: 2px; }
.wb-piece .crown { font-size: calc(var(--cell) * .28); line-height: 1; }
.wb-piece.black .crown { color: #c6cbd6; }
.wb-piece.white .crown { color: #6b4d05; }

.wb-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.wb-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10, 11, 15, .85); border-radius: 10px;
}
.wb-overlay-inner { text-align: center; padding: 24px; }
.wb-overlay-inner .big {
  font-size: 30px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--gp-text);
}
.wb-overlay-inner .sub { color: var(--gp-muted); font-size: 14px; margin-top: 8px; }

/* ------------------------------------------------------ panel gospodarza */

.wb-hostbox { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.wb-botrow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- czat */

.wb-chat { height: 430px; }
.wb-spec-list li { display: flex; align-items: center; gap: 8px; }
.gp-log li .who { font-weight: 700; }
.gp-log li .who.w { color: var(--gp-accent); }
.gp-log li .who.b { color: var(--gp-blue); }
.gp-log li .who.spec { color: var(--gp-green); }

/* --------------------------------------------------------------- stawka */

.wb-stake-row {
  display: flex; justify-content: space-between;
  font-size: 13.5px; font-weight: 700; margin-top: 6px;
}
.wb-stake-row span { color: var(--gp-text2); font-weight: 600; }
.wb-stake-row .green { color: var(--gp-green); }
.wb-stake-row .yellow { color: var(--gp-accent); }
.wb-stake-row .red { color: var(--gp-red); }

/* -------------------------------------------------------- responsywność */

@media (max-width: 1280px) {
  .wb-room { grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 14px; padding: 16px; }
  .wb-board { --cell: 50px; }
}
@media (max-width: 1020px) {
  .wb-room { grid-template-columns: minmax(0, 1fr); }
  .wb-side { flex-direction: row; flex-wrap: wrap; }
  .wb-side > * { flex: 1 1 240px; }
  .wb-chat { height: 340px; }
  .wb-center { order: -1; }
}
@media (max-width: 700px) {
  .wb-room { padding: 14px; gap: 12px; }
  .wb-board { --cell: min(9.4vw, 44px); border-width: 4px; }
  .wb-side { flex-direction: column; }
  .wb-side > * { flex: 1 1 auto; }
  .wb-status { font-size: 12.5px; padding: 9px 11px; }
  .wb-actions .gp-btn { flex: 1 1 auto; }
  .wb-clock-time { font-size: 21px; }
  .wb-chat { height: 300px; }
  .wb-botrow { gap: 7px; }
}

/* Wybór wariantu wyłączony, bo narzuca go turniej. Przygaszony, a nie ukryty:
   gracz ma widzieć, na czym gra, nawet jeśli nie może tego zmienić.
   Selektor celuje w #set-variant, bo tak nazywa się ten przełącznik
   w szablonie - klasa .gp-choice obsługuje też zegar i inkrement. */
#set-variant.is-locked { opacity: .65; }
#set-variant.is-locked button:disabled { cursor: not-allowed; }
