/* Visor d'escacs (landing, articles i previsualització del panell) */
.viewer { --v-fg: #0B1710; --v-mut: #5a6b5f; --v-card: #fff; --v-accent: #D2481F; --v-line: rgba(14,42,28,.25); --v-btn: #0E2A1C; --v-btnfg: #F3EFE4;
  width: 100%; max-width: 560px; margin: 1.4em 0; color: var(--v-fg); font-family: 'Bricolage Grotesque', system-ui, sans-serif; }
.blog .viewer, .dark .viewer { --v-fg: #F3EFE4; --v-mut: rgba(243,239,228,.65); --v-card: rgba(243,239,228,.07); --v-accent: #CDF26B; --v-line: rgba(243,239,228,.3); --v-btn: #CDF26B; --v-btnfg: #0B1710; }
.viewer .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.viewer button { font: inherit; color: inherit; }
.v-head { margin-bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
.v-head b { font-family: 'Instrument Serif', serif; font-size: 1.5rem; font-weight: 400; line-height: 1.15; }
.v-head span { font-size: .88rem; color: var(--v-mut); }
.v-modes { display: inline-flex; background: rgba(128,128,128,.14); border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.v-modes button { border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: .9rem; }
.v-modes button.on { background: var(--v-btn); color: var(--v-btnfg); }

/* Tauler: files i columnes de mida fixa; la peça no pot canviar mai la mida de la casella */
.vb { width: 100%; aspect-ratio: 1 / 1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr));
  container-type: inline-size; border: 6px solid #0E2A1C; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(14,42,28,.28); background: #0E2A1C; box-sizing: border-box; }
.vs { all: unset; box-sizing: border-box; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; cursor: pointer;
  background: #EAE2CE; -webkit-tap-highlight-color: transparent; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'DejaVu Sans', serif; font-size: 9.4cqw; line-height: 1; user-select: none; }
.vs.d { background: #5F8A6B; }
.vs .pc { display: block; line-height: 1; font-variant-emoji: text; }
.vs em { position: absolute; font: 600 clamp(8px, 1.9cqw, 11px) 'Bricolage Grotesque', sans-serif; font-style: normal; color: #0E2A1C; opacity: .6; pointer-events: none; }
.vs .rk { top: 2px; left: 3px; }
.vs .fl { bottom: 2px; right: 4px; }
.vs.w { color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 3px #000; }
.vs.b { color: #0B1710; }
.vs.last { box-shadow: inset 0 0 0 3px rgba(205,242,107,.95); }
.vs.sel { background: #CDF26B; }
.vs.chk { background: radial-gradient(circle, #ff6a3d 0%, #D2481F 55%, transparent 82%), #EAE2CE; }
.vs.hint::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(14,42,28,.4); }
.vs.cap::after { content: ""; position: absolute; inset: 5%; border-radius: 50%; border: .5cqw solid rgba(210,72,31,.75); }
.vs:focus-visible { outline: 3px solid var(--v-accent); outline-offset: -3px; z-index: 1; }

.v-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.v-ctl[hidden] { display: none; }
.v-ctl button { border: 1px solid var(--v-line); background: transparent; border-radius: 999px; min-width: 44px; height: 44px; padding: 0 14px; cursor: pointer; }
.v-ctl button.wide { padding: 0 18px; }
.v-ctl button:hover:not(:disabled) { background: var(--v-btn); color: var(--v-btnfg); }
.v-ctl button:disabled { opacity: .35; cursor: default; }
.v-ctl .flip { margin-left: auto; }
.v-ply { font-size: .85rem; color: var(--v-mut); margin-left: 4px; }

/* Comentari i llista: alçada fixa perquè la pàgina no es mogui mai */
.viewer .v-comment { margin: 12px 0 0; height: 6.2em; overflow-y: auto; background: var(--v-card); border-left: 4px solid var(--v-accent); padding: 10px 14px; border-radius: 6px 14px 14px 6px; font-size: .98rem; line-height: 1.45; color: var(--v-fg); }
.v-moves { margin-top: 10px; height: 104px; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px 4px; align-items: center; position: relative; }
.v-moves.off { opacity: .35; pointer-events: none; }
.v-moves .mn { font-size: .8rem; color: var(--v-mut); margin-left: 6px; }
.v-moves .mv { border: 0; background: transparent; padding: 3px 7px; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.v-moves .mv:hover { background: rgba(128,128,128,.2); }
.v-moves .mv.cur { background: var(--v-btn); color: var(--v-btnfg); }
.v-error { background: #fde3da; color: #8a2a0c; padding: 10px 14px; border-radius: 10px; }
.v-raw { white-space: pre-wrap; font-size: .8rem; opacity: .7; }
