:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3fb;
  --text: #14213d;
  --muted: #63708a;
  --border: #dbe3ef;
  --accent: #245eea;
  --accent-strong: #1648c7;
  --good: #167c53;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(31, 46, 81, 0.10);
  --radius: 18px;
  --game-max: 780px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-size: 17px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, select, input { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  box-shadow: 0 5px 15px rgba(36, 94, 234, .25);
}
.header-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .button, .language-link {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-height: 48px;
  border-radius: 11px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.icon-button:hover, .button:hover, .language-link:hover { border-color: #b8c7dc; }
.icon-button:focus-visible, .button:focus-visible, .language-link:focus-visible, .game-cell:focus-visible {
  outline: 3px solid rgba(36, 94, 234, .28);
  outline-offset: 2px;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-strong); }
.button.danger { color: var(--danger); }
.button[aria-pressed="true"] { background: #e9efff; border-color: #aabff7; color: #163b9a; }

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 20px 64px;
}
.hero {
  text-align: center;
  max-width: 760px;
  margin: 10px auto 36px;
}
.hero h1, .game-title h1 {
  margin: 0;
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); }
.hero p { max-width: 600px; margin: 16px auto 0; color: var(--muted); font-size: 1.05rem; }
.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf7f1;
  color: var(--good);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.game-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.game-card {
  min-height: 215px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(31,46,81,.14); }
.game-card .emoji { font-size: 3rem; line-height: 1; margin-bottom: 20px; }
.game-card h2 { margin: 0 0 7px; font-size: 1.15rem; }
.game-card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.game-card .play-label { margin-top: 20px; color: var(--accent); font-weight: 800; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: var(--game-max);
  margin: 0 auto;
}
.game-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.game-title { display: flex; gap: 14px; align-items: center; }
.game-title .game-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
}
.game-title h1 { font-size: clamp(1.55rem, 5vw, 2.1rem); }
.game-title p { margin: 5px 0 0; color: var(--muted); }
.game-panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.game-toolbar {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.toolbar-group { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: flex; gap: 18px; color: var(--muted); font-size: 1rem; }
.stats strong { color: var(--text); font-variant-numeric: tabular-nums; }
.game-stage {
  min-height: 460px;
  padding: clamp(16px, 4vw, 30px);
  background: linear-gradient(145deg, #f2f6fd 0%, #e9eff8 100%);
  display: grid;
  place-items: center;
}
.grid-board {
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  display: grid;
  gap: clamp(5px, 1.3vw, 10px);
  user-select: none;
  touch-action: none;
}
.game-cell {
  border: 0;
  border-radius: clamp(8px, 2vw, 15px);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(39, 55, 86, .12);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  min-width: 0;
  min-height: 0;
}
.game-cell:disabled { cursor: default; }

/* Fifteen */
.fifteen-board { grid-template-columns: repeat(4, 1fr); }
.fifteen-tile { font-size: clamp(1.15rem, 6vw, 2.25rem); background: linear-gradient(145deg, #fff, #e7edf6); }
.fifteen-tile.blank { visibility: hidden; pointer-events: none; }

/* 2048 */
.twenty48-board { grid-template-columns: repeat(4, 1fr); background: #c9bcae; padding: clamp(6px, 1.4vw, 10px); border-radius: 18px; }
.twenty48-tile { font-size: clamp(1rem, 5vw, 2rem); background: #e5ded5; color: #5d554e; }
.twenty48-tile[data-value="4"] { background: #ddd3c5; }
.twenty48-tile[data-value="8"] { background: #d6c2a7; }
.twenty48-tile[data-value="16"] { background: #cbb18e; }
.twenty48-tile[data-value="32"] { background: #bfa174; }
.twenty48-tile[data-value="64"] { background: #b29060; color: white; }
.twenty48-tile[data-value="128"], .twenty48-tile[data-value="256"], .twenty48-tile[data-value="512"], .twenty48-tile[data-value="1024"], .twenty48-tile[data-value="2048"] { background: #8c744c; color: white; }

/* Memory */
.memory-board { grid-template-columns: repeat(4, 1fr); }
.memory-card {
  padding: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg,#5b7ccb,#3859ad);
  color: #fff;
  border: 1px solid rgba(32,55,119,.22);
  box-shadow: inset 0 1px rgba(255,255,255,.22), 0 4px 14px rgba(39,55,86,.14);
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}
.memory-card:not(:disabled):active { transform: scale(.97); }
.memory-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(1.55rem, 7vw, 3rem);
  line-height: 1;
}
.memory-card.revealed, .memory-card.matched {
  background: #fffdf7;
  color: var(--text);
  border-color: rgba(39,55,86,.12);
}
.memory-card.matched {
  background: #eaf7f1;
  box-shadow: inset 0 0 0 2px rgba(35,151,84,.22), 0 4px 14px rgba(39,55,86,.10);
}

/* Minesweeper */
.mines-board { grid-template-columns: repeat(9, 1fr); width: min(100%, 590px); gap: clamp(2px, .7vw, 5px); }
.mine-cell { border-radius: 6px; background: #dfe7f2; box-shadow: inset 0 -2px 0 rgba(45,67,100,.10); font-size: clamp(1.4rem, 6vw, 2.2rem); font-weight: 800; }
.mine-cell.revealed { background: #f9fbfd; box-shadow: inset 0 0 0 1px #d9e1ec; }
.mine-cell.mine { background: #fdecec; }
.mine-cell.flagged { color: #b42318; }
.mine-cell[data-count="1"] { color: #245eea; }
.mine-cell[data-count="2"] { color: #167c53; }
.mine-cell[data-count="3"] { color: #b42318; }
.mine-cell[data-count="4"], .mine-cell[data-count="5"], .mine-cell[data-count="6"], .mine-cell[data-count="7"], .mine-cell[data-count="8"] { color: #6534a6; }

.completion-overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(245, 247, 251, .76);
  backdrop-filter: blur(4px);
  z-index: 20;
}
.completion-overlay.visible { display: grid; }
.completion-card {
  width: min(92%, 380px);
  text-align: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(31,46,81,.18);
  padding: 28px;
}
.completion-card .trophy { font-size: 2.8rem; }
.completion-card h2 { margin: 10px 0 5px; font-size: 1.6rem; }
.completion-card p { margin: 0 0 18px; color: var(--muted); }
.completion-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.info-section {
  max-width: var(--game-max);
  margin: 28px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.info-section h2 { margin-top: 0; }
.info-section p, .info-section li { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  color: var(--muted);
  font-size: .88rem;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 900px) {
  .game-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .header-inner { padding: 0 14px; min-height: 58px; }
  .page-shell { padding: 26px 12px 42px; }
  .game-catalog { grid-template-columns: 1fr; }
  .game-card { min-height: 170px; }
  .game-header-row { align-items: center; }
  .game-title p { display: none; }
  .game-toolbar { padding: 9px; }
  .game-toolbar .button { min-height: 48px; padding: 9px 12px; font-size: 1rem; }
  .stats { width: 100%; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 9px; }
  .game-stage { min-height: 0; padding: 12px; }
  .info-section { padding: 19px; }
  .brand-text-long { display: inline; }
}

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

/* Shared card engine / Klondike */
.card-game-layout,
.card-game-info { max-width: 980px; }
.card-game-stage {
  display: block;
  min-height: 540px;
  padding: clamp(10px, 2.4vw, 22px);
  background: linear-gradient(145deg, #126f49 0%, #0d5c3c 100%);
  overflow-x: clip;
}
.klondike-table {
  --card-w: clamp(36px, 8vw, 78px);
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.klondike-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(10px, 3vw, 28px);
  margin-bottom: clamp(18px, 4vw, 34px);
}
.stock-waste,
.foundations {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--card-w);
  gap: clamp(5px, 1.2vw, 12px);
}
.tableau {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 11px);
  align-items: start;
}
.tableau-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 140px;
  border-radius: 10px;
}
.tableau-pile .playing-card + .playing-card { margin-top: calc(-1 * var(--tableau-overlap, 52px)); }
.foundation-pile { border-radius: 10px; }
.playing-card,
.card-slot {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-w);
  aspect-ratio: 5 / 7;
  border-radius: clamp(5px, 1vw, 9px);
  border: 1px solid rgba(12, 31, 25, .24);
  padding: 0;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 22, 14, .22);
  touch-action: manipulation;
}
.playing-card:focus-visible,
.card-slot:focus-visible {
  outline: 3px solid #ffde59;
  outline-offset: 2px;
  z-index: 30;
}
.card-face {
  background: #fffefa;
  color: #121926;
}
.card-face.red-card { color: #c5252b; }
.card-back {
  background:
    linear-gradient(135deg, rgba(255,255,255,.18) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(315deg, rgba(255,255,255,.18) 25%, transparent 25%) 0 0 / 10px 10px,
    #245eea;
  border: 3px solid #f8fbff;
  color: #fff;
  display: grid;
  place-items: center;
}
.card-back-mark { font-size: clamp(.8rem, 2vw, 1.4rem); opacity: .72; }
.card-slot {
  background: rgba(255, 255, 255, .08);
  border: 2px dashed rgba(255, 255, 255, .28);
  box-shadow: none;
  color: rgba(255,255,255,.42);
  display: grid;
  place-items: center;
}
.stock-empty span { font-size: clamp(1.2rem, 4vw, 2rem); }
.foundation-symbol,
.empty-king { font-size: clamp(1.2rem, 4vw, 2rem); font-weight: 800; }
.card-corner {
  position: absolute;
  left: 7%;
  top: 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .85;
  font-size: clamp(.55rem, 1.7vw, .95rem);
  font-weight: 850;
}
.card-corner small { font-size: .8em; margin-top: 3px; }
.card-corner-bottom {
  left: auto;
  top: auto;
  right: 7%;
  bottom: 4%;
  transform: rotate(180deg);
}
.card-suit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.15rem, 4vw, 2.3rem);
}
.selected-card {
  transform: translateY(-5px);
  box-shadow: 0 0 0 3px #ffde59, 0 7px 14px rgba(0, 22, 14, .28);
  z-index: 25;
}
.dragging-card { opacity: .55; }
.drop-target.drag-over,
.card-slot.drag-over {
  box-shadow: 0 0 0 3px rgba(255, 222, 89, .95);
}
.button:disabled {
  opacity: .45;
  cursor: default;
}
.card-help-line {
  margin: 12px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 620px) {
  .card-game-stage { min-height: 470px; padding: 10px 2px 16px; }
  .klondike-table { --card-w: clamp(46px, 12vw, 52px); }
  .klondike-top { margin-bottom: 18px; gap: 8px; }
  .stock-waste, .foundations { gap: 4px; }
  .tableau { gap: 2px; }
  .tableau-pile .playing-card + .playing-card { margin-top: calc(-1 * var(--tableau-overlap-mobile, 20px)); }
  .playing-card, .card-slot { border-radius: 5px; }
  .card-back { border-width: 2px; }
  .card-corner { left: 5%; top: 3%; font-size: .78rem; }
  .card-corner-bottom { left: auto; top: auto; right: 5%; bottom: 3%; }
  .card-help-line { font-size: .95rem; padding: 0 8px; }
}

/* FreeCell */
.freecell-table {
  --card-w: clamp(35px, 7.3vw, 72px);
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.freecell-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(10px, 3vw, 28px);
  margin-bottom: clamp(18px, 4vw, 32px);
}
.freecells,
.freecell-foundations {
  display: grid;
  grid-template-columns: repeat(4, var(--card-w));
  gap: clamp(4px, 1vw, 10px);
}
.freecell-slot,
.foundation-pile { border-radius: 10px; }
.freecell-cascades {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(3px, .8vw, 9px);
  align-items: start;
}
.freecell-cascade {
  min-width: 0;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
}
.freecell-cascade .playing-card + .playing-card { margin-top: -49px; }
.freecell-symbol { font-size: clamp(1rem, 3vw, 1.7rem); font-weight: 800; }

@media (max-width: 620px) {
  .freecell-table { --card-w: clamp(42px, 11.3vw, 46px); }
  .freecell-top { gap: 6px; margin-bottom: 16px; }
  .freecells, .freecell-foundations { gap: 1px; }
  .freecell-cascades { gap: 1px; }
  .freecell-cascade .playing-card + .playing-card { margin-top: -17px; }
}


/* Senior-friendly QA additions */
.direction-controls {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-areas: ". up ." "left down right";
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.direction-controls .button { width: 58px; height: 52px; padding: 0; font-size: 1.45rem; }
.direction-controls [data-direction="up"] { grid-area: up; }
.direction-controls [data-direction="left"] { grid-area: left; }
.direction-controls [data-direction="down"] { grid-area: down; }
.direction-controls [data-direction="right"] { grid-area: right; }
@media (max-width: 620px) {
  .header-inner { gap: 10px; }
  .header-actions { gap: 6px; }
  .icon-button, .language-link { min-height: 48px; }
  .card-suit { font-size: 1.45rem; }
  .site-footer { font-size: 1rem; }
}

/* v9 — Tilenzo visual pass */
:root {
  --bg: #f4f1ea;
  --surface: #fffdf9;
  --surface-soft: #f2eee4;
  --text: #10213a;
  --muted: #5f6b78;
  --border: #ddd9cf;
  --accent: #239754;
  --accent-strong: #167a41;
  --good: #167c53;
  --shadow: 0 12px 28px rgba(42, 49, 56, .10);
}
body {
  background:
    radial-gradient(circle at 10% 0%, rgba(92,164,199,.12), transparent 28rem),
    linear-gradient(180deg,#f7f4ee,#f2efe8);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", "Segoe UI", sans-serif;
}
.site-header { background: rgba(255,253,249,.96); border-bottom-color:#e4dfd5; }
.brand { font-size:1.12rem; letter-spacing:-.035em; }
.brand-mark { width:38px; height:38px; border-radius:0; background:transparent; box-shadow:none; }
.brand-mark img { width:38px; height:38px; display:block; }
.icon-button,.button,.language-link { border-color:#d9d5cc; box-shadow:0 2px 4px rgba(29,36,42,.03); }
.button.primary { background:linear-gradient(#2eaa61,#208e4e); border-color:#208e4e; box-shadow:0 4px 10px rgba(28,139,73,.18); }
.button.primary:hover { background:linear-gradient(#279b57,#197a41); }
.hero { position:relative; max-width:850px; padding:34px 24px 26px; }
.hero::before,.hero::after { content:""; position:absolute; width:150px; height:90px; border-radius:50%; background:radial-gradient(ellipse at center, rgba(74,156,100,.13), rgba(74,156,100,0) 70%); z-index:-1; }
.hero::before { left:-30px; top:5px; transform:rotate(-15deg); }
.hero::after { right:-20px; top:15px; transform:rotate(16deg); }
.hero h1 { font-size:clamp(2.15rem,6vw,3.8rem); font-weight:800; }
.hero p { font-size:1.1rem; }
.badge { display:none; }
.game-catalog { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.game-card { padding:0 0 18px; min-height:250px; overflow:hidden; align-items:stretch; border-radius:17px; }
.game-card .emoji { display:none; }
.game-card .game-art { display:block; width:100%; aspect-ratio: 1 / 1; object-fit: contain; object-position:center; padding:12px; border-bottom:1px solid #d8ded6; background:#f7f3ec; }




.game-card h2,.game-card p,.game-card .play-label { margin-left:18px; margin-right:18px; }
.game-card h2 { margin-top:16px; margin-bottom:5px; font-size:1.16rem; }
.game-card .play-label { align-self:stretch; justify-content:center; text-align:center; color:white; background:linear-gradient(#2eaa61,#208e4e); padding:10px 15px; border-radius:999px; margin-top:14px; }
.game-panel { border-radius:20px; }
.game-stage { background:linear-gradient(145deg,#f7f2e9,#eee7dc); }
.game-title .game-icon { background:#eee9df; border:1px solid #ded8ce; }
.info-section { background:#fffaf3; }

/* Give each non-card game a distinct, tactile board instead of generic app tiles. */
.fifteen-board { background:#a87345; padding:10px; border-radius:18px; box-shadow:inset 0 3px 12px rgba(70,38,18,.25); }
.fifteen-tile { background:linear-gradient(145deg,#e7bd7c,#c99151); color:#4a2c14; border:1px solid rgba(90,52,24,.18); box-shadow:inset 0 1px rgba(255,255,255,.55),0 3px 8px rgba(78,45,19,.22); }
.twenty48-board { background:#b5a28c; box-shadow:inset 0 3px 10px rgba(75,59,41,.16); }
.mines-board { padding:8px; border-radius:16px; background:#b9c4ce; box-shadow:inset 0 3px 10px rgba(51,65,77,.15); }
.mine-cell { background:linear-gradient(145deg,#e7edf1,#c7d1d9); border:1px solid rgba(73,88,101,.16); }
.card-game-stage { background:radial-gradient(circle at 50% 25%,#188154,#0d603d 62%,#0a5033); }
.playing-card,.card-slot { box-shadow:0 5px 11px rgba(0,28,17,.25); }
.card-face { background:#fffdf8; }

@media (max-width:900px){ .game-catalog{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:620px){
  .game-catalog{grid-template-columns:1fr 1fr; gap:10px;}
  .game-card{min-height:190px;border-radius:14px;}
  .game-card .game-art{aspect-ratio:1/1;}
  .game-card h2{font-size:.98rem;margin:10px 11px 3px;}
  .game-card p{display:none;}
  .game-card .play-label{margin:9px 11px 0;padding:8px 10px;font-size:.9rem;}
  .hero{padding:22px 6px 18px;}
}


/* Premium inline icon system */
.button-icon { width: 1.1rem; height: 1.1rem; display:inline-flex; align-items:center; justify-content:center; flex: 0 0 auto; }
.button.icon-only, .direction-controls .button { padding:0; }
.button-icon svg, .trophy svg { width:100%; height:100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .button-icon, .button .button-icon, .site-footer .button-icon { color: currentColor; }
.sound-icon { position: relative; width: 1.15rem; height: 1.15rem; }
.sound-icon .sound-off-icon { position:absolute; inset:0; display:none; }
.icon-button.is-muted .sound-icon > svg:first-child { display:none; }
.icon-button.is-muted .sound-icon .sound-off-icon { display:block; }
.game-art-icon { overflow:hidden; background:#fff8ef; padding:4px; display:grid; place-items:center; }
.game-art-icon img { width:100%; height:100%; object-fit:contain; object-position:center; display:block; }
.game-title { align-items: center; }
.game-title .game-icon { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 4px 14px rgba(39,55,86,.12); }
.completion-card .trophy { width: 56px; height: 56px; margin: 0 auto 6px; color: #2eaa61; }
.site-footer a.buttonlike, .site-footer a { display:inline-flex; align-items:center; gap:7px; }
.direction-controls .button .button-icon { width: 1.2rem; height:1.2rem; }
@media (max-width: 720px) {
  .game-title .game-icon { width: 56px; height: 56px; border-radius: 16px; }
  .button-icon { width: 1rem; height: 1rem; }
}


/* Tilenzo brand pass v12 */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  min-height: 470px;
  overflow: hidden;
  margin: -10px 0 48px;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid #e0ddd4;
  border-radius: 30px;
  background:
    radial-gradient(circle at 86% 18%, rgba(113,188,139,.24), transparent 28%),
    radial-gradient(circle at 9% 88%, rgba(126,186,224,.22), transparent 30%),
    linear-gradient(145deg,#fffdf8,#f3f8f1 54%,#eef6f9);
  box-shadow: 0 24px 55px rgba(56,69,61,.11);
}
.hero-copy { align-self:center; position:relative; z-index:3; max-width:610px; }
.eyebrow { margin:0 0 9px; color:#23814d !important; font-size:.78rem !important; font-weight:850; letter-spacing:.075em; text-transform:uppercase; }
.home-hero h1 { margin:0; font-size:clamp(2.65rem,6.5vw,5.3rem); line-height:.96; letter-spacing:-.052em; }
.home-hero h1 span { color:#23814d; }
.hero-lead { max-width:560px; margin:22px 0 18px; color:#4f5d58; font-size:clamp(1.02rem,2vw,1.2rem); line-height:1.65; }
.hero-points { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 23px; }
.hero-points span { padding:7px 11px; border:1px solid #d8e4db; border-radius:999px; background:rgba(255,255,255,.72); color:#3f5548; font-size:.84rem; font-weight:750; }
.hero-cta { padding:12px 18px; }
.hero-art { min-height:330px; position:relative; align-self:stretch; }
.hero-card { position:absolute; width:clamp(160px,19vw,240px); aspect-ratio:1; object-fit:cover; border-radius:25px; border:8px solid rgba(255,255,255,.92); box-shadow:0 22px 38px rgba(39,63,49,.20); }
.hero-card-a { right:28%; top:5%; transform:rotate(-8deg); z-index:2; }
.hero-card-b { right:-1%; top:25%; transform:rotate(8deg); z-index:1; }
.hero-card-c { right:30%; bottom:-5%; transform:rotate(5deg); z-index:3; width:clamp(135px,16vw,205px); }
.hero-leaf { position:absolute; width:110px; height:54px; border-radius:100% 0 100% 0; background:linear-gradient(145deg,#6eb87d,#2f8c58); opacity:.22; }
.leaf-one { right:-25px; top:15px; transform:rotate(25deg); }
.leaf-two { left:12px; bottom:14px; transform:rotate(-35deg); }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:30px; margin:0 0 20px; }
.section-heading h2 { margin:0; font-size:clamp(1.6rem,3vw,2.35rem); letter-spacing:-.035em; }
.section-heading > p { max-width:470px; margin:0; color:var(--muted); }
.home-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:34px; }
.home-info-grid .info-section { margin:0; }

/* Branded card backs */
.card-back {
  background:
    radial-gradient(circle at 22% 20%, rgba(255,255,255,.18) 0 2px, transparent 2.5px) 0 0/14px 14px,
    linear-gradient(145deg,#2e6bd1,#174ea9 70%,#123f90);
  border: 3px solid #f7fbff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 5px 11px rgba(0,28,17,.25);
}
.card-back::before { content:""; position:absolute; inset:5px; border:1px solid rgba(255,255,255,.42); border-radius:calc(clamp(5px,1vw,9px) - 2px); pointer-events:none; }
.card-back-mark { width:44%; aspect-ratio:1; display:grid; place-items:center; color:rgba(255,255,255,.9); opacity:1; }
.card-back-mark svg { width:100%; height:100%; fill:rgba(255,255,255,.18); stroke:#fff; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* Branded 2048 palette */
.twenty48-board { background:#bca890; border:1px solid rgba(95,72,45,.16); }
.twenty48-tile { background:#f5efe4; color:#69533c; box-shadow:inset 0 1px rgba(255,255,255,.7),0 4px 9px rgba(92,66,39,.14); }
.twenty48-tile[data-value="2"] { background:#f8f2e8; color:#6e5944; }
.twenty48-tile[data-value="4"] { background:#f2ddb8; color:#745535; }
.twenty48-tile[data-value="8"] { background:#f6b15f; color:#fffdf8; }
.twenty48-tile[data-value="16"] { background:#f17a57; color:white; }
.twenty48-tile[data-value="32"] { background:#e85f50; color:white; }
.twenty48-tile[data-value="64"] { background:#cf4b43; color:white; }
.twenty48-tile[data-value="128"] { background:#7ebd7c; color:white; }
.twenty48-tile[data-value="256"] { background:#55a96b; color:white; }
.twenty48-tile[data-value="512"] { background:#328f5c; color:white; }
.twenty48-tile[data-value="1024"] { background:#26794f; color:white; font-size:clamp(.9rem,4.2vw,1.75rem); }
.twenty48-tile[data-value="2048"] { background:linear-gradient(145deg,#e3af3c,#cb7928); color:#fff; box-shadow:0 0 0 3px rgba(236,185,67,.24),0 5px 13px rgba(117,73,21,.23); font-size:clamp(.9rem,4.2vw,1.75rem); }

/* Branded Memory deck – no system emoji */
.memory-card { position:relative; overflow:hidden; background:linear-gradient(145deg,#3f74c9,#2353a9); border:2px solid rgba(255,255,255,.88); }
.memory-card::before { content:""; position:absolute; inset:5px; border:1px solid rgba(255,255,255,.28); border-radius:inherit; pointer-events:none; }
.memory-symbol { position:relative; z-index:1; }
.memory-vector svg, .memory-back-mark svg { width:58%; height:58%; max-width:74px; max-height:74px; stroke:currentColor; fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; }
.memory-back-mark { color:#fff; opacity:.92; }
.memory-back-mark svg { fill:rgba(255,255,255,.12); }
.memory-card.revealed { background:#fffaf1; color:#2b7650; border-color:#e6dccb; }
.memory-card.revealed::before { border-color:rgba(43,118,80,.12); }
.memory-card.matched { background:linear-gradient(145deg,#e6f5e8,#cdebd4); color:#25774b; border-color:#bddfc7; }

@media (max-width:820px) {
  .home-hero { grid-template-columns:1fr; min-height:0; padding:32px 24px 25px; }
  .hero-art { min-height:245px; margin-top:18px; }
  .hero-card { width:min(42vw,190px); border-width:6px; border-radius:20px; }
  .hero-card-a { left:7%; right:auto; top:4%; }
  .hero-card-b { right:4%; top:22%; }
  .hero-card-c { left:35%; bottom:-8px; width:min(34vw,155px); }
  .section-heading { align-items:flex-start; flex-direction:column; gap:8px; }
  .home-info-grid { grid-template-columns:1fr; }
}
@media (max-width:520px) {
  .home-hero { margin-top:-20px; border-radius:0 0 24px 24px; margin-left:-20px; margin-right:-20px; }
  .home-hero h1 { font-size:clamp(2.5rem,13vw,3.6rem); }
  .hero-art { min-height:205px; }
  .hero-points span { font-size:.78rem; }
}


/* Compact first viewport + visible game-list navigation v13 */
.home-hero {
  min-height: 300px;
  margin-bottom: 22px;
  padding: clamp(20px, 3vw, 34px) clamp(22px, 4vw, 42px);
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, .88fr);
}
.home-hero h1 { font-size: clamp(2.25rem, 5vw, 4.15rem); line-height: .98; }
.hero-lead { margin: 13px 0 12px; font-size: clamp(.98rem, 1.7vw, 1.1rem); line-height: 1.5; }
.hero-points { margin-bottom: 13px; }
.hero-points span { padding: 5px 9px; }
.hero-cta { padding: 9px 15px; min-height: 44px; }
.hero-art { min-height: 235px; }
.hero-card { width: clamp(120px, 14vw, 176px); border-width: 6px; border-radius: 20px; }
.hero-card-a { right: 30%; top: 2%; }
.hero-card-b { right: 1%; top: 22%; }
.hero-card-c { right: 31%; bottom: -2%; width: clamp(105px, 12vw, 150px); }
.section-heading { margin-bottom: 13px; }
.section-heading .eyebrow { display:none; }
.section-heading h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
.section-heading > p { font-size: .92rem; }
.game-card { min-height: 225px; }
.game-card .game-art { aspect-ratio: 1.18 / 1; object-fit:contain; object-position:center; padding:10px 14px; }
.game-card h2 { margin-top: 12px; }
.game-card .play-label { margin-top: 10px; padding: 9px 14px; }

.game-header-back { flex: 0 0 auto; white-space: nowrap; background:#fffdf8; }
.game-header-back:hover { border-color:#9fc8ad; background:#f6fbf7; }

@media (min-width: 900px) and (min-height: 700px) {
  .page-shell { padding-top: 24px; }
  .home-hero + .section-heading { scroll-margin-top: 76px; }
}
@media (max-width: 820px) {
  .home-hero { grid-template-columns: 1fr 210px; min-height: 280px; padding: 22px; }
  .hero-art { min-height: 205px; margin-top:0; }
  .hero-card { width: 132px; }
  .hero-card-a { left:auto; right:38px; top:2px; }
  .hero-card-b { right:-2px; top:55px; }
  .hero-card-c { left:auto; right:70px; bottom:-2px; width:112px; }
  .game-header-row { flex-wrap: wrap; }
  .game-header-back { margin-left: 70px; }
}
@media (max-width: 620px) {
  .home-hero { grid-template-columns:1fr; min-height:0; padding: 19px 18px 17px; }
  .home-hero h1 { font-size: clamp(2.2rem, 11vw, 3.1rem); }
  .hero-art { display:none; }
  .hero-lead { margin: 10px 0; }
  .hero-points { margin-bottom: 10px; }
  .section-heading > p { display:none; }
  .game-header-back { width:100%; margin-left:0; }
}


/* Correctly cropped generated game artwork */
.game-card .game-art {
  width: 100%;
  aspect-ratio: 1.08 / 1;
  object-fit: contain;
  object-position: center center;
  padding: 12px;
  background: #f7f3ec;
}
.game-art-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 720px) {
  .game-card .game-art { padding: 8px; }
}


/* SEO-friendly visible breadcrumbs */
.breadcrumb{max-width:var(--game-max);margin:0 auto 16px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:.92rem}.breadcrumb a{color:var(--accent-strong);text-decoration:none;font-weight:700}.breadcrumb a:hover{text-decoration:underline}.breadcrumb [aria-current="page"]{color:var(--muted)}


/* Launch localization + responsive image pass */
.language-switcher{display:flex;align-items:center;gap:4px;padding:3px;border:1px solid #ded8ce;border-radius:12px;background:#fffaf3}.language-switcher .language-link{min-height:40px;padding:6px 9px;border:0;background:transparent;box-shadow:none}.language-switcher .language-link[aria-current="page"]{background:#e5f3e8;color:#177540}.game-picture{display:block;width:100%;height:auto}.game-picture img{display:block}.game-icon .game-picture{width:100%;height:100%}.game-icon .game-picture img{width:100%;height:100%;object-fit:contain}.game-seo-copy{margin-top:22px}.game-seo-copy h2:not(:first-child){margin-top:1.4em}.home-info-grid a,.game-seo-copy a{font-weight:700;color:#177540}.header-actions{flex-wrap:wrap;justify-content:flex-end}@media(max-width:620px){.language-switcher{gap:1px}.language-switcher .language-link{min-height:38px;padding:5px 7px;font-size:.84rem}.header-inner{padding-left:12px;padding-right:12px}.header-actions{gap:5px}.game-header-back span:last-child{display:inline}}html[lang="zh-Hans"] body{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif}

.game-icon .game-picture{height:100%}.game-card .game-picture{height:auto}

/* v16 — normalized generated game artwork safe-area */
.game-card .game-art {
  object-fit: contain;
  object-position: center;
  padding: 8px;
}
@media (max-width: 720px) {
  .game-card .game-art { padding: 6px; }
}


/* Language picker dropdown + locale suggestion v18 */
.language-picker { position: relative; }
.language-picker-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 16px; background: #fffdf8; color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 rgba(20,34,18,.03);
}
.language-picker-button:hover { background:#f7faf7; border-color:#bdd6c5; }
.language-picker-button:focus-visible { outline: 3px solid rgba(35,143,79,.18); outline-offset: 2px; }
.language-picker-globe, .language-picker-chevron { display:inline-flex; align-items:center; justify-content:center; }
.language-picker-globe svg, .language-picker-chevron svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.language-picker-chevron svg { width:16px; height:16px; transition: transform .18s ease; }
.language-picker.is-open .language-picker-chevron svg { transform: rotate(180deg); }
.language-current { line-height:1; }
.language-menu {
  position:absolute; right:0; top:calc(100% + 8px); z-index:60; min-width: 200px; padding: 8px;
  border:1px solid #d9e3dc; border-radius: 18px; background:#fffefb; box-shadow: 0 18px 36px rgba(26,45,35,.14);
  opacity:0; transform: translateY(-6px); pointer-events:none; transition: opacity .16s ease, transform .16s ease;
}
.language-picker.is-open .language-menu { opacity:1; transform: translateY(0); pointer-events:auto; }
.language-menu a {
  display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-radius:12px;
  color: var(--ink); text-decoration:none; font-weight:700;
}
.language-menu a:hover { background:#f4f8f4; }
.language-menu a[aria-current="page"] { background:#edf7ef; color:#23814d; }
.language-short { color: var(--muted); font-size: .92rem; font-weight: 800; }
.language-menu a[aria-current="page"] .language-short { color:#23814d; }
.language-suggestion {
  position:absolute; left:clamp(20px,3vw,34px); bottom:14px; z-index:4; display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  max-width:min(92%, 430px); padding:12px 14px; border:1px solid #d9e7dd; border-radius:16px; background:rgba(255,255,255,.9);
  box-shadow:0 12px 30px rgba(37,64,47,.10); backdrop-filter: blur(6px);
}
.language-suggestion p { margin:0; color:#3e5448; font-size:.95rem; font-weight:700; }
.language-suggestion-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.button.small { min-height:40px; padding:8px 14px; border-radius:14px; }
.button.ghost { background:#fffdf8; color:var(--ink); border:1px solid var(--border); }
.button.ghost:hover { background:#f5f8f5; }
.hero-art-hand { display:flex; align-items:center; justify-content:flex-end; min-height:235px; }
.hero-banner-hand { display:block; width:min(100%, 430px); max-height:100%; height:auto; object-fit:contain; filter:drop-shadow(0 18px 28px rgba(39,63,49,.16)); }
@media (max-width: 820px) {
  .hero-art-hand { min-height:205px; }
  .hero-banner-hand { width:min(100%, 250px); }
  .language-suggestion { position: static; margin-top: 14px; max-width: 100%; }
}
@media (max-width: 620px) {
  .hero-art-hand { display:none; }
  .language-picker-button { min-height:44px; padding: 0 12px; border-radius:14px; }
  .language-menu { right:0; left:auto; min-width:190px; }
}


/* Memo illustrated pair cards v19 */
.memory-picture { position:absolute; inset:0; display:grid; place-items:center; padding:7%; }
.memory-picture img { width:100%; height:100%; object-fit:cover; border-radius:clamp(8px,1.4vw,16px); display:block; user-select:none; pointer-events:none; }
.memory-card.revealed, .memory-card.matched { padding:0; overflow:hidden; }
.memory-card.revealed::before, .memory-card.matched::before { display:none; }
.memory-card.matched .memory-picture { opacity:.82; }
.memory-card.matched { box-shadow:inset 0 0 0 4px rgba(46,170,97,.32); }
@media (max-width:620px){ .memory-picture { padding:5%; } }

/* Final first-viewport + normalized art pass v20 */
@media (min-width: 900px) {
  .page-shell { padding-top: 16px; }
  .home-hero {
    min-height: 0;
    margin-top: -4px;
    margin-bottom: 14px;
    padding: 18px 30px;
    grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
    align-items: center;
  }
  .home-hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.45rem);
    line-height: .95;
  }
  .hero-lead {
    margin: 10px 0 9px;
    font-size: 1rem;
    line-height: 1.42;
  }
  .hero-points { margin-bottom: 10px; gap: 6px; }
  .hero-points span { padding: 4px 8px; font-size: .8rem; }
  .hero-cta { min-height: 42px; padding: 8px 14px; }
  .hero-art-hand {
    min-height: 0;
    height: 220px;
    align-self: center;
    justify-content: center;
    overflow: hidden;
  }
  .hero-banner-hand {
    width: auto;
    height: 220px;
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
  }
  .section-heading { margin-bottom: 10px; }
  .section-heading h2 { font-size: clamp(1.3rem, 2vw, 1.75rem); }
  .section-heading > p { font-size: .88rem; }
  .game-card { min-height: 0; }
  .game-card .game-art {
    aspect-ratio: 1.32 / 1;
    padding: 8px 10px;
    object-fit: contain;
    object-position: center;
  }
  .game-card h2 { margin-top: 10px; }
  .game-card p { font-size: .88rem; }
  .game-card .play-label { margin-top: 8px; padding: 8px 12px; }
}

/* Same safe-area behavior for all six current game illustrations */
.game-card .game-picture { background:#f7f3ec; }
.game-card .game-art,
.game-art-icon img {
  object-fit: contain;
  object-position: center center;
}


/* Final UI corrections v21 */
.twenty48-board > .twenty48-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: grid;
  place-items: center;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
  border: 0;
}
.twenty48-board > .twenty48-tile:focus,
.twenty48-board > .twenty48-tile:active {
  transform: none;
}
.twenty48-board > .twenty48-tile:focus-visible {
  outline: 2px solid rgba(53, 126, 82, .28);
  outline-offset: -3px;
}

.game-card .game-picture {
  display: grid;
  place-items: center;
  background: #f7f3ec;
}
.game-card .game-art {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center center;
  padding: 10px;
}
.game-art-icon img,
.game-card .game-picture img {
  display: block;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
}

@media (min-width: 900px) {
  .home-hero {
    margin-top: -2px;
    margin-bottom: 10px;
    padding: 14px 26px;
    grid-template-columns: minmax(0, 1.24fr) minmax(210px, .76fr);
  }
  .home-hero h1 {
    font-size: clamp(2.05rem, 3.5vw, 3rem);
    line-height: .94;
  }
  .hero-lead {
    margin: 8px 0 8px;
    font-size: .98rem;
    line-height: 1.38;
    max-width: 36rem;
  }
  .hero-points { margin-bottom: 8px; }
  .hero-points span { padding: 4px 8px; font-size: .78rem; }
  .hero-cta { min-height: 40px; padding: 7px 13px; }
  .hero-art-hand {
    height: 154px;
    min-height: 0;
    align-self: center;
    justify-content: center;
    overflow: hidden;
  }
  .hero-banner-hand {
    width: auto;
    height: 154px;
    max-width: 100%;
    max-height: 154px;
    object-fit: contain;
  }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: clamp(1.22rem, 1.8vw, 1.6rem); }
  .section-heading > p { font-size: .85rem; }
}


/* Home simplification + full-bleed icon treatment v22 */
.home-hero.home-hero-textonly {
  display: block;
  min-height: 0;
  margin: 4px auto 10px;
  padding: 6px 0 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  text-align: center;
}
.home-hero.home-hero-textonly .hero-copy {
  max-width: 880px;
  margin: 0 auto;
}
.home-hero.home-hero-textonly .eyebrow {
  margin-bottom: 8px;
}
.home-hero.home-hero-textonly h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: .95;
}
.home-hero.home-hero-textonly .hero-lead {
  margin: 12px auto 0;
  max-width: 760px;
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.5;
}
.home-hero.home-hero-textonly .hero-points,
.home-hero.home-hero-textonly .hero-cta,
.home-hero.home-hero-textonly .hero-art,
.home-hero.home-hero-textonly .hero-art-hand,
.home-hero.home-hero-textonly .language-suggestion { position: static; margin-top: 14px; max-width: 100%; }

.game-card .game-picture {
  display: grid;
  place-items: stretch;
  padding: 0;
  background: #f0eee8;
  overflow: hidden;
}
.game-card .game-art {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  object-fit: cover;
  object-position: center center;
  background: transparent;
}
/* Use the icon's dominant color across the whole art frame */
.game-card[href*="/games/solitaire/"] .game-picture { background:#3aab62; }
.game-card[href*="/games/freecell/"] .game-picture { background:#8fd0fb; }
.game-card[href*="/games/minesweeper/"] .game-picture { background:#c5e5fb; }
.game-card[href*="/games/2048/"] .game-picture { background:#f4deb0; }
.game-card[href*="/games/15-puzzle/"] .game-picture { background:#e7c08b; }
.game-card[href*="/games/memo/"] .game-picture { background:#cdc6fb; }

@media (min-width: 900px) {
  .home-hero.home-hero-textonly {
    margin: 0 auto 6px;
    padding: 2px 0 0;
  }
  .home-hero.home-hero-textonly h1 {
    font-size: clamp(1.95rem, 3.7vw, 2.95rem);
  }
  .home-hero.home-hero-textonly .hero-lead {
    margin-top: 10px;
    font-size: 1rem;
  }
}
@media (max-width: 620px) {
  .home-hero.home-hero-textonly h1 { font-size: clamp(1.95rem, 10vw, 2.6rem); }
  .home-hero.home-hero-textonly .hero-lead { font-size: .98rem; }
}


/* v24 game entry scroll + adaptive Klondike */
.game-panel { scroll-margin-top: 78px; }
.tableau { --tableau-overlap: 52px; }
@media (max-width: 620px) {
  .tableau { --tableau-overlap-mobile: 20px; }
}


/* v27 mobile ad architecture + compact mobile game chrome + square puzzle hardening */

/* Ad containers stay completely out of layout until an ad provider marks them ready.
   For QA, add ?ads=preview to any game URL. */
.ad-slot { display:none; }
.ad-slot[data-ad-ready="true"],
.ad-slot.is-preview {
  display:flex;
  align-items:center;
  justify-content:center;
  width:min(100%, 360px);
  margin:8px auto;
  overflow:hidden;
  background:#f7f5ef;
  border:1px solid #e5dfd3;
  border-radius:10px;
}
.ad-slot--compact[data-ad-ready="true"],
.ad-slot--compact.is-preview { min-height:50px; }
.ad-slot--large[data-ad-ready="true"],
.ad-slot--large.is-preview { min-height:100px; }
.ad-slot-placeholder {
  display:none;
  color:#8a8175;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.ad-slot.is-preview .ad-slot-placeholder { display:block; }

/* Keep every puzzle tile genuinely square, including pressed/focused button states. */
.grid-board {
  grid-auto-rows: 1fr;
}
.grid-board > .game-cell,
.fifteen-board > .fifteen-tile,
.twenty48-board > .twenty48-tile,
.memory-board > .memory-card,
.mines-board > .mine-cell {
  width:100%;
  aspect-ratio:1 / 1;
  height:auto;
  min-width:0;
  min-height:0;
  padding:0;
  display:grid;
  place-items:center;
  appearance:none;
  -webkit-appearance:none;
  line-height:1;
}
.grid-board > .game-cell:active,
.grid-board > .game-cell:focus,
.fifteen-board > .fifteen-tile:active,
.twenty48-board > .twenty48-tile:active,
.memory-board > .memory-card:active,
.mines-board > .mine-cell:active {
  aspect-ratio:1 / 1;
}

.twenty48-help-line {
  margin:12px auto 0;
  max-width:520px;
  color:var(--muted);
  text-align:center;
  font-size:.92rem;
  line-height:1.45;
}


/* FreeCell: brief visual feedback for a card/run that cannot be moved. */
@keyframes freecell-card-reject {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
[data-freecell] .playing-card.card-rejected {
  animation: freecell-card-reject 260ms ease-out;
  box-shadow: 0 0 0 3px rgba(196, 67, 67, .55), 0 7px 14px rgba(0, 22, 14, .22);
}
@media (prefers-reduced-motion: reduce) {
  [data-freecell] .playing-card.card-rejected,
  .sudoku-cell.cell-error { animation: none; }
}

/* FreeCell uses a runtime variable so long cascades can compress without shrinking cards. */
.freecell-cascade .playing-card + .playing-card {
  margin-top:calc(-1 * var(--freecell-overlap, 49px));
}

@media (max-width:700px) {
  /* More useful viewport height for games; touch targets remain >= 40px. */
  .header-inner {
    min-height:52px;
    padding-left:10px;
    padding-right:10px;
    gap:8px;
  }
  .brand { gap:7px; font-size:.98rem; }
  .brand-mark { width:28px; height:28px; border-radius:9px; }
  .brand-mark img { width:28px; height:28px; }
  .header-actions { gap:5px; }
  .icon-button,
  .language-link,
  .language-picker-button {
    height:40px;
    min-height:40px;
    padding:5px 9px;
    border-radius:11px;
    line-height:1;
  }

  .page-shell { padding-top:16px; }
  .breadcrumb { margin-bottom:10px; font-size:.84rem; gap:6px; }
  .game-header-row { margin-bottom:10px; gap:10px; }
  .game-title { gap:10px; }
  .game-title .game-icon { width:44px; height:44px; border-radius:12px; }
  .game-title h1 { font-size:clamp(1.35rem, 6.8vw, 1.72rem); }
  .game-header-back { min-height:40px; padding:6px 9px; font-size:.9rem; }

  .game-toolbar {
    padding:7px 8px;
    gap:7px;
  }
  .toolbar-group {
    gap:6px;
    width:100%;
    flex-wrap:nowrap;
  }
  .game-toolbar .button {
    min-height:40px;
    padding:6px 9px;
    font-size:.9rem;
    flex:1 1 auto;
    white-space:nowrap;
  }
  .game-toolbar .button-icon svg { width:17px; height:17px; }
  .stats {
    width:100%;
    justify-content:space-between;
    gap:8px;
    border-top:1px solid var(--border);
    padding-top:6px;
    font-size:.88rem;
    line-height:1.2;
  }

  .ad-slot--mobile[data-ad-ready="true"],
  .ad-slot--mobile.is-preview {
    margin:7px auto;
    width:min(calc(100% - 16px), 360px);
  }

  .game-stage { padding:10px; }
  .card-game-stage { padding-top:8px; }
  .direction-controls { margin-top:12px; }
  .twenty48-help-line { margin-top:8px; padding:0 6px; font-size:.86rem; }

  /* Dynamic Klondike variable now applies on mobile too. */
  .tableau-pile .playing-card + .playing-card {
    margin-top:calc(-1 * var(--tableau-overlap, 30px));
  }
  .freecell-cascade .playing-card + .playing-card {
    margin-top:calc(-1 * var(--freecell-overlap, 28px));
  }
}

@media (min-width:701px) {
  /* Current pre-game inventory is deliberately mobile-only. Desktop can get a rail later. */
  .ad-slot--mobile { display:none !important; }
}


/* v29 — FreeCell viewport-fit cascade spacing */
.freecell-cascade .playing-card + .playing-card {
  margin-top: calc(-1 * var(--freecell-overlap, 49px));
}
@media (max-width: 620px) {
  .freecell-cascade .playing-card + .playing-card {
    margin-top: calc(-1 * var(--freecell-overlap, 17px));
  }
}


/* Solitaire card-back picker */
.card-back-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.card-back-option {
  appearance: none;
  border: 1px solid #d9d5cc;
  background: #fffdf8;
  border-radius: 10px;
  padding: 3px;
  width: 42px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(29,36,42,.03);
}
.card-back-option:hover { border-color: #b8d7c0; background: #f7faf7; }
.card-back-option.is-active,
.card-back-option[aria-pressed="true"] {
  border-color: #208e4e;
  box-shadow: inset 0 0 0 1px rgba(32,142,78,.95);
}
.card-back-option-thumb {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: #fff center / cover no-repeat;
  background-image: var(--thumb-card-back-image);
  display: block;
}
.klondike-table[data-card-back-style] .card-back {
  background: #fff center / cover no-repeat;
  background-image: var(--card-back-image);
  border: 0;
  box-shadow: 0 5px 11px rgba(0,28,17,.25);
  overflow: hidden;
}
.klondike-table[data-card-back-style] .card-back::before,
.klondike-table[data-card-back-style] .card-back-mark {
  display: none;
}
@media (max-width: 900px) {
  .card-back-picker { flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .card-back-picker {
    width: 100%;
    justify-content: flex-start;
    padding-top: 2px;
  }
  .card-back-option {
    width: 34px;
    height: 47px;
    border-radius: 9px;
    padding: 2px;
  }
}


/* Puzzle & Memo style pickers v34 */
.game-style-picker {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  flex:0 0 auto;
  margin-inline:auto;
}
.game-style-option {
  appearance:none;
  -webkit-appearance:none;
  width:46px;
  height:46px;
  padding:3px;
  border:1px solid #d9d5cc;
  border-radius:11px;
  background:#fffdf8;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 2px 4px rgba(29,36,42,.04);
}
.game-style-option:hover { border-color:#b8d7c0; background:#f7faf7; }
.game-style-option.is-active,
.game-style-option[aria-pressed="true"] {
  border-color:#208e4e;
  box-shadow:inset 0 0 0 1px rgba(32,142,78,.95);
}
.game-style-option img,
.game-style-option .game-style-swatch {
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
  border-radius:7px;
}
.game-style-swatch--default {
  background:linear-gradient(145deg,#f5efe4,#f6b15f 55%,#55a96b);
}
.game-style-swatch--memo {
  background:linear-gradient(145deg,#3f74c9,#2353a9);
  position:relative;
}
.game-style-swatch--memo::after {
  content:"";
  position:absolute;
  inset:7px;
  border:1px solid rgba(255,255,255,.5);
  border-radius:5px;
}
@media (max-width:620px) {
  .game-style-picker { width:100%; order:2; gap:6px; }
  .game-style-option { width:40px; height:40px; border-radius:10px; padding:2px; }
  .game-style-option img,.game-style-option .game-style-swatch { border-radius:7px; }
}

/* 15 Puzzle material themes */
.fifteen-board[data-style="marble"] {
  background:linear-gradient(145deg,#d8c6a2,#b69b70);
}
.fifteen-board[data-style="marble"] .fifteen-tile {
  background:
    linear-gradient(120deg,rgba(201,172,123,.18) 1px,transparent 1px) 0 0/36px 36px,
    linear-gradient(145deg,#fffdf8,#eee3d2);
  color:#6d421f;
  border:1px solid rgba(118,88,53,.18);
  box-shadow:inset 0 1px rgba(255,255,255,.75),0 3px 8px rgba(82,62,40,.16);
}
.fifteen-board[data-style="steel"] {
  background:linear-gradient(145deg,#7b858d,#555f66);
}
.fifteen-board[data-style="steel"] .fifteen-tile {
  background:linear-gradient(180deg,#f1f3f4,#bcc3c8 48%,#e4e7e9);
  color:#20262a;
  border:1px solid #9ba4aa;
  box-shadow:inset 0 1px rgba(255,255,255,.88),0 3px 8px rgba(26,32,36,.28);
}
.fifteen-board[data-style="terracotta"] {
  background:linear-gradient(145deg,#864321,#5a2f1c);
}
.fifteen-board[data-style="terracotta"] .fifteen-tile {
  background:linear-gradient(145deg,#dc8754,#b75d32);
  color:#4a2416;
  border:1px solid rgba(89,42,22,.3);
  box-shadow:inset 0 1px rgba(255,220,184,.35),0 3px 8px rgba(65,31,18,.28);
}

/* Minesweeper material themes */
.mines-board[data-style="glass"] {
  background:linear-gradient(145deg,#85c9ee,#5eaee0);
}
.mines-board[data-style="glass"] .mine-cell:not(.revealed) {
  background:linear-gradient(145deg,rgba(245,252,255,.92),rgba(182,224,247,.78));
  border:1px solid rgba(255,255,255,.78);
  box-shadow:inset 0 1px rgba(255,255,255,.9),0 2px 5px rgba(54,117,156,.2);
}
.mines-board[data-style="stone"] {
  background:linear-gradient(145deg,#626a68,#3f4644);
}
.mines-board[data-style="stone"] .mine-cell:not(.revealed) {
  background:linear-gradient(145deg,#c5c7c3,#929793);
  border:1px solid #7f8581;
  box-shadow:inset 0 1px rgba(255,255,255,.35),0 2px 4px rgba(23,28,26,.3);
}
.mines-board[data-style="steampunk"] {
  background:linear-gradient(145deg,#8b4e25,#5b301c);
}
.mines-board[data-style="steampunk"] .mine-cell:not(.revealed) {
  background:linear-gradient(145deg,#d8a24a,#a96624);
  border:1px solid #75471f;
  box-shadow:inset 0 1px rgba(255,228,157,.48),0 2px 4px rgba(63,34,15,.32);
}

/* 2048 material themes */
.twenty48-board[data-style="glass"] { background:linear-gradient(145deg,#86caef,#5baedf); }
.twenty48-board[data-style="glass"] .twenty48-tile { border:1px solid rgba(255,255,255,.66); box-shadow:inset 0 1px rgba(255,255,255,.8),0 3px 7px rgba(48,112,150,.18); }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="0"] { background:rgba(224,244,255,.45); }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="2"] { background:#e9f7ff; color:#6d513d; }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="4"] { background:#ffe6a9; color:#7a4f22; }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="8"] { background:#ffad59; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="16"] { background:#f66d79; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="32"],
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="64"] { background:#e94f68; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="128"],
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="256"],
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="512"],
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="1024"],
.twenty48-board[data-style="glass"] .twenty48-tile[data-value="2048"] { background:#3e9f83; color:#fff; }

.twenty48-board[data-style="stone"] { background:linear-gradient(145deg,#5f6662,#3d4440); }
.twenty48-board[data-style="stone"] .twenty48-tile { border:1px solid #868b87; box-shadow:inset 0 1px rgba(255,255,255,.35),0 3px 6px rgba(28,32,30,.26); }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="0"] { background:#858b87; }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="2"] { background:#d0d2cf; color:#23519a; }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="4"] { background:#c0c3bf; color:#7d471e; }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="8"] { background:#aeb2ad; color:#178344; }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="16"] { background:#a2a6a2; color:#c13c2f; }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="32"],
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="64"] { background:#8c918c; color:#fff; }
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="128"],
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="256"],
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="512"],
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="1024"],
.twenty48-board[data-style="stone"] .twenty48-tile[data-value="2048"] { background:#69706b; color:#fff; }

.twenty48-board[data-style="copper"] { background:linear-gradient(145deg,#8f4a24,#5e2e19); }
.twenty48-board[data-style="copper"] .twenty48-tile { border:1px solid #7f481e; box-shadow:inset 0 1px rgba(255,227,159,.35),0 3px 7px rgba(63,31,14,.28); }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="0"] { background:#9d6533; }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="2"] { background:#deb35b; color:#633410; }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="4"] { background:#d6a143; color:#603010; }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="8"] { background:#d8752f; color:#fff3d6; }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="16"] { background:#c9572b; color:#fff3d6; }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="32"],
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="64"] { background:#a84627; color:#fff3d6; }
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="128"],
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="256"],
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="512"],
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="1024"],
.twenty48-board[data-style="copper"] .twenty48-tile[data-value="2048"] { background:#71371f; color:#ffe9b8; }

/* Keep every themed puzzle tile square regardless of theme or interaction. */
.fifteen-board[data-style] > .fifteen-tile,
.mines-board[data-style] > .mine-cell,
.twenty48-board[data-style] > .twenty48-tile,
.memory-board[data-style] > .memory-card {
  width:100%;
  aspect-ratio:1 / 1;
  height:auto;
  min-width:0;
  min-height:0;
}

/* Memo theme alignment — generated set assets are normalized to square crops. */
.memory-board[data-style="garden"] .memory-picture img,
.memory-board[data-style="woodland"] .memory-picture img,
.memory-board[data-style="ocean"] .memory-picture img {
  object-position: 50% 50%;
}

/* Respect the native hidden attribute even on flex-styled buttons. */
[hidden] { display: none !important; }

/* v36-next: Spider, Hearts, Sudoku, Snake */
.spider-stage { min-height: 650px; padding: 18px; background: linear-gradient(160deg,#16804f,#075f39); align-items: stretch; }
.spider-game { width:100%; max-width:1100px; margin:0 auto; }
.spider-topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; color:#fff; }
.spider-stock { display:flex; min-height:70px; align-items:flex-start; }
.spider-stock-card { width:52px; height:72px; margin-left:-34px; position:relative; }
.spider-stock-card:first-child { margin-left:0; }
.spider-tableau { display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:8px; align-items:start; }
.spider-column { position:relative; min-height:430px; }
.spider-column .playing-card { width:100%; aspect-ratio:0.72; position:absolute; top:calc(var(--spider-index) * var(--spider-step, 28px)); left:0; }
.spider-column .card-back + .playing-card { }
.spider-empty { width:100%; aspect-ratio:0.72; }
.spider-completed { font-weight:800; }

.hearts-stage { min-height:560px; padding:18px; background:linear-gradient(145deg,#f8eee8,#fff9f4); }
.hearts-table { width:min(100%,900px); min-height:500px; display:grid; grid-template-rows:auto 1fr auto; gap:16px; }
.hearts-opponents { display:flex; justify-content:space-around; color:var(--muted); font-weight:750; }
.hearts-center { display:grid; place-items:center; }
.hearts-trick { width:min(100%,430px); aspect-ratio:1.35; position:relative; }
.hearts-trick-slot { position:absolute; width:82px; min-height:118px; display:grid; justify-items:center; gap:4px; }
.hearts-trick-slot .playing-card { width:72px; }
.hearts-player-2 { top:0; left:50%; transform:translateX(-50%); }
.hearts-player-3 { top:50%; right:0; transform:translateY(-50%); }
.hearts-player-0 { bottom:0; left:50%; transform:translateX(-50%); }
.hearts-player-1 { top:50%; left:0; transform:translateY(-50%); }
.hearts-player-name { font-size:.78rem; color:var(--muted); font-weight:750; }
.hearts-hand { display:flex; justify-content:center; align-items:flex-end; overflow-x:auto; padding:8px 12px 2px; min-height:150px; }
.hearts-hand .playing-card { flex:0 0 74px; width:74px; margin-left:-23px; position:relative; }
.hearts-hand .playing-card:first-child { margin-left:0; }
.hearts-hand .playing-card:hover { transform:translateY(-8px); z-index:5; }
.hearts-card-disabled { opacity:.52; }
.hearts-status { text-align:center; min-height:1.5em; color:var(--muted); font-weight:750; }

.sudoku-stage { min-height:560px; }
.sudoku-wrap { width:min(100%,560px); }
.sudoku-board { width:100%; aspect-ratio:1; display:grid; grid-template-columns:repeat(9,1fr); background:#20334e; gap:1px; border:3px solid #20334e; border-radius:12px; overflow:hidden; }
.sudoku-cell { border:0; border-radius:0; background:#fffdf9; color:#18304f; display:grid; place-items:center; font-size:clamp(1rem,4.8vw,1.65rem); font-weight:800; min-width:0; padding:0; }
.sudoku-cell.given { background:#edf2f7; color:#0f2746; }
.sudoku-cell.selected { background:#dcf1e2; outline:3px solid #259758; outline-offset:-3px; }
.sudoku-cell.box-right { border-right:3px solid #20334e; }
.sudoku-cell.box-bottom { border-bottom:3px solid #20334e; }
@keyframes sudoku-cell-reject {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.sudoku-cell.cell-error {
  background:#ffe3e3;
  color:#8f2424;
  outline:3px solid rgba(196,67,67,.7);
  outline-offset:-3px;
  animation:sudoku-cell-reject 260ms ease-out;
}
.sudoku-pad { display:grid; grid-template-columns:repeat(9,1fr); gap:6px; margin-top:12px; }
.sudoku-pad button { min-height:46px; padding:0; font-weight:850; font-size:1.1rem; }

.snake-stage { min-height:560px; }
.snake-wrap { width:min(100%,560px); }
.snake-board { width:100%; aspect-ratio:1; display:grid; gap:1px; padding:6px; background:#173f2c; border-radius:18px; touch-action:none; user-select:none; }
.snake-cell { aspect-ratio:1; background:rgba(255,255,255,.045); border-radius:3px; }
.snake-cell.body { background:#79ce55; border-radius:34%; }
.snake-cell.head { background:#4eae3e; border-radius:40%; box-shadow:inset 0 0 0 2px rgba(255,255,255,.25); }
.snake-cell.food { background:#e65147; border-radius:50%; box-shadow:0 0 0 2px rgba(255,255,255,.16); }
.snake-controls { display:grid; grid-template-columns:repeat(3,58px); justify-content:center; gap:7px; margin-top:14px; }
.snake-controls .up { grid-column:2; }
.snake-controls .left { grid-column:1; grid-row:2; }
.snake-controls .down { grid-column:2; grid-row:2; }
.snake-controls .right { grid-column:3; grid-row:2; }
.snake-speed-toggle { min-width:72px; font-variant-numeric:tabular-nums; }

@media(max-width:720px){
  .spider-stage { min-height:560px; padding:10px 6px 14px; }
  .spider-tableau { gap:3px; }
  .spider-column { min-height:390px; }
  .spider-column .playing-card { top:calc(var(--spider-index) * min(var(--spider-step, 22px), 22px)); }
  .spider-stock-card { width:40px; height:56px; margin-left:-27px; }
  .hearts-stage { padding:10px 6px; }
  .hearts-hand .playing-card { flex-basis:52px; width:52px; margin-left:-25px; }
  .hearts-trick-slot { width:62px; min-height:95px; }
  .hearts-trick-slot .playing-card { width:56px; }
  .sudoku-stage,.snake-stage { padding:10px; }
  .sudoku-pad { gap:4px; }
  .sudoku-pad button { min-height:42px; font-size:1rem; }
}


/* v36 QA fixes: clearer Minesweeper flags and extended 2048 palette. */
.mine-flag-glyph {
  display:inline-block;
  font-size:clamp(1.8rem,7.2vw,2.75rem);
  line-height:1;
  transform:translateY(-0.04em);
  font-weight:900;
}

/* 2048 values above 2048 keep distinct colors instead of collapsing to one style. */
.twenty48-tile.tile-high-1 { background:#7d5bb8; color:#fff; font-size:clamp(.78rem,3.9vw,1.55rem); }
.twenty48-tile.tile-high-2 { background:#5b63b8; color:#fff; font-size:clamp(.74rem,3.6vw,1.45rem); }
.twenty48-tile.tile-high-3 { background:#387c9f; color:#fff; font-size:clamp(.68rem,3.3vw,1.34rem); }
.twenty48-tile.tile-high-4 { background:#2f776f; color:#fff; font-size:clamp(.64rem,3vw,1.22rem); }
.twenty48-tile.tile-high-5 { background:#76506f; color:#fff; font-size:clamp(.6rem,2.8vw,1.12rem); }
.twenty48-tile.tile-high-6 { background:#293b57; color:#fff; font-size:clamp(.56rem,2.6vw,1.02rem); }

.twenty48-board[data-style="glass"] .twenty48-tile.tile-high-1 { background:#7f69cf; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile.tile-high-2 { background:#6557b5; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile.tile-high-3 { background:#397eb0; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile.tile-high-4 { background:#347f86; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile.tile-high-5 { background:#6a5791; color:#fff; }
.twenty48-board[data-style="glass"] .twenty48-tile.tile-high-6 { background:#34445f; color:#fff; }

.twenty48-board[data-style="stone"] .twenty48-tile.tile-high-1 { background:#656d73; color:#fff; }
.twenty48-board[data-style="stone"] .twenty48-tile.tile-high-2 { background:#58666a; color:#fff; }
.twenty48-board[data-style="stone"] .twenty48-tile.tile-high-3 { background:#4f6660; color:#fff; }
.twenty48-board[data-style="stone"] .twenty48-tile.tile-high-4 { background:#445b52; color:#fff; }
.twenty48-board[data-style="stone"] .twenty48-tile.tile-high-5 { background:#554e5b; color:#fff; }
.twenty48-board[data-style="stone"] .twenty48-tile.tile-high-6 { background:#343b42; color:#fff; }

.twenty48-board[data-style="copper"] .twenty48-tile.tile-high-1 { background:#63354f; color:#ffe9c2; }
.twenty48-board[data-style="copper"] .twenty48-tile.tile-high-2 { background:#593e6c; color:#ffe9c2; }
.twenty48-board[data-style="copper"] .twenty48-tile.tile-high-3 { background:#405d72; color:#fff0cd; }
.twenty48-board[data-style="copper"] .twenty48-tile.tile-high-4 { background:#355d55; color:#fff0cd; }
.twenty48-board[data-style="copper"] .twenty48-tile.tile-high-5 { background:#5b3b47; color:#fff0cd; }
.twenty48-board[data-style="copper"] .twenty48-tile.tile-high-6 { background:#302d38; color:#fff0cd; }

/* Hearts v37.1 — stable opening state and clearer trick layout */
.hearts-table { min-height: 470px; }
.hearts-center > div { width:100%; display:grid; justify-items:center; }
.hearts-trick { width:min(100%,420px); height:260px; aspect-ratio:auto; position:relative; }
.hearts-trick-slot { width:88px; min-height:104px; display:grid; justify-items:center; align-content:start; gap:5px; }
.hearts-trick-slot .playing-card { width:66px; }
.hearts-player-2 { top:0; left:50%; transform:translateX(-50%); }
.hearts-player-3 { top:50%; right:12px; transform:translateY(-50%); }
.hearts-player-0 { bottom:0; left:50%; transform:translateX(-50%); }
.hearts-player-1 { top:50%; left:12px; transform:translateY(-50%); }
.hearts-player-name { white-space:nowrap; line-height:1.1; }
@media(max-width:720px){
  .hearts-table { min-height:430px; }
  .hearts-trick { width:min(100%,330px); height:220px; }
  .hearts-trick-slot { width:68px; min-height:86px; }
  .hearts-trick-slot .playing-card { width:52px; }
  .hearts-player-3 { right:4px; }
  .hearts-player-1 { left:4px; }
}


/* v37-next — Spider backs + centered new game art + Sudoku/Snake visual themes */
.spider-game[data-card-back-style] .card-back {
  background:#fff center / cover no-repeat;
  background-image:var(--card-back-image);
  border:0;
  overflow:hidden;
}
.spider-game[data-card-back-style] .card-back::before,
.spider-game[data-card-back-style] .card-back-mark { display:none; }

/* Generated tiles had large baked-in top/bottom margins; the assets are now recropped,
   while these rules keep all catalog/game-title art centered in its frame. */
.game-card[href*="/games/spider/"] .game-art,
.game-card[href*="/games/sudoku/"] .game-art,
.game-card[href*="/games/snake/"] .game-art,
.game-card[href*="/games/hearts/"] .game-art,
.game-icon .game-art {
  object-position:50% 50%;
}
.game-card[href*="/games/spider/"] .game-picture { background:#5d43c4; }
.game-card[href*="/games/sudoku/"] .game-picture { background:#efe4c9; }
.game-card[href*="/games/snake/"] .game-picture { background:#0d6944; }
.game-card[href*="/games/hearts/"] .game-picture { background:#bd2930; }

/* Sudoku: same live, no-reset theme behavior as Minesweeper. */
.sudoku-board[data-style="classic"] { background:#20334e; }
.sudoku-board[data-style="sage"] { background:#53715f; }
.sudoku-board[data-style="sage"] .sudoku-cell { background:#f4f8f1; color:#264738; }
.sudoku-board[data-style="sage"] .sudoku-cell.given { background:#dfeadf; color:#193f2d; }
.sudoku-board[data-style="sage"] .sudoku-cell.selected { background:#c8e7cb; outline-color:#318f52; }
.sudoku-board[data-style="ocean"] { background:#315e86; }
.sudoku-board[data-style="ocean"] .sudoku-cell { background:#f3f9fd; color:#16436d; }
.sudoku-board[data-style="ocean"] .sudoku-cell.given { background:#dcebf5; color:#123858; }
.sudoku-board[data-style="ocean"] .sudoku-cell.selected { background:#cceaf6; outline-color:#2b78a9; }
.sudoku-board[data-style="plum"] { background:#674c70; }
.sudoku-board[data-style="plum"] .sudoku-cell { background:#fbf6fb; color:#58395e; }
.sudoku-board[data-style="plum"] .sudoku-cell.given { background:#eaddea; color:#432849; }
.sudoku-board[data-style="plum"] .sudoku-cell.selected { background:#ead3e7; outline-color:#8d4e87; }
.sudoku-board[data-style] .sudoku-cell.box-right { border-right-color:inherit; }
.sudoku-board[data-style] .sudoku-cell.box-bottom { border-bottom-color:inherit; }
.sudoku-theme-swatch--classic { background:linear-gradient(135deg,#20334e 0 28%,#fffdf9 28% 62%,#edf2f7 62%); }
.sudoku-theme-swatch--sage { background:linear-gradient(135deg,#53715f 0 28%,#f4f8f1 28% 62%,#dfeadf 62%); }
.sudoku-theme-swatch--ocean { background:linear-gradient(135deg,#315e86 0 28%,#f3f9fd 28% 62%,#dcebf5 62%); }
.sudoku-theme-swatch--plum { background:linear-gradient(135deg,#674c70 0 28%,#fbf6fb 28% 62%,#eaddea 62%); }

/* Snake themes alter board/cells only; current run stays intact. */
.snake-board[data-style="forest"] { background:#173f2c; }
.snake-board[data-style="forest"] .snake-cell.body { background:#79ce55; }
.snake-board[data-style="forest"] .snake-cell.head { background:#4eae3e; }
.snake-board[data-style="forest"] .snake-cell.food { background:#e65147; }
.snake-board[data-style="midnight"] { background:#172840; }
.snake-board[data-style="midnight"] .snake-cell { background:rgba(255,255,255,.06); }
.snake-board[data-style="midnight"] .snake-cell.body { background:#69b8d3; }
.snake-board[data-style="midnight"] .snake-cell.head { background:#3d91b0; }
.snake-board[data-style="midnight"] .snake-cell.food { background:#f19b52; }
.snake-board[data-style="sand"] { background:#8f7654; }
.snake-board[data-style="sand"] .snake-cell { background:rgba(255,250,232,.12); }
.snake-board[data-style="sand"] .snake-cell.body { background:#d2b447; }
.snake-board[data-style="sand"] .snake-cell.head { background:#ad8d2f; }
.snake-board[data-style="sand"] .snake-cell.food { background:#b75142; }
.snake-board[data-style="berry"] { background:#55334e; }
.snake-board[data-style="berry"] .snake-cell { background:rgba(255,255,255,.055); }
.snake-board[data-style="berry"] .snake-cell.body { background:#c97ba8; }
.snake-board[data-style="berry"] .snake-cell.head { background:#a85a8a; }
.snake-board[data-style="berry"] .snake-cell.food { background:#f0b451; }
.snake-theme-swatch--forest { background:linear-gradient(135deg,#173f2c 0 40%,#79ce55 40% 72%,#e65147 72%); }
.snake-theme-swatch--midnight { background:linear-gradient(135deg,#172840 0 40%,#69b8d3 40% 72%,#f19b52 72%); }
.snake-theme-swatch--sand { background:linear-gradient(135deg,#8f7654 0 40%,#d2b447 40% 72%,#b75142 72%); }
.snake-theme-swatch--berry { background:linear-gradient(135deg,#55334e 0 40%,#c97ba8 40% 72%,#f0b451 72%); }

/* v37 — 15-language localization */
.language-menu{max-height:min(72vh,560px);overflow-y:auto;overscroll-behavior:contain}
html[lang="ja"] body{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","Noto Sans JP",sans-serif}
html[lang="ko"] body{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif}
html[lang="zh-Hant"] body{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei","Noto Sans CJK TC",sans-serif}

/* v39 mobile toolbar fit + consistent game-card grid alignment */
.game-card h2 {
  min-height: 2.45em;
  line-height: 1.22;
}
.game-card p {
  min-height: 2.7em;
}
.game-card .play-label {
  margin-top: auto;
}

@media (max-width: 620px) {
  .toolbar-group {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    width: 100%;
    gap: 4px;
  }
  .toolbar-group .button {
    min-width: 0;
    width: 100%;
    padding: 6px 5px;
    font-size: clamp(.72rem, 3.15vw, .88rem);
    line-height: 1.08;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
  .toolbar-group .button .button-icon {
    display: none;
  }
  .game-card h2 {
    min-height: 2.45em;
    line-height: 1.22;
    display: flex;
    align-items: flex-start;
  }
  .game-card p {
    min-height: 0;
  }
  .game-card .play-label {
    margin-top: auto;
  }
}
