/* Puzzles (Sudoku, 2048, Minesweeper) and the head-to-head quizzes (games/puzzle.js, games/quiz.js). */
.pz { max-width: 460px; margin: 0 auto; }
.pz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pz-head .chips { padding: 0; }
.pz .gm-status { text-align: center; font-weight: 700; margin: 10px 0; }
.sd-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.sd-tools .btn.on, .pz .btn.on { background: var(--me-tint); box-shadow: inset 0 0 0 2px var(--me); }

/* sudoku */
.sd-board { display: grid; grid-template-columns: repeat(9, 1fr); border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--raised); user-select: none; }
.sd-c { aspect-ratio: 1; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: transparent; color: var(--me-strong, var(--me)); font: 700 clamp(1rem, 5vw, 1.4rem) var(--display, inherit); padding: 0; cursor: pointer; display: grid; place-items: center; min-width: 0; }
.sd-c.given { color: var(--ink); }
.sd-c.br { border-right: 2px solid var(--ink); }
.sd-c.bb { border-bottom: 2px solid var(--ink); }
.sd-c:nth-child(9n) { border-right: 0; }
.sd-c:nth-child(n+73) { border-bottom: 0; }
.sd-c.peer { background: color-mix(in srgb, var(--me) 7%, transparent); }
.sd-c.same { background: color-mix(in srgb, var(--me) 18%, transparent); }
.sd-c.sel { background: var(--me-tint); box-shadow: inset 0 0 0 2px var(--me); }
.sd-c.wrong { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.sd-notes { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; font: 600 clamp(.45rem, 2vw, .62rem)/1 system-ui, sans-serif; color: var(--ink-soft); }
.sd-notes i { font-style: normal; display: grid; place-items: center; }
.sd-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sd-pad button { height: 48px; border-radius: 12px; border: 1px solid var(--rule); background: var(--raised); color: var(--ink); font: 700 1.25rem var(--display, inherit); cursor: pointer; }
.sd-pad button:active { transform: scale(.95); }

/* 2048 */
.g48-score { display: grid; text-align: center; padding: 4px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--rule); }
.g48-score b { font-size: 1.3rem; }
.g48-wrap { position: relative; margin-top: 10px; }
.g48-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 14%, var(--paper)); touch-action: none; user-select: none; outline: none; }
.g48-c { aspect-ratio: 1; border-radius: 10px; background: color-mix(in srgb, var(--paper) 70%, var(--rule)); display: grid; place-items: center; font: 800 clamp(1.1rem, 7vw, 2rem) var(--display, inherit); color: #5b4636; }
.g48-c.new { animation: g48-pop .18s ease-out; }
.g48-c.merged { animation: g48-bump .2s ease-out; }
@keyframes g48-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes g48-bump { 50% { transform: scale(1.14); } }
.g48-c.t2 { background: #fdf3e7; } .g48-c.t4 { background: #fbe4c8; }
.g48-c.t8 { background: #f8b98a; color: #fff; } .g48-c.t16 { background: #f59a6b; color: #fff; }
.g48-c.t32 { background: #f47c6a; color: #fff; } .g48-c.t64 { background: #ee5b5b; color: #fff; }
.g48-c.t128 { background: #f1cf6b; color: #fff; font-size: clamp(1rem, 6vw, 1.7rem); } .g48-c.t256 { background: #efc650; color: #fff; font-size: clamp(1rem, 6vw, 1.7rem); }
.g48-c.t512 { background: #e9b93a; color: #fff; font-size: clamp(1rem, 6vw, 1.7rem); }
.g48-c.t1024, .g48-c.t2048, .g48-c.t4096 { background: linear-gradient(135deg, var(--me), #f2b33d); color: #fff; font-size: clamp(.85rem, 5vw, 1.4rem); box-shadow: 0 0 18px var(--glow, rgba(0,0,0,.2)); }
.g48-msg { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 8px; border-radius: 16px; background: color-mix(in srgb, var(--paper) 78%, transparent); font-weight: 800; font-size: 1.2rem; }
.g48-msg.on { display: grid; animation: g48-pop .25s ease-out; }

/* minesweeper */
.ms-bar { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; font-weight: 700; }
.ms-reset { font-size: 1.8rem; background: none; border: 0; cursor: pointer; }
.ms-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.ms-board { display: grid; grid-template-columns: repeat(var(--cols), minmax(26px, 1fr)); gap: 2px; min-width: calc(var(--cols) * 28px); user-select: none; -webkit-touch-callout: none; }
.ms-c { aspect-ratio: 1; border: 0; border-radius: 5px; padding: 0; background: color-mix(in srgb, var(--me) 26%, var(--raised)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); font: 800 clamp(.75rem, 3.6vw, 1rem) system-ui, sans-serif; cursor: pointer; color: var(--ink); touch-action: manipulation; }
.ms-c.open { background: var(--raised); box-shadow: inset 0 0 0 1px var(--rule); cursor: default; }
.ms-c.boom { background: var(--bad); }
.ms-c.bad { background: color-mix(in srgb, var(--bad) 25%, var(--raised)); }
.ms-c.n1 { color: #3b82f6; } .ms-c.n2 { color: #10b981; } .ms-c.n3 { color: #ef4444; } .ms-c.n4 { color: #6d28d9; }
.ms-c.n5 { color: #b45309; } .ms-c.n6 { color: #0891b2; } .ms-c.n7 { color: var(--ink); } .ms-c.n8 { color: var(--ink-soft); }

/* quizzes */
.qz { max-width: 460px; margin: 0 auto; display: grid; gap: 12px; }
.qz-tally { display: flex; justify-content: center; gap: 16px; }
.qz-tally span { padding: 4px 12px; border-radius: 99px; background: var(--raised); border: 1px solid var(--rule); }
.qz-tally span.in { border-color: var(--good); }
.qz-timer { display: flex; align-items: center; gap: 8px; }
.qz-clock { flex: 1; height: 8px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.qz-clock i { display: block; height: 100%; background: var(--me); transition: width .25s linear; }
.qz-clock.low i { background: var(--bad); }
.qz-secs { min-width: 2.5em; text-align: right; color: var(--ink-soft); }
.qz-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.qz-tiles span { width: 40px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: var(--me-tint); border: 1px solid var(--me); font: 800 1.4rem var(--display, inherit); color: var(--ink); animation: g48-pop .25s ease-out; }
.qz-row { display: flex; gap: 8px; margin-bottom: 8px; }
.qz-input { flex: 1; min-width: 0; text-transform: uppercase; font-weight: 700; letter-spacing: .08em; }
.qz-scr { display: grid; justify-items: stretch; }
.qz-scr > .btn.ghost { justify-self: center; }
.qz-question { font-weight: 800; font-size: 1.15rem; text-align: center; margin: 4px 0 12px; }
.qz-opts { display: grid; gap: 8px; }
.qz-opt { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--rule); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.qz-opt b { color: var(--me); margin-right: 4px; }
.qz-opt:active { transform: scale(.98); }
.qz-opt:disabled { opacity: .55; cursor: default; }
.qz-last { padding: 10px 12px; border-radius: 14px; background: var(--raised); border: 1px solid var(--rule); display: grid; gap: 6px; }
.qz-last-row { display: flex; gap: 12px; flex-wrap: wrap; }
.qz-last-row .ok { color: var(--good); } .qz-last-row .no { color: var(--bad); }
.qz-last-row small { color: var(--ink-soft); }
.qz-review { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.qz-review small { color: var(--ink-soft); }
