:root {
  cursor:
    var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default);
}

html,
body,
*,
body::before,
body::after,
*::before,
*::after {
  cursor:
    var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default);
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: none;
  min-height: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  min-height: 100vh;
}

.hypercarryPageScrollbar {
  position: fixed;
  top: 8px;
  right: 4px;
  bottom: 8px;
  z-index: 9000;
  width: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.hypercarryPageScrollbar.isActive {
  opacity: 1;
  pointer-events: auto;
}

.hypercarryPageScrollbarTrack {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(rgba(20, 15, 10, 0.96), rgba(13, 10, 7, 0.98)),
    #17110b;
  box-shadow:
    inset 0 0 0 1px rgba(226, 184, 86, 0.18),
    0 0 12px rgba(0, 0, 0, 0.28);
}

.hypercarryPageScrollbarThumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 44px;
  border: 2px solid rgba(13, 10, 7, 0.96);
  border-radius: 999px;
  background:
    linear-gradient(
      160deg,
      #f5e7ad 0%,
      #dfc35f 18%,
      #b98824 36%,
      #ecd983 52%,
      #c69836 68%,
      #dfc663 84%,
      #a6751d 100%
    );
  background-clip: padding-box;
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.42),
    inset -1px 0 0 rgba(0, 0, 0, 0.34);
  cursor: var(--cursor-grab, grab);
}

.hypercarryPageScrollbarThumb:hover,
.hypercarryPageScrollbarThumb.isDragging {
  background:
    linear-gradient(
      160deg,
      #faedba 0%,
      #e6ca6d 18%,
      #c1922b 36%,
      #f0df91 52%,
      #cea03e 68%,
      #e8cf70 84%,
      #b27f22 100%
    );
}

.hypercarryPageScrollbarThumb.isDragging {
  cursor: var(--cursor-grabbing, grabbing);
}

.hypercarrySelectControl {
  position: relative;
  display: inline-grid;
  width: 100%;
  min-width: 0;
}

.presetSelectRow .hypercarrySelectControl {
  flex: 1 1 auto;
}

.hypercarryNativeSelect {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.hypercarrySelectButton {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid rgba(226, 184, 86, 0.52);
  border-radius: 7px;
  padding: 8px 10px;
  color: #fff7db;
  background:
    linear-gradient(rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.24)),
    #15110a;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: var(--cursor-pointer, pointer);
}

.hypercarrySelectButton:disabled {
  opacity: 0.58;
  cursor: var(--cursor-not-allowed, not-allowed);
}

.hypercarrySelectValue {
  min-width: 0;
  padding-right: 26px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hypercarrySelectChevron {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 15px;
  height: 14px;
  opacity: 0.86;
  transform: translateY(-50%);
  transition: transform 0.14s ease;
}

.hypercarrySelectChevron::before,
.hypercarrySelectChevron::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    top 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}

.hypercarrySelectChevron::before {
  top: 4px;
}

.hypercarrySelectChevron::after {
  top: 9px;
}

.hypercarrySelectControl.isOpen .hypercarrySelectChevron {
  transform: translateY(-50%);
}

.hypercarrySelectControl.isOpen .hypercarrySelectChevron::before {
  top: 6px;
  transform: rotate(45deg);
}

.hypercarrySelectControl.isOpen .hypercarrySelectChevron::after {
  top: 6px;
  transform: rotate(-45deg);
}

.hypercarrySelectMenu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  z-index: 10020;
  display: grid;
  max-height: min(260px, 42vh);
  overflow: auto;
  border: 1px solid rgba(226, 184, 86, 0.68);
  border-radius: 0 0 8px 8px;
  padding: 0;
  background:
    linear-gradient(rgba(20, 15, 10, 0.98), rgba(13, 10, 7, 0.99)),
    #17110b;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  scrollbar-color: #dfc35f rgba(13, 10, 7, 0.88);
  scrollbar-width: auto;
}

.hypercarrySelectMenu[hidden] {
  display: none;
}

.hypercarrySelectMenu::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.hypercarrySelectMenu::-webkit-scrollbar-track {
  border-radius: 999px;
  background:
    linear-gradient(rgba(20, 15, 10, 0.92), rgba(13, 10, 7, 0.96)),
    #17110b;
}

.hypercarrySelectMenu::-webkit-scrollbar-thumb {
  border: 2px solid rgba(13, 10, 7, 0.92);
  border-radius: 999px;
  background:
    linear-gradient(
      160deg,
      #f5e7ad 0%,
      #dfc35f 18%,
      #b98824 36%,
      #ecd983 52%,
      #c69836 68%,
      #dfc663 84%,
      #a6751d 100%
    );
  background-clip: padding-box;
}

.hypercarrySelectOption {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  padding: 8px 9px;
  color: #fff7db;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: var(--cursor-pointer, pointer);
}

.hypercarrySelectOption:hover,
.hypercarrySelectOption:focus-visible,
.hypercarrySelectOption.isSelected {
  color: #17100a;
  background: linear-gradient(180deg, #fff0a8 0%, #d8a233 100%);
  outline: 0;
}

.hypercarrySelectOption:disabled {
  opacity: 0.5;
  cursor: var(--cursor-not-allowed, not-allowed);
}

:where(.chatThread, pre, .infoReaderBody, .hypercarryBar, .setupPresetRow) {
  scrollbar-color: #dfc35f rgba(13, 10, 7, 0.88);
  scrollbar-width: auto;
}

:where(.chatThread, pre, .infoReaderBody, .hypercarryBar, .setupPresetRow)::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

:where(.chatThread, pre, .infoReaderBody, .hypercarryBar, .setupPresetRow)::-webkit-scrollbar-track {
  border-radius: 999px;
  background:
    linear-gradient(rgba(20, 15, 10, 0.92), rgba(13, 10, 7, 0.96)),
    #17110b;
}

:where(.chatThread, pre, .infoReaderBody, .hypercarryBar, .setupPresetRow)::-webkit-scrollbar-thumb {
  border: 2px solid rgba(13, 10, 7, 0.92);
  border-radius: 999px;
  background:
    linear-gradient(
      160deg,
      #f5e7ad 0%,
      #dfc35f 18%,
      #b98824 36%,
      #ecd983 52%,
      #c69836 68%,
      #dfc663 84%,
      #a6751d 100%
    );
  background-clip: padding-box;
}

:where(.chatThread, pre, .infoReaderBody, .hypercarryBar, .setupPresetRow)::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      160deg,
      #faedba 0%,
      #e6ca6d 18%,
      #c1922b 36%,
      #f0df91 52%,
      #cea03e 68%,
      #e8cf70 84%,
      #b27f22 100%
    );
}

/* Chessboard interaction only */
#board .piece-417db,
img.piece-417db {
  cursor:
    var(--cursor-pointer, url("/visual/cursors/pointer.cur") 4 4, pointer);
}

#board .piece-417db.boardPieceCursorGrab,
img.piece-417db.boardPieceCursorGrab {
  cursor:
    var(--cursor-grab, grab);
}

#board .piece-417db.boardPieceCursorDefault,
img.piece-417db.boardPieceCursorDefault {
  cursor:
    var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default);
}

#board .piece-417db.boardPieceCursorPointer,
img.piece-417db.boardPieceCursorPointer {
  cursor:
    var(--cursor-pointer, url("/visual/cursors/pointer.cur") 4 4, pointer);
}

body.isBoardPieceDragging,
body.isBoardPieceDragging #board,
body.isBoardPieceDragging #board *,
body.isBoardPieceDragging img.piece-417db {
  cursor:
    var(--cursor-grabbing, grabbing);
}

body.isBoardCursorRecovering #board,
body.isBoardCursorRecovering #board *,
body.isBoardCursorRecovering #board .piece-417db,
body.isBoardCursorRecovering img.piece-417db {
  cursor:
    var(--cursor-grab, grab) !important;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 24px 16px;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--active-background-image, url('/visual/backgrounds/0.png'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.appShell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 25px;
  background: rgba(246, 246, 246, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:root {
  --ui-light-bg: #f4f4f4;
  --ui-light-border: rgba(0, 0, 0, 0.10);
  --ui-light-text: #111111;
  --ui-dark-bg: #2f2f2f;
  --ui-dark-bg-hover: #3a3a3a;
  --ui-dark-border: #3a3a3a;
  --ui-dark-text: #f0f0f0;
  --ui-dark-pill: #424242;
}

.app-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.app-title-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-title-meta {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.app-logo {
  width: 420px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.appLogoFrame {
  display: contents;
}

.app-byline {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #4a4a4a;
  text-transform: none;
  align-self: flex-end;
  margin-bottom: 6px;
}

.app-byline a {
  color: inherit;
  text-decoration: none;
}

.app-byline a:hover {
  text-decoration: underline;
}

.titleNavLinks {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.customisationsLink,
.customisationsBackLink,
.profileTopLink,
.loginTopLink {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 24px;
  height: 24px;
  color: #333333;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
}

.customisationsGlyph {
  display: inline-block;
  transform: translateX(-2px);
}

.customisationsBackLink {
  width: 18px;
}

.app-title-meta .app-byline {
  align-self: flex-start;
}

.customisationsTooltip {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  z-index: 20;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(24, 24, 24, 0.86);
  color: #f5f5f5;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.14s ease;
}

.customisationsLink:hover .customisationsTooltip,
.customisationsLink:focus-visible .customisationsTooltip,
.customisationsBackLink:hover .customisationsTooltip,
.customisationsBackLink:focus-visible .customisationsTooltip,
.profileTopLink:hover .customisationsTooltip,
.profileTopLink:focus-visible .customisationsTooltip,
.loginTopLink:hover .customisationsTooltip,
.loginTopLink:focus-visible .customisationsTooltip {
  opacity: 1;
}

#board .customPieceTransformedSquare {
  position: relative;
  overflow: hidden;
}

#board .customPieceTransformedSquare > img,
#board .customPieceTransformedSquare [class*="piece-"] {
  opacity: 0 !important;
}

#board .customPieceTransformedSquare::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--custom-piece-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 4;
  transform:
    translate(var(--custom-piece-x, 0px), var(--custom-piece-y, 0px))
    scale(var(--custom-piece-scale, 1));
  transform-origin: center center;
}

/* -------------------------
   Music Player
   ------------------------- */

.musicPlayer {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  max-width: 360px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
}

.musicTrackText {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  position: relative;
  padding-right: 12px;
  margin-right: 2px;
}

.musicTrackText::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 1px;
}

.musicTrackName {
  font-size: 12px;
  font-weight: 850;
  color: #111;
  white-space: pre-line;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.15;
}

.musicTrackMeta {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 650;
  opacity: 0.66;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.musicControlsStack {
  flex: 0 0 120px;
  display: grid;
  place-items: center;
  min-height: 78px;
}

.musicDeck {
  position: relative;
  width: 120px;
  height: 78px;
}

.musicDisc {
  position: absolute;
  left: 0;
  top: 3px;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #eeeeee 0 8%, #111 9% 18%, #222 19% 30%, #050505 31% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    0 5px 14px rgba(0,0,0,0.25);
  animation: musicDiscSpin 1.35s linear infinite;
  animation-play-state: paused;
}

.musicDisc::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
}

.musicDisc::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 2px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.22),
    0 0 5px rgba(255,255,255,0.28);
  transform: translateX(-50%);
}

.musicDiscCenter {
  position: absolute;
  width: 10px;
  height: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #f8f8f8;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
}

.musicDisc.isSpinning {
  animation-play-state: running;
}

.musicStylusBtn {
  position: absolute;
  left: 64px;
  top: 3px;
  display: block;
  width: 32px;
  height: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 0;
  cursor: pointer;
  box-shadow: none;
}

.musicStylusBtn:hover,
.musicStylusBtn:active,
.musicStylusBtn:focus {
  background: transparent;
  box-shadow: none;
  filter: none;
  outline: 0;
}

.musicStylus {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 63% 30%;
  transition: transform 0.18s ease;
  pointer-events: none;
  user-select: none;
}

.musicStylusBtn.isPlaying .musicStylus {
  transform: rotate(30deg);
}

.musicVolumeSlider {
  position: absolute;
  left: 101px;
  top: 4px;
  width: 15px;
  height: 70px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.58), rgba(255,255,255,0.2) 38%, rgba(0,0,0,0.22) 100%),
    #8e8e8e;
  border: 1px solid rgba(0,0,0,0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.38),
    0 2px 4px rgba(0,0,0,0.18);
  pointer-events: auto;
}

.musicVolumeTicks {
  position: absolute;
  right: 1px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.9) 0 1px,
      transparent 1px 5px
    );
  border-radius: 1px;
}

.musicVolumeRange {
  position: absolute;
  left: 2px;
  top: 6px;
  width: 8px;
  height: 58px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  writing-mode: vertical-lr;
  direction: rtl;
  cursor: pointer;
}

.musicVolumeRange:focus {
  outline: 0;
}

.musicVolumeRange::-webkit-slider-runnable-track {
  width: 6px;
  height: 58px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3f3f3f, #777777 48%, #2f2f2f);
  border: 1px solid rgba(0,0,0,0.26);
  box-shadow: inset 0 0 3px rgba(0,0,0,0.38);
}

.musicVolumeRange::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 1px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.96) 0 1px,
      rgba(255,255,255,0.42) 1px 2px
    ),
    linear-gradient(90deg, #e6e6e6, #ffffff 45%, #c4c4c4);
  border: 1px solid rgba(0,0,0,0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.22),
    0 1px 3px rgba(0,0,0,0.3);
}

.musicVolumeRange::-moz-range-track {
  width: 6px;
  height: 58px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3f3f3f, #777777 48%, #2f2f2f);
  border: 1px solid rgba(0,0,0,0.26);
  box-shadow: inset 0 0 3px rgba(0,0,0,0.38);
}

.musicVolumeRange::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(90deg, #e6e6e6, #ffffff 45%, #c4c4c4);
  border: 1px solid rgba(0,0,0,0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.22),
    0 1px 3px rgba(0,0,0,0.3);
}

@keyframes musicDiscSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.musicButtons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.musicBtn {
  width: 21px;
  height: 21px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 3px 9px rgba(0,0,0,0.10);
}

.musicBtn:hover {
  background: #ffffff;
}

.musicPlayBtn {
  position: relative;
  width: 23px;
  height: 23px;
}

.musicPlayBtn::before,
.musicPlayBtn::after {
  content: "";
  display: block;
}

.musicPlayBtn::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #202020;
}

.musicPlayBtn::after {
  display: none;
}

.musicPlayBtn.isPlaying {
  gap: 3px;
}

.musicPlayBtn.isPlaying::before,
.musicPlayBtn.isPlaying::after {
  display: block;
  width: 3px;
  height: 10px;
  margin-left: 0;
  border: 0;
  border-radius: 1px;
  background: #202020;
}

.roomCodeBadge {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.72);
  color: #f7f7f7;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.roomCodeBadge span {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.card {
  position: relative;
  background: #f6f6f6;
  padding: 14px;
  border-radius: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.muted {
  opacity: 0.82;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaeaea;
  font-size: 12px;
}

.divider {
  height: 1px;
  background: #e0e0e0;
  margin: 12px 0;
}

.title-xl {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.title-md {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.title-sm {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-top: 10px;
}

input[type="text"] {
  padding: 8px;
  width: 260px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
}

input[type="number"] {
  padding: 6px;
  width: 90px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
}

button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  font-weight: 650;
  cursor:
    var(--cursor-pointer, pointer);
}

button:hover {
  background: #f2f2f2;
}

button:disabled,
input:disabled {
  opacity: 0.55;
  cursor:
    var(--cursor-not-allowed, not-allowed);
}

.inputModeControl {
  position: relative;
  z-index: 220;
  display: inline-flex;
  align-items: stretch;
}

.inputModeControl.isOpen {
  z-index: 10040;
}

.inputModeControl #playBtn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.inputModeControl.isOpen #playBtn,
.inputModeControl.isOpen .inputModeToggleBtn {
  border-color: rgba(228, 184, 73, 0.86);
  border-bottom-color: rgba(228, 184, 73, 0.38);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

#playPanel .playInputRow {
  align-items: stretch;
  width: 100%;
  flex-wrap: nowrap;
}

#playPanel .playInputRow #moveInput {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

#playPanel .playInputRow .inputModeControl {
  flex: 0 0 auto;
}

#playPanel {
  z-index: 120;
  overflow: visible;
}

.premoveQueueStrip {
  display: block;
  margin-top: 10px;
  padding: 0;
}

.premoveQueueStrip[hidden] {
  display: none;
}

.premoveQueueColumns {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, auto);
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.premoveQueueColumn {
  display: grid;
  justify-items: stretch;
  gap: 6px;
  width: 205px;
  max-width: 100%;
  padding: 7px 8px;
  border: 1px solid rgba(245, 214, 135, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.premoveQueueColumn[hidden] {
  visibility: hidden;
  display: grid;
}

.premoveQueueColumn.isBlack {
  background: rgba(0, 0, 0, 0.15);
}

.premoveQueueLabel {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 246, 214, 0.82);
  text-align: center;
  white-space: nowrap;
}

.premoveQueueList {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.premoveQueueItem {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.premoveQueueNumber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 246, 214, 0.86);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.premovePill {
  display: inline-flex;
  align-items: center;
  justify-self: stretch;
  min-width: 0;
  width: 100%;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 750;
}

.premovePill.isWhite {
  background: rgba(255, 255, 255, 0.18);
}

.premovePill.isBlack {
  background: rgba(0, 0, 0, 0.24);
}

.premovePillText {
  flex: 1 1 auto;
  min-width: 0;
  padding: 3px 7px 3px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.premovePillCancel,
.premoveClearBtn {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.premovePillCancel {
  width: 25px;
  height: 25px;
  padding: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  line-height: 1;
}

.premoveClearBtn {
  justify-self: center;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.premovePillCancel:hover,
.premoveClearBtn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.inputModeToggleBtn {
  position: relative;
  min-width: 34px;
  padding: 10px 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
  color: transparent;
}

.inputModeToggleBtn::before,
.inputModeToggleBtn::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #5b5141;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.inputModeToggleBtn::before {
  right: 16px;
  transform: translateY(-50%) rotate(45deg);
}

.inputModeToggleBtn::after {
  right: 11px;
  transform: translateY(-50%) rotate(-45deg);
}

.inputModeToggleBtn[aria-expanded="true"]::before {
  transform: translateY(-50%) rotate(-45deg);
}

.inputModeToggleBtn[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(45deg);
}

.inputModeMenu {
  position: absolute;
  box-sizing: border-box;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 9999;
  display: grid;
  min-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(228, 184, 73, 0.86);
  border-top-color: rgba(228, 184, 73, 0.38);
  border-radius: 0 0 8px 8px;
  background: #fffaf0;
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.26);
}

.inputModeMenu[hidden] {
  display: none;
}

.inputModeOption {
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #342819;
}

.inputModeOption:hover,
.inputModeOption.isActive {
  background: linear-gradient(180deg, #fff3b8 0%, #e3b84a 100%);
  color: #1b1308;
}

.msgCommentary {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #f0f0f0;
  opacity: 0.92;
}

.msgCommentary.isMuted {
  opacity: 0.78;
}

.error {
  color: #b00020;
  font-weight: 650;
}

.ok {
  color: #0a7a0a;
  font-weight: 650;
}

.setupGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .setupGrid {
    grid-template-columns: 1fr;
  }
}

.setupCol {
  min-width: 0;
}

.setupList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.setupItem {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e3e3e3;
}

.setupItem:hover {
  border-color: #d0d0d0;
}

.setupItem .meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setupItem .meta small {
  opacity: 0.85;
  line-height: 1.35;
}

.setupItemDark {
  background: var(--ui-dark-bg);
  border: 1px solid var(--ui-dark-border);
  color: var(--ui-dark-text);
}

.setupItemDark:hover {
  border-color: #4a4a4a;
}

.setupItemDark small {
  color: #d6d6d6;
  opacity: 1;
}

.setupItemDark .pill {
  background: var(--ui-dark-pill);
  color: var(--ui-dark-text);
}

.tipBox {
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 12px;
}

.tipTitle {
  font-weight: 800;
  margin-bottom: 6px;
}

.tipBody {
  white-space: pre-wrap;
  line-height: 1.55;
  min-height: 72px;
}

.mainRow {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.leftPanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  width: max(500px, min(650px, 50vw));
  flex: 0 0 auto;
}

.rightPanel {
  flex: 1 1 380px;
  min-width: 0;
}

.mobileSacrificeSlot {
  display: none;
  width: 100%;
}

@media (max-width: 900px) {
  .mobileSacrificeSlot:not(:empty) {
    display: block;
  }

  .mobileSacrificeSlot #sacrificePanel {
    width: 100%;
    margin-top: 0 !important;
    box-sizing: border-box;
  }
}

.noTakeBacksStatus {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(176, 226, 255, 0.30);
  background: rgba(176, 226, 255, 0.10);
  color: #dff4ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#board .square-55d63.noTakeBacksLockedWhite {
  box-shadow:
    inset 0 0 0 2px rgba(32, 116, 255, 0.75),
    inset 0 0 18px rgba(32, 116, 255, 0.18);
}

#board .square-55d63.noTakeBacksLockedBlack {
  box-shadow:
    inset 0 0 0 2px rgba(218, 42, 42, 0.75),
    inset 0 0 18px rgba(218, 42, 42, 0.18);
}

.boardStage {
  position: relative;
  width: max(500px, min(650px, 50vw));
}

.boardStage.isGameOver::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(2px);
}

.boardStage.reviewBoardOffline #board {
  filter: brightness(1.18) saturate(0.82);
}

.boardStage.reviewBoardOffline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.18);
}

#board {
  position: relative;
  width: 100%;
  overflow: visible;
}

.no-js .requires-js {
  display: none !important;
}

.no-js .show-without-js,
.no-js .fallback-panel {
  display: block !important;
  visibility: hidden;
  animation: revealNoJsFallback 0s linear 500ms forwards;
}

@keyframes revealNoJsFallback {
  to {
    visibility: visible;
  }
}

.no-js body.gamePage .show-without-js,
.no-js body.gamePage .fallback-panel {
  animation-delay: 1000ms;
}

.no-js .jsFallbackRibbon {
  display: flex !important;
}

.js-enabled .fallback-panel {
  display: none !important;
}

.jsFallbackRibbon {
  position: relative;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(238, 198, 96, 0.56);
  border-radius: 8px;
  color: #fff3cf;
  background: rgba(71, 49, 17, 0.78);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.jsFallbackRibbon strong {
  color: #ffe08a;
}

.jsFallbackRibbon span {
  margin-left: 4px;
}

.gameJsFallbackRibbon {
  margin-bottom: 12px;
}

.boardNoJsFallback {
  display: grid;
  grid-template: repeat(8, 1fr) / repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background:
    conic-gradient(
      from 90deg,
      #b58863 0 25%,
      #f0d9b5 0 50%,
      #b58863 0 75%,
      #f0d9b5 0
    ) 0 0 / 25% 25%;
}

.boardNoJsFallback img {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
#board .notation-322f9 {
  cursor:
    var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default);
}

#board.boardCursorWait,
#board.boardCursorWait [class*="square-"] {
  cursor:
    var(--cursor-wait-progress, progress);
}

body.hasAppliedBoard #board {
  background:
    conic-gradient(from 90deg, #b98a63 0 25%, #efd9ad 0 50%, #b98a63 0 75%, #efd9ad 0) 0 0 / 25% 25%;
}

body.hasAppliedBoard #board::before,
body.hasAppliedBoard #board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.hasAppliedBoard #board::before {
  background-image: var(--active-board-primary-image);
  background-size: var(--active-board-primary-size, 100%);
  background-repeat: var(--active-board-primary-repeat, repeat);
  background-position: var(--active-board-primary-x, 0px) var(--active-board-primary-y, 0px);
  opacity: var(--active-board-primary-opacity, 1);
  filter: brightness(var(--active-board-primary-brightness, 1));
  mix-blend-mode: var(--active-board-primary-blend-mode, normal);
}

body.hasAppliedBoard #board::after {
  background-image: var(--active-board-secondary-image);
  background-size: var(--active-board-secondary-size, 100%);
  background-repeat: var(--active-board-secondary-repeat, repeat);
  background-position: var(--active-board-secondary-x, 0px) var(--active-board-secondary-y, 0px);
  opacity: var(--active-board-secondary-opacity, 1);
  filter: brightness(var(--active-board-secondary-brightness, 1));
  mix-blend-mode: var(--active-board-secondary-blend-mode, normal);
}

html[data-active-board-scope="light"] body.hasAppliedBoard #board::before,
html[data-active-board-scope="dark"] body.hasAppliedBoard #board::after {
  -webkit-mask-image: conic-gradient(from 90deg, #000 0 25%, transparent 0 50%, #000 0 75%, transparent 0);
  -webkit-mask-size: 25% 25%;
  mask-image: conic-gradient(from 90deg, #000 0 25%, transparent 0 50%, #000 0 75%, transparent 0);
  mask-size: 25% 25%;
}

html[data-active-board-scope="dark"] body.hasAppliedBoard #board::before,
html[data-active-board-scope="light"] body.hasAppliedBoard #board::after {
  -webkit-mask-image: conic-gradient(from 90deg, transparent 0 25%, #000 0 50%, transparent 0 75%, #000 0);
  -webkit-mask-size: 25% 25%;
  mask-image: conic-gradient(from 90deg, transparent 0 25%, #000 0 50%, transparent 0 75%, #000 0);
  mask-size: 25% 25%;
}

html[data-active-board-scope="whole"] body.hasAppliedBoard #board::after {
  display: none;
}

body.hasAppliedBoard #board > * {
  position: relative;
  z-index: 1;
}

#board,
#board *,
.hypercarryPiece[data-side="white"][data-piece="n"],
.hypercarryPiece[data-side="black"][data-piece="q"],
.sacrificed-piece[draggable="true"],
.sacrificed-piece.isDraggableSacrifice {
  touch-action: none;
}

body.isDragScrollLocked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.isLoading,
.boardThinkingCover.show,
.boardThinkingCover.show * {
  cursor:
    var(--cursor-wait-progress, progress);
}

#evalBarContainer {
  position: absolute;
  top: 8px;
  left: 8px;
  height: calc(100% - 16px);
  display: flex;
  align-items: center;
  z-index: 8;
}

.cutinOverlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  overflow: hidden;
  border-radius: 12px;
}

.cutinLayer {
  position: absolute;
  left: 50%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.cutinLayerTop {
  top: 5%;
  transform: translateX(-50%);
}

.cutinLayerCenter {
  top: 50%;
  transform: translate(-50%, -50%);
}

.cutinOverlayGameEndDraw .cutinLayerCenter {
  top: auto;
  bottom: 8%;
  transform: translateX(-50%);
}

.cutinLayerBottom {
  bottom: 5%;
  transform: translateX(-50%);
  flex-direction: column-reverse;
}

.cutinOverlaySandboxReveal .cutinLayerTop {
  top: 3%;
  height: 47%;
  justify-content: flex-start;
  overflow: hidden;
}

.cutinOverlaySandboxReveal .cutinLayerBottom {
  bottom: 3%;
  height: 47%;
  justify-content: flex-start;
  overflow: hidden;
}

.cutinOverlaySandboxReveal .cutinRevealGroup {
  gap: 0;
}

.cutinOverlaySandboxReveal .cutinRevealGroup[data-reveal-layout="2-2"] {
  gap: 5%;
}

.cutinCard {
  width: 100%;
  max-width: 1880px;
  max-height: 800px;
  aspect-ratio: 1880 / 800;
  display: block;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  box-shadow:
    0 10px 16px rgba(0, 0, 0, 0.38),
    0 0 12px rgba(255, 255, 255, 0.18);
  animation:
    cutinEnter 0.24s ease-out forwards,
    cutinExit 0.30s ease-in forwards;
  animation-delay: 0s, var(--cutin-exit-delay, 1.9s);
}

.cutinImage {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.cutinRevealGroup {
  width: 100%;
  max-width: 1880px;
  display: flex;
  flex-direction: column;
  gap: 2%;
}

.cutinRevealRow {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5%;
}

.cutinRevealCard {
  flex: 0 0 1880px;
  width: 1880px;
  max-width: 100%;
  max-height: none;
  aspect-ratio: 1880 / 800;
}

.cutinRevealRow[data-reveal-row-size="2"] .cutinRevealCard {
  flex-basis: 768px;
  width: 768px;
  max-width: 40%;
}

.cutinCard.isPersistent {
  animation: cutinEnter 0.24s ease-out forwards;
}

.cutinCard + .cutinCard {
  margin-top: -5.5%;
}

.cutinLayerBottom .cutinCard + .cutinCard {
  margin-top: 0;
  margin-bottom: -5.5%;
}

.cutinRevealRow .cutinRevealCard + .cutinRevealCard,
.cutinLayerBottom .cutinRevealRow .cutinRevealCard + .cutinRevealCard {
  margin-top: 0;
  margin-bottom: 0;
}

.cutinRevealCard.cutinCard {
  width: 1880px;
  max-width: 100%;
  aspect-ratio: 1880 / 800;
}

.cutinOverlaySandboxReveal .cutinRevealRow[data-reveal-row-size="1"] .cutinRevealCard.cutinCard {
  width: 1632px;
  max-width: 85%;
}

.cutinRevealRow[data-reveal-row-size="2"] .cutinRevealCard.cutinCard {
  width: 768px;
  max-width: 40%;
}

.cutinOverlaySandboxReveal .cutinRevealGroup[data-reveal-layout="1-2"] .cutinRevealRow[data-reveal-row-size="2"] {
  margin-top: -8.3008%;
}

@keyframes cutinEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cutinExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
}

#evalBarContainer.eval-collapsed #evalBar {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

#evalBarContainer.eval-expanded #evalBar {
  width: 18px;
  opacity: 1;
}

#evalBar {
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.25);
  background: #222;
  transition: width 0.18s ease, opacity 0.18s ease;
  position: relative;
}

#evalBar.isFlipped {
  flex-direction: column;
}

#evalWhite {
  width: 100%;
  background: #f4f4f4;
  transition: height 0.18s ease;
}

#evalBlack {
  width: 100%;
  background: #2f2f2f;
  transition: height 0.18s ease;
}

#evalValue {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #888;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

.evalResultScore {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #888;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

.evalWhiteResult {
  bottom: 6px;
}

.evalBlackResult {
  top: 6px;
}

#evalBar.isFlipped .evalWhiteResult {
  top: 6px;
  bottom: auto;
}

#evalBar.isFlipped .evalBlackResult {
  top: auto;
  bottom: 6px;
}

#evalToggle {
  margin-left: 6px;
  width: 18px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30,30,30,0.9);
  color: #f5f5f5;
  font-size: 12px;
  cursor:
    var(--cursor-pointer, pointer);
  user-select: none;
}

.boardHiddenCover,
.boardThinkingCover,
.boardGameOverCover {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 5;
}

.boardHiddenCover {
  border: 1px solid #d7d7d7;
  background: #1f1f1f;
  color: #f0f0f0;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.boardThinkingCover {
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(2px);
  color: #f5f5f5;
  z-index: 6;
}

.boardGameOverCover {
  color: #f5f5f5;
  z-index: 26;
  pointer-events: none;
}

.boardGameOverCover.isDrawGameOver .gameOverInner {
  transform: translateY(-92px);
}

.boardHiddenCover.show,
.boardThinkingCover.show,
.boardGameOverCover.show {
  display: flex;
}

.thinkingInner,
.gameOverInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.thinkingTitle,
.gameOverTitle {
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 0.01em;
}

.gameOverReason {
  font-size: 15px;
  opacity: 0.95;
}

.thinkingDots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.thinkingDots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f5f5f5;
  opacity: 0.35;
  animation: thinkingPulse 1.2s infinite ease-in-out;
}

.thinkingDots span:nth-child(2) {
  animation-delay: 0.15s;
}

.thinkingDots span:nth-child(3) {
  animation-delay: 0.30s;
}

@keyframes thinkingPulse {
  0%, 80%, 100% {
    transform: scale(0.75);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.infoBar {
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 12px;
}

.infoLine {
  margin: 2px 0;
}

.sectionTitle {
  margin: 12px 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.boardViewRow {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.boardViewRow .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  white-space: nowrap;
}

.boardViewDivider {
  width: 1px;
  height: 28px;
  background: #d7d7d7;
  flex: 0 0 auto;
}

.drawOfferControl {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px 12px;
  flex: 0 0 auto;
}

.drawOfferHint {
  font-size: 12px;
  line-height: 1.2;
}

.matchAutoFlipPill {
  min-width: 116px;
  justify-content: center;
}

/* =========================
   Promotion Popup
   ========================= */

.promotion-popup {
  position: absolute;
  z-index: 30;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.promotion-popup.hidden {
  display: none;
}

.promotion-options {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: rgba(24, 24, 28, 0.96);
}

.promotion-popup.white-side .promotion-options {
  background: #f3f3f3;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.promotion-popup.black-side .promotion-options {
  background: rgba(24, 24, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.promo-btn {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 52px;
  height: 52px;
  padding: 0;
  margin: 0;
  line-height: 0;
  font-size: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background-color: #6a6a6a;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 80%;
  background-origin: padding-box;
  background-clip: padding-box;
  cursor:
    var(--cursor-pointer, pointer);
  transition: background-color 0.12s ease, opacity 0.12s ease;
  overflow: hidden;
  box-sizing: border-box;
  flex: 0 0 52px;
  transform: none;
  outline: none;
}

.promotion-popup.white-side .promo-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background-color: #8a8a8a;
}

.promotion-popup.black-side .promo-btn {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background-color: #4f4f4f;
}

.promotion-popup.white-side .promo-btn:hover:not(:disabled) {
  background-color: #969696;
  transform: none;
  filter: brightness(1.03);
}

.promotion-popup.black-side .promo-btn:hover:not(:disabled) {
  background-color: #5c5c5c;
  transform: none;
  filter: brightness(1.05);
}

.promo-btn:hover:not(:disabled) {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

.promo-btn:disabled,
.promo-btn.disabled {
  opacity: 0.35;
  cursor:
    var(--cursor-not-allowed, not-allowed);
  filter: grayscale(1);
}

/* =========================
   Claim Draw Popup
   ========================= */

.claim-draw-popup {
  z-index: 30;
}

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

.claim-draw-options button {
  min-width: 220px;
}

/* =========================
   Captured Pieces Row
   ========================= */

.capturedRow {
  width: max(500px, min(650px, 50vw));
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.boardFooterSlot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(32, 32, 32, 0.18);
}

.boardFooterSlot img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

#whiteCaptured {
  justify-self: start;
}

#blackCaptured {
  justify-self: end;
}

.capturedLabel {
  font-size: 12px;
  color: #9a9a9a;
  text-align: center;
  white-space: nowrap;
}

.capturedBubble {
  min-height: 42px;
  min-width: 120px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

.whiteCapture {
  background: var(--ui-light-bg);
  border: 1px solid var(--ui-light-border);
}

.blackCapture {
  background: var(--ui-dark-bg);
  border: 1px solid var(--ui-dark-border);
}

.captured-piece {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.queen-resummon-piece {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 1px;
}

.queen-resummon-ready {
  cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(255, 235, 130, 0.85));
  outline-color: rgba(255, 235, 130, 0.9);
}

.queen-resummon-piece.is-selected {
  outline-width: 2px;
}

.queen-resummon-cooldown,
.queen-resummon-budget,
.queen-resummon-disabled,
.queen-resummon-used {
  opacity: 0.48;
  filter: grayscale(0.75);
}

.sacrificed-piece[draggable="true"],
.sacrificed-piece.isDraggableSacrifice {
  cursor:
    var(--cursor-grab, grab);
}

.sacrificed-piece[draggable="true"]:active,
.sacrificed-piece.isDraggableSacrifice:active {
  cursor:
    var(--cursor-grabbing, grabbing);
}

html.isSacrificePieceDragging,
html.isSacrificePieceDragging *,
body.isSacrificePieceDragging,
body.isSacrificePieceDragging * {
  cursor:
    var(--cursor-grabbing, url("/visual/cursors/grabbing.cur") 31 30, grabbing) !important;
}

.sacrificed-forced,
.sacrificed-random {
  opacity: 0.58;
}

.captured-placeholder {
  font-size: 11px;
  letter-spacing: 0.2px;
}

.captured-points {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.captured-hypercarry-points {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.whiteCapture .captured-points {
  color: #444;
}

.blackCapture .captured-points {
  color: var(--ui-dark-text);
}

/* Optional: if you want placeholders to match bubble contrast better */
.whiteCapture .captured-placeholder {
  color: #444;
}

.blackCapture .captured-placeholder {
  color: var(--ui-dark-text);
}

.timerSideCard {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #d7d7d7;
}

.timerSideWhite {
  background: #ffffff;
  color: #111111;
  border-color: #dddddd;
}

.timerSideBlack {
  background: var(--ui-dark-bg);
  color: var(--ui-dark-text);
  border-color: var(--ui-dark-border);
}

.timerSideBlack .radioGroupLabel {
  color: #f0f0f0;
  opacity: 0.9;
}

.timerSideBlack input[type="number"] {
  background: #ffffff;
  color: #111111;
}

.timerBotWhite {
  background: #ffffff;
  color: #111111;
  border-color: #dddddd;
}

.timerBotBlack {
  background: #2f2f2f;
  color: #f0f0f0;
  border-color: #3a3a3a;
}

.timerBotBlack .radioGroupLabel {
  color: #f0f0f0;
  opacity: 0.9;
}

.timerBotBlack input[type="number"] {
  background: #ffffff;
  color: #111111;
}

.timerTopRow {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.timerIncrementLabel {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
  white-space: nowrap;
}

.timerIncrementButtons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.incrementPresetBtn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  font-weight: 700;
  min-width: 56px;
}

.incrementPresetBtn:hover {
  background: #f2f2f2;
}

.incrementPresetBtn.isActive {
  background: #ffffff;
  color: #111111;
  border-color: rgba(176, 226, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(176, 226, 255, 0.55),
    0 0 14px rgba(176, 226, 255, 0.42),
    0 0 24px rgba(176, 226, 255, 0.20);
}

.timerIncrementCustom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #d7d7d7;
  background: #ffffff;
  white-space: nowrap;
}

.timerIncrementCustom span {
  font-weight: 650;
  font-size: 13px;
}

.timerIncrementCustom input[type="number"] {
  width: 76px;
  padding: 6px 8px;
}

@media (max-width: 900px) {
  .timerTopRow {
    align-items: flex-start;
  }

  .timerIncrementRow {
    width: 100%;
	display: none;
  }
}

.timerGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 0;
  width: 100%;
}

@media (max-width: 900px) {
  .timerGrid {
    grid-template-columns: 1fr;
  }
}

.timerRowUnderBoard {
  width: max(500px, min(650px, 50vw));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.clockBox {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #cfcfcf;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.clockLabel {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.clockValue {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.clockBox.clockActive {
  background: #ffffff;
  color: #111111;
  border-color: #d7d7d7;
}

.clockInactive {
  background: #dcdcdc;
  color: #555555;
  border-color: #c7c7c7;
}

.pauseBtnWrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

#pauseResumeBtn {
  min-width: 120px;
}

.sacOuter {
  background: #f6f6f6;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 12px;
}

.sacTwoGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .sacTwoGrid {
    grid-template-columns: 1fr;
  }
}

.sacSideW {
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 12px;
}

.sacSideB {
  background: var(--ui-dark-bg);
  border: 1px solid var(--ui-dark-border);
  border-radius: 12px;
  padding: 12px;
  color: var(--ui-dark-text);
}

.sacSideB .pill {
  background: var(--ui-dark-pill);
  color: var(--ui-dark-text);
}

.sacSideTitle {
  font-weight: 900;
  margin: 0 0 8px;
}

.sacHdr {
  font-weight: 900;
  opacity: 0.9;
}

.sacSideB .sacHdr {
  opacity: 0.9;
}

.scoreBlock {
  line-height: 1.35;
  margin: 6px 0 10px;
}

.scoreLine1 {
  font-weight: 800;
}

.scoreLine2 {
  font-weight: 800;
  margin-top: 2px;
}

.sacTable {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.pieceCell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}

.pieceName {
  font-weight: 700;
  line-height: 1.1;
}

.pieceValue .pill {
  font-size: 12px;
  padding: 2px 8px;
}

.countCell {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.adjCell {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btnSmall {
  padding: 6px 10px;
  border-radius: 10px;
}

.sacSideB button {
  border: 1px solid #4a4a4a;
  background: #3a3a3a;
  color: #f0f0f0;
}

.sacSideB button:hover {
  background: #444;
}

.sacSideB button:disabled {
  opacity: 0.55;
}

.collapsibleBox summary {
  list-style: none;
  cursor:
    var(--cursor-pointer, pointer);
  user-select: none;
  margin: 0;
}

.collapsibleBox summary::-webkit-details-marker {
  display: none;
}

.collapsibleHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0 !important;
}

.debugCopyBtn {
  margin-left: auto;
  padding: 6px 10px;
  border-color: var(--ui-dark-border);
  background: var(--ui-dark-bg);
  color: var(--ui-dark-text);
}

.debugCopyBtn:hover {
  background: var(--ui-dark-bg-hover);
}

.collapsibleHeader::after {
  content: "▾";
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.collapsibleBox:not([open]) .collapsibleHeader::after {
  transform: rotate(-90deg);
}

.collapsibleBox pre {
  margin-top: 10px;
}

.historyBox {
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
}

.historyText {
  white-space: pre-wrap;
  line-height: 1.55;
}

.historyChatWrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.historyChatWrap.hasChat {
  grid-template-columns: minmax(0, 0.92fr) minmax(220px, 1.08fr);
  align-items: start;
}

.chatThreadPanel {
  min-height: 180px;
  max-height: var(--chat-panel-max-height, 650px);
  display: flex;
  flex-direction: column;
  background: var(--ui-dark-bg);
  border-color: var(--ui-dark-border);
  color: var(--ui-dark-text);
  overflow: hidden;
}

.chatThreadPanel .sectionTitle {
  color: var(--ui-dark-text);
}

.chatThread {
  display: grid;
  gap: 8px;
  max-height: var(--chat-thread-max-height, 560px);
  overflow-y: auto;
  padding-right: 2px;
}

.chatBubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.35;
  font-size: 14px;
}

.chatBubbleUser {
  justify-self: end;
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.chatBubbleBot {
  justify-self: start;
  background: #3a3a3a;
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chatBubbleTyping {
  opacity: 0.75;
}

@media (max-width: 900px) {
  .historyChatWrap.hasChat {
    grid-template-columns: 1fr;
  }
}

pre {
  background: #f4f4f4;
  padding: 12px;
  overflow: auto;
  border-radius: 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  max-width: 100%;
}

.modeRow {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.botSetupRow {
  align-items: center;
  column-gap: 48px;
}

.botPlayAsWrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px 14px;
  flex: 0 0 auto;
}

.botPlayAsWrap > .radioGroupLabel {
  grid-column: 1;
  grid-row: 1;
  padding-top: 7px;
}

.botPlayAsControls {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  width: 183px;
}

.botPlayAsWhite {
  order: 1;
}

.botPlayAsBlack {
  order: 2;
}

.botPlayAsExhibition {
  order: 3;
  flex-basis: 100%;
  justify-content: center;
  width: 100%;
}

.botDifficultyWrap {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr);
  align-items: center;
  gap: 2px 8px;
  flex: 1 1 460px;
  min-width: min(460px, 100%);
  max-width: 590px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #111111;
  box-sizing: border-box;
}

.botDifficultyWrap::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: -24px;
  width: 1px;
  background: rgba(32, 32, 32, 0.22);
}

.botDifficultyTop {
  display: contents;
}

.botDifficultyTop .radioGroupLabel {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  color: rgba(17, 17, 17, 0.88);
  opacity: 1;
  width: auto;
  white-space: nowrap;
  line-height: 1.2;
}

.botDifficultyWrap.hasRecommendation .botDifficultyTop .radioGroupLabel {
  grid-row: 1;
  align-self: end;
}

.botDifficultyRecommendation {
  grid-column: 1;
  grid-row: 2;
  width: 150px;
  display: none;
  color: rgba(32, 32, 32, 0.62);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
}

.botDifficultyWrap.hasRecommendation .botDifficultyRecommendation {
  display: block;
}

.botDifficultySliderWrap {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  position: relative;
  top: 8px !important;
  width: 100%;
  height: 18px;
  margin-top: 0;
}

.botDifficultyWrap:not(.hasRecommendation) .botDifficultySliderWrap {
  top: 9px !important;
}

.botDifficultyWrap.hasRecommendation .botDifficultySliderWrap {
  align-self: end;
  margin-top: 6px;
}

.botDifficultySliderWrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.botDifficultyTicks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.botDifficultyTicks span {
  position: absolute;
  top: 5px;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  transform: translateX(-50%);
}

.botDifficultyTicks span:nth-child(1) {
  left: 0;
}

.botDifficultyTicks span:nth-child(2) {
  left: 33.333333%;
}

.botDifficultyTicks span:nth-child(3) {
  left: 66.666667%;
}

.botDifficultyTicks span:nth-child(4) {
  left: 100%;
}

.botDifficultySlider {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: var(--cursor-pointer, pointer);
}

.botDifficultySlider:disabled {
  cursor: var(--cursor-not-allowed, not-allowed);
  opacity: 0.5;
}

.botDifficultyWrap.isDisabled {
  opacity: 0.58;
}

.botDifficultyWrap.isDisabled .botDifficultySliderWrap::before {
  background: rgba(0, 0, 0, 0.18);
}

.botDifficultySlider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.botDifficultySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #2f2f2f;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.30);
}

.botDifficultySlider::-moz-range-track {
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.botDifficultySlider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #2f2f2f;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.30);
}

.botDifficultyNotches {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  position: relative;
  top: 8px !important;
  height: 16px;
  width: 100%;
  margin-left: 0;
  margin-top: 4px;
}

.botDifficultyWrap:not(.hasRecommendation) .botDifficultyNotches {
  top: 9px !important;
}

.botDifficultyNotches > div {
  position: absolute;
  top: 0;
  display: grid;
  gap: 2px;
  width: 92px;
  text-align: center;
  transform: translateX(-50%);
}

.botDifficultyNotches > div:nth-child(1) {
  left: 0;
}

.botDifficultyNotches > div:nth-child(2) {
  left: 33.333333%;
}

.botDifficultyNotches > div:nth-child(3) {
  left: 66.666667%;
}

.botDifficultyNotches > div:nth-child(4) {
  left: 100%;
}

.botDifficultyNotches b {
  color: #1f1f1f;
  font-size: 12px;
  line-height: 1.1;
  transition: color 140ms ease, text-shadow 140ms ease, transform 140ms ease;
}

.botDifficultyNotches b.isActive {
  color: #008fa3;
  text-shadow: 0 0 7px rgba(0, 177, 201, 0.36);
  transform: translateY(-1px);
}

.onlineRoomActions {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  align-items: stretch;
  position: relative;
}

.onlineRoomActions::before,
.onlineRoomActions::after {
  content: "";
  position: absolute;
  right: 100%;
  width: 14px;
  border-top: 1px dotted rgba(32, 32, 32, 0.48);
}

.onlineRoomActions::before {
  top: 13px;
}

.onlineRoomActions::after {
  bottom: 13px;
}

.modeReviewPill {
  user-select: none;
}

.onlineRoomActions button,
.roomBubble input {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.roomActionDark {
  background: var(--ui-dark-bg);
  border: 1px solid var(--ui-dark-border);
  color: var(--ui-dark-text);
}

.roomActionDark:hover {
  background: var(--ui-dark-bg-hover);
}

.roomActionWrap {
  position: relative;
}

.roomActionBtn {
  width: 100%;
}

.roomBubble {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 60;
  min-width: 162px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 20, 20, 0.14);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.20);
  transform: translateY(-50%);
}

.roomBubble.hidden {
  display: none;
}

.roomBubble::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid rgba(20, 20, 20, 0.14);
  border-bottom: 1px solid rgba(20, 20, 20, 0.14);
  transform: translateY(-50%) rotate(45deg);
}

.roomBubble button {
  width: 100%;
}

.roomBubbleCreate {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.roomBubbleJoin {
  width: min(290px, calc(100vw - 48px));
}

.joinRoomCodeRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.joinRoomCodeRow input {
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
}

.viewAllRoomsBtn {
  margin-top: 7px;
}

.radioPill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d7d7d7;
  background: #fff;
  flex: 0 0 auto;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.radioPill b {
  font-size: inherit;
  line-height: inherit;
}

.radioPill.isBlack {
  background: var(--ui-dark-bg);
  border: 1px solid var(--ui-dark-border);
  color: var(--ui-dark-text);
}

.radioPill.isBlack b {
  color: var(--ui-dark-text);
}

.radioPill.isBlack .pill {
  background: var(--ui-dark-pill);
  color: var(--ui-dark-text);
}

.radioPill input {
  margin: 0;
}

.radioGroupLabel {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Hypercarry selector */
.hypercarrySelectorPanel {
  display: block;
  position: relative;
  margin-top: 10px;
}

.hypercarrySelectorPanel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 41px;
  bottom: 0;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.06),
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.06)
  );
  pointer-events: none;
  transform: translateX(-50%);
}

.hypercarrySelectorPanel.hideCenterDivider::after {
  display: none;
}

.hypercarryBar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 90%;
  margin: 10px auto 0;
  padding: 4px 0 2px;
  box-sizing: border-box;
}

.hypercarryHalf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

.setupPresetRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 90%;
  margin: 8px auto 0;
  box-sizing: border-box;
}

.hypercarryLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 81px minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "white-tray tray-divider black-tray"
    "white-preset preset-divider black-preset";
  align-items: center;
  gap: 8px 0;
  width: 90%;
  margin: 10px auto 0;
  padding: 4px 0 2px;
}

.hypercarryLayout .hypercarryHalfWhite {
  grid-area: white-tray;
}

.hypercarryLayout .hypercarryHalfBlack {
  grid-area: black-tray;
}

.hypercarryLayout .setupPresetWhite {
  grid-area: white-preset;
}

.hypercarryLayout .setupPresetBlack {
  grid-area: black-preset;
}

.hypercarryLayout .hypercarryDivider {
  grid-area: tray-divider;
  justify-self: center;
}

.hypercarryLayout .setupPresetDivider {
  grid-area: preset-divider;
  justify-self: center;
}

.setupPresetControl {
  display: grid;
  grid-template-columns: auto minmax(120px, 190px);
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
  color: #333333;
}

.setupPresetControl > span {
  opacity: 0.72;
  white-space: nowrap;
}

.setupPresetControl select {
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 3px 26px 3px 8px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #ffffff;
  color: #222222;
  font-size: 12px;
  font-weight: 700;
  cursor: var(--cursor-pointer, pointer);
}

.setupPresetControl select:disabled {
  opacity: 0.55;
  cursor: var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default);
}

.setupPresetControl .hypercarrySelectButton {
  min-height: 30px;
  padding: 3px 8px;
  border-color: #d8d8d8;
  border-radius: 6px;
  color: #222222;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.setupPresetControl .hypercarrySelectControl {
  opacity: 1;
  z-index: 1;
}

.setupPresetControl .hypercarrySelectControl.isOpen {
  z-index: 10030;
}

.setupPresetControl .hypercarrySelectControl.isOpen .hypercarrySelectButton {
  border-color: rgba(216, 162, 51, 0.84);
  border-bottom-color: transparent;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.setupPresetControl .hypercarrySelectMenu {
  top: calc(100% - 1px);
  z-index: 10030;
  opacity: 1;
  border-color: rgba(216, 162, 51, 0.84);
  border-radius: 0 0 6px 6px;
  color: #222222;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.setupPresetControl .hypercarrySelectOption {
  color: #222222;
}

.setupPresetBlack .hypercarrySelectButton {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--ui-dark-text, #f7f7f7);
  background: var(--ui-dark-bg, #2f2f2f);
}

.setupPresetBlack .hypercarrySelectMenu {
  border-color: rgba(216, 162, 51, 0.84);
  color: var(--ui-dark-text, #f7f7f7);
  background: var(--ui-dark-bg, #2f2f2f);
}

.setupPresetBlack .hypercarrySelectOption {
  color: var(--ui-dark-text, #f7f7f7);
}

.setupPresetBlack .hypercarrySelectOption:hover,
.setupPresetBlack .hypercarrySelectOption:focus-visible,
.setupPresetBlack .hypercarrySelectOption.isSelected {
  color: #17100a;
}

.setupPresetDivider {
  width: 1px;
  height: 30px;
  margin: 0 28px;
  background: transparent;
  border-radius: 999px;
  flex: 0 0 auto;
}

.setupPresetControl.isHidden,
.setupPresetDivider.isHidden {
  display: none;
}

.hypercarryDivider {
  width: 1px;
  align-self: stretch;
  min-height: 54px;
  background: transparent;
  margin: 0 28px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.hypercarryPiece {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
  overflow: hidden;
}

.hypercarryPiece img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.hypercarryPiece img.customPieceTransformed {
  transform:
    translate(var(--custom-piece-x, 0px), var(--custom-piece-y, 0px))
    scale(var(--custom-piece-scale, 1));
  transform-origin: center center;
}

.hypercarryPiece.isEnabled {
  opacity: 1;
  cursor:
    var(--cursor-pointer, pointer);
}

.hypercarryPiece.isEnabled:hover {
  transform: scale(1.16);
  background: transparent;
}

.hypercarryPiece.isSelected {
  transform: scale(1.10);
  border-radius: 14px;
  background: #e7e7e7;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.hypercarryPiece.isSelected[data-side="white"] img {
  filter:
    drop-shadow(0 0 2px rgba(190, 235, 255, 1.0))
    drop-shadow(0 0 6px rgba(190, 235, 255, 0.95))
    drop-shadow(0 0 10px rgba(190, 235, 255, 0.55));
}

.hypercarryPiece.isSelected[data-side="black"] img {
  filter:
    drop-shadow(0 0 2px rgba(255, 140, 140, 1.0))
    drop-shadow(0 0 6px rgba(255, 140, 140, 0.95))
    drop-shadow(0 0 10px rgba(255, 140, 140, 0.55));
}

.hypercarryPiece.isDisabled {
  opacity: 0.26;
  filter: grayscale(0.35);
  cursor:
    var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default);
}

.hypercarryPiece.isDisabled:hover {
  transform: none;
  background: transparent;
}

.hypercarryPiece:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(176, 226, 255, 0.22);
}

/* New elements only */
#copyHistoryBtn {
  min-width: 160px;
}

#dragonTurnWrap {
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 12px;
}

@media (max-width: 900px) {
  .hypercarryBar {
    width: 94%;
    gap: 12px;
    overflow-x: auto;
  }

  .hypercarryHalf {
    gap: 10px;
  }

  .setupPresetRow {
    width: 94%;
    gap: 10px;
    overflow-x: auto;
  }

  .setupPresetControl {
    grid-template-columns: 1fr;
    gap: 4px;
    min-width: 135px;
  }

  .hypercarryPiece {
    width: 52px;
    height: 52px;
  }

  .hypercarryPiece img {
    width: 44px;
    height: 44px;
  }

  .hypercarryDivider {
    min-height: 44px;
  }
}

.configActionRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 5px;
  align-items: center;
  margin-top: 16px;
  width: 100%;
}

.configActionRow #confirmBtn {
  grid-column: 1;
  justify-self: end;
  margin-right: 5px;
}

.configActionRow #resetBtn {
  grid-column: 2;
  justify-self: start;
  margin-left: 5px;
}

.title-note {
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  opacity: var(--hc-trim-outer-opacity, 0.69);
}

.customRulesetsPanel {
  background: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: 8px;
  padding-top: 8px;
}

.customRulesetsPanel > .modeRow {
  align-items: flex-start;
  margin-top: 6px;
}

.customRulesetsPanel > .modeRow .radioGroupLabel {
  padding-top: 6px;
}

.customRulesetsPanel > .modeRow:first-child {
  margin-top: 0;
}

.rulesetPillGroup {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 6px;
  min-width: 0;
}

#fenInput {
  display: inline-block;
  max-width: calc(100% - 34px);
  width: calc(100% - 34px);
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  min-height: 2.7em;
  max-height: 9em;
  line-height: 1.35;
  resize: vertical;
  white-space: pre-wrap;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-all;
  vertical-align: top;
}

#fenInput[readonly] {
  resize: none;
}

#fenInput:not([readonly]) {
  border-bottom: 1px dotted rgba(32, 32, 32, 0.45);
}

.reviewInputRow input {
  flex: 1 1 auto;
  min-width: 0;
}

.reviewMoveNavRow {
  justify-content: flex-start;
  flex-wrap: nowrap;
  justify-content: space-between;
  max-width: none;
}

.reviewMoveNavRow button {
  flex: 0 0 auto;
}

.reviewCandidateArrowLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.rulesetHint {
  font-size: 13px;
  line-height: 1.35;
}

.timerConfigCard {
  background: transparent;
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.historyBoxDark {
  background: var(--ui-dark-bg);
  border-color: var(--ui-dark-border);
  color: var(--ui-dark-text);
}

.historyBoxDark .sectionTitle,
.historyBoxDark #msg {
  color: var(--ui-dark-text);
}

#msg.ok {
  color: #35b85f !important;
}

#msg.error {
  color: #e05252 !important;
}

.historyBoxDark input[type="text"] {
  background: #ffffff;
  color: #111111;
}

.isBlackPill {
  background: var(--ui-dark-bg);
  color: var(--ui-dark-text);
  border-color: var(--ui-dark-border);
}

.isBlackPill:hover {
  background: var(--ui-dark-bg-hover);
}

.primaryDarkBtn {
  background: var(--ui-dark-bg);
  color: var(--ui-dark-text);
  border-color: var(--ui-dark-border);
}

.primaryDarkBtn:hover {
  background: var(--ui-dark-bg-hover);
}

.timerIncrementCustom.isBlack {
  border-color: var(--ui-dark-border);
  background: var(--ui-dark-bg);
  color: var(--ui-dark-text);
}

.timerIncrementCustom.isBlack input[type="number"] {
  background: #f5f5f5;
  color: #111111;
  border-color: #d7d7d7;
}

.boardPieceGlowWhite,
.boardPieceGlowWhite img.piece-417db,
#board .piece-417db.boardPieceGlowWhite {
  filter: drop-shadow(0 0 8px rgba(32, 116, 255, 0.85)) drop-shadow(0 0 16px rgba(32, 116, 255, 0.55));
}

.boardPieceGlowBlack,
.boardPieceGlowBlack img.piece-417db,
#board .piece-417db.boardPieceGlowBlack {
  filter: drop-shadow(0 0 8px rgba(218, 42, 42, 0.85)) drop-shadow(0 0 16px rgba(218, 42, 42, 0.55));
}

#board .square-55d63.boardDragSourceWhite {
  box-shadow: inset 0 0 0 2px rgba(32, 116, 255, 0.45);
}

#board .square-55d63.boardDragSourceBlack {
  box-shadow: inset 0 0 0 2px rgba(218, 42, 42, 0.45);
}

#board .square-55d63.cardinalReturnGlow {
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 0, 0.75),
    inset 0 0 50px rgba(255, 255, 0, 0.25) !important;
}

#board .square-55d63.rookWarpCircle::before,
#board .square-55d63.rookWarpCircleInactive::before {
  content: "";
  position: absolute;
  inset: 2%;
  background-image: var(--rook-warp-url);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
}

#board .square-55d63.rookWarpCircle img.piece-417db,
#board .square-55d63.rookWarpCircleInactive img.piece-417db {
  position: relative;
  z-index: 2;
}

#board .square-55d63.rookWarpCircleInactive::before {
  filter: saturate(0.35) brightness(0.55);
}

#board .square-55d63.rookWarpSource,
#board .square-55d63.rookWarpSelected,
#board .square-55d63.rookWarpTarget {
  box-shadow:
    var(--rook-warp-top, 0 0 0 0 transparent),
    var(--rook-warp-bottom, 0 0 0 0 transparent),
    var(--rook-warp-left, 0 0 0 0 transparent),
    var(--rook-warp-right, 0 0 0 0 transparent),
    inset 0 0 32px var(--rook-warp-glow, rgba(255, 255, 0, 0.14));
}

#board .square-55d63.rookWarpSource,
#board .square-55d63.rookWarpSelected {
  --rook-warp-top: inset 0 4px 0 rgba(255, 255, 0, 0.86);
  --rook-warp-bottom: inset 0 -4px 0 rgba(255, 255, 0, 0.86);
  --rook-warp-left: inset 4px 0 0 rgba(255, 255, 0, 0.86);
  --rook-warp-right: inset -4px 0 0 rgba(255, 255, 0, 0.86);
  --rook-warp-glow: rgba(255, 255, 0, 0.14);
}

#board .square-55d63.rookWarpTarget {
  --rook-warp-top: inset 0 4px 0 rgba(97, 206, 255, 0.95);
  --rook-warp-bottom: inset 0 -4px 0 rgba(97, 206, 255, 0.95);
  --rook-warp-left: inset 4px 0 0 rgba(97, 206, 255, 0.95);
  --rook-warp-right: inset -4px 0 0 rgba(97, 206, 255, 0.95);
  --rook-warp-glow: rgba(97, 206, 255, 0.18);
}

#board .square-55d63.popeHolyTop,
#board .square-55d63.popeHolyBottom,
#board .square-55d63.popeHolyLeft,
#board .square-55d63.popeHolyRight {
  box-shadow:
    var(--pope-holy-top, 0 0 0 0 transparent),
    var(--pope-holy-bottom, 0 0 0 0 transparent),
    var(--pope-holy-left, 0 0 0 0 transparent),
    var(--pope-holy-right, 0 0 0 0 transparent),
    inset 0 0 32px rgba(255, 255, 0, 0.14);
}

#board .square-55d63.popeHolyTop {
  --pope-holy-top: inset 0 4px 0 rgba(255, 255, 0, 0.86);
}

#board .square-55d63.popeHolyBottom {
  --pope-holy-bottom: inset 0 -4px 0 rgba(255, 255, 0, 0.86);
}

#board .square-55d63.popeHolyLeft {
  --pope-holy-left: inset 4px 0 0 rgba(255, 255, 0, 0.86);
}

#board .square-55d63.popeHolyRight {
  --pope-holy-right: inset -4px 0 0 rgba(255, 255, 0, 0.86);
}

.clockBox {
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.clockBox.clockActive {
  background: #ffffff;
  color: #111111;
  border-color: rgba(190, 235, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(190, 235, 255, 0.50),
    0 0 8px rgba(190, 235, 255, 0.34),
    0 0 14px rgba(190, 235, 255, 0.16);
}

#blackClock.clockActive {
  background: var(--ui-dark-bg);
  color: var(--ui-dark-text);
  border-color: rgba(255, 122, 122, 0.74);
  box-shadow:
    0 0 0 1px rgba(255, 122, 122, 0.34),
    0 0 8px rgba(255, 122, 122, 0.24),
    0 0 14px rgba(255, 122, 122, 0.12);
}

.clockBox.clockCriticalWhite {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: rgba(190, 235, 255, 1) !important;
  box-shadow:
    0 0 0 2px rgba(190, 235, 255, 0.62),
    0 0 10px rgba(190, 235, 255, 0.46),
    0 0 16px rgba(190, 235, 255, 0.22);
}

.clockBox.clockCriticalBlack {
  background: var(--ui-dark-bg) !important;
  color: var(--ui-dark-text) !important;
  border-color: rgba(255, 122, 122, 0.95) !important;
  box-shadow:
    0 0 0 2px rgba(255, 122, 122, 0.48),
    0 0 10px rgba(255, 122, 122, 0.34),
    0 0 16px rgba(255, 122, 122, 0.16);
}

.clockBox.clockFlashPulse {
  animation: hcClockPulse 0.72s ease-out 1;
}

@keyframes hcClockPulse {
  0% { transform: scale(1); }
  28% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Mark board squares as overlay containers */
#board .square-55d63 {
  position: relative;
}

#board .square-55d63.queenResummonHint::before,
#board .square-55d63.legalMoveHintEmpty::after,
#board .square-55d63.legalMoveHintCapture::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 12;
}

#board .square-55d63.queenResummonHint::before,
#board .square-55d63.legalMoveHintEmpty::after {
  width: 24%;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: rgba(32, 32, 32, 0.24);
  transform: translate(-50%, -50%);
}

#board .square-55d63.legalMoveHintCapture::after {
  inset: 8%;
  border: 5px solid rgba(32, 32, 32, 0.24);
  border-radius: 50%;
  box-sizing: border-box;
}

body.hasAppliedBoard #board .square-55d63 {
  background: transparent !important;
}

#board .square-55d63.premoveStep1 {
  background: rgba(255, 255, 0, 0.58) !important;
}

#board .square-55d63.premoveStep2 {
  background: rgba(255, 150, 24, 0.62) !important;
}

#board .square-55d63.premoveStep3 {
  background: rgba(218, 42, 42, 0.66) !important;
}

/* Hide the native queen image on special-queen squares */
#board .specialQueenPawn [class*="piece-"],
#board .specialQueenPawn img,
#board .specialQueenKnight [class*="piece-"],
#board .specialQueenKnight img,
#board .specialBishop [class*="piece-"],
#board .specialBishop img {
  opacity: 0 !important;
}

/* Draw the correct special queen art as a square overlay */
#board .specialQueenPawn::after,
#board .specialQueenKnight::after,
#board .specialBishop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--special-queen-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 2;
}

/* While dragging from a special-queen square, hide the overlay on the source square */
#board .specialQueenDraggingFrom::after {
  opacity: 0 !important;
}

#board .specialQueenDraggingFrom [class*="piece-"],
#board .specialQueenDraggingFrom img {
  opacity: 0 !important;
}

#board .dukePawn [class*="piece-"],
#board .dukePawn img {
  opacity: 0 !important;
}

#board .dukePawn::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--duke-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 3;
}

#board .neutralPiece::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--neutral-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 8;
}

#board .neutralPiece {
  cursor:
    var(--cursor-pointer, url("/visual/cursors/pointer.cur") 4 4, pointer);
}

#board .neutralPieceSelected {
  box-shadow: inset 0 0 0 4px rgba(190, 55, 75, 0.85);
}

.neutralDragGhost {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 99999;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.32));
}

#board .neutralDragSource,
#board .neutralDragTarget {
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 0, 0.75),
    inset 0 0 50px rgba(255, 255, 0, 0.25) !important;
}

#board .neutralDragHiddenSource::after {
  opacity: 0;
}

/* =========================================================
   Gold trim and texture refinements
   ========================================================= */

:root {
  --hc-foil-gold:
    linear-gradient(
      135deg,
      rgba(255, 248, 203, 0.69) 0%,
      rgba(248, 229, 141, 0.69) 9%,
      rgba(215, 167, 33, 0.69) 24%,
      rgba(255, 241, 169, 0.69) 40%,
      rgba(200, 138, 17, 0.69) 56%,
      rgba(246, 214, 94, 0.69) 74%,
      rgba(139, 90, 3, 0.69) 100%
    );
  --hc-foil-gloss:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.10) 18%,
      rgba(255, 255, 255, 0.02) 34%,
      rgba(0, 0, 0, 0.00) 58%,
      rgba(0, 0, 0, 0.12) 100%
    );
  --hc-container-pattern: url("/static/visual/ui/background_pattern.png");
  --hc-pattern-size: 180px;
  --hc-trim-major-outer-width: 2.5px;
  --hc-trim-outer-opacity: 0.69;
  --hc-trim-shadow: 0 10px 24px rgba(122, 86, 9, 0.10);
}

.appShell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 3.6px solid rgba(215, 167, 33, 0.69) !important;
  border-radius: 25px;
  background: rgba(246, 246, 246, 0.36) !important;
  background-image: none !important;
  background-clip: padding-box !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.appShell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: calc(25px - 3.6px);
  background-image: var(--hc-container-pattern);
  background-size: var(--hc-pattern-size) auto;
  background-repeat: repeat;
  background-position: 0 0;
  opacity: 0.12;
}

.appShell::after {
  content: "";
  position: absolute;
  inset: 2.7px;
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
  padding: 2.5px;
  border-radius: calc(25px - 6.3px);
  background-image: var(--hc-foil-gloss), var(--hc-foil-gold) !important;
  background-blend-mode: soft-light, normal;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.appShell > * {
  position: relative;
  z-index: 1;
}

.card,
.infoBar,
#sacrificePanel,
#historyPanel,
#debugStateContainer,
#botDebugContainer {
  position: relative;
  isolation: isolate;
  border: none !important;
  border-radius: 16px;
  background-image: none !important;
  background-size: auto !important;
  background-repeat: initial !important;
  background-position: initial !important;
  background-origin: padding-box !important;
  background-clip: padding-box !important;
  box-shadow: var(--hc-trim-shadow);
  transform: translateZ(0);
}

.card::before,
.infoBar::before,
#sacrificePanel::before,
#historyPanel::before,
#debugStateContainer::before,
#botDebugContainer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  padding: var(--hc-trim-major-outer-width);
  border-radius: inherit;
  background-image: var(--hc-foil-gloss), var(--hc-foil-gold);
  background-blend-mode: soft-light, normal;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: var(--hc-trim-outer-opacity);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}

.card::after,
.infoBar::after,
#sacrificePanel::after,
#historyPanel::after,
#debugStateContainer::after,
#botDebugContainer::after {
  display: none !important;
  content: none !important;
}

#playPanel,
#reviewPanel,
#chatThreadPanel,
#debugStateContainer.historyBoxDark,
#botDebugContainer.historyBoxDark {
  position: relative;
  isolation: isolate;
  border: 2.5px solid transparent !important;
  background:
    linear-gradient(var(--ui-dark-bg), var(--ui-dark-bg)) padding-box,
    var(--hc-foil-gloss) border-box,
    var(--hc-foil-gold) border-box !important;
  background-blend-mode: normal, soft-light, normal;
  box-sizing: border-box;
}

#playPanel::before,
#playPanel::after,
#reviewPanel::before,
#reviewPanel::after,
#chatThreadPanel::before,
#chatThreadPanel::after,
#debugStateContainer.historyBoxDark::before,
#debugStateContainer.historyBoxDark::after,
#botDebugContainer.historyBoxDark::before,
#botDebugContainer.historyBoxDark::after {
  display: none !important;
  content: none !important;
}

.app-title-left {
  position: relative;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.app-title-left::before,
.app-title-left::after {
  display: none !important;
  content: none !important;
}

.app-title-left::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: 0;
  top: 0;
  width: 420px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  border-radius: 12px;
  background-image: var(--hc-foil-gloss), var(--hc-foil-gold);
  background-blend-mode: soft-light, normal;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  padding: 2.5px;
  box-sizing: border-box;
}

.app-logo {
  box-sizing: border-box;
  display: block;
  border: 0;
  border-radius: 12px;
  background: none !important;
  box-shadow: 0 4px 14px rgba(122, 86, 9, 0.10);
  overflow: hidden;
}

#musicPlayer {
  border: 2.5px solid transparent !important;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)) padding-box,
    var(--hc-foil-gloss) border-box,
    var(--hc-foil-gold) border-box !important;
  background-blend-mode: normal, soft-light, normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10) !important;
}

#musicPlayer::before,
#musicPlayer::after {
  display: none !important;
  content: none !important;
}

.boardFooterSlot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 14px 0 0 !important;
  border-top: 1px solid rgba(32, 32, 32, 0.18) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.boardFooterSlot::before,
.boardFooterSlot::after {
  display: none !important;
  content: none !important;
}

.boardFooterSlot img {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border: 2.5px solid transparent;
  border-radius: 12px;
  border-image: none;
  background:
    linear-gradient(#000 0 0) padding-box,
    var(--hc-foil-gloss) border-box,
    var(--hc-foil-gold) border-box;
  background-blend-mode: normal, soft-light, normal;
  box-shadow: 0 4px 14px rgba(122, 86, 9, 0.10);
}

.footerInfoRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(32, 32, 32, 0.18);
  color: #111111;
  font-size: 13px;
  font-weight: 500;
}

.footerVisitorCount {
  justify-self: start;
  display: grid;
  gap: 2px;
}

.footerCopyright {
  justify-self: end;
  text-align: right;
}

.footerVisitorNumber {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footerInfoButton {
  justify-self: center;
  padding: 7px 12px;
  border-color: rgba(255, 255, 255, 0.52);
  color: #111111;
  background: rgba(255, 255, 255, 0.94);
}

.infoReaderDialog {
  width: min(820px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #f5f5f5;
  background: #111111;
}

.infoReaderDialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
}

.infoReaderInner {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: min(760px, calc(100vh - 32px));
}

.infoReaderHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.infoReaderHeader button {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.infoReaderPager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.infoReaderPager[hidden] {
  display: none;
}

.infoReaderPager button {
  padding: 6px 10px;
}

.infoReaderPageLabel {
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: #f5f5f5;
}

.infoReaderPageLabel strong {
  font-weight: 800;
}

.infoReaderPageCount {
  font-weight: 400;
}

.infoReaderCurrentPage {
  font-weight: 800;
}

.infoReaderBody {
  margin: 0;
  padding: 18px 20px 20px;
  overflow: auto;
  overflow-wrap: anywhere;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.infoReaderPlainText {
  white-space: pre-wrap;
}

.infoReaderFormatted {
  display: grid;
  gap: 10px;
}

.infoReaderFormatted h2,
.infoReaderFormatted h3,
.infoReaderFormatted h4,
.infoReaderFormatted p,
.infoReaderFormatted ul {
  margin: 0;
}

.infoReaderFormatted h2 {
  margin-top: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.25;
}

.infoReaderFormatted h2:first-child {
  margin-top: 2px;
  padding-bottom: 0;
  border-bottom: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 20px;
  font-style: italic;
}

.infoReaderFormatted h3 {
  margin-top: 20px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.3;
}

.infoReaderFormatted h3:first-child {
  margin-top: 2px;
}

.infoReaderFormatted h4 {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 780;
}

.infoReaderFormatted p {
  color: rgba(245, 245, 245, 0.9);
}

.infoReaderFormatted ul {
  display: grid;
  gap: 5px;
  padding-left: 20px;
  color: rgba(245, 245, 245, 0.9);
}

.infoReaderFormatted li::marker {
  color: rgba(255, 255, 255, 0.58);
}

.infoReaderLicenses {
  gap: 12px;
}

.infoReaderLicenseNote {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: rgba(245, 245, 245, 0.92);
  background: rgba(255, 255, 255, 0.07);
}

.infoReaderLicenseNote strong {
  color: #ffffff;
  font-size: 13px;
  font-weight: 820;
  text-transform: uppercase;
}

.infoReaderLicenseCard {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
}

.infoReaderLicenseCard h3 {
  margin-top: 0;
}

.infoReaderLicenseEntry {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
}

.infoReaderLicenseField {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.infoReaderLicenseField.isBlock {
  align-items: start;
}

.infoReaderLicenseKey {
  color: rgba(255, 255, 255, 0.58);
  font-weight: 780;
}

.infoReaderLicenseValue {
  min-width: 0;
  color: rgba(245, 245, 245, 0.92);
}

.infoReaderLicenseBlock {
  white-space: pre-wrap;
}

.infoReaderLicenseValue a {
  color: #d8c06a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.infoReaderLicenseList {
  margin-top: 0;
}

.infoReaderTocTitle {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 800;
}

.infoReaderTocList {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  white-space: normal;
}

.infoReaderTocItem {
  justify-self: stretch;
  text-align: left;
  color: #111111;
  background: rgba(255, 255, 255, 0.94);
}

@media (max-width: 720px) {
  .footerInfoRow {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footerVisitorCount,
  .footerCopyright {
    justify-self: center;
    text-align: center;
  }

  .infoReaderLicenseField {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.capturedLabel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  min-height: 22px;
  padding: 4px 10px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)) padding-box,
    var(--hc-foil-gloss) border-box,
    var(--hc-foil-gold) border-box;
  background-blend-mode: normal, soft-light, normal;
  color: #4f4422 !important;
  -webkit-text-fill-color: #4f4422;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: none;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 1 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 3px 8px rgba(0, 0, 0, 0.10);
}

/* Final live-page cursor layer */
html,
body,
.appShell,
.appShell *,
body::before,
body::after,
*::before,
*::after {
  cursor:
    var(--cursor-default, url("/visual/cursors/default.cur") 8 7, default) !important;
}

#board.boardCursorWait,
#board.boardCursorWait [class*="square-"] {
  cursor:
    var(--cursor-wait-progress, progress) !important;
}

a,
button,
summary,
#evalToggle,
.promo-btn,
.hypercarryPiece.isEnabled,
#board .piece-417db.boardPieceCursorPointer,
img.piece-417db.boardPieceCursorPointer,
#board .neutralPiece {
  cursor:
    var(--cursor-pointer, url("/visual/cursors/pointer.cur") 4 4, pointer) !important;
}

#board .piece-417db.boardPieceCursorGrab,
img.piece-417db.boardPieceCursorGrab,
.sacrificed-piece.isDraggableSacrifice {
  cursor:
    var(--cursor-grab, grab) !important;
}

body.isBoardPieceDragging,
body.isBoardPieceDragging *,
html.isSacrificePieceDragging,
html.isSacrificePieceDragging *,
body.isSacrificePieceDragging,
body.isSacrificePieceDragging * {
  cursor:
    var(--cursor-grabbing, url("/visual/cursors/grabbing.cur") 31 30, grabbing) !important;
}

html.isSacrificePieceDragging #board .piece-417db,
html.isSacrificePieceDragging #board img,
body.isSacrificePieceDragging #board .piece-417db,
body.isSacrificePieceDragging #board img {
  pointer-events: none;
  cursor:
    var(--cursor-grabbing, url("/visual/cursors/grabbing.cur") 31 30, grabbing) !important;
}

button:disabled,
input:disabled,
.promo-btn:disabled,
.promo-btn.disabled {
  cursor:
    var(--cursor-not-allowed, not-allowed) !important;
}

body.isLoading,
.boardThinkingCover.show,
.boardThinkingCover.show * {
  cursor:
    var(--cursor-wait-progress, progress) !important;
}

#board .noblePawn [class*="piece-"],
#board .noblePawn img {
  opacity: 0 !important;
}

#board .noblePawn::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noble-pawn-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 3;
}

#board .kingDomainWhite [class*="piece-"],
#board .kingDomainWhite img,
#board .kingDomainBlack [class*="piece-"],
#board .kingDomainBlack img {
  opacity: 0 !important;
}

#board .kingDomainWhite::after,
#board .kingDomainBlack::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--avarice-url);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 2;
}

#board .specialBishop::after {
  background-image: var(--special-bishop-url);
}

#board .neutralDragHiddenSource::after {
  opacity: 0;
}


/* -------------------------
   Kingdom Announcement / Decree Ads
   ------------------------- */

.decreeLayer {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.decreeBanner {
  position: fixed;
  top: 36px;
  width: clamp(255px, 16vw, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: auto;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.34));
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.decreeBanner[hidden] {
  display: none;
}

.decreeBanner.isVisible {
  opacity: 1;
  transform: translateY(0);
}

.decreeBannerLeft {
  left: 0px;
}

.decreeBannerRight {
  right: 3px;
}

.decreeTrumpet {
  display: block;
  width: 80%;
  height: auto;
  object-fit: contain;
  margin-bottom: -66px;
  user-select: none;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.decreeBannerLeft .decreeTrumpet {
  transform: translateX(-10px);
  transform-origin: 50% 58%;
}

.decreeBannerLeft .decreeTrumpet.isFanfarePlaying {
  transform: translateX(-10px) rotate(-15deg);
}

.decreeBannerRight .decreeTrumpet {
  transform: translateX(10px) scaleX(-1);
  transform-origin: 50% 58%;
}

.decreeBannerRight .decreeTrumpet.isFanfarePlaying {
  transform: translateX(10px) scaleX(-1) rotate(-15deg);
}

.decreeScrollWrap {
  position: relative;
  width: 100%;
}

.decreeScrollFrame {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.decreeContent {
  position: absolute;
  left: 50%;
  top: 14%;
  width: 52%;
  height: 68%;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: start;
  gap: 7px;
  padding: 0;
  color: #2f2114;
  text-align: center;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.decreeBanner.isOpen .decreeContent {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.decreeKicker {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(115, 83, 31, 0.34);
  background: rgba(255, 244, 205, 0.48);
  color: #5f4218;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.05;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.decreeImageFrame {
  width: 100%;
  max-height: clamp(144px, 36vh, 255px);
  overflow: hidden;
  opacity: 75%;
  border: 1px solid rgba(90, 61, 21, 0.42);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.04)),
    rgba(84, 47, 19, 0.15);
}

.decreeAdImage {
  display: block;
  width: 100%;
  height: auto;
  object-fit: unset;
}

.decreeAdTitle {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 0.9vw, 17px);
  font-weight: 900;
  line-height: 1.25;
  color: #2d1e10;
  text-shadow: 0 1px 0 rgba(255, 248, 222, 0.65);
}

.decreeAdBody {
  max-height: 7.5em;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(10px, 0.66vw, 13px);
  font-weight: 520;
  line-height: 1.25;
  color: #4a3520;
}

.decreeAdCta {
  align-self: end;
  justify-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(88, 52, 16, 0.36);
  background:
    linear-gradient(180deg, rgba(121, 30, 21, 0.88), rgba(83, 18, 13, 0.9));
  color: #f9dfb7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 0 0 1px rgba(255, 204, 125, 0.14),
    0 3px 8px rgba(50, 25, 8, 0.18);
  display: none;
}

.decreeCloseBtn {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(92, 17, 14, 0.82);
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,0.26), transparent 22%),
    radial-gradient(circle at 50% 55%, #9b241c 0%, #711711 58%, #4f0e0b 100%);
  color: #f8dcc0;
  font-size: 17px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 0 0 2px rgba(255, 198, 124, 0.16),
    0 3px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  z-index: 2;
  transform: translateX(-50%) scale(0.9);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease,
    filter 0.12s ease;
}

.decreeBanner.isOpen .decreeCloseBtn {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.decreeCloseBtn:hover,
.decreeCloseBtn:focus-visible {
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,0.32), transparent 22%),
    radial-gradient(circle at 50% 55%, #aa2a20 0%, #7b1a13 58%, #530f0b 100%);
  filter: brightness(1.06);
}

.decreeCloseBtn:focus-visible {
  outline: 2px solid rgba(255, 230, 180, 0.85);
  outline-offset: 2px;
}

@media (max-width: 1500px) {
  .decreeLayer {
    display: none;
  }
}
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  .app-title-left::before {
    display: none !important;
    content: none !important;
  }

  .appLogoFrame {
    position: relative;
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .appLogoFrame .app-logo {
    width: auto;
    max-width: 100%;
  }

  .appLogoFrame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: 12px;
    background-image: var(--hc-foil-gloss), var(--hc-foil-gold);
    background-blend-mode: soft-light, normal;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 2.5px;
    box-sizing: border-box;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 900px) {
  .gamePage .app-title-left::before,
  body[data-profile-view-kind] .app-title-left::before,
  body[data-can-upload] .app-title-left::before,
  .loginPage .app-title-left::before {
    display: none !important;
    content: none !important;
  }

  .gamePage .appLogoFrame,
  body[data-profile-view-kind] .appLogoFrame,
  body[data-can-upload] .appLogoFrame,
  .loginPage .appLogoFrame {
    position: relative;
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .gamePage .appLogoFrame .app-logo,
  body[data-profile-view-kind] .appLogoFrame .app-logo,
  body[data-can-upload] .appLogoFrame .app-logo,
  .loginPage .appLogoFrame .app-logo {
    width: auto;
    max-width: 100%;
  }

  .gamePage .appLogoFrame::before,
  body[data-profile-view-kind] .appLogoFrame::before,
  body[data-can-upload] .appLogoFrame::before,
  .loginPage .appLogoFrame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: 12px;
    background-image: var(--hc-foil-gloss), var(--hc-foil-gold);
    background-blend-mode: soft-light, normal;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 2.5px;
    box-sizing: border-box;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 900px) {
  body[data-profile-view-kind] .app-titlebar,
  body[data-can-upload] .app-titlebar,
  .loginPage .app-titlebar {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-profile-view-kind] .app-title-left,
  body[data-can-upload] .app-title-left,
  .loginPage .app-title-left {
    width: 100%;
  }

  body[data-profile-view-kind] #musicPlayer,
  body[data-can-upload] #musicPlayer,
  .loginPage #musicPlayer {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
    box-sizing: border-box;
  }

  .gamePage .app-titlebar {
    flex-direction: column;
    align-items: stretch;
  }

  .gamePage .app-title-left {
    width: 100%;
  }

  .gamePage #musicPlayer {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
    box-sizing: border-box;
  }

  .gamePage .customRulesetsPanel > .modeRow {
    flex-direction: column;
    align-items: stretch;
  }

  .gamePage .customRulesetsPanel > .modeRow .radioGroupLabel {
    padding-top: 0;
  }

  .gamePage .rulesetPillGroup {
    width: 100%;
    flex: 0 1 auto;
  }

  .gamePage .gameModeRow > .radioGroupLabel {
    flex: 0 0 100%;
  }

  .gamePage .hypercarrySelectorPanel {
    display: block;
  }

  .gamePage .hypercarrySelectorPanel::after {
    display: none;
  }

  .gamePage .hypercarryLayout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "white-tray"
      "white-preset"
      "tray-divider"
      "black-tray"
      "black-preset";
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 4px 0 2px;
  }

  .gamePage .hypercarryHalfWhite,
  .gamePage .hypercarryHalfBlack {
    width: 100%;
    flex: 0 0 auto;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .gamePage .setupPresetWhite,
  .gamePage .setupPresetBlack {
    width: 100%;
    margin-top: 8px;
    justify-self: stretch;
  }

  .gamePage .setupPresetDivider {
    display: none;
  }

  .gamePage .hypercarryDivider {
    grid-area: tray-divider;
    width: 100%;
    height: 1px;
    min-height: 1px;
    margin: 10px 0;
    align-self: auto;
    background: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.06),
      rgba(0, 0, 0, 0.18),
      rgba(0, 0, 0, 0.06)
    );
  }

  .gamePage .hypercarrySelectorPanel.hideCenterDivider .hypercarryDivider {
    display: none;
  }

  .gamePage .mainRow,
  .gamePage .leftPanel,
  .gamePage .rightPanel,
  .gamePage .boardStage,
  .gamePage .capturedRow,
  .gamePage .timerRowUnderBoard {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .gamePage .leftPanel,
  .gamePage .rightPanel {
    flex: 1 1 100%;
  }
}
