:root {
  --draughts-ink: #23241f;
  --draughts-paper: #f3ecd8;
  --draughts-paper-dark: #d9cba8;
  --draughts-brass: #d4aa52;
  --draughts-wine: #8e2738;
  --draughts-wood: #6b3d24;
  --draughts-wood-dark: #352116;
  --board-light: #e6d5ae;
  --board-dark: #244b3c;
  --piece-light: #f4e8c7;
  --piece-light-edge: #a98e5d;
  --piece-dark: #a92f45;
  --piece-dark-edge: #591729;
}

.draughts-page {
  min-height: 100%;
  color: var(--draughts-ink);
  background:
    repeating-linear-gradient(90deg, rgba(65, 37, 22, 0.11) 0 1px, transparent 1px 96px),
    linear-gradient(135deg, #a96f46 0 18%, #75472e 18% 55%, #523321 55%);
  transition: background-color 0.35s ease;
}

.draughts-page[data-room="night"] {
  --board-light: #c9c6b7;
  --board-dark: #263a54;
  --draughts-paper: #e8e4d8;
  --draughts-paper-dark: #c4bdad;
  --draughts-brass: #e0b85c;
  --draughts-wine: #ad3e69;
  background:
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 32px),
    linear-gradient(145deg, #171c2a, #252d3d 58%, #3b2840);
}

.draughts-page[data-room="terrace"] {
  --board-light: #f0dfb8;
  --board-dark: #3d6850;
  --draughts-paper: #fff4d7;
  --draughts-paper-dark: #d8ca9d;
  --draughts-brass: #c8903c;
  --draughts-wine: #a54636;
  background:
    repeating-linear-gradient(0deg, rgba(36, 76, 54, 0.07) 0 2px, transparent 2px 45px),
    linear-gradient(135deg, #769a75, #d8c88e 54%, #b76d4d);
}

.draughts-page[data-pieces="cobalt"] {
  --piece-light: #f2ae72;
  --piece-light-edge: #9f5834;
  --piece-dark: #285ca8;
  --piece-dark-edge: #15366c;
}

.draughts-page[data-pieces="plum"] {
  --piece-light: #bfe0c7;
  --piece-light-edge: #668f72;
  --piece-dark: #713d71;
  --piece-dark-edge: #3d203e;
}

.draughts-page .site-header {
  color: #f6eedc;
  background: rgba(39, 29, 22, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.13);
}

.draughts-page .site-brand-mark {
  color: #2d2116;
  background: var(--draughts-brass);
  box-shadow: 4px 4px 0 #19130e;
}

.draughts-page .site-brand-text span {
  color: rgba(246, 238, 220, 0.68);
}

.draughts-page .site-footer {
  color: rgba(246, 238, 220, 0.7);
  background: #292018;
  border-top: 0;
}

.draughts-page .site-footer strong,
.draughts-page .site-footer a:hover {
  color: var(--draughts-brass);
}

.draughts-page .visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.draughts-main {
  min-height: calc(100svh - var(--site-header-h));
  padding: 18px clamp(12px, 2.5vw, 34px) 0;
}

.draughts-stage {
  width: min(1280px, 100%);
  min-height: 790px;
  position: relative;
  margin: 0 auto;
  isolation: isolate;
  scroll-margin-top: var(--site-header-h);
}

.match-marquee {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 8px 2px 8px 15px;
  color: #f4ead2;
  border-left: 6px solid var(--draughts-brass);
}

.match-marquee p {
  color: var(--draughts-brass);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-marquee h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.match-marquee h1 span {
  margin-left: 8px;
  color: rgba(244, 234, 210, 0.62);
  font-family: var(--font);
  font-size: 0.62em;
  font-weight: 500;
  text-transform: none;
}

.match-state {
  min-width: 148px;
  padding: 8px 12px;
  color: #2c261d;
  background: var(--draughts-paper);
  border: 1px solid #8f7e5c;
  box-shadow: 5px 5px 0 rgba(32, 21, 14, 0.35);
  text-align: right;
  transform: rotate(0.6deg);
}

.match-state span,
.match-state strong {
  display: block;
}

.match-state span {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.match-state strong {
  color: var(--draughts-wine);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.draughts-layout {
  display: grid;
  grid-template-columns: minmax(540px, 1fr) 340px;
  gap: clamp(18px, 2.5vw, 34px);
  align-items: start;
}

.board-column {
  min-width: 0;
}

.player-rail {
  width: min(720px, calc(100% - 34px));
  min-height: 46px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 auto;
  padding: 7px 14px;
  color: #eee6d2;
  background: rgba(37, 28, 21, 0.87);
  border-inline: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease, transform 0.2s ease;
}

.player-rail-black {
  border-bottom: 3px solid var(--piece-dark);
}

.player-rail-white {
  border-top: 3px solid var(--piece-light);
}

.player-rail.is-active {
  color: #2b241b;
  background: var(--draughts-brass);
  transform: scale(1.015);
}

.player-rail small,
.player-rail strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-rail small {
  opacity: 0.68;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-rail strong {
  font-family: Georgia, serif;
  font-size: 1rem;
}

.player-rail > span:last-child {
  min-width: 28px;
  font: 900 1.2rem Georgia, serif;
  text-align: right;
}

.rail-piece {
  width: 27px;
  aspect-ratio: 1;
  border: 3px solid;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.13), 0 2px 0 rgba(0, 0, 0, 0.3);
}

.rail-piece-white {
  background: var(--piece-light);
  border-color: var(--piece-light-edge);
}

.rail-piece-black {
  background: var(--piece-dark);
  border-color: var(--piece-dark-edge);
}

.board-frame {
  width: min(760px, 100%);
  aspect-ratio: 1;
  position: relative;
  margin: 8px auto;
  padding: clamp(8px, 1.4vw, 15px);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, #8b5936, var(--draughts-wood) 55%, var(--draughts-wood-dark));
  border: 2px solid #2b1a10;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 226, 178, 0.2),
    inset 0 0 24px rgba(27, 15, 8, 0.42),
    0 18px 34px rgba(24, 14, 9, 0.38);
}

.draughts-board {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  border: 2px solid #2a2117;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.18);
}

.board-square {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  font: inherit;
}

.board-square.is-light {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 65%),
    var(--board-light);
  cursor: default;
}

.board-square.is-dark {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px),
    var(--board-dark);
  cursor: pointer;
}

.board-square.is-dark:hover {
  box-shadow: inset 0 0 0 3px rgba(255, 231, 174, 0.34);
}

.board-square.is-selected {
  box-shadow: inset 0 0 0 5px var(--draughts-brass);
}

.board-square.is-origin::after,
.board-square.is-target::after {
  content: '';
  width: 23%;
  aspect-ratio: 1;
  position: relative;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
}

.board-square.is-origin::after {
  width: 72%;
  border: 4px solid rgba(255, 225, 143, 0.75);
}

.board-square.is-target::after {
  background: var(--draughts-brass);
  box-shadow: 0 0 0 5px rgba(43, 32, 21, 0.22);
  animation: targetPulse 1.3s ease-in-out infinite;
}

.board-square.is-capture-target::after {
  width: 38%;
  background: var(--draughts-wine);
  border: 4px double #f4d889;
  box-shadow: 0 0 16px rgba(129, 27, 46, 0.75);
}

.board-square[data-col="0"]::before {
  content: attr(data-rank);
  position: absolute;
  left: 5px;
  top: 3px;
  z-index: 2;
  color: rgba(29, 26, 20, 0.58);
  font-size: clamp(0.5rem, 1vw, 0.72rem);
  font-weight: 900;
  pointer-events: none;
}

.board-square[data-row="7"] > span {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: rgba(29, 26, 20, 0.58);
  font-size: clamp(0.5rem, 1vw, 0.72rem);
  font-weight: 900;
}

.piece-layer,
.effect-layer {
  position: absolute;
  inset: clamp(10px, 1.55vw, 17px);
  pointer-events: none;
}

.piece-layer {
  z-index: 4;
}

.effect-layer {
  z-index: 6;
  overflow: hidden;
}

.piece-slot {
  width: 12.5%;
  height: 12.5%;
  position: absolute;
  display: grid;
  place-items: center;
  transition: left 0.24s cubic-bezier(0.2, 0.8, 0.25, 1), top 0.24s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.draughts-piece {
  width: 72%;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border: clamp(3px, 0.55vw, 6px) solid;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.14),
    inset 0 -9px 12px rgba(0, 0, 0, 0.2),
    0 5px 0 rgba(0, 0, 0, 0.22),
    0 9px 12px rgba(0, 0, 0, 0.2);
}

.piece-white {
  background: var(--piece-light);
  border-color: var(--piece-light-edge);
}

.piece-black {
  background: var(--piece-dark);
  border-color: var(--piece-dark-edge);
}

.draughts-piece::before {
  content: '';
  width: 54%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.draughts-piece.is-king::after {
  content: '♛';
  position: absolute;
  color: rgba(255, 246, 210, 0.92);
  font-size: clamp(0.82rem, 3.6vw, 2rem);
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

.piece-white.is-king::after {
  color: #5c4229;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.piece-slot.is-selectable .draughts-piece {
  animation: selectableGlow 1.7s ease-in-out infinite;
}

.piece-slot.is-selected .draughts-piece {
  transform: translateY(-5px);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    0 0 0 5px var(--draughts-brass),
    0 11px 16px rgba(0, 0, 0, 0.36);
}

.piece-slot.is-arriving .draughts-piece {
  animation: pieceArrive 0.28s both;
}

.piece-slot.is-crowned .draughts-piece {
  animation: crownRise 0.8s both;
}

.moving-piece {
  width: 9%;
  aspect-ratio: 1;
  position: absolute;
  z-index: 2;
  border: 5px solid;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.15), 0 8px 14px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  transition: left 0.24s cubic-bezier(0.2, 0.8, 0.25, 1), top 0.24s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.moving-piece.piece-white {
  background: var(--piece-light);
}

.moving-piece.piece-black {
  background: var(--piece-dark);
}

.capture-spark {
  width: 7px;
  height: 7px;
  position: absolute;
  left: var(--spark-x);
  top: var(--spark-y);
  background: var(--draughts-brass);
  border-radius: 50%;
  animation: sparkBurst 0.65s ease-out both;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
}

.match-book {
  min-height: 704px;
  position: relative;
  padding: 20px 18px;
  color: #30291f;
  background:
    linear-gradient(90deg, transparent 25px, rgba(157, 53, 58, 0.22) 25px 27px, transparent 27px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(73, 101, 105, 0.11) 31px 32px),
    var(--draughts-paper);
  border: 1px solid #766a51;
  box-shadow: 12px 14px 0 rgba(39, 24, 15, 0.27);
  transform: rotate(0.35deg);
}

.match-book::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(80, 68, 49, 0.13);
  pointer-events: none;
}

.turn-page {
  position: relative;
  padding: 6px 12px 15px;
  border-bottom: 3px double rgba(74, 60, 40, 0.32);
  text-align: center;
}

.turn-page span,
.turn-page strong {
  display: block;
}

.turn-page span {
  color: var(--draughts-wine);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.turn-page strong {
  margin: 3px 0 5px;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

.turn-page p {
  min-height: 35px;
  color: #655d4f;
  font-size: 0.76rem;
  line-height: 1.35;
}

.match-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin: 14px 0 16px;
}

.match-tools button {
  height: 39px;
  color: #393126;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(74, 61, 42, 0.32);
  border-radius: 3px;
  font: 900 1.15rem var(--font);
  cursor: pointer;
}

.match-tools button:hover:not(:disabled) {
  color: #f8ebc8;
  background: var(--draughts-wine);
}

.match-tools button:disabled {
  opacity: 0.3;
  cursor: default;
}

.appearance-page,
.notation-page,
.hall-preview {
  position: relative;
  padding: 13px 8px;
  border-top: 1px solid rgba(82, 68, 46, 0.24);
}

.appearance-page h2,
.notation-page h2,
.hall-preview h2 {
  font-family: Georgia, serif;
  font-size: 1rem;
}

.room-swatches,
.piece-swatches {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.room-swatch {
  width: 48px;
  height: 27px;
  padding: 0;
  border: 2px solid rgba(51, 42, 31, 0.32);
  border-radius: 3px;
  cursor: pointer;
}

.room-swatch[data-room-choice="club"] {
  background: linear-gradient(135deg, #75472e 50%, #244b3c 50%);
}

.room-swatch[data-room-choice="night"] {
  background: linear-gradient(135deg, #20293a 50%, #ad3e69 50%);
}

.room-swatch[data-room-choice="terrace"] {
  background: linear-gradient(135deg, #769a75 50%, #d8c88e 50%);
}

.room-swatch.is-active,
.piece-swatch.is-active {
  outline: 3px solid var(--draughts-wine);
  outline-offset: 2px;
}

.piece-swatch {
  width: 48px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(51, 42, 31, 0.32);
  border-radius: 3px;
  cursor: pointer;
}

.piece-swatch i {
  width: 20px;
  aspect-ratio: 1;
  margin-inline: -2px;
  border: 2px solid rgba(37, 29, 20, 0.38);
  border-radius: 50%;
}

.piece-swatch[data-piece-choice="ruby"] i:first-child { background: #f4e8c7; }
.piece-swatch[data-piece-choice="ruby"] i:last-child { background: #a92f45; }
.piece-swatch[data-piece-choice="cobalt"] i:first-child { background: #f2ae72; }
.piece-swatch[data-piece-choice="cobalt"] i:last-child { background: #285ca8; }
.piece-swatch[data-piece-choice="plum"] i:first-child { background: #bfe0c7; }
.piece-swatch[data-piece-choice="plum"] i:last-child { background: #713d71; }

.notation-page > div,
.hall-preview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.notation-page > div span {
  color: #777061;
  font-size: 0.66rem;
  font-weight: 900;
}

#move-list {
  height: 132px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 25px;
  grid-auto-flow: row;
  gap: 0 12px;
  margin-top: 8px;
  overflow-y: auto;
  list-style-position: inside;
  font: 700 0.75rem ui-monospace, SFMono-Regular, Consolas, monospace;
}

#move-list li {
  padding: 4px 3px;
  border-bottom: 1px dotted rgba(80, 66, 43, 0.26);
}

#move-list .empty-notation {
  grid-column: 1 / -1;
  color: #837b6e;
  font-family: var(--font);
  font-style: italic;
  list-style: none;
}

.hall-preview button,
.ticket-link {
  color: var(--draughts-wine);
  background: transparent;
  border: 0;
  font: 800 0.7rem var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#hall-mini {
  margin-top: 9px;
  list-style: none;
}

#hall-mini li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 5px 3px;
  border-bottom: 1px dotted rgba(80, 66, 43, 0.26);
  font-size: 0.75rem;
}

#hall-mini b {
  color: var(--draughts-wine);
}

.setup-overlay,
.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: start;
  justify-items: end;
  padding: 94px 55px 34px;
  overflow-y: auto;
  background: linear-gradient(90deg, rgba(29, 21, 15, 0.12), rgba(29, 21, 15, 0.68) 62%, rgba(29, 21, 15, 0.9));
  backdrop-filter: blur(1.5px);
}

.setup-ticket,
.result-ticket {
  width: min(480px, 100%);
  position: relative;
  padding: 28px clamp(22px, 4vw, 38px);
  color: var(--draughts-ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(62, 84, 88, 0.08) 28px 29px),
    var(--draughts-paper);
  border: 1px solid #766a51;
  box-shadow: 13px 15px 0 rgba(20, 14, 10, 0.35);
  transform: rotate(-0.35deg);
}

.setup-ticket::after,
.result-ticket::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(97, 75, 45, 0.18);
  pointer-events: none;
}

.ticket-number {
  position: absolute;
  right: 21px;
  top: 15px;
  color: #867b68;
  font: 800 0.62rem ui-monospace, monospace;
}

.ticket-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.crown-mark {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #f3e4bd;
  background: var(--draughts-wine);
  border: 4px double #e2bd6a;
  border-radius: 50%;
  font-size: 2rem;
}

.ticket-heading p {
  color: var(--draughts-wine);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-heading h2 {
  font-family: Georgia, serif;
  font-size: 2.5rem;
  line-height: 0.9;
  text-transform: uppercase;
}

.setup-choice {
  display: grid;
  gap: 7px;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.mode-choice {
  grid-template-columns: repeat(2, 1fr);
}

.difficulty-choice {
  grid-template-columns: repeat(3, 1fr);
}

.setup-choice legend {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 3px;
  color: #746b5c;
  font-size: 0.63rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setup-choice label {
  position: relative;
  cursor: pointer;
}

.setup-choice input {
  position: absolute;
  opacity: 0;
}

.setup-choice span {
  min-height: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(72, 59, 41, 0.22);
  text-align: center;
}

.setup-choice input:checked + span {
  color: #f8edcf;
  background: var(--board-dark);
  border-color: #173529;
  box-shadow: 3px 3px 0 rgba(42, 31, 20, 0.22);
}

.setup-choice b {
  font-size: 0.82rem;
}

.setup-choice small {
  margin-top: 2px;
  font-size: 0.62rem;
}

.difficulty-choice span {
  min-height: 38px;
  font-size: 0.72rem;
  font-weight: 850;
}

.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 15px;
}

.name-fields label {
  min-width: 0;
}

.name-fields label:only-child {
  grid-column: 1 / -1;
}

.name-fields:has(#player-two-field.hidden) > label:first-child {
  grid-column: 1 / -1;
}

.name-fields span {
  display: block;
  margin-bottom: 4px;
  color: #746b5c;
  font-size: 0.63rem;
  font-weight: 900;
  text-transform: uppercase;
}

.name-fields input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  color: #2d281f;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(71, 57, 38, 0.35);
  border-radius: 2px;
  font: 800 0.86rem var(--font);
}

.name-fields input:focus {
  outline: 3px solid rgba(142, 39, 56, 0.28);
  border-color: var(--draughts-wine);
}

.ticket-rule {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 8px 0 17px;
  padding: 8px 0;
  border-block: 1px solid rgba(76, 62, 42, 0.25);
}

.ticket-rule b {
  color: var(--draughts-wine);
  font: 900 1.1rem Georgia, serif;
}

.ticket-rule span {
  color: #655d4f;
  font-size: 0.68rem;
  line-height: 1.3;
}

.start-match-button {
  width: min(320px, 100%);
  min-height: 50px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 8px 16px;
  color: #f8edce;
  background: var(--draughts-wine);
  border: 2px solid #531522;
  border-radius: 2px;
  box-shadow: 0 6px 0 #531522;
  font: 900 0.92rem var(--font);
  cursor: pointer;
}

.start-match-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #531522;
}

.start-match-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #531522;
}

.start-match-button small {
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 600;
}

.setup-ticket > .ticket-link,
.result-ticket > .ticket-link {
  position: relative;
  z-index: 2;
  display: block;
  margin: 16px auto 0;
}

.result-overlay {
  place-items: center;
  padding: 30px;
  background: rgba(31, 23, 17, 0.78);
  backdrop-filter: blur(5px);
}

.result-ticket {
  text-align: center;
}

.result-ticket > p:first-child {
  color: var(--draughts-wine);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-crown {
  width: 78px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 13px auto;
  color: #f2dfad;
  background: var(--draughts-wine);
  border: 6px double var(--draughts-brass);
  border-radius: 50%;
  font-size: 2.7rem;
  animation: crownRise 0.8s both;
}

.result-ticket h2 {
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.result-ticket > p:not(:first-child) {
  margin-top: 6px;
  color: #6a6254;
  font-size: 0.85rem;
}

.result-ticket dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0;
  border-block: 2px solid rgba(75, 61, 41, 0.28);
}

.result-ticket dl div {
  padding: 10px 5px;
}

.result-ticket dl div + div {
  border-left: 1px solid rgba(75, 61, 41, 0.22);
}

.result-ticket dt {
  color: #756d60;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-ticket dd {
  color: var(--draughts-wine);
  font: 900 1.15rem Georgia, serif;
}

.game-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 9px 16px;
  color: #f9edce;
  background: #30261d;
  border-left: 5px solid var(--draughts-brass);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
  transform: translateX(-50%);
  animation: toastLift 0.2s both;
}

.club-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(720px, calc(100svh - 30px));
  margin: auto;
  padding: 0;
  color: var(--draughts-ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(62, 84, 88, 0.08) 29px 30px),
    var(--draughts-paper);
  border: 1px solid #766a51;
  border-radius: 3px;
  box-shadow: 15px 18px 0 rgba(18, 13, 9, 0.36);
}

.club-dialog::backdrop {
  background: rgba(31, 23, 17, 0.78);
  backdrop-filter: blur(4px);
}

.club-dialog > form,
.club-dialog > div {
  padding: clamp(20px, 4vw, 34px);
}

.club-dialog header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 3px double rgba(75, 61, 41, 0.3);
}

.club-dialog header span {
  color: var(--draughts-wine);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.club-dialog header h2 {
  font-family: Georgia, serif;
  font-size: 2rem;
}

.club-dialog header button {
  width: 36px;
  height: 36px;
  color: #3d3327;
  background: transparent;
  border: 1px solid rgba(66, 52, 35, 0.32);
  border-radius: 3px;
  font-size: 1.5rem;
  cursor: pointer;
}

.club-dialog ol {
  display: grid;
  gap: 12px;
  margin: 20px 0;
  padding-left: 22px;
}

.club-dialog li {
  padding-left: 4px;
  line-height: 1.5;
}

.dialog-confirm {
  display: block;
  margin-left: auto;
  padding: 9px 20px;
  color: #faedcd;
  background: var(--draughts-wine);
  border: 1px solid #531522;
  border-radius: 3px;
  font-weight: 850;
  cursor: pointer;
}

.hall-table-wrap {
  margin: 18px -8px;
  overflow-x: auto;
}

.hall-dialog table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.hall-dialog th,
.hall-dialog td {
  padding: 9px 7px;
  border-bottom: 1px dotted rgba(76, 62, 42, 0.28);
  text-align: right;
}

.hall-dialog th:nth-child(2),
.hall-dialog td:nth-child(2) {
  text-align: left;
}

.hall-dialog th {
  color: var(--draughts-wine);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.hall-dialog tbody tr:first-child {
  background: rgba(212, 170, 82, 0.18);
  font-weight: 900;
}

.hall-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #746d60;
  font-size: 0.7rem;
}

.hall-dialog footer button {
  color: var(--draughts-wine);
  background: transparent;
  border: 0;
  font-size: 0.7rem;
  font-weight: 850;
  text-decoration: underline;
  cursor: pointer;
}

.draughts-info {
  width: min(1080px, calc(100% - 20px));
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 30px 48px;
  margin: 0 auto;
  padding: clamp(50px, 7vw, 86px) 0;
  color: #f2ead6;
}

.draughts-info .eyebrow {
  color: var(--draughts-brass);
}

.draughts-info h2 {
  margin-bottom: 13px;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.draughts-info p {
  color: rgba(242, 234, 214, 0.78);
  line-height: 1.65;
}

.draughts-info dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  border-block: 1px solid rgba(255, 255, 255, 0.2);
}

.draughts-info dl div {
  padding: 12px 8px;
}

.draughts-info dt {
  color: rgba(242, 234, 214, 0.58);
  font-size: 0.63rem;
  font-weight: 900;
  text-transform: uppercase;
}

.draughts-info dd {
  margin-top: 3px;
  font-family: Georgia, serif;
  font-weight: 900;
}

.draughts-info ul {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  list-style: none;
  background: rgba(255, 255, 255, 0.13);
}

.draughts-info li {
  min-height: 86px;
  padding: 17px;
  background: rgba(38, 29, 22, 0.78);
  line-height: 1.4;
}

@keyframes targetPulse {
  0%, 100% { transform: scale(0.82); opacity: 0.76; }
  50% { transform: scale(1); opacity: 1; }
}

@keyframes selectableGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

@keyframes pieceArrive {
  0% { opacity: 0; transform: scale(0.82); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes crownRise {
  0% { opacity: 0; transform: translateY(12px) scale(0.72) rotate(-8deg); }
  55% { opacity: 1; transform: translateY(-5px) scale(1.09) rotate(3deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

@keyframes sparkBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(0.15); }
}

@keyframes toastLift {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 1050px) {
  .draughts-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .match-book {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    margin: 0 auto;
    width: min(760px, 100%);
  }

  .turn-page,
  .match-tools {
    grid-column: 1;
  }

  .appearance-page {
    grid-column: 1;
  }

  .notation-page {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .hall-preview {
    grid-column: 2;
  }

  #move-list {
    height: 166px;
  }

  .setup-overlay {
    justify-items: center;
    padding-top: 82px;
    background: rgba(31, 23, 17, 0.72);
    backdrop-filter: blur(3px);
  }

  .draughts-info {
    grid-template-columns: 1fr;
  }

  .draughts-info dl {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .draughts-main {
    padding: 10px 8px 0;
  }

  .draughts-page .site-nav {
    overflow-x: auto;
  }

  .draughts-stage {
    min-height: 760px;
  }

  .match-marquee {
    min-height: 58px;
    margin-bottom: 8px;
    padding-left: 9px;
  }

  .match-marquee h1 {
    font-size: 1.55rem;
  }

  .match-marquee h1 span {
    display: block;
    margin: 2px 0 0;
    font-size: 0.52em;
  }

  .match-state {
    min-width: 100px;
    padding: 6px 8px;
  }

  .match-state strong {
    font-size: 1.05rem;
  }

  .player-rail {
    width: calc(100% - 12px);
  }

  .board-frame {
    padding: 7px;
  }

  .piece-layer,
  .effect-layer {
    inset: 9px;
  }

  .draughts-piece {
    width: 76%;
    border-width: 3px;
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.14),
      inset 0 -5px 7px rgba(0, 0, 0, 0.18),
      0 3px 0 rgba(0, 0, 0, 0.22),
      0 5px 7px rgba(0, 0, 0, 0.18);
  }

  .draughts-piece::before {
    border-width: 1px;
  }

  .board-square.is-selected {
    box-shadow: inset 0 0 0 3px var(--draughts-brass);
  }

  .board-square.is-origin::after {
    border-width: 2px;
  }

  .match-book {
    grid-template-columns: 1fr;
    padding: 15px 13px;
    transform: none;
  }

  .turn-page,
  .match-tools,
  .appearance-page,
  .notation-page,
  .hall-preview {
    grid-column: 1;
    grid-row: auto;
  }

  .notation-page {
    display: none;
  }

  .appearance-page {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
  }

  .room-swatches,
  .piece-swatches {
    margin-top: 0;
  }

  .room-swatch,
  .piece-swatch {
    width: 39px;
  }

  .setup-overlay {
    position: fixed;
    inset: var(--site-header-h) 0 0;
    z-index: 40;
    align-items: start;
    padding: 14px 12px 34px;
  }

  .setup-ticket {
    padding: 21px 19px;
  }

  .ticket-heading {
    margin-bottom: 13px;
  }

  .crown-mark {
    width: 48px;
    font-size: 1.6rem;
  }

  .ticket-heading h2 {
    font-size: 2rem;
  }

  .name-fields {
    grid-template-columns: 1fr 1fr;
  }

  .setup-choice {
    margin-bottom: 11px;
  }

  .ticket-rule {
    margin-bottom: 13px;
  }

  .result-overlay {
    position: fixed;
    inset: var(--site-header-h) 0 0;
    padding: 16px 12px;
  }

  .draughts-info {
    width: calc(100% - 12px);
    padding: 48px 0 60px;
  }

  .draughts-info dl,
  .draughts-info ul {
    grid-template-columns: 1fr 1fr;
  }

  .draughts-info li {
    min-height: 100px;
    padding: 14px;
    font-size: 0.84rem;
  }

  .hall-dialog footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .mode-choice {
    grid-template-columns: 1fr 1fr;
  }

  .name-fields {
    grid-template-columns: 1fr;
  }

  .difficulty-choice span {
    padding-inline: 4px;
    font-size: 0.66rem;
  }

  .ticket-rule {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .draughts-page *,
  .draughts-page *::before,
  .draughts-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
