/* Daily Wordle and Daily Connections. Tokens come from /style.css and /site.css. */
.ar-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); }
.ar-stats { display: flex; gap: var(--sp-lg); }
.ar-stat { display: grid; gap: 1px; }
.ar-stat strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.ar-stat span { font-size: 12px; color: var(--muted); }
.ar-intro { margin: 0; text-align: center; }
.ar-msg { justify-self: center; padding: 8px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 14px; animation: pop 200ms var(--ease-out) both; }
.ar-result { display: grid; gap: var(--sp-sm); justify-items: center; text-align: center; background: linear-gradient(rgb(var(--tint) / .14), rgb(var(--tint) / .14)), var(--surface); }
.ar-headline { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.ar-pts { display: flex; gap: var(--sp-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.ar-pts .streak { color: var(--bad); }
.lb-col { display: grid; gap: 1px; }
.lb-col .meta { font-size: 12px; }

/* ---- wordle ---- */
:root { --wd-correct: #1f9d55; --wd-present: #d9741f; --wd-absent: #6b7380; }
@media (prefers-color-scheme: dark) { :root { --wd-correct: #2fb768; --wd-present: #e08a3a; --wd-absent: #4a5361; } }
.wd-board { display: grid; gap: 6px; width: min(100%, 340px); margin-inline: auto; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-tile { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 2px solid var(--line); font-size: clamp(24px, 8vw, 32px); font-weight: 900; text-transform: uppercase; color: var(--fg); transition: transform 120ms var(--ease-out), border-color 120ms; }
.wd-tile.filled { border-color: var(--faint); transform: scale(1.04); }
.wd-tile.correct, .wd-tile.present, .wd-tile.absent { color: #fff; border-color: transparent; transform: none; }
.wd-tile.correct { background: var(--wd-correct); --fill: var(--wd-correct); }
.wd-tile.present { background: var(--wd-present); --fill: var(--wd-present); }
.wd-tile.absent { background: var(--wd-absent); --fill: var(--wd-absent); }
.wd-tile.flip { animation: wd-flip 600ms var(--ease-in-out) both; }
@keyframes wd-flip {
  0% { transform: rotateX(0); background: transparent; color: var(--fg); border-color: var(--faint); }
  49% { transform: rotateX(90deg); background: transparent; color: var(--fg); border-color: var(--faint); }
  50% { background: var(--fill); color: #fff; border-color: transparent; }
  100% { transform: rotateX(0); background: var(--fill); color: #fff; border-color: transparent; }
}
.shake { animation: ar-shake 350ms linear; }
@keyframes ar-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.wd-kb { display: grid; gap: 6px; width: min(100%, 500px); margin-inline: auto; }
.wd-kr { display: flex; gap: 5px; justify-content: center; }
.wd-key { flex: 1 1 0; min-width: 0; height: 52px; border-radius: 8px; background: var(--line); color: var(--fg); font-size: 15px; font-weight: 800; transition: transform 120ms var(--ease-out), background-color 160ms; }
.wd-key.wide { flex: 1.6 1 0; font-size: 12px; }
.wd-key:active { transform: scale(.94); }
.wd-key.correct { background: var(--wd-correct); color: #fff; }
.wd-key.present { background: var(--wd-present); color: #fff; }
.wd-key.absent { background: var(--wd-absent); color: #fff; }
@media (hover: hover) and (pointer: fine) { .wd-key:not(.correct):not(.present):not(.absent):hover { background: rgb(var(--acc) / .3); } }

/* ---- connections ---- */
.cn-solved { display: grid; gap: 8px; }
.cn-solved:empty { display: none; }
.cn-group { display: grid; gap: 2px; place-content: center; min-height: 64px; padding: 8px 12px; border-radius: 10px; text-align: center; color: #14161c; animation: pop 320ms var(--ease-out) both; }
.cn-group strong { font-size: 14px; font-weight: 900; letter-spacing: .02em; }
.cn-group span { font-size: 14px; font-weight: 600; }
.cn-group.yellow { background: #f9df6d; }
.cn-group.green { background: #a0c35a; }
.cn-group.blue { background: #8fb5f0; }
.cn-group.purple { background: #c08fd0; }
.cn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cn-tile { display: grid; place-items: center; min-height: 64px; padding: 4px; border-radius: 10px; background: var(--line); color: var(--fg); font-size: 13px; font-weight: 800; text-transform: uppercase; overflow-wrap: anywhere; transition: transform 140ms var(--ease-out), background-color 160ms, color 160ms; }
.cn-tile:active:not(:disabled) { transform: scale(.96); }
.cn-tile.on { background: var(--fg); color: var(--bg); }
.cn-tile:disabled { cursor: default; }
@media (min-width: 480px) { .cn-tile { font-size: 15px; min-height: 76px; } }
.cn-controls { display: grid; gap: var(--sp-sm); justify-items: center; }
.cn-dots { display: flex; align-items: center; gap: 6px; }
.cn-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--faint); }
.cn-dot.on { background: var(--fg); border-color: var(--fg); }
.cn-actions { display: flex; gap: var(--sp-sm); flex-wrap: wrap; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .wd-tile.flip { animation-duration: 1ms; } .shake { animation: none; } }

/* ---- stacker ---- */
.sk-board { display: flex; justify-content: center; padding-right: 28px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sk-frame { container-type: inline-size; flex: 0 1 320px; min-width: 0; }
.sk-wrap { --cell: calc((100cqw - 24px) / 7); position: relative; }
.sk-grid { display: grid; grid-template-columns: repeat(7, var(--cell)); grid-auto-rows: var(--cell); gap: 4px; }
.sk-cell { border-radius: 5px; background: var(--line); transition: background-color 90ms; }
.sk-cell.prize { background: rgb(243 162 0 / .22); }
.sk-cell.on { background: var(--l-arcade, #d6336c); }
.sk-cell.moving { background: var(--fg); }
.sk-falling { position: absolute; inset: 0; pointer-events: none; }
.sk-piece { position: absolute; top: calc((14 - var(--row)) * (var(--cell) + 4px)); left: calc(var(--c) * (var(--cell) + 4px)); width: calc(var(--w) * (var(--cell) + 4px) - 4px); height: var(--cell); border-radius: 5px; background: var(--fg); animation: sk-fall 1s cubic-bezier(.5, 0, 1, .6) forwards; }
.sk-piece.miss { background: var(--bad); }
@keyframes sk-fall { to { transform: translate(calc(var(--dir) * 14px), 420px) rotate(calc(var(--dir) * -38deg)); opacity: 0; } }
.sk-marks span { position: absolute; left: calc(100% + 6px); top: calc((14 - var(--row)) * (var(--cell) + 4px) + var(--cell) / 3); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; color: #b36b00; }
@media (prefers-color-scheme: dark) { .sk-marks span { color: #ffbf3d; } }
.sk-actions { display: flex; justify-content: center; align-items: center; min-height: 56px; }
.sk-stop { min-width: 220px; min-height: 56px; font-size: 20px; font-weight: 900; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .sk-piece { animation-duration: 1ms; } }

/* ---- pwappy bird ---- */
.pw-stage { position: relative; width: min(100%, 360px, calc((100dvh - 280px) * .6)); min-width: 220px; margin-inline: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pw-canvas { display: block; width: 100%; aspect-ratio: 360 / 600; border-radius: 18px; border: 1px solid var(--glass-edge); background: #6bb3e6; cursor: pointer; }
.pw-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--sp-md); border-radius: 18px; background: rgb(0 0 0 / .12); }
.pw-box { display: grid; gap: var(--sp-md); justify-items: center; width: 100%; max-width: 260px; }
.pw-box .ar-result { width: 100%; }
