/* OVER THE BOARD. Chakra Petch + Outfit, dark, phone first. Tokens come from fv.css. */

/* ---------------------------------------------------------------- the Games card and the games page */
.card.tile.gcard .frame { aspect-ratio: 16 / 9; background: #0b0b10; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: clamp(10px, 1.2vw, 18px); padding: 0 var(--gutter) clamp(28px, 4vw, 70px); }
.gcards .card.tile { width: auto; }
.otb-art {
  position: absolute; inset: 0; display: block; overflow: hidden;
  background:
    radial-gradient(90% 100% at 92% 0%, rgba(250, 96, 16, .34), rgba(250, 96, 16, 0) 62%),
    radial-gradient(80% 90% at 0% 100%, rgba(44, 232, 128, .2), rgba(44, 232, 128, 0) 62%),
    repeating-conic-gradient(#12121a 0 25%, #1a1a27 0 50%) 0 0 / 25% 50%;
}
.otb-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7, 7, 11, .75), rgba(7, 7, 11, 0) 55%); }
.otb-art .ttl { position: absolute; z-index: 2; left: 6%; top: 9%; font: 700 clamp(16px, 7.2cqw, 36px)/.94 var(--display); letter-spacing: .02em; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.otb-art .faces { position: absolute; z-index: 1; right: 4%; bottom: 19%; display: flex; align-items: flex-end; }
.otb-art .faces img { width: 21cqw; flex: none; margin-left: -6.5cqw; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); }
.otb-art .faces img:nth-child(odd) { margin-bottom: 4cqw; }
@container (max-width: 330px) {
  .otb-art .ttl { display: none; }
  .otb-art .faces { right: 50%; transform: translateX(50%); bottom: auto; top: 9%; }
  .otb-art .faces img { width: 24cqw; margin-left: -8cqw; }
}
.card.gcard:hover .otb-art .faces img { transform: translateY(-2px); }
.otb-art .faces img { transition: transform .35s cubic-bezier(.2, .7, .2, 1); }

/* ---------------------------------------------------------------- the ladder */
.otb-page .crumbs { margin-bottom: 10px; }
.otb-prog { margin-top: 10px !important; font-weight: 600; color: var(--gold); }
.otb-ladder { display: grid; gap: clamp(8px, 1vw, 14px); padding: 0 var(--gutter); grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.otb-card {
  --fw: clamp(78px, 24vw, 112px);
  position: relative; display: grid; grid-template-columns: var(--fw) minmax(0, 1fr); grid-template-areas: 'face nm' 'face sp' 'face tg' 'face lv' 'face st';
  column-gap: clamp(10px, 1.4vw, 16px); row-gap: 3px; align-content: start; padding: 14px 14px 14px 12px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), border-color .2s, box-shadow .25s;
}
.otb-card .face { grid-area: face; align-self: start; }
.otb-card .face img { width: 100%; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
.otb-card .no { position: absolute; top: 9px; right: 13px; font: 700 15px/1 var(--display); opacity: .45; }
.otb-card .nm { grid-area: nm; font: 600 clamp(17px, 1.3vw + 11px, 22px)/1.15 var(--display); padding-right: 22px; }
.otb-card .sp { grid-area: sp; font-size: var(--fs-small); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--bc); }
.otb-card .tg { grid-area: tg; font-size: var(--fs-small); line-height: 1.35; margin-top: 2px; }
.otb-card .lv { grid-area: lv; display: flex; gap: 2px; margin-top: 8px; align-items: flex-end; }
.otb-card .lv i { width: 6px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .16); }
.otb-card .lv i.on { background: var(--bc); }
.otb-card .st { grid-area: st; display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-small); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.otb-card .st svg { width: 1.2em; height: 1.2em; color: var(--green); }
a.otb-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .4); }
.otb-card.is-next { border-color: var(--bc); box-shadow: 0 0 0 1px var(--bc), 0 22px 54px -26px var(--bc); background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); }
.otb-card.is-next .st { color: var(--orange); }
.otb-card.is-beaten .st { color: var(--green); }
.otb-card.is-locked { cursor: not-allowed; }
.otb-card.is-locked { background: rgba(255, 255, 255, .02); border-style: dashed; }
.otb-card.is-locked .nm, .otb-card.is-locked .sp, .otb-card.is-locked .tg, .otb-card.is-locked .lv { opacity: .5; }
.otb-card.is-locked .st { opacity: .75; }
.otb-card.is-locked .face { position: relative; }
.otb-card.is-locked .face::after { content: ''; position: absolute; right: 2%; bottom: 4%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: #0d0d14 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / 58% no-repeat; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }

.otb-foot { padding: clamp(24px, 3vw, 48px) var(--gutter) clamp(24px, 3vw, 56px); display: grid; gap: 22px; }
.otb-preview, .otb-sw { display: inline-flex; align-items: center; gap: 10px; align-self: start; justify-self: start; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); font-size: var(--fs-small); font-weight: 500; }
.otb-preview:hover, .otb-sw:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.otb-preview .knob, .otb-sw .knob { position: relative; flex: none; width: 2.3em; height: 1.3em; border-radius: 999px; background: rgba(255, 255, 255, .28); transition: background .2s; }
.otb-preview .knob::after, .otb-sw .knob::after { content: ''; position: absolute; left: .17em; top: .17em; width: .96em; height: .96em; border-radius: 50%; background: #fff; transition: transform .2s; }
.otb-preview[aria-checked="true"] .knob, .otb-sw[aria-checked="true"] .knob { background: var(--green); }
.otb-preview[aria-checked="true"] .knob::after, .otb-sw[aria-checked="true"] .knob::after { transform: translateX(1em); background: #031; }
.otb-sw:disabled { opacity: .5; cursor: not-allowed; }

.otb-credits { max-width: 880px; font-size: var(--fs-small); }
.otb-credits summary { cursor: pointer; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; padding: 6px 0; }
.otb-credits summary:hover { opacity: 1; }
.otb-credits .cr-in { padding-top: 8px; }
.otb-credits p { margin: 0 0 12px; max-width: 70ch; line-height: 1.5; }
.otb-credits h3 { margin: 18px 0 2px; font-size: calc(var(--fs-body) * 1.05); }
.otb-credits h3 small { font: 500 var(--fs-small)/1 var(--ui); opacity: .75; margin-left: 6px; }
.otb-credits a { border-bottom: 1px solid rgba(255, 255, 255, .4); }
.otb-credits pre { margin: 8px 0 0; padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 240px; overflow: auto; scrollbar-width: none; }
.otb-credits pre::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------- the table */
.otb-table { --bsz: min(calc(100vw - 2 * var(--gutter)), calc(100vh - var(--bar-h) - 170px), 980px); }
.otb-head { display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter); margin-bottom: 10px; font-size: var(--fs-small); }
.otb-head .back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); font-weight: 500; }
.otb-head .back:hover { background: rgba(255, 255, 255, .16); }
.otb-head .back svg { width: 1.3em; height: 1.3em; }
.otb-head .lvl { font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--bc); }

.otb-grid { display: grid; gap: clamp(12px, 2vw, 36px); padding: 0 var(--gutter); justify-content: center; align-items: start;
  grid-template-columns: var(--bsz) minmax(300px, 480px); grid-template-rows: auto auto 1fr; align-content: start; grid-template-areas: 'board talk' 'board over' 'board side'; }
.otb-talk { grid-area: talk; }
.otb-boardcol { grid-area: board; width: var(--bsz); }
.otb-side { grid-area: side; }
.otb-over { grid-area: over; }

.otb-talk { display: flex; gap: 14px; align-items: flex-start; }
.otb-talk .face { flex: none; width: clamp(84px, 11vw, 150px); }
.otb-talk .face img { width: 100%; filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--bc) 45%, transparent)); }
.bubble { position: relative; flex: 1; min-width: 0; min-height: clamp(86px, 8vw, 118px); padding: 12px 16px 14px; border-radius: 18px; background: #14141d; border: 1px solid #3a3a4c; border: 1px solid color-mix(in srgb, var(--bc) 62%, #2c2c3a); box-shadow: 0 18px 40px -26px #000; }
.bubble::before { content: ''; position: absolute; left: -8px; top: 28px; width: 14px; height: 14px; background: #14141d; border-left: 1px solid #3a3a4c; border-bottom: 1px solid #3a3a4c; border-left-color: color-mix(in srgb, var(--bc) 62%, #2c2c3a); border-bottom-color: color-mix(in srgb, var(--bc) 62%, #2c2c3a); transform: rotate(45deg); }
.bubble .who { display: block; margin-bottom: 6px; font-size: var(--fs-small); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--bc); }
.bubble p { margin: 0; font-size: clamp(16px, .55vw + 12px, 20px); line-height: 1.4; text-wrap: pretty; }
.bubble[data-kind="error"] { border-color: #ff6b5b; }
.bubble .dots { display: none; position: absolute; right: 16px; top: 14px; gap: 5px; }
.bubble .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--bc); animation: otbDot 1.1s infinite ease-in-out; }
.bubble .dots i:nth-child(2) { animation-delay: .15s; }
.bubble .dots i:nth-child(3) { animation-delay: .3s; }
.bubble.thinking p { opacity: .28; }
.bubble.thinking .dots { display: flex; }
.bubble.pop p { animation: otbPop .38s cubic-bezier(.2, .9, .3, 1.15) backwards; }
.otb-talk .face.bump img { animation: faceBump .42s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes faceBump { 0% { transform: none; } 30% { transform: translateY(-5px) rotate(-2.5deg) scale(1.03); } 100% { transform: none; } }
.bubble .ghost { margin-top: 10px; }
@keyframes otbDot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes otbPop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

.otb-strip { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 2px; font-size: var(--fs-small); }
.otb-strip .who { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.otb-strip.opp .who { color: var(--bc); }
.otb-strip .tray { display: flex; align-items: center; min-width: 0; }
.otb-strip .tray svg { width: 20px; height: 20px; margin-right: -9px; flex: none; }
.otb-strip .tray em { margin-left: 14px; font-style: normal; font-weight: 600; opacity: .85; }
.otb-strip .status { margin-left: auto; font-weight: 600; text-align: right; }

.otb-boardwrap { position: relative; width: var(--bsz); aspect-ratio: 1; border-radius: 12px; background: #0b0b10; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 40px 90px -46px var(--bc); touch-action: manipulation; }
.otb-board { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.otb-board svg { display: block; }
.cm-chessboard.ptu .board .square.white { fill: #dbe3e6; }
.cm-chessboard.ptu .board .square.black { fill: #6b8496; }
.cm-chessboard.ptu .board .border { fill: #6b8496; stroke-width: 0; }
.cm-chessboard.ptu .coordinates .coordinate { font-weight: 600; font-family: var(--ui); }
.cm-chessboard.ptu .coordinates .coordinate.white { fill: #6b8496; }
.cm-chessboard.ptu .coordinates .coordinate.black { fill: #dbe3e6; }
.cm-chessboard-draggable-piece { z-index: 60; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .4)); }

.fxl { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.fxl .marks { position: absolute; inset: 0; }
.mk { position: absolute; width: 12.5%; height: 12.5%; pointer-events: none; }
.mk.last { background: rgba(255, 200, 87, .3); }
.mk.sel { background: rgba(250, 96, 16, .38); box-shadow: inset 0 0 0 2px rgba(250, 96, 16, .95); }
.mk.dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; border-radius: 50%; background: rgba(15, 15, 25, .42); transform: translate(-50%, -50%); }
.mk.cap::after { content: ''; position: absolute; inset: 5%; border-radius: 50%; border: 3px solid rgba(250, 96, 16, .95); }
.mk.check { background: radial-gradient(circle, rgba(255, 52, 52, .8) 0%, rgba(255, 52, 52, .35) 45%, rgba(255, 52, 52, 0) 72%); }
.fx-piece { position: absolute; width: 12.5%; height: 12.5%; transform-origin: 50% 90%; will-change: transform, opacity; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .35)); }
.fx-piece.attacker.q { transform-origin: 50% 58%; }
.fx-piece svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fx-star, .fx-ring, .fx-bit, .fx-slash, .fx-spark { position: absolute; display: block; pointer-events: none; }
.fx-star { width: 24%; aspect-ratio: 1; opacity: 0; }
.fx-star svg, .fx-spark svg { display: block; width: 100%; height: 100%; fill: var(--fx, #ffb347); }
.fx-ring { width: 16%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--fx, #ffb347); opacity: 0; }
.fx-bit { width: var(--s, 3%); aspect-ratio: 1; border-radius: 50%; background: var(--fx, #ffb347); opacity: 0; }
.fx-slash { width: 24%; height: 1.4%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 30%, #fff 70%, rgba(255, 255, 255, 0)); opacity: 0; }
.fx-spark { width: 4.2%; aspect-ratio: 1; opacity: 0; }

.promo { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(7, 7, 11, .6); border-radius: 12px; pointer-events: auto; }
.promo[hidden] { display: none; }
.promo .pm { display: grid; gap: 10px; justify-items: center; padding: 14px; border-radius: 16px; background: #14141d; border: 1px solid rgba(255, 255, 255, .25); }
.promo .pm b { font: 600 var(--fs-small)/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.promo .pm-row { display: flex; gap: 8px; }
.promo .pm-row button { width: clamp(52px, 11vw, 76px); aspect-ratio: 1; border-radius: 12px; background: #dbe3e6; border: 2px solid transparent; }
.promo .pm-row button:hover, .promo .pm-row button:focus-visible { border-color: var(--orange); }
.promo .pm-row svg { width: 100%; height: 100%; }

.otb-side { display: grid; gap: 12px; }
.otb-side .meta { display: grid; gap: 2px; font-size: var(--fs-small); }
.otb-side .meta b { font: 600 var(--fs-row)/1.2 var(--display); }
.otb-side .meta span { opacity: .9; }
.otb-side .meta .tg { margin-top: 2px; }
.moves:empty { display: none; }
.moves { list-style: none; margin: 0; padding: 8px 12px; max-height: clamp(110px, 24vh, 220px); overflow: auto; scrollbar-width: none; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 14px; line-height: 1.75; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); align-content: start; }
.moves::-webkit-scrollbar { display: none; }
.moves li { display: flex; gap: 8px; }
.moves .n { width: 1.9em; opacity: .5; }
.moves li span:nth-child(2), .moves li span:nth-child(3) { min-width: 3.4em; }
.otb-side .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.otb-side .toggles { display: flex; flex-wrap: wrap; gap: 8px; }

.otb-over { margin: 0; }
.otb-over[hidden] { display: none; }
.ov-card { display: grid; gap: 10px; padding: 16px 18px 18px; border-radius: 18px; background: linear-gradient(180deg, #1b1b27, #12121a); border: 1px solid color-mix(in srgb, var(--bc) 55%, #2c2c3a); box-shadow: 0 24px 50px -30px #000; animation: otbPop .4s cubic-bezier(.2, .9, .3, 1.1) both; }
.ov-card[data-kind="win"], .ov-card[data-kind="resign"] { border-color: var(--green); }
.ov-card .kicker { color: var(--orange); }
.ov-card[data-kind="win"] .kicker, .ov-card[data-kind="resign"] .kicker { color: var(--green); }
.ov-card h2 { margin: 0; font-size: clamp(22px, 1.4vw + 14px, 32px); line-height: 1.08; }
.ov-card p { margin: 0; }
.ov-card .nx { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.ov-card .nx img { width: 60px; flex: none; }
.ov-card .nx p { display: grid; gap: 1px; }
.ov-card .nx span { font-size: var(--fs-small); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.ov-card .nx b { font: 600 var(--fs-row)/1.15 var(--display); }
.ov-card .nx small { font-size: var(--fs-small); }
.ov-card .btns { margin-top: 4px; }

@media (max-width: 899px) {
  .otb-table { --bsz: calc(100vw - 2 * var(--gutter)); }
  .otb-grid { grid-template-columns: var(--bsz); grid-template-rows: none; grid-template-areas: 'talk' 'board' 'over' 'side'; gap: 10px; }
  .otb-talk { gap: 10px; }
  .otb-talk .face { width: clamp(66px, 20vw, 96px); }
  .bubble { min-height: 0; padding: 10px 13px 12px; }
  .bubble::before { top: 22px; }
  .bubble p { font-size: 16px; }
  .otb-side .meta { display: none; }
  .moves { max-height: 74px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); font-size: 13px; }
  .otb-head { margin-bottom: 8px; }
  .otb-foot { padding-top: 16px; }
}
@media (min-width: 900px) and (max-width: 1180px) { .otb-grid { grid-template-columns: var(--bsz) minmax(260px, 1fr); } .otb-talk .face { width: 100px; } }
@media (prefers-reduced-motion: reduce) { .bubble.pop p, .ov-card, .otb-talk .face.bump img { animation: none; } .bubble .dots i { animation: none; } }
body.has-player .otb-foot { padding-bottom: 96px; }

/* the header has one more link now (Games): on a narrow laptop, the "I'd watch" label gives way so nothing is pushed off the bar */
@media (min-width: 901px) and (max-width: 1040px) { .bar .mylist-link .lbl { display: none; } }
@media (min-width: 901px) and (max-width: 940px) { .bar nav { gap: 10px; } }
