/* Discovery, accessibility and multiplayer-ready UI. */
.modal-backdrop{overflow-y:auto;overscroll-behavior:contain}.modal{max-height:calc(100dvh - 24px);overflow-y:auto}
.quick-deck{margin:4px 0 20px;padding:14px;border:1px solid var(--line);border-radius:16px;background:rgba(17,20,42,.72)}
.quick-heading{font-family:"Orbitron",sans-serif;font-size:12px;font-weight:800;letter-spacing:1px;text-transform:uppercase;color:var(--gold);margin-bottom:10px}
.quick-rail{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));gap:9px}
.quick-game{display:flex;align-items:center;gap:9px;min-width:0;padding:9px;border:1px solid rgba(255,255,255,.1);border-left:3px solid var(--card-c,var(--neon));border-radius:12px;background:rgba(255,255,255,.04)}
.quick-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:9px;background:rgba(255,255,255,.08);font-size:21px;flex:0 0 auto}
.quick-copy{display:flex;flex-direction:column;min-width:0;flex:1}.quick-copy strong{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quick-copy small{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.favorite-btn{position:absolute;left:10px;top:10px;z-index:3;width:30px;height:30px;border-radius:999px;background:rgba(0,0,0,.58);border:1px solid rgba(255,194,75,.45);color:var(--gold);font-size:18px;line-height:1}
.favorite-btn:focus-visible,.public-room:focus-visible{outline:3px solid #fff;outline-offset:2px}
.experience-chip{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;border:1px solid rgba(255,255,255,.14);background:rgba(0,0,0,.32);color:#d8dcf3;font-size:11px;font-weight:800;white-space:nowrap}
.ghost-chip{border-color:rgba(192,139,255,.55);color:#d9bfff}.ready-controls{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.settings-body{display:grid;gap:9px;margin:14px 0}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.035);cursor:pointer}.setting-row span{display:flex;flex-direction:column;gap:3px}.setting-row strong{font-size:13px}.setting-row small{color:var(--muted);font-size:11.5px;line-height:1.35}.setting-row input{width:22px;height:22px;accent-color:var(--neon)}
.public-rooms{display:grid;grid-template-columns:1fr;gap:10px;margin:14px 0}.public-room{display:flex;align-items:center;gap:9px;text-align:left;padding:13px;border-radius:13px;border:1px solid var(--line);background:rgba(255,255,255,.045);color:#fff}.public-room:hover{border-color:var(--neon)}.public-room>span:first-child{font-size:28px}.public-room>span:nth-child(2){display:flex;flex:1;flex-direction:column;gap:3px}.public-room small{color:var(--muted)}.match-tools{display:flex;align-items:end;gap:9px;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-radius:12px}.match-tools label{display:grid;gap:4px;font-size:11px;color:var(--muted)}.match-tools select{background:#151936;color:#fff;border:1px solid var(--line);border-radius:8px;padding:8px}
.profile-sync-help{font-size:11px!important;margin-bottom:7px!important}.profile-sync-code{width:100%;resize:vertical;min-height:54px;padding:9px;border-radius:9px;border:1px solid var(--line);background:#0d1022;color:#dce1ff;font:11px ui-monospace,SFMono-Regular,Consolas,monospace}.profile-sync-actions{margin:8px 0 12px!important}
.game-filters{display:flex;gap:8px;overflow-x:auto;padding:0 2px 16px;scrollbar-width:thin}.game-filters button{flex:none;border:1px solid rgba(255,255,255,.14);border-radius:999px;background:rgba(255,255,255,.05);color:#fff;padding:8px 12px;font:700 12px inherit;cursor:pointer}.game-filters button[aria-pressed="true"]{background:#7c5cff;border-color:#a995ff}.card-play{margin-top:auto;border:0;border-radius:9px;padding:8px 12px;background:var(--card-c);color:#080a18;font-weight:900;cursor:pointer}.game-card{display:flex;flex-direction:column}.update-banner{position:fixed;z-index:1200;left:50%;bottom:18px;transform:translateX(-50%);display:flex;gap:10px;align-items:center;padding:12px 14px;border-radius:14px;background:#171a36;border:1px solid #7c5cff;box-shadow:0 16px 60px #000a}.update-banner[hidden]{display:none}.game-loading{padding:48px;text-align:center;color:#c8cbe8}.platform-settings{margin-top:18px;padding-top:12px;border-top:1px solid rgba(255,255,255,.12)}.platform-settings h4{margin:16px 0 4px}.platform-settings p{font-size:12px;color:#aeb4d4}.newgame-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;margin-bottom:14px}.newgame-toolbar select{background:#20254b;color:#fff;border:1px solid #59608b;border-radius:8px;padding:7px}.sudoku-grid{width:min(94vw,450px);display:grid;grid-template-columns:repeat(9,1fr);border:3px solid #8890b8}.sudoku-cell{aspect-ratio:1;border:1px solid #4b527a;background:#151936;color:#fff;font-size:clamp(14px,4vw,23px);padding:0}.sudoku-cell:nth-child(3n){border-right-width:3px}.sudoku-cell:nth-child(n+19):nth-child(-n+27),.sudoku-cell:nth-child(n+46):nth-child(-n+54){border-bottom-width:3px}.sudoku-cell.fixed{background:#282e59;color:#6ee7b7;font-weight:900}.sudoku-cell.selected{outline:3px solid #ffd166;z-index:1}.sudoku-pad{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;width:min(94vw,450px);margin-top:12px}.sudoku-pad button,.match-grid button{border:1px solid #515982;background:#20254b;color:#fff;border-radius:9px;min-height:44px;font-weight:900}.sol-top{display:flex;gap:8px;width:min(96vw,760px);align-items:start}.sol-gap{flex:1}.sol-found{display:flex;gap:8px}.card-pile,.playing-card{width:clamp(44px,11vw,72px);height:clamp(64px,16vw,100px);border-radius:8px;border:1px solid #aab;background:#f8f8f2;color:#111;padding:4px;display:flex;flex-direction:column;justify-content:space-between;align-items:start;font-weight:900}.card-pile{background:#5b2d90;color:#fff;align-items:center;justify-content:center}.playing-card.red{color:#cf2348}.playing-card b{align-self:center;font-size:24px}.playing-card.picked{outline:4px solid #ffd166}.playing-card.empty{background:transparent;border:2px dashed #8da;color:#8da;justify-content:center;align-items:center}.sol-tabs{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;width:min(96vw,760px);margin-top:18px;align-items:start}.sol-col{min-height:290px}.match-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:4px;width:min(94vw,480px)}.match-grid button{font-size:clamp(19px,6vw,32px);padding:2px;aspect-ratio:1}.match-grid button.selected{outline:3px solid #ffd166;transform:scale(.9)}.dice-row{display:flex;gap:8px;justify-content:center;margin:14px}.dice-row button{font-size:48px;border:2px solid transparent;background:#fff;color:#111;border-radius:12px;padding:4px 10px}.dice-row button.held{border-color:#ffd166;transform:translateY(-8px)}.score-sheet{display:grid;grid-template-columns:repeat(2,minmax(130px,1fr));gap:7px;width:min(94vw,540px)}.score-sheet button{display:flex;justify-content:space-between;background:#20254b;color:#fff;border:1px solid #515982;border-radius:8px;padding:10px}.mancala{display:grid;grid-template-columns:60px 1fr 60px;grid-template-rows:1fr 1fr;gap:8px;width:min(96vw,680px);background:#7f4f24;border-radius:80px;padding:18px}.mancala-row{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.mancala-row.top{grid-column:2;grid-row:1}.mancala-row:not(.top){grid-column:2;grid-row:2}.mancala-store{grid-row:1/3;display:grid;place-items:center;border-radius:50px;background:#d4a373;color:#2b1709;font-size:26px;font-weight:900}.mancala-store:first-child{grid-column:1}.mancala-store:last-child{grid-column:3}.mancala-pit{min-width:0;aspect-ratio:1;border:0;border-radius:50%;background:#d4a373;color:#2b1709;font-weight:900;font-size:18px}.mancala-pit:disabled{opacity:.55}@media(max-width:520px){.update-banner{width:calc(100% - 28px);box-sizing:border-box;flex-wrap:wrap}.sol-tabs{gap:2px}.mancala{grid-template-columns:42px 1fr 42px;padding:10px}.mancala-row{gap:3px}.dice-row button{font-size:34px;padding:3px 6px}}

/* Skip layout/paint work for off-screen card collections on large decks. */
.game-filters button[aria-pressed="true"]{background:#6545d3}
.game-card{content-visibility:auto;contain-intrinsic-size:190px 225px}

.color-assist{--green:#00e5ff;--red:#ff8a3d}.color-assist .tag.mp,.color-assist .net-status.live{border:2px solid currentColor}.color-assist .tag.mp::before{content:"✓ ";font-weight:900}.color-assist .c4-cell .disc.r{background:repeating-linear-gradient(45deg,#ff8a3d 0 7px,#7d2e00 7px 12px)}.color-assist .c4-cell .disc.y{background:repeating-linear-gradient(-45deg,#00e5ff 0 7px,#005968 7px 12px)}
.large-text{font-size:112.5%}.large-text .controls-hint,.large-text .game-card p,.large-text .modal p{font-size:.82rem}.large-text .btn,.large-text .pill{letter-spacing:.3px}

.reduce-motion *,.reduce-motion *::before,.reduce-motion *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}}

@media (max-width:820px){.quick-rail{display:flex;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:3px}.quick-game{min-width:235px;scroll-snap-align:start}.ready-controls{width:100%;justify-content:center}.public-rooms{grid-template-columns:1fr}}
@media (orientation:landscape) and (max-height:520px){.game-surface{min-height:260px;padding:10px}.stage-head{margin-bottom:8px}.game-controls{position:sticky;bottom:4px;z-index:7;background:rgba(10,12,28,.82);border-radius:16px;margin-top:4px}.gc-btn{width:44px;height:44px}.gc-action{height:44px}}
@media (orientation:landscape) and (max-height:520px){.modal-backdrop{align-items:flex-start;padding:8px}.modal{max-height:calc(100dvh - 16px)}}

/* Gem Match: phased, touch-first match-3 board. */
.game-surface.match3-surface{overflow:visible}
.match3-shell{width:min(98vw,540px);display:grid;justify-items:center;gap:11px;padding:16px;border:1px solid rgba(174,159,255,.34);border-radius:22px;background:linear-gradient(155deg,rgba(43,34,91,.95),rgba(17,22,57,.97));box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 18px 48px rgba(0,0,0,.28)}
.match3-toolbar{width:100%;margin:0;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.match3-stat{display:grid;gap:2px;min-width:0;padding:8px 10px;text-align:center;border:1px solid rgba(255,255,255,.13);border-radius:12px;background:rgba(8,11,31,.52)}
.match3-stat small{color:#aeb4d4;font-size:9px;font-weight:850;letter-spacing:.09em;text-transform:uppercase}
.match3-stat b{display:inline-block;color:#fff;font:900 17px/1.1 "Orbitron",sans-serif;transition:transform 150ms cubic-bezier(.23,1,.32,1),opacity 150ms cubic-bezier(.23,1,.32,1)}
.match3-stat b.is-updated{transform:scale(1.08);opacity:.76}
.match3-goal{width:100%;display:grid;gap:5px}
.match3-goal-copy{display:flex;align-items:center;justify-content:space-between;color:#cfd4f4;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
.match3-goal progress{display:block;width:100%;height:9px;overflow:hidden;border:0;border-radius:999px;background:#090c22;accent-color:#ffca55}
.match3-goal progress::-webkit-progress-bar{background:#090c22;border-radius:999px}
.match3-goal progress::-webkit-progress-value{border-radius:999px;background:linear-gradient(90deg,#9b5de5,#35d6ff,#ffd166)}
.match3-goal progress::-moz-progress-bar{border-radius:999px;background:linear-gradient(90deg,#9b5de5,#35d6ff,#ffd166)}
.match3-feedback{min-height:20px;display:flex;align-items:center;justify-content:center;padding:5px 10px;border:1px solid rgba(255,255,255,.12);border-radius:999px;background:rgba(7,10,29,.56);color:#e8ebff;text-align:center;font-size:11px;font-weight:750;transform:translateY(0) scale(1);opacity:1;transition:transform 160ms cubic-bezier(.23,1,.32,1),opacity 140ms cubic-bezier(.23,1,.32,1)}
.match3-feedback.is-refreshing{transform:translateY(3px) scale(.98);opacity:.55;transition-duration:0ms}
.match3-feedback[data-tone="success"]{color:#94f5c1;border-color:rgba(61,220,132,.46)}
.match3-feedback[data-tone="goal"]{color:#ffe28b;border-color:rgba(255,209,102,.62);background:rgba(108,69,0,.32)}
.match3-feedback[data-tone="warning"]{color:#ffb3bd;border-color:rgba(255,92,108,.5)}
.match3-feedback[data-tone="hint"]{color:#9ceeff;border-color:rgba(53,214,255,.48)}
.match3-board-wrap{width:min(100%,500px);padding:8px;border:1px solid rgba(178,158,255,.36);border-radius:19px;background:linear-gradient(145deg,rgba(9,12,38,.92),rgba(38,26,78,.91));box-shadow:inset 0 0 32px rgba(0,0,0,.35)}
.match-grid.match3-grid{width:100%;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;touch-action:none;user-select:none}
.match-grid.match3-grid .match3-cell{position:relative;isolation:isolate;display:grid;place-items:center;min-width:0;min-height:0;aspect-ratio:1;padding:1px;overflow:visible;border:1px solid rgba(176,179,225,.24);border-radius:11px;background:linear-gradient(145deg,rgba(56,61,116,.72),rgba(25,29,71,.8));color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.08);cursor:pointer;-webkit-tap-highlight-color:transparent}
.match-grid.match3-grid .match3-cell:focus-visible{z-index:5;outline:3px solid #fff;outline-offset:1px}
.match-grid.match3-grid .match3-cell.selected{z-index:4;outline:3px solid #ffd166;outline-offset:-2px;transform:none}
.match3-gem{display:grid;place-items:center;width:100%;height:100%;font-size:clamp(21px,6.8vw,37px);line-height:1;transform:translate3d(0,0,0) scale(1);opacity:1;filter:drop-shadow(0 4px 4px rgba(0,0,0,.34));will-change:transform,opacity;transition:transform 180ms cubic-bezier(.77,0,.175,1),opacity 150ms cubic-bezier(.23,1,.32,1)}
.match3-cell.selected .match3-gem{transform:scale(.9)}
.match3-cell.is-hint{border-color:#62e8ff;box-shadow:inset 0 0 0 2px rgba(98,232,255,.65),0 0 14px rgba(98,232,255,.35)}
.match3-cell.is-hint .match3-gem{transform:translateY(-3px) scale(1.05)}
.match3-cell.is-swapping{z-index:6}
.match3-cell.is-swapping .match3-gem{transform:translate3d(var(--swap-x,0),var(--swap-y,0),0) scale(1.03)}
.match3-cell.is-invalid{border-color:#ff5c6c;box-shadow:inset 0 0 0 2px rgba(255,92,108,.65)}
.match3-cell.is-invalid .match3-gem{transform:scale(.92);opacity:.68}
.match3-cell.is-clearing .match3-gem{transform:scale(.92);opacity:0}
.match3-cell.is-cross::after{content:"✦";position:absolute;inset:0;display:grid;place-items:center;z-index:2;color:#fff;font-size:22px;text-shadow:0 0 10px #fff;pointer-events:none}
.match3-cell.is-fall-start .match3-gem{transform:translate3d(0,var(--fall-y,-60px),0) scale(.96);opacity:.18}
.match3-cell.is-entering .match3-gem{transform:translateY(-8px) scale(.96);opacity:.12}
.match3-grid.is-shuffling .match3-cell .match3-gem{transform:scale(.94);opacity:.12}
.match3-actions{display:flex;justify-content:center;gap:9px;flex-wrap:wrap}
.match3-actions .btn{min-height:42px;transition:transform 140ms cubic-bezier(.23,1,.32,1)}
.match3-actions .btn:active{transform:scale(.97)}
.match3-rules{margin:0;color:#aeb4d4;text-align:center;font-size:10px;line-height:1.4}

html[data-theme="glass"] .match3-shell{border-color:rgba(138,217,255,.35);background:linear-gradient(150deg,rgba(45,43,103,.64),rgba(5,16,48,.74));-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}
html[data-theme="glass"] .match3-board-wrap{border-color:rgba(113,229,255,.4);background:linear-gradient(145deg,rgba(5,11,35,.8),rgba(56,31,99,.65))}
html[data-theme="glass"] .match-grid.match3-grid .match3-cell{border-color:rgba(205,229,255,.24);background:linear-gradient(145deg,rgba(96,107,179,.42),rgba(24,31,83,.52))}

html[data-theme="neo"] .game-surface.match3-surface{background:#51d9ff}
html[data-theme="neo"] .match3-shell{color:#17141c;border:3px solid #17141c;border-radius:3px;background:#ffd84d;box-shadow:7px 7px 0 #17141c}
html[data-theme="neo"] .match3-stat{border:2px solid #17141c;border-radius:2px;background:#ff8fc5;box-shadow:2px 2px 0 #17141c}
html[data-theme="neo"] .match3-stat:nth-child(2){background:#9ff0d0}
html[data-theme="neo"] .match3-stat:nth-child(3){background:#e7d8ff}
html[data-theme="neo"] .match3-stat small,html[data-theme="neo"] .match3-stat b,html[data-theme="neo"] .match3-goal-copy{color:#17141c}
html[data-theme="neo"] .match3-goal progress{height:12px;border:2px solid #17141c;border-radius:1px;background:#fff8e8}
html[data-theme="neo"] .match3-goal progress::-webkit-progress-bar{border-radius:0;background:#fff8e8}
html[data-theme="neo"] .match3-goal progress::-webkit-progress-value{border-radius:0;background:#5237bd}
html[data-theme="neo"] .match3-goal progress::-moz-progress-bar{border-radius:0;background:#5237bd}
html[data-theme="neo"] .match3-feedback{color:#17141c;border:2px solid #17141c;border-radius:2px;background:#9ff0d0;box-shadow:2px 2px 0 #17141c}
html[data-theme="neo"] .match3-feedback[data-tone="warning"]{color:#17141c;background:#ff9da7}
html[data-theme="neo"] .match3-feedback[data-tone="hint"]{color:#17141c;background:#b6efff}
html[data-theme="neo"] .match3-feedback[data-tone="success"],html[data-theme="neo"] .match3-feedback[data-tone="goal"]{color:#17141c;background:#ff8fc5}
html[data-theme="neo"] .match3-board-wrap{padding:7px;border:3px solid #17141c;border-radius:2px;background:#5237bd;box-shadow:5px 5px 0 #17141c}
html[data-theme="neo"] .match-grid.match3-grid .match3-cell{color:#17141c;border:2px solid #17141c;border-radius:1px;background:#e7d8ff;box-shadow:none}
html[data-theme="neo"] .match-grid.match3-grid .match3-cell:nth-child(odd){background:#dff8ff}
html[data-theme="neo"] .match-grid.match3-grid .match3-cell.selected{outline-color:#17141c;background:#ff8fc5}
html[data-theme="neo"] .match-grid.match3-grid .match3-cell.is-hint{border-color:#17141c;background:#9ff0d0;box-shadow:inset 0 0 0 2px #17141c}
html[data-theme="neo"] .match3-rules{color:#17141c;font-weight:800}

@media (hover:hover) and (pointer:fine){
  .match-grid.match3-grid .match3-cell:not(:disabled):hover .match3-gem{transform:translateY(-2px) scale(1.04)}
}
@media (max-width:520px){
  .match3-shell{padding:6px;gap:8px}
  .match3-board-wrap{width:100%;padding:2px}
  .match-grid.match3-grid{gap:2px}
  .match3-stat{padding:7px 5px}
  .match3-feedback{min-height:18px;font-size:10px}
  .match3-rules{max-width:330px}
}
@media (orientation:landscape) and (max-height:520px){
  .match3-shell{grid-template-columns:minmax(260px,1fr) minmax(260px,1fr);max-width:680px;align-items:center;padding:9px}
  .match3-toolbar,.match3-goal,.match3-feedback,.match3-actions,.match3-rules{grid-column:2}
  .match3-board-wrap{grid-column:1;grid-row:1/7;width:min(72vh,430px)}
}
@media (prefers-reduced-motion:reduce){
  .match3-gem,.match3-feedback,.match3-stat b,.match3-actions .btn{transition:opacity 120ms ease-out}
  .match3-cell.is-swapping .match3-gem,.match3-cell.is-invalid .match3-gem,.match3-cell.is-clearing .match3-gem,.match3-cell.is-fall-start .match3-gem,.match3-cell.is-entering .match3-gem,.match3-grid.is-shuffling .match3-cell .match3-gem{transform:none}
}
.reduce-motion .match3-gem,.reduce-motion .match3-feedback,.reduce-motion .match3-stat b,.reduce-motion .match3-actions .btn{transition:opacity 120ms ease-out!important}
.reduce-motion .match3-cell.is-swapping .match3-gem,.reduce-motion .match3-cell.is-invalid .match3-gem,.reduce-motion .match3-cell.is-clearing .match3-gem,.reduce-motion .match3-cell.is-fall-start .match3-gem,.reduce-motion .match3-cell.is-entering .match3-gem,.reduce-motion .match3-grid.is-shuffling .match3-cell .match3-gem{transform:none}

.mancala-bot-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:rgba(155,93,229,.16);color:#dbcaff;font-size:10px;font-weight:850;letter-spacing:.04em;text-transform:uppercase}
.mancala-bot-badge[hidden]{display:none}
html[data-theme="neo"] .mancala-bot-badge{color:#17141c;border:2px solid #17141c;border-radius:2px;background:#9ff0d0;box-shadow:2px 2px 0 #17141c}
