/* Non-Realm Games refinement — 2026-10-18
   Canonical shell + focused play surfaces. Intentionally excludes Baseline Realm. */

:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:start!important;
  gap:14px 20px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header>div:first-child{
  min-width:0;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header h2{
  margin-bottom:4px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-shell-actions,
:is(#blockGridPanel,#colourSortPanel) .link-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  width:auto!important;
  margin:0!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-shell-action,
:is(#blockGridPanel,#colourSortPanel) .link-actions>.action{
  min-height:42px!important;
  height:42px!important;
  width:auto!important;
  min-width:42px!important;
  padding:0 13px!important;
  border-radius:14px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  font-size:14px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-shell-action--icon{
  width:42px!important;
  padding:0!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-info-details{
  display:none!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-toggle-row{
  margin-top:10px!important;
  gap:7px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-toggle-row .game-toggle-btn{
  min-height:40px!important;
  padding:9px 14px!important;
  border-radius:13px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-panel-stack{
  margin-top:10px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-play-root{
  overflow:hidden;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .round-status-card{
  min-height:64px!important;
  align-content:center!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-window-actions{
  gap:8px!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
}

/* Detect the Word — stable centre column with immediate keyboard. */
#detectwordPanel #wordBoard{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
#detectwordPanel .word-box{width:min(100%,660px);margin-inline:auto;padding:clamp(14px,2vw,22px)!important}
#detectwordPanel .word-grid{justify-items:center;gap:8px!important}
#detectwordPanel .word-row{justify-content:center!important}
#detectwordPanel .letter-cell{
  width:clamp(44px,7vw,58px)!important;
  height:clamp(44px,7vw,58px)!important;
  border-radius:11px!important;
  font-size:clamp(20px,3vw,27px)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
#detectwordPanel .word-entry-stack{margin-top:2px}
#detectwordPanel #wordGuessInput{text-align:center;font-size:20px;font-weight:800;letter-spacing:.08em}
#detectwordPanel .mobile-game-keypad[data-keypad="detectword"]{
  width:min(100%,720px)!important;
  margin:0 auto!important;
  grid-column:1!important;
  grid-row:auto!important;
  position:relative!important;
  top:auto!important;
  max-height:none!important;
}
#detectwordPanel .mobile-word-keypad{grid-template-columns:repeat(10,minmax(0,1fr))!important}
#detectwordPanel .round-status-card{min-height:72px!important}

/* Make The Number — visual expression builder with keyboard fallback. */
#make24Panel #make24Board{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
#make24Panel .formula-box{width:min(100%,760px);margin-inline:auto;padding:clamp(15px,2.2vw,24px)!important}
#make24Panel .make-number-target{
  display:grid;
  justify-items:center;
  gap:4px;
  padding:12px 16px;
  border-radius:16px;
  background:rgba(14,26,61,.18);
  border:1px solid rgba(16,24,39,.24);
}
#make24Panel .make-number-target span{font-size:12px;font-weight:850;text-transform:uppercase;letter-spacing:.1em}
#make24Panel .make-number-target strong{font-size:clamp(42px,7vw,68px);line-height:1}
#make24Panel .numbers-strip{justify-content:center!important}
#make24Panel .number-chip{
  appearance:none;
  cursor:pointer;
  transition:transform .12s ease,opacity .15s ease,box-shadow .15s ease;
}
#make24Panel button.number-chip:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 12px 24px -15px rgba(5,12,31,.65)}
#make24Panel .number-chip.is-used{opacity:.34;filter:saturate(.5);transform:scale(.94)}
#make24Panel .make-number-composer{display:grid;gap:10px}
#make24Panel .make-number-operators{display:grid;grid-template-columns:repeat(6,minmax(48px,1fr));gap:7px}
#make24Panel .make-number-operators button{
  min-height:48px;
  border-radius:13px;
  font-size:20px;
  font-weight:900;
}
#make24Panel .make-number-edit-row{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
#make24Panel .make-number-builder-note{min-height:20px;text-align:center;font-size:13px;color:var(--games-muted)}
#make24Panel #make24ExpressionInput{text-align:center;font-size:20px;font-weight:800;letter-spacing:.025em}
#make24Panel .mobile-game-keypad[data-keypad="make24"]{
  width:min(100%,620px)!important;
  margin:0 auto!important;
  grid-column:1!important;
  grid-row:auto!important;
  position:relative!important;
  top:auto!important;
  max-height:none!important;
}

/* Track the Coin — focus the scene during tracking and make selection phase obvious. */
#trackcoinPanel .trackcoin-scene{
  position:relative;
  border-radius:22px!important;
  overflow:hidden;
}
#trackcoinPanel .trackcoin-lane{
  isolation:isolate;
  border-radius:20px!important;
  box-shadow:inset 0 -18px 35px rgba(6,12,31,.17),inset 0 1px 0 rgba(255,255,255,.16);
}
#trackcoinPanel .trackcoin-cup{
  filter:drop-shadow(0 13px 8px rgba(3,8,24,.26));
  transition:filter .15s ease,transform .15s ease;
}
#trackcoinPanel .trackcoin-cup.is-selectable:hover{
  filter:drop-shadow(0 17px 10px rgba(3,8,24,.34)) brightness(1.08);
}
#trackcoinPanel .trackcoin-item-token{
  width:clamp(34px,5vw,48px)!important;
  height:clamp(34px,5vw,48px)!important;
  border-radius:50%;
  background:radial-gradient(circle at 34% 28%,#fff1a3 0 8%,#f4c56c 9% 32%,#c78c24 66%,#75500f 100%)!important;
  border:3px solid rgba(96,60,5,.56)!important;
  box-shadow:0 4px 0 rgba(95,61,8,.34),0 0 24px rgba(244,197,108,.62)!important;
}
#trackcoinPanel .trackcoin-scene.is-phase-hide .trackcoin-game-status,
#trackcoinPanel .trackcoin-scene.is-phase-hide .trackcoin-status{
  opacity:.16;
  transition:opacity .25s ease;
}
#trackcoinPanel .trackcoin-scene.is-phase-pick .trackcoin-game-status{
  border-color:rgba(244,197,108,.62)!important;
  box-shadow:0 0 0 3px rgba(244,197,108,.12);
}
#trackcoinPanel .trackcoin-pick-prompt{
  position:absolute;
  z-index:8;
  left:50%;
  top:10px;
  transform:translateX(-50%);
  padding:8px 14px;
  border-radius:999px;
  background:rgba(10,17,45,.88);
  color:#fff4d4;
  font-weight:900;
  letter-spacing:.035em;
  pointer-events:none;
}
#trackcoinPanel .trackcoin-resume-card{
  display:grid;
  place-items:center;
  gap:10px;
  text-align:center;
  padding:18px;
}

/* Rule Shift — rule is the visual anchor, choices are secondary. */
#ruleshiftPanel .ruleshift-rule-card{
  position:relative;
  padding:clamp(18px,3vw,30px)!important;
  text-align:center;
  border:2px solid rgba(16,24,39,.36)!important;
  box-shadow:0 14px 34px -25px rgba(0,0,0,.68);
}
#ruleshiftPanel .ruleshift-rule-card>strong{
  display:block;
  margin:10px auto 14px;
  font-size:clamp(27px,4.3vw,48px)!important;
  line-height:1.08;
  letter-spacing:-.025em;
}
#ruleshiftPanel .ruleshift-rule-card.is-rule-change{
  animation:ruleShiftChange .44s cubic-bezier(.2,.75,.25,1);
}
@keyframes ruleShiftChange{0%{transform:scale(.96);filter:brightness(1.35)}60%{transform:scale(1.015)}100%{transform:scale(1);filter:brightness(1)}}
#ruleshiftPanel .ruleshift-rule-kicker{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(12,21,50,.16);
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
#ruleshiftPanel .ruleshift-options-grid{gap:clamp(9px,1.4vw,15px)!important}
#ruleshiftPanel .ruleshift-token{
  position:relative;
  overflow:hidden;
  min-height:112px!important;
  border-radius:18px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.23),0 10px 18px -15px rgba(0,0,0,.6);
  transition:transform .12s ease,box-shadow .12s ease;
}
#ruleshiftPanel .ruleshift-token:hover{transform:translateY(-3px);box-shadow:inset 0 1px 0 rgba(255,255,255,.26),0 14px 24px -16px rgba(0,0,0,.7)}
#ruleshiftPanel .ruleshift-token-caption{
  position:absolute;
  left:7px;right:7px;bottom:6px;
  padding:4px 5px;
  border-radius:8px;
  background:rgba(8,13,34,.7);
  color:#fff;
  font-size:10px;
  font-weight:800;
  line-height:1.1;
  pointer-events:none;
}

/* Keep management secondary to the play surface. */
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-toolbar .stat-pills{
  opacity:.9;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .stat-pill{
  min-height:38px!important;
}

/* Compact phone shell: icon-first top controls, play area retains width. */
@media(max-width:820px){
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header{
    grid-template-columns:1fr!important;
    gap:9px!important;
  }
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-shell-actions,
  :is(#blockGridPanel,#colourSortPanel) .link-actions{
    width:100%!important;
    justify-content:flex-start!important;
    gap:6px!important;
    flex-wrap:nowrap!important;
  }
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-shell-action{
    flex:0 0 42px!important;
    width:42px!important;
    min-width:42px!important;
    padding:0!important;
  }
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-shell-action__label{
    position:absolute!important;
    width:1px!important;height:1px!important;
    overflow:hidden!important;clip:rect(0 0 0 0)!important;
    white-space:nowrap!important;
  }
  :is(#blockGridPanel,#colourSortPanel) .link-actions>.action{
    flex:1 1 0!important;
    min-width:0!important;
    padding:0 8px!important;
    font-size:12px!important;
  }
  #detectwordPanel .mobile-word-keypad{grid-template-columns:repeat(7,minmax(0,1fr))!important}
  #make24Panel .make-number-operators{grid-template-columns:repeat(3,minmax(48px,1fr))}
  #ruleshiftPanel .ruleshift-token-caption{font-size:9px}
}
@media(prefers-reduced-motion:reduce){
  #pairsPanel .memory-card,
  #pairsPanel .memory-card-face,
  #ruleshiftPanel .ruleshift-rule-card.is-rule-change,
  #trackcoinPanel .trackcoin-cup{transition:none!important;animation:none!important}
}

/* Canonical autosave/status control matches the compact toolbar. */
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-save-status{
  width:42px!important;height:42px!important;min-width:42px!important;border-radius:14px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-save-status svg{
  width:24px!important;height:24px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-shell-action__icon{
  display:inline-grid;place-items:center;min-width:18px;font-size:18px;font-weight:900;line-height:1;
}
@media(max-width:820px){
  :is(#blockGridPanel,#colourSortPanel) .game-shell-action{
    flex:0 0 42px!important;width:42px!important;min-width:42px!important;padding:0!important;
  }
  :is(#blockGridPanel,#colourSortPanel) .game-shell-action__label{
    position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;
    clip:rect(0 0 0 0)!important;white-space:nowrap!important;
  }
}

:is(#blockGridPanel,#colourSortPanel) .game-info-details{display:none!important}


/* ==========================================================================
   2026-10-18 coherence correction authority
   These rules intentionally override older Games Hub component experiments.
   Baseline Realm is not targeted here.
   ========================================================================== */

/* --- Canonical non-Realm header actions: never let labels overflow icon slots. --- */
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header{
  grid-template-columns:minmax(0,1fr) auto!important;
  column-gap:18px!important;
  row-gap:10px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .game-shell-actions,
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .link-actions{
  min-width:0!important;
  max-width:100%!important;
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:7px!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .game-shell-action{
  flex:0 0 auto!important;
  min-width:42px!important;
  overflow:hidden!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .game-shell-action--icon{
  width:42px!important;
  max-width:42px!important;
  padding:0!important;
}
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .game-shell-action--icon .game-shell-action__label,
:is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel) .game-header .games-settings-trigger.game-shell-action--icon .games-settings-trigger__label{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
}
@media(max-width:1180px){
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header{
    grid-template-columns:1fr!important;
  }
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .game-shell-actions,
  :is(#pairsPanel,#detectwordPanel,#make24Panel,#trackcoinPanel,#ruleshiftPanel,#blockGridPanel,#colourSortPanel) .game-header .link-actions{
    justify-content:flex-start!important;
  }
}

/* --- Live XP: compact enough to watch while playing. --- */
:is(#pairsGameCard,#wordGameCard,#make24GameCard,#trackCoinGamePanel,#ruleShiftGameCard) .game-live-xp{
  display:grid!important;
  grid-template-columns:auto minmax(120px,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  padding:8px 11px!important;
  border:1px solid rgba(115,139,215,.28)!important;
  border-radius:13px!important;
  background:rgba(10,20,58,.18)!important;
  color:var(--games-ink)!important;
  font-size:12px!important;
}
.game-live-xp>strong{white-space:nowrap;font-size:12px!important}
.game-live-xp>span:last-child{white-space:nowrap;color:var(--games-muted)!important}
.game-live-xp__bar{
  height:8px!important;
  border-radius:999px!important;
  overflow:hidden!important;
  background:rgba(5,12,35,.62)!important;
  border:1px solid rgba(126,147,219,.24)!important;
}
.game-live-xp__bar>span{
  display:block!important;
  height:100%!important;
  border-radius:inherit!important;
  background:linear-gradient(90deg,#5d78d4,#8ca4f0)!important;
}

/* --- Detailed progress tabs: explicit hierarchy and label/value separation. --- */
.game-progress-stats,
#trackCoinStats,
#ruleShiftStats{
  display:grid!important;
  gap:16px!important;
}
.coherent-progress-overview{
  display:grid!important;
  gap:11px!important;
  padding:18px!important;
  border-radius:17px!important;
  border:1px solid rgba(115,139,215,.28)!important;
  background:rgba(10,20,58,.18)!important;
}
.coherent-progress-heading{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:14px!important;
  flex-wrap:wrap!important;
}
.coherent-progress-heading>div:first-child{display:grid!important;gap:3px!important}
.coherent-progress-heading strong{font-size:clamp(21px,2.2vw,30px)!important;line-height:1.1!important}
.coherent-progress-kicker{
  color:var(--games-muted)!important;
  text-transform:uppercase!important;
  letter-spacing:.09em!important;
  font-size:11px!important;
  font-weight:900!important;
}
.coherent-progress-next{
  color:var(--games-muted)!important;
  font-size:13px!important;
  font-weight:750!important;
}
.coherent-progress-xp-meta{
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  gap:12px!important;
  color:var(--games-muted)!important;
  font-size:13px!important;
}
.coherent-progress-bar{
  height:15px!important;
  overflow:hidden!important;
  border-radius:999px!important;
  background:#0b1434!important;
  border:1px solid rgba(115,139,215,.28)!important;
}
.coherent-progress-bar>span{
  display:block!important;
  height:100%!important;
  border-radius:inherit!important;
  background:linear-gradient(90deg,#5571ce 0%,#7891e6 58%,#a1b4ff 100%)!important;
}
.coherent-progress-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;
  gap:10px!important;
}
.coherent-progress-stat{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:16px!important;
  min-height:58px!important;
  padding:12px 14px!important;
  border-radius:13px!important;
  border:1px solid rgba(115,139,215,.23)!important;
  background:rgba(10,20,58,.14)!important;
}
.coherent-progress-stat>span{
  min-width:0!important;
  color:var(--games-muted)!important;
  font-size:13px!important;
  line-height:1.25!important;
}
.coherent-progress-stat>strong{
  justify-self:end!important;
  text-align:right!important;
  font-size:15px!important;
  color:var(--games-ink)!important;
  white-space:normal!important;
}

/* --- Detect The Word: keypad closed by JS; when opened it follows the puzzle vertically. --- */
@media(min-width:821px){
  body[data-app="games"] #detectwordPanel .game-play-root.desktop-keypad-open #wordBoard,
  body[data-app="games"] #detectwordPanel .game-play-root.keypad-open #wordBoard,
  body[data-app="games"] #detectwordPanel .game-play-root.desktop-keypad-open:fullscreen #wordBoard,
  body[data-app="games"] #detectwordPanel .game-play-root.keypad-open:fullscreen #wordBoard{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    align-items:start!important;
  }
  body[data-app="games"] #detectwordPanel #wordBoard>.word-box{
    grid-column:1!important;
    grid-row:auto!important;
    width:min(100%,720px)!important;
    justify-self:center!important;
    align-self:start!important;
  }
  body[data-app="games"] #detectwordPanel #wordBoard>.mobile-word-keypad[aria-hidden="false"],
  body[data-app="games"] #detectwordPanel .desktop-keypad-open #wordBoard>.mobile-word-keypad{
    display:grid!important;
    grid-column:1!important;
    grid-row:auto!important;
    position:relative!important;
    top:auto!important;
    width:min(100%,720px)!important;
    max-height:none!important;
    overflow:visible!important;
    justify-self:center!important;
    grid-template-columns:repeat(10,minmax(0,1fr))!important;
    grid-auto-rows:minmax(48px,auto)!important;
    gap:7px!important;
    padding:10px!important;
  }
}

/* --- Pairs: one authoritative flip model + tier-aware sizing. --- */
body[data-app="games"] #pairsPanel #pairsBoard{
  width:min(100%,var(--pairs-board-max,630px))!important;
  margin-inline:auto!important;
  grid-template-columns:repeat(var(--pairs-cols-desktop,4),minmax(0,1fr))!important;
  justify-content:center!important;
  align-items:stretch!important;
  gap:10px!important;
}
body[data-app="games"] #pairsPanel #pairsBoard.is-pairs-idle{
  width:100%!important;
  max-width:none!important;
  grid-template-columns:1fr!important;
}
body[data-app="games"] #pairsPanel .memory-card{
  position:relative!important;
  isolation:isolate!important;
  min-width:0!important;
  min-height:0!important;
  aspect-ratio:1.3 / 1!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid rgba(115,139,215,.32)!important;
  border-radius:14px!important;
  background:#23335f!important;
  box-shadow:0 8px 18px -14px rgba(0,0,0,.68)!important;
  transform:none!important;
  cursor:pointer!important;
}
body[data-app="games"] #pairsPanel .memory-card:hover:not(:disabled){
  border-color:rgba(156,177,241,.58)!important;
  box-shadow:0 10px 22px -14px rgba(0,0,0,.76)!important;
}
body[data-app="games"] #pairsPanel .memory-card:focus-visible{
  outline:2px solid #a9b9f4!important;
  outline-offset:2px!important;
}
body[data-app="games"] #pairsPanel .memory-card[disabled]{
  cursor:default!important;
}
body[data-app="games"] #pairsPanel .memory-card-face{
  position:absolute!important;
  inset:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:10px!important;
  border-radius:13px!important;
  backface-visibility:visible!important;
  transform:none!important;
  pointer-events:none!important;
  transition:opacity .16s ease,visibility .16s ease!important;
}
body[data-app="games"] #pairsPanel .memory-card-back{
  z-index:2!important;
  opacity:1!important;
  visibility:visible!important;
  background:
    radial-gradient(circle at 50% 48%,rgba(204,176,111,.13) 0 9%,transparent 10% 100%),
    linear-gradient(145deg,#304277 0%,#1e2d59 60%,#17234a 100%)!important;
  color:#d5bb7c!important;
}
body[data-app="games"] #pairsPanel .memory-card-back::after{
  content:"◆"!important;
  font-size:clamp(20px,2.2vw,32px)!important;
  color:#cdb57b!important;
  text-shadow:none!important;
}
body[data-app="games"] #pairsPanel .memory-card-front{
  z-index:1!important;
  opacity:0!important;
  visibility:hidden!important;
  overflow:hidden!important;
  background:linear-gradient(145deg,#aa8974 0%,#967466 58%,#7f6662 100%)!important;
  color:#1f294d!important;
  font-size:clamp(28px,3.2vw,46px)!important;
  line-height:1!important;
  text-shadow:none!important;
}
body[data-app="games"] #pairsPanel .memory-card-front>img,
body[data-app="games"] #pairsPanel .memory-card-front>svg{
  display:block!important;
  max-width:72%!important;
  max-height:72%!important;
  object-fit:contain!important;
}
body[data-app="games"] #pairsPanel .memory-card.is-open .memory-card-back,
body[data-app="games"] #pairsPanel .memory-card.is-matched .memory-card-back{
  z-index:1!important;
  opacity:0!important;
  visibility:hidden!important;
}
body[data-app="games"] #pairsPanel .memory-card.is-open .memory-card-front,
body[data-app="games"] #pairsPanel .memory-card.is-matched .memory-card-front{
  z-index:3!important;
  opacity:1!important;
  visibility:visible!important;
}
body[data-app="games"] #pairsPanel .memory-card.is-matched{
  opacity:.64!important;
  filter:saturate(.72) brightness(.98)!important;
}
body[data-app="games"] #pairsPanel #pairsBoard[data-pairs-theme="archive"] .memory-card-back{
  background:linear-gradient(145deg,#514238,#342f34 58%,#25273b 100%)!important;
}
body[data-app="games"] #pairsPanel #pairsBoard[data-pairs-theme="night"] .memory-card-back{
  background:radial-gradient(circle at 30% 22%,rgba(231,222,190,.12) 0 2px,transparent 3px),linear-gradient(145deg,#202a53,#111a38)!important;
}
body[data-app="games"] #pairsPanel .pairs-result-card{
  grid-column:1/-1!important;
  padding:16px!important;
  border-radius:14px!important;
  text-align:center!important;
  background:rgba(174,138,112,.30)!important;
  border:1px solid rgba(115,139,215,.28)!important;
}
body[data-app="games"] #pairsPanel .pairs-theme-picker{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  margin-top:12px!important;
}
body[data-app="games"] #pairsPanel .pairs-theme-picker button{
  min-height:40px!important;
}

@media(max-width:820px){
  body[data-app="games"] #pairsPanel #pairsBoard{
    width:min(100%,620px)!important;
    grid-template-columns:repeat(var(--pairs-cols-mobile,4),minmax(0,1fr))!important;
    gap:8px!important;
  }
  body[data-app="games"] #pairsPanel .memory-card-front{
    font-size:clamp(26px,8vw,42px)!important;
  }
}
@media(max-width:520px){
  body[data-app="games"] #pairsPanel #pairsBoard{
    grid-template-columns:repeat(var(--pairs-cols-phone,3),minmax(0,1fr))!important;
    gap:7px!important;
  }
  body[data-app="games"] #pairsPanel .memory-card{
    border-radius:12px!important;
  }
  body[data-app="games"] #pairsPanel .memory-card-face{
    padding:7px!important;
    border-radius:11px!important;
  }
}

/* --- Rule Shift: stronger categorical colours and centered option groups. --- */
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--red .ruleshift-shape{background:#c65b5d!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--blue .ruleshift-shape{background:#5074d8!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--green .ruleshift-shape{background:#7f9846!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--yellow .ruleshift-shape{background:#d3aa3d!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--purple .ruleshift-shape{background:#8d67c7!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--orange .ruleshift-shape{background:#db853b!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--teal .ruleshift-shape{background:#249aa8!important}
body[data-app="games"] #ruleshiftPanel .ruleshift-colour--pink .ruleshift-shape{background:#c45f92!important}

body[data-app="games"] #ruleshiftPanel .ruleshift-options-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(132px,160px))!important;
  justify-content:center!important;
  justify-items:stretch!important;
  align-items:stretch!important;
  gap:12px!important;
  width:100%!important;
  margin-inline:auto!important;
}
body[data-app="games"] #ruleshiftPanel .ruleshift-token{
  width:100%!important;
  min-width:0!important;
  max-width:160px!important;
  min-height:112px!important;
  justify-self:center!important;
}
body[data-app="games"] #ruleshiftPanel .ruleshift-token-caption{
  display:block!important;
  visibility:visible!important;
  width:auto!important;
  height:auto!important;
  max-width:none!important;
  max-height:none!important;
  overflow:visible!important;
  font-size:10px!important;
  line-height:1.1!important;
}

/* Keep phone boards compact while still centering incomplete rows. */
@media(max-width:820px){
  body[data-app="games"] #ruleshiftPanel .ruleshift-options-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    justify-content:center!important;
    gap:8px!important;
  }
  body[data-app="games"] #ruleshiftPanel .ruleshift-token{
    max-width:none!important;
    min-height:92px!important;
  }
  body[data-app="games"] #ruleshiftPanel .ruleshift-token-caption{
    font-size:9px!important;
  }
  .coherent-progress-grid{grid-template-columns:1fr!important}
  .game-live-xp{grid-template-columns:auto minmax(80px,1fr)!important}
  .game-live-xp>span:last-child{grid-column:1/-1!important}
}


/* Independent non-Realm modules share the same compact live XP language. */
:is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp{
  display:grid!important;
  grid-template-columns:auto minmax(120px,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  width:100%!important;
  padding:8px 11px!important;
  margin:8px 0!important;
  border:1px solid rgba(115,139,215,.28)!important;
  border-radius:13px!important;
  background:rgba(10,20,58,.18)!important;
  color:var(--games-ink)!important;
  font-size:12px!important;
}
:is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp>strong{white-space:nowrap;font-size:12px!important}
:is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp>span:last-child{white-space:nowrap;color:var(--games-muted)!important}
:is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp__bar{
  height:8px!important;border-radius:999px!important;overflow:hidden!important;
  background:rgba(5,12,35,.62)!important;border:1px solid rgba(126,147,219,.24)!important;
}
:is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp__bar>span{
  display:block!important;height:100%!important;border-radius:inherit!important;
  background:linear-gradient(90deg,#5d78d4,#8ca4f0)!important;
}
@media(max-width:820px){
  :is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp{
    grid-template-columns:auto minmax(80px,1fr)!important;
  }
  :is(#blockGridGameCard,#colourSortGameCard,#crossnumberGamePanel) .game-live-xp>span:last-child{
    grid-column:1/-1!important;
  }
}
