/* Chess Variants layout. Colours come from ../rocket-chess/board.css (dark and light themes). */
.cv { max-width: 900px; margin: 0 auto; padding: 10px 8px 16px; user-select: none; -webkit-user-select: none; color: var(--ui-text); border-radius: 14px; }
.cv[data-theme="light"] { background: #f7efe0; }
.cv [hidden] { display: none !important; }
.cv-top { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.cv-top > .rg-modes { max-width: none; }
.cv-variants { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 13px; background: var(--ui-bg); border: 1px solid var(--ui-line); }
.cv-v { appearance: none; min-width: 0; min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 5px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--ui-muted); cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s, box-shadow .15s; }
.cv-v b { font: 800 14px/1.15 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cv-v small { font-size: 10.5px; line-height: 1.15; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .cv-v:hover { color: var(--ui-strong); background: rgba(85,214,255,.07); } }
.cv-v[aria-pressed="true"] { background: var(--ui-bg2); color: var(--ui-strong); box-shadow: inset 0 0 0 1.5px var(--ui-accent), 0 2px 12px rgba(85,214,255,.16); }
.cv-v:focus-visible { outline: 2px solid var(--ui-gold); outline-offset: 1px; }
.cv-opts { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ui-muted); }
.cv-opts label { display: inline-flex; align-items: center; gap: 4px; }
.cv-opts select { background: var(--ui-bg); color: var(--ui-text); border: 1px solid var(--ui-line); border-radius: 7px; padding: 6px 8px; font-size: 13px; }
.cv-tools { display: flex; gap: 6px; margin-left: auto; }
.cv-btn { background: var(--ui-bg); color: var(--ui-text); border: 1px solid var(--ui-line); border-radius: 8px; padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; }
@media (hover: hover) { .cv-btn:hover:not(:disabled) { border-color: var(--ui-accent); } }
.cv-btn:disabled { opacity: 0.4; cursor: default; }
.cv-btn:active:not(:disabled) { transform: translateY(1px); }
.cv-btn:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.cv-btn-primary { background: var(--ui-gold); color: var(--ui-gold-ink); border-color: var(--ui-gold); }
@media (hover: hover) { .cv-btn-primary:hover:not(:disabled) { filter: brightness(1.08); } }
.cv-main { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.cv-boardwrap { width: 100%; max-width: 580px; margin: 0 auto; }
.cv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 2px 0; }
.cv-tray { display: flex; gap: 1px; flex-wrap: wrap; align-items: center; min-width: 0; flex: 1 1 auto; min-height: 22px; }
.cv-tray .cv-lost { width: 18px; height: 18px; display: block; }
.cv-lead { font-size: 12px; color: var(--ui-muted); margin-left: 6px; }
.cv-pocket { gap: 4px; flex-wrap: nowrap; }
.cv-pk { appearance: none; position: relative; width: 38px; height: 38px; padding: 0; border-radius: 8px; border: 1px solid var(--ui-line); background: var(--ui-bg); cursor: pointer; flex: none; touch-action: none; }
.cv-pk svg { position: absolute; inset: 8%; width: 84%; height: 84%; }
.cv-pk i { position: absolute; right: -4px; top: -5px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--ui-gold); color: var(--ui-gold-ink); font: 800 11px/16px system-ui, sans-serif; font-style: normal; text-align: center; }
.cv-pk.none { opacity: .22; }
.cv-pk:disabled { cursor: default; }
.cv-pocket.live .cv-pk:not(:disabled) { border-color: var(--ui-accent); box-shadow: 0 0 0 1px rgba(85,214,255,.25); }
@media (hover: hover) { .cv-pocket.live .cv-pk:not(:disabled):hover { background: var(--ui-bg2); } }
.cv-pk.on { background: var(--sq-light-sel); border-color: var(--ui-accent); }
.cv-pk:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.cv-clock { flex: none; min-width: 74px; padding: 4px 10px; border-radius: 8px; background: var(--ui-bg); border: 1px solid var(--ui-line); font: 800 18px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: center; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.cv-clock.run { color: var(--ui-strong); border-color: var(--ui-accent); background: var(--ui-bg2); }
.cv-clock.low.run { color: #fff; background: #b8283f; border-color: #ff6b81; animation: cv-low 1s ease-in-out infinite alternate; }
@keyframes cv-low { to { background: #7d1426; } }
.cv-side { background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 10px; padding: 12px; min-height: 200px; }
.cv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.cv-status { font-weight: 700; font-size: 15px; color: var(--ui-strong); min-width: 0; flex: 1 1 auto; padding-top: 2px; }
.cv-icons { display: flex; gap: 4px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 92px; }
.cv-icons .rb-icon { width: 34px; height: 34px; } .cv-icons .rb-icon svg { width: 18px; height: 18px; }
.cv-info { font-size: 12.5px; color: var(--ui-muted); margin: 0 0 10px; }
.cv-info p { margin: 0 0 4px; }
.cv-link { appearance: none; border: 0; background: none; padding: 0; color: var(--ui-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cv-checks { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 6px; color: var(--ui-text); font-weight: 700; }
.cv-pips { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 3px; }
.cv-pips i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ui-muted); }
.cv-pips i.on { background: #ff6b81; border-color: #ff6b81; box-shadow: 0 0 6px rgba(255,107,129,.6); }
.cv-moves { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 28px 1fr 1fr; gap: 2px 6px; font-size: 13px; max-height: 300px; overflow: auto; font-variant-numeric: tabular-nums; }
.cv-moves li { display: contents; } .cv-moves .n { color: var(--ui-muted); } .cv-moves span { padding: 1px 4px; border-radius: 3px; white-space: nowrap; } .cv-moves span.cur { background: var(--ui-line); color: var(--ui-strong); }
.cv-record { margin-top: 12px; font-size: 12px; color: var(--ui-muted); }
.cv-thinking { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ui-accent); margin-left: 6px; animation: cv-pulse .8s infinite alternate; }
@keyframes cv-pulse { to { opacity: 0.2; } }
.cv-overlay { position: fixed; inset: 0; background: rgba(2,5,14,0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.cv-overlay:not([hidden]) .cv-dialog { animation: cv-pop .18s ease-out; }
@keyframes cv-pop { from { transform: scale(.94); opacity: 0; } }
.cv-dialog { background: var(--ui-bg); color: var(--ui-text); border: 1px solid var(--ui-line); border-radius: 14px; padding: 22px; width: min(100%, 420px); max-height: calc(100% - 16px); overflow: auto; text-align: center; box-shadow: 0 24px 60px var(--ui-shadow); }
.cv-dialog h3 { margin: 0 0 4px; color: var(--ui-strong); font-size: 22px; }
.cv-dialog p { margin: 0 0 14px; color: var(--ui-muted); }
.cv-dialog .cv-tag { color: var(--ui-accent); font-weight: 700; margin-bottom: 10px; }
.cv-rules { text-align: left; margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; }
.cv-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cv-actions .cv-btn { padding: 10px 16px; font-size: 14px; }
@media (max-width: 760px) {   /* phones: the status sits above the board, the move list becomes a strip below it */
  .cv-variants { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cv-main { grid-template-columns: 1fr; gap: 6px; }
  .cv-side { display: contents; }
  .cv-head { order: -1; margin: 0; align-items: center; }
  .cv-status { text-align: left; font-size: 15px; }
  .cv-icons { max-width: none; flex-wrap: nowrap; }
  .cv-info { order: 1; margin: 2px 0 0; text-align: center; }
  .cv-checks { justify-content: center; }
  .cv-moves:empty { display: none; }
  .cv-moves { order: 1; display: flex; gap: 2px 10px; overflow-x: auto; max-height: none; padding: 6px 2px; scrollbar-width: none; }
  .cv-moves::-webkit-scrollbar { display: none; }
  .cv-moves li { display: flex; gap: 4px; flex: none; }
  .cv-record { order: 2; text-align: center; margin: 0; }
  .cv-side > .ol-bar { order: -2; margin: 0; }
  .cv-tools { margin-left: 0; width: 100%; } .cv-tools .cv-btn { flex: 1 1 0; }
  .cv-opts label { flex: 1 1 140px; } .cv-opts select { flex: 1 1 auto; }
}
@media (max-width: 420px) { .cv-v small { display: none; } .cv-v { min-height: 40px; } }
/* full screen (.cv-fit, set by game.js inside the site's immersive stage): no page scrolling, the board sized to fit */
.cv.cv-fit { max-width: none; height: 100%; margin: 0; padding: 6px 4px 8px; display: flex; flex-direction: column; overflow: hidden; border-radius: 0; }
.cv-fit .cv-top { flex: none; margin: 0 0 6px; gap: 5px; }
.cv-fit .cv-v small { display: none; } .cv-fit .cv-v { min-height: 36px; }
.cv-fit .cv-btn { padding: 6px 10px; font-size: 12.5px; }
.cv-fit .cv-main { flex: 1 1 auto; min-height: 0; gap: 6px; align-items: stretch; }
.cv-fit .cv-boardwrap { min-width: 0; min-height: 0; max-width: none; width: auto; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cv-fit .cv-board, .cv-fit .cv-bar { width: var(--cv-bs); flex: none; }
.cv-fit .cv-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv.cv-port { justify-content: center; }
.cv-port .cv-main { flex: 0 0 auto; grid-template-columns: minmax(0, 1fr); }
.cv-port .cv-side { display: contents; }
.cv-port .cv-head { order: -1; margin: 0; align-items: center; } .cv-port .cv-icons { max-width: none; flex-wrap: nowrap; }
.cv-port .cv-info { display: none; }
.cv-port .cv-moves, .cv-port .cv-moves:empty { order: 1; display: flex; min-height: 24px; gap: 2px 10px; overflow-x: auto; max-height: none; padding: 2px; scrollbar-width: none; }
.cv-port .cv-moves li { display: flex; gap: 4px; flex: none; }
.cv-port .cv-record { display: none; }
.cv-port .cv-side > .ol-bar { order: -2; margin: 0; }
.cv-fit .ol-bar { padding: 7px 9px; gap: 5px; }
.cv.cv-land { display: grid; grid-template-columns: var(--cv-bs) 270px; grid-template-rows: auto minmax(0, 1fr); gap: 6px 14px; padding: 6px; height: auto; flex: 0 0 auto; margin: auto; justify-content: center; }
.cv-land .cv-main { display: contents; }
.cv-land .cv-boardwrap { grid-column: 1; grid-row: 1 / -1; }
.cv-land .cv-top { grid-column: 2; grid-row: 1; margin: 0; }
.cv-land .cv-variants { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cv-land .cv-v b { font-size: 12.5px; }
.cv-land .cv-opts { gap: 4px; } .cv-land .cv-tools { width: 100%; } .cv-land .cv-tools .cv-btn { flex: 1 1 auto; }
.cv-land .cv-side { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; height: 0; min-height: 100%; padding: 10px; overflow: hidden; }
.cv-land .cv-moves { display: grid; flex: 1 1 auto; min-height: 0; max-height: none; align-content: start; }
.cv-land .cv-moves li { display: contents; }
.cv-land .cv-side > .ol-bar { flex: none; margin: 0 0 8px; }
.cv-fit .cv-tray .cv-lost { width: min(18px, calc(var(--cv-bs) / 19)); height: min(18px, calc(var(--cv-bs) / 19)); flex: none; }
.cv-fit .cv-tray { flex-wrap: nowrap; overflow: hidden; }
.cv-fit .cv-pk { width: min(38px, calc(var(--cv-bs) / 9)); height: min(38px, calc(var(--cv-bs) / 9)); }
@media (pointer: coarse) { .cv-btn, .cv-opts select { min-height: 42px; } .cv-icons .rb-icon { width: 40px; height: 40px; } }
@media (prefers-reduced-motion: reduce) { .cv-thinking, .cv-overlay:not([hidden]) .cv-dialog, .cv-clock.low.run { animation: none; } }
