/* ---------- Chess hub, Classic Chess and Puzzles. Board styles come from dicechess/dicechess.css ---------- */

/* hub */
.ch-hub { max-width: 560px; margin: 0 auto; padding: 0 1rem 2rem; }
.ch-hub .hero { padding-top: 1.4rem; }
.ch-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.ch-modes .tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: .9rem; }
.ch-modes .tile.wide .emoji { font-size: 2.8rem; }
.ch-modes .tile.wide > div { display: flex; flex-direction: column; gap: .15rem; }
.ch-modes .tile .stat { margin-top: .2rem; font-size: .8rem; font-weight: 600; color: #fff; background: #0003;
  border-radius: 999px; padding: .1em .6em; align-self: flex-start; }
.ch-modes .tile .stat.done { background: #4fe39a33; color: #b8ffd9; }
.ch-sec { font-family: var(--fun); font-size: 1.05rem; margin: 1.5rem 0 .2rem; color: var(--muted); font-weight: 600; }
.ch-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-top: .5rem; }
.ch-levels a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .55rem .1rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: .72rem; text-align: center; }
.ch-levels a b { font-size: 1.4rem; line-height: 1; }
.ch-levels a small { color: var(--muted); font-size: .62rem; }
.ch-levels a.mine { border-color: var(--accent); box-shadow: 0 0 10px #ffc14555; }
.ch-credit { text-align: center; margin-top: 1.4rem; }

/* move list */
.ch-moves { flex: none; display: flex; gap: .25rem .4rem; align-items: baseline; overflow-x: auto; white-space: nowrap;
  padding: .3rem .6rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  font: .85rem/1.3 system-ui, sans-serif; scrollbar-width: none; cursor: pointer; min-height: 1.9rem; }
.ch-moves::-webkit-scrollbar { display: none; }
.ch-moves.open { flex-wrap: wrap; white-space: normal; max-height: 30dvh; overflow-y: auto; }
.ch-mn { color: var(--muted); font-size: .75rem; }
.ch-mv { font-weight: 600; }
.ch-mv.cur { color: var(--accent); }
.ch .dk-actions { flex-wrap: wrap; }
.ch .dk-actions button.armed { color: var(--bad); border-color: var(--bad); }
.ch .dk-actions button:disabled { opacity: .4; }

/* pieces that can move (subtle — classic chess doesn't need the dice-chess glow) */
.pz.ready { filter: drop-shadow(0 0 .55cqw #ffd54a) drop-shadow(0 .5cqw .4cqw #0007); }

/* promotion picker */
.ch-promo { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: #0008; border-radius: 8px; }
.ch-promo-box { background: var(--panel); border: 2px solid var(--accent); border-radius: 16px; padding: .7rem .8rem; text-align: center;
  font-family: var(--fun); box-shadow: 0 10px 30px #000a; }
.ch-promo-box div { display: flex; gap: .4rem; margin-top: .4rem; }
.pz-btn { width: 15cqw; height: 15cqw; max-width: 72px; max-height: 72px; padding: 0; display: grid; place-items: center; font-size: 11cqw;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", serif; line-height: 1; background: #f1dcb4; border: none; }
.pz-btn.w { color: #fffaf0; -webkit-text-stroke: .3cqw #2b1d10; }
.pz-btn.b { color: #1d1824; }

/* puzzles */
.ch-pbar { flex: none; display: flex; justify-content: space-around; align-items: center; padding: .35rem .5rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); font-family: var(--fun); }
.ch-pbar span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-size: 1rem; }
.ch-pbar small { font: .65rem system-ui, sans-serif; color: var(--muted); }
.ch-rushclock { font-size: 1.7rem !important; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.ch-rushclock.low { color: var(--bad); animation: dangerpulse .8s infinite; }
.ch-pbar .strikes { flex-direction: row !important; gap: .1rem; font-size: .9rem !important; }
.ch-tomove { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; vertical-align: -.25em; margin-right: .2em;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", serif; font-size: .95em; }
.ch-tomove.w { background: #f6ead2; color: #fffaf0; -webkit-text-stroke: 1px #3a2a18; }
.ch-tomove.b { background: #3a2f4f; color: #18141f; -webkit-text-stroke: .7px #8d7fb0; }
.statusbar.win { color: var(--good); }
.sq.chbad::before { content: ""; position: absolute; inset: 0; background: #ff3b3088; }
.sq.chgood::before { content: ""; position: absolute; inset: 0; background: #4fe39a77; }
.dch-board.shake { animation: stuck .4s; }
.btnlink { display: inline-flex; align-items: center; border-radius: 12px; padding: .5em 1.1em; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: .85rem; }
.btnlink.primary { background: linear-gradient(180deg, #ffd36b, var(--accent)); color: var(--accent-ink); border-color: transparent;
  font-family: var(--fun); font-weight: 600; box-shadow: 0 3px 0 #b9801a; font-size: 1rem; }
.ch-intro { text-align: center; max-width: 420px; }
.ch-big { font-size: 4rem; }
.ch-marks { font-size: 1.1rem; letter-spacing: .1em; word-break: break-all; margin: .5rem 0; }
.ch-link { display: block; margin-top: .9rem; }
