/* Zupilo playable puzzles — lantern-garden boards, unique motifs, editorial depth. */

.games-intro h1 { max-width: 18ch; }
.games-promise {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 28px;
}
.games-promise article {
  padding: 20px 20px 22px;
  border: 1px solid #ead6ef;
  border-radius: 22px;
  background:
    radial-gradient(120px 80px at 100% 0%, #f3e8ff88, transparent 70%),
    linear-gradient(160deg, #fffaf7, #f7eefb);
  box-shadow: inset 0 1px 0 #fff, 0 10px 28px #6b3d8a0c;
}
.games-promise h2 {
  margin: 0 0 10px;
  font: 800 17px/1.25 var(--display);
  letter-spacing: -.02em;
  color: var(--ink);
}
.games-promise p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.games-editorial-note {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 28px;
  align-items: start;
  margin: 42px 0 12px;
  padding: 28px 30px;
  border: 1px solid #e5cfee;
  border-radius: 26px;
  background:
    linear-gradient(135deg, #2d1848 0%, #4a2870 48%, #6b3d8a 100%);
  color: #f8eef8;
  box-shadow: 0 18px 40px #3a1d5528;
}
.games-editorial-note .eyebrow { color: #f0c9ff; }
.games-editorial-note h2 {
  margin: 8px 0 0;
  font: 800 clamp(1.45rem, 2.4vw, 2rem)/1.2 var(--display);
  letter-spacing: -.03em;
  color: #fff6e8;
}
.games-editorial-note p { color: #ead7f2; font-size: 15px; line-height: 1.7; margin: 0 0 12px; }
.games-editorial-note a { color: #ffe29a; font-weight: 700; }

.game-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 8px 26px; }
.filter-pill {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #e5cfe9;
  border-radius: 999px;
  background: #fffcf9;
  color: #6b477a;
  font-size: 13px;
  font-weight: 700;
  transition: transform 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms;
}
.filter-pill:hover { transform: translateY(-1px); background: #f2e2f8; }
.filter-pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, #aa65ee, #813acb);
  border-color: #ad72e8;
  box-shadow: inset 0 1px 0 #ebcaff66, 0 5px 12px #9e57c725;
}

/* Distinctive catalog tiles (not guide story cards) */
.puzzle-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.puzzle-catalog-home { margin-top: 4px; }
.puzzle-catalog-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.puzzle-tile {
  --tile-accent: var(--accent);
  margin: 0;
  border-radius: 24px;
  background: #fffcf9;
  border: 1px solid #ead6ea;
  box-shadow: 0 10px 28px #603b7c10;
  overflow: hidden;
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease), border-color 240ms;
}
.puzzle-tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tile-accent) 45%, #ead6ea);
  box-shadow: 0 16px 34px #5a2f7c1c;
}
.puzzle-tile-link {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 100%;
  text-decoration: none;
  color: inherit;
}
.puzzle-tile-art {
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    radial-gradient(90px 70px at 30% 20%, color-mix(in srgb, var(--tile-accent) 35%, transparent), transparent 70%),
    linear-gradient(165deg, #2a1544, #4a2a6e 60%, #1f1236);
}
.puzzle-tile-art svg { width: 100%; height: auto; max-width: 148px; filter: drop-shadow(0 8px 16px #00000033); }
.puzzle-tile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 16px;
  min-width: 0;
}
.puzzle-tile-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8a6a98;
}
.puzzle-tile-kicker span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #f6eef9;
  border: 1px solid #ead6f0;
}
.puzzle-tile-title {
  display: block;
  font: 800 clamp(1.15rem, 1.7vw, 1.4rem)/1.2 var(--display);
  letter-spacing: -.025em;
  color: var(--ink);
}
.puzzle-tile-tagline {
  display: block;
  font: 700 14px/1.45 var(--display);
  color: color-mix(in srgb, var(--tile-accent) 75%, #35214f);
}
.puzzle-tile-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.puzzle-tile-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.puzzle-tile-traits span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ebd7f0;
  color: #5f3f72;
  font-size: 11px;
  font-weight: 700;
}
.puzzle-tile-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font: 800 13px/1 var(--display);
  color: var(--tile-accent);
}
.puzzle-tile-cta::after { content: '→'; transition: transform 160ms var(--ease); }
.puzzle-tile:hover .puzzle-tile-cta::after { transform: translateX(3px); }

/* Detail shell */
.game-shell {
  --game-accent: var(--accent);
  padding: 28px 33px 40px;
  margin-top: 30px;
  margin-bottom: 40px;
  border: 1px solid #fff8f4ca;
  border-radius: 28px;
  background:
    radial-gradient(420px 220px at 100% -10%, color-mix(in srgb, var(--game-accent) 18%, transparent), transparent 60%),
    #fffaf5f5;
  box-shadow: 0 15px 45px #7a479c12;
}
.game-header { max-width: 920px; margin: 10px auto 24px; text-align: left; }
.game-header-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.game-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #7a568c;
}
.game-host-badge {
  padding: 6px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #efe2ff, #ffe9c8);
  border: 1px solid #e0c4f0;
  color: #4c2a66;
  font: 700 12px/1 var(--display);
}
.game-header h1 {
  font: 800 clamp(2rem, 3.8vw, 3.15rem)/1.1 var(--display);
  letter-spacing: -.035em;
  margin: 0 0 10px;
}
.game-tagline {
  margin: 0 0 12px;
  font: 700 clamp(1.05rem, 1.8vw, 1.3rem)/1.35 var(--display);
  color: color-mix(in srgb, var(--game-accent) 70%, #35214f);
}
.game-header .lead { margin: 0 0 14px; font-size: 17px; max-width: 62ch; }
.game-trait-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.game-trait-row li {
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5cff0;
  font: 700 12px/1 var(--display);
  color: #5a3d6d;
}
.game-controls-line { margin: 0 0 10px; font-size: 14px; color: #6c4f79; }
.game-jump { margin: 0; font-size: 13px; color: #7a5a8a; }
.game-jump a { color: var(--game-accent); font-weight: 700; text-decoration: none; }
.game-jump a:hover { text-decoration: underline; }

.game-stage-wrap {
  max-width: 960px;
  margin: 0 auto 38px;
  padding: 16px 18px 22px;
  border: 1px solid color-mix(in srgb, var(--game-accent) 28%, #e4cee8);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--game-accent) 22%, #eddaf8) 0%, transparent 46%),
    linear-gradient(155deg, #f8effc, #fff5ef 65%, #fceef6);
  box-shadow: inset 0 2px 0 #ffffff, 0 16px 36px #5e30801a;
}
.game-stage-wrap.is-phone-stage {
  display: block;
  max-width: min(1080px, 100%);
  padding: 18px 18px 24px;
  background:
    radial-gradient(ellipse 80% 50% at 72% 18%, #c4b5fd55, transparent 55%),
    linear-gradient(165deg, #1e1b4b 0%, #312e81 42%, #4c1d95 100%);
  border-color: #5b21b688;
  box-shadow: inset 0 1px 0 #ffffff22, 0 24px 48px #1e1b4b44;
}
.game-stage-layout {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: clamp(16px, 2.8vw, 36px);
  align-items: start;
  width: 100%;
}
.game-stage-ads {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  min-width: 0;
}
.game-ad-label {
  margin: 0;
  width: 100%;
  font: 700 10px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #c4b5fd;
  text-align: left;
}
.game-ad-slot {
  width: 100%;
  max-width: 300px;
  border-radius: 14px;
  border: 1px dashed #a78bfa66;
  background:
    linear-gradient(160deg, #312e8188, #1e1b4b99),
    repeating-linear-gradient(-45deg, transparent, transparent 8px, #ffffff08 8px, #ffffff08 16px);
  box-shadow: inset 0 1px 0 #ffffff14;
}
.game-ad-slot-sky {
  min-height: 480px;
  aspect-ratio: 160 / 600;
  max-height: min(600px, calc(100dvh - 220px));
}
.game-ad-slot-box {
  min-height: 250px;
  aspect-ratio: 300 / 250;
}
.game-stage-phone {
  justify-self: end;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}
.game-stage-wrap.is-phone-stage .game-stage-label {
  color: #e9d5ff;
  width: 100%;
}

/* —— Real phone handset frame —— */
.phone-scale-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
}
.phone-device {
  --phone-w: min(100%, 390px);
  --phone-fit-h: min(780px, calc(100dvh - 112px));
  position: relative;
  width: min(var(--phone-w), calc(var(--phone-fit-h) * 9 / 19.5));
  margin-inline: 0;
  margin-left: auto;
  filter: drop-shadow(0 28px 40px #0f172a66);
  transform-origin: top right;
}
.phone-bezel {
  position: relative;
  border-radius: 42px;
  padding: 11px;
  background:
    linear-gradient(145deg, #3f3f46 0%, #18181b 38%, #09090b 100%);
  box-shadow:
    inset 0 1px 0 #ffffff33,
    inset 0 -2px 4px #00000088,
    0 0 0 1px #000;
}
.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 32px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  min-height: 0;
  max-height: var(--phone-fit-h);
  height: auto;
  background: linear-gradient(180deg, #faf5ff, #fdf4ff 55%, #fff7ed);
  box-shadow: inset 0 0 0 1px #ffffff22;
}
.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 118px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #09090b;
  box-shadow: inset 0 0 0 1px #27272a;
}
.phone-speaker {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #27272a;
}
.phone-camera {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #93c5fd, #1e3a8a 55%, #0f172a);
  box-shadow: 0 0 0 2px #18181b;
}
.phone-home {
  flex: 0 0 auto;
  height: 18px;
  display: grid;
  place-items: center;
  padding-bottom: 6px;
}
.phone-home::after {
  content: '';
  width: 118px;
  height: 4px;
  border-radius: 999px;
  background: #0f172a55;
}
.phone-btn {
  position: absolute;
  right: -3px;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: #27272a;
  box-shadow: inset 0 0 0 1px #52525b;
}
.phone-btn-power { top: 120px; height: 56px; }
.phone-btn-vol-up { left: -3px; right: auto; top: 110px; height: 36px; border-radius: 0 2px 2px 0; }
.phone-btn-vol-down { left: -3px; right: auto; top: 156px; height: 36px; border-radius: 0 2px 2px 0; }

.has-phone-frame .game-chrome {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  padding: 36px 10px 8px;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.has-phone-frame .game-board-shell,
.has-phone-frame .game-board-surface {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.has-phone-frame .game-board-surface {
  width: 100%;
  max-width: 100%;
}
.has-phone-frame .theme-zen-blocks .game-chrome,
.has-phone-frame .theme-voxel-feast .game-chrome,
.has-phone-frame .theme-pastel-cats .game-chrome {
  width: 100% !important;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 36px 8px 8px;
}

/* Sudoku fills the phone like a native puzzle app */
.has-phone-frame .lantern-sudoku-board .sudoku-board {
  width: 100%;
  max-width: 100%;
}
.has-phone-frame .sudoku-nums {
  width: 100%;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
}
.has-phone-frame .sudoku-nums button {
  min-height: 40px;
  border-radius: 10px;
}
.game-stage-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 0 4px;
  font: 700 11px/1.2 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7a5a8c;
}
.game-root { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.game-chrome { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.game-loading { padding: 36px 20px; text-align: center; color: var(--muted); }

.game-board-shell {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.game-board-shell.is-shake {
  animation: board-shake calc(280ms * var(--shake, 1)) var(--ease);
}
@keyframes board-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(calc(-4px * var(--shake, 1))); }
  40% { transform: translateX(calc(4px * var(--shake, 1))); }
  60% { transform: translateX(calc(-3px * var(--shake, 1))); }
  80% { transform: translateX(calc(2px * var(--shake, 1))); }
}

.game-fx {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: visible;
  z-index: 5;
}
.game-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: particle-fly 620ms var(--ease) forwards;
  box-shadow: 0 0 8px currentColor;
}
@keyframes particle-fly {
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)));
    opacity: 0;
  }
}
.game-float {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, 0);
  font: 800 22px/1 var(--display);
  letter-spacing: -.02em;
  text-shadow: 0 2px 0 #2a154466;
  animation: float-up 900ms var(--ease) forwards;
  white-space: nowrap;
}
.game-float-good { color: #6d28d9; }
.game-float-combo { color: #db2777; }
.game-float-win { color: #b45309; font-size: 26px; }
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.9); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(1); }
}

.game-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1;
}
.game-star { color: #d6c3e4; filter: grayscale(.4); transform: scale(.9); }
.game-star.is-on {
  color: #f5b942;
  filter: none;
  text-shadow: 0 0 12px #ffd76a99;
  animation: star-pop 360ms var(--ease) both;
}
.game-star.is-on:nth-child(2) { animation-delay: 60ms; }
.game-star.is-on:nth-child(3) { animation-delay: 120ms; }
@keyframes star-pop {
  from { transform: scale(0.4) rotate(-12deg); opacity: .2; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.game-board-surface.is-win-pulse {
  animation: win-pulse 480ms var(--ease);
}
@keyframes win-pulse {
  0% { box-shadow: inset 0 1px 0 #fff, 0 0 0 0 #f5b94200; }
  40% { box-shadow: inset 0 1px 0 #fff, 0 0 0 6px #f5b94255; }
  100% { box-shadow: inset 0 1px 0 #fff, 0 8px 20px #5d348012; }
}
.game-btn-mute { opacity: .85; font-size: 13px; }

.game-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 440px;
}
.game-stat {
  min-width: 0;
  padding: 10px 10px 11px;
  border: 1px solid #e6d1ec;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffefb, #faf3ff);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px #6a3d8d0c;
  text-align: center;
}
.game-stat span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-stat strong {
  display: block;
  margin-top: 4px;
  font: 800 clamp(15px, 3.6vw, 19px)/1.2 var(--display);
  color: var(--ink);
}

.game-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.game-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 9px 15px;
  border: 1px solid #dcc2e7;
  border-radius: 999px;
  background: #fffdf9;
  color: var(--ink);
  font: 700 14px/1 var(--display);
  transition: transform 140ms var(--ease), background 140ms, border-color 140ms, box-shadow 140ms;
}
.game-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f3e4fa;
  border-color: #bc8de0;
}
.game-btn:active:not(:disabled) { transform: scale(.98); }
.game-btn:disabled { opacity: .48; cursor: not-allowed; }
.game-btn-primary,
.game-btn.is-active {
  border-color: color-mix(in srgb, var(--game-accent) 70%, #a65cf0);
  background: linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 80%, #9d59ee), color-mix(in srgb, var(--game-accent) 55%, #7633d1));
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--game-accent) 25%, transparent);
}
.game-btn-primary:hover:not(:disabled),
.game-btn.is-active:hover:not(:disabled) {
  filter: brightness(1.05);
}

.game-select {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #dcc2e7;
  border-radius: 999px;
  background: #fffdf9;
  color: var(--ink);
  font: 700 14px var(--display);
}

.game-banner {
  width: 100%;
  max-width: 620px;
  padding: 14px 18px;
  border: 1px solid #d7b2ec;
  border-radius: 18px;
  background: linear-gradient(135deg, #f0def9, #fff2d8);
  text-align: center;
  animation: banner-in 280ms var(--ease) both;
}
.game-banner p { margin: 0 0 10px; font-weight: 700; color: var(--ink); }
.game-banner-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
@keyframes banner-in {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.game-board-surface {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid #e6d3eb;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #ffffff, #fbf5ff);
  box-shadow: inset 0 1px 0 #fff, 0 8px 20px #5d348012;
  touch-action: manipulation;
}
.game-board-surface:focus-visible { outline: 3px solid #8c45db; outline-offset: 4px; }
.game-subcontrols { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.game-status {
  margin: 2px 0 0;
  min-height: 22px;
  font-size: 13px;
  font-weight: 700;
  color: #674979;
  text-align: center;
}
.game-status[data-tone="win"] { color: #1f7a4d; }
.game-status.is-flash { animation: status-flash 320ms var(--ease); }
.game-stat strong.is-tick { animation: stat-tick 280ms var(--ease); }
.game-banner.is-celebrate {
  box-shadow: 0 0 0 1px #f0c76a88, 0 12px 28px #9b57d230;
}
@keyframes status-flash {
  from { opacity: .35; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}
@keyframes stat-tick {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Color Flask Sort — glass tubes + liquid gloss */
.flask-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 16px; padding: 14px 6px 8px; }
.flask-btn {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 3px;
  width: 68px;
  height: 188px;
  padding: 14px 9px 12px;
  border: 2.5px solid #c9aee0;
  border-radius: 14px 14px 28px 28px;
  background:
    linear-gradient(105deg, #ffffffaa 0%, #ffffff00 28%, #ffffff00 72%, #ffffff55 100%),
    linear-gradient(180deg, #fdf9ff 0%, #efe3f8 55%, #e5d4f2 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset -10px 0 16px #7c3aed12,
    inset 10px 0 14px #ffffff66,
    0 10px 22px #5b348018;
  overflow: hidden;
  transition: transform 160ms var(--ease), border-color 160ms, box-shadow 160ms;
}
.flask-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 18%; right: 18%;
  height: 10px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #ffffffcc, #e8d7f5);
  border: 1.5px solid #d4bae6;
  border-top: 0;
  z-index: 2;
  pointer-events: none;
}
.flask-btn::after {
  content: '';
  position: absolute;
  inset: 12px auto 14px 8px;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffffbb, #ffffff22);
  pointer-events: none;
  z-index: 2;
}
.flask-btn.is-selected { transform: translateY(-10px) scale(1.03); border-color: #7d36d5; box-shadow: 0 14px 28px #7d36d540, inset 0 1px 0 #fff; }
.flask-btn.is-legal { border-color: #2f9e6d; box-shadow: 0 0 0 3px #8ee0b866, 0 10px 22px #2f9e6d22; }
.flask-btn.is-hint { border-color: #e29d00; box-shadow: 0 0 0 3px #ffdf7a99; }
.flask-btn.is-complete {
  border-color: #2f9e6d;
  background:
    linear-gradient(105deg, #ffffffaa 0%, #ffffff00 28%, #ffffff00 72%, #ffffff55 100%),
    linear-gradient(180deg, #f2fff8, #dff7ea);
}
.flask-btn.is-empty {
  background:
    linear-gradient(105deg, #ffffff88 0%, #ffffff00 30%),
    repeating-linear-gradient(-42deg, #f8f1fc, #f8f1fc 5px, #efe4f7 5px, #efe4f7 10px);
}
.flask-btn.is-poured { animation: pour-pop 280ms var(--ease); }
.flask-layer {
  position: relative;
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 8px;
  font: 800 12px/1 var(--display);
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 1px 2px #00000055;
  box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 6px #00000022;
  overflow: hidden;
}
.flask-layer::after {
  content: '';
  position: absolute;
  inset: 3px auto 3px 4px;
  width: 28%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff77, #ffffff10);
  pointer-events: none;
}
.flask-layer.flask-slot {
  background: #ffffff40;
  border: 1px dashed #d7c0e6;
  color: transparent;
  text-shadow: none;
  box-shadow: none;
}
.flask-layer.flask-slot::after { display: none; }
@keyframes pour-pop {
  0% { transform: scale(.96); }
  50% { transform: scale(1.03); }
  100% { transform: none; }
}
.flask-label { display: block; margin-top: 8px; font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; }
.flask-wrap { display: flex; flex-direction: column; align-items: center; }
.c-0 { background: linear-gradient(180deg, #9b6ef0, #6d28d9 55%, #5b21b6); }
.c-1 { background: linear-gradient(180deg, #f472b6, #db2777 55%, #be185d); }
.c-2 { background: linear-gradient(180deg, #2dd4bf, #0f766e 55%, #115e59); }
.c-3 { background: linear-gradient(180deg, #fbbf24, #d97706 55%, #b45309); }
.c-4 { background: linear-gradient(180deg, #60a5fa, #2563eb 55%, #1d4ed8); }
.c-5 { background: linear-gradient(180deg, #c4a484, #92400e 55%, #78350f); }

/* Logic grids — moon / sun / sight */
.logic-grid { display: grid; gap: 7px; padding: 6px; border-radius: 18px; background:
  radial-gradient(120px 80px at 10% 0%, #f3e8ff88, transparent 70%),
  linear-gradient(180deg, #faf5ff, #f3ebfa); }
.logic-cell {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1;
  border: 1.5px solid #e0ccec;
  border-radius: 14px;
  background:
    linear-gradient(160deg, #fffdfb, #f5ecfb);
  color: var(--ink);
  font: 800 20px/1 var(--display);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #e6d3f0;
  transition: transform 120ms var(--ease), background 120ms, border-color 120ms, box-shadow 120ms;
}
.logic-cell:hover { transform: translateY(-1px); }
.logic-cell.is-cursor { box-shadow: inset 0 0 0 2.5px #451c6e, 0 3px 0 #e6d3f0; }
.logic-cell.is-hint { outline: 3px solid #f0a500; outline-offset: 1px; }
.logic-cell.is-error { box-shadow: inset 0 0 0 3px #cc2c4b; }
.logic-cell.cell-blue {
  background: radial-gradient(circle at 32% 28%, #a78bfa, #6d28d9 48%, #4c1d95);
  border-color: #5b21b6;
  color: #f5f3ff;
  text-shadow: 0 1px 2px #2e1065aa;
  box-shadow: inset 0 2px 0 #ffffff55, 0 4px 10px #6d28d933;
}
.logic-cell.cell-red {
  background: radial-gradient(circle at 32% 28%, #fb7185, #e11d48 50%, #9f1239);
  border-color: #be123c;
  color: #fff;
  box-shadow: inset 0 2px 0 #ffffff44, 0 4px 10px #e11d4830;
}
.logic-cell.cell-gold {
  background: radial-gradient(circle at 32% 28%, #fde68a, #f59e0b 48%, #d97706);
  border-color: #b45309;
  color: #3d214f;
  box-shadow: inset 0 2px 0 #ffffff66, 0 4px 10px #f59e0b33;
}
.logic-cell.cell-locked { box-shadow: inset 0 0 0 2px #ffffff99, 0 3px 0 #e6d3f0; }
.logic-cell.cell-locked::before {
  content: '';
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ffffffaa;
  box-shadow: 0 0 0 1px #ffffff55;
}

/* Flood garden tiles */
.flood-board {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(180px 120px at 80% 10%, #ccfbf1aa, transparent 70%),
    linear-gradient(165deg, #ecfdf8, #f5f3ff);
  box-shadow: inset 0 1px 0 #fff;
}
.flood-tile {
  min-width: 22px;
  min-height: 22px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid #ffffff55;
  color: #ffffffee;
  font: 800 11px/1 var(--display);
  display: grid;
  place-items: center;
  box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 6px #00000022;
  transition: transform 120ms var(--ease), box-shadow 120ms;
}
.flood-tile.is-region {
  outline: 2px solid #ffffffcc;
  outline-offset: -1px;
  box-shadow: inset 0 2px 0 #ffffff77, 0 0 10px #ffffff55;
}
.flood-c-0 { background: linear-gradient(145deg, #c4b5fd, #7c3aed 55%, #5b21b6); }
.flood-c-1 { background: linear-gradient(145deg, #fda4af, #e11d48 55%, #9f1239); }
.flood-c-2 { background: linear-gradient(145deg, #5eead4, #0d9488 55%, #115e59); }
.flood-c-3 { background: linear-gradient(145deg, #fcd34d, #d97706 55%, #b45309); }
.flood-c-4 { background: linear-gradient(145deg, #93c5fd, #2563eb 55%, #1d4ed8); }
.flood-c-5 { background: linear-gradient(145deg, #d8b4a0, #92400e 55%, #78350f); }
.flood-swatch {
  min-width: 52px !important;
  border-radius: 14px !important;
  font-weight: 800 !important;
  box-shadow: inset 0 2px 0 #ffffff55, 0 4px 10px #00000018 !important;
}

/* Nonogram — garden paint */
.nono-wrap { overflow-x: auto; max-width: 100%; padding: 6px; }
.nono-grid {
  display: grid;
  gap: 4px;
  width: fit-content;
  margin-inline: auto;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(140px 90px at 0% 0%, #ddd6fe88, transparent 70%),
    linear-gradient(180deg, #faf5ff, #f3e8ff);
}
.nono-clue {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 5px;
  font: 700 12px/1.2 var(--display);
  color: #5d3e72;
  background: linear-gradient(180deg, #fff, #f3e8ff);
  border: 1px solid #e9d5ff;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 #fff;
}
.nono-clue-row { flex-direction: row; justify-content: flex-end; gap: 5px; padding-inline: 8px; }
.nono-clue.is-done { opacity: .45; text-decoration: line-through; }
.nono-cell {
  min-width: 34px;
  min-height: 34px;
  width: 38px;
  height: 38px;
  border: 1px solid #e0c4f0;
  border-radius: 9px;
  background:
    linear-gradient(160deg, #fffefb, #faf5ff);
  color: #9c7cad;
  font: 800 15px/1 var(--display);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #ead6f4;
  transition: background 140ms var(--ease), transform 120ms var(--ease);
}
.nono-cell.is-filled {
  background:
    radial-gradient(circle at 30% 25%, #c4b5fd, transparent 45%),
    linear-gradient(160deg, #8b5cf6, #5b21b6 60%, #4c1d95);
  border-color: #5b21b6;
  color: #fff;
  box-shadow: inset 0 2px 0 #ffffff55, 0 3px 8px #6d28d940;
}
.nono-cell.is-crossed {
  background:
    repeating-linear-gradient(135deg, #f8f1fc, #f8f1fc 4px, #efe4f7 4px, #efe4f7 8px);
  color: #b794c9;
}
.nono-cell.is-cursor { outline: 2.5px solid #ffaa08; outline-offset: -2px; }

/* Crystal Match — cut gem faces */
.crystal-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  width: min(100%, 384px);
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(160px 100px at 90% 0%, #f5d0fe66, transparent 70%),
    linear-gradient(165deg, #2a1548, #3b2163);
  box-shadow: inset 0 1px 0 #ffffff22, 0 12px 28px #1a0c2e33;
}
.crystal-cell {
  aspect-ratio: 1;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #4a2f6d88;
  box-shadow: inset 0 0 0 1px #ffffff18;
  transition: transform 120ms var(--ease), box-shadow 120ms, filter 120ms;
}
.crystal-cell .gem {
  width: 72%;
  height: 72%;
  display: grid;
  place-items: center;
  font: 800 15px/1 var(--display);
  color: #fff;
  text-shadow: 0 1px 2px #00000055;
  box-shadow:
    inset 0 3px 0 #ffffff66,
    inset 0 -4px 8px #00000033,
    0 4px 10px #00000033;
  position: relative;
  overflow: hidden;
}
.crystal-cell .gem::after {
  content: '';
  position: absolute;
  top: 12%; left: 16%;
  width: 34%; height: 28%;
  border-radius: 50%;
  background: #ffffff66;
  filter: blur(1px);
}
.gem-0 .gem { background: linear-gradient(145deg, #c4b5fd, #7c3aed 45%, #4c1d95); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); border-radius: 0; }
.gem-1 .gem { background: linear-gradient(145deg, #fda4af, #e11d72 45%, #9d174d); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; }
.gem-2 .gem { background: linear-gradient(145deg, #5eead4, #0d9488 45%, #115e59); clip-path: polygon(50% 4%, 90% 28%, 90% 72%, 50% 96%, 10% 72%, 10% 28%); border-radius: 0; }
.gem-3 .gem { background: linear-gradient(145deg, #fde68a, #f59e0b 45%, #b45309); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border-radius: 0; }
.gem-4 .gem { background: linear-gradient(145deg, #93c5fd, #2563eb 45%, #1e3a8a); border-radius: 12px; transform: rotate(12deg); }
.gem-4 .gem > span { transform: rotate(-12deg); }
.crystal-cell.is-selected { transform: scale(1.08); box-shadow: 0 0 0 3px #ffe08a, 0 0 18px #ffd76a88; z-index: 2; }
.crystal-cell.is-hint { box-shadow: 0 0 0 3px #ffaa08, 0 0 14px #ffaa0866; }
.crystal-cell.is-crate {
  background: linear-gradient(160deg, #b45309, #78350f);
  box-shadow: inset 0 2px 0 #ffffff33, 0 4px 8px #00000033;
}
.crystal-cell.is-crate .gem {
  width: 78%; height: 78%;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, #92400e, #92400e 6px, #a16207 6px, #a16207 12px),
    linear-gradient(160deg, #d97706, #78350f);
  clip-path: none;
  color: #fff7ed;
}
.crystal-cell.is-flashing {
  animation: crystal-flash 160ms var(--ease);
  filter: brightness(1.4) saturate(1.2);
  box-shadow: 0 0 0 3px #fff6c8, 0 0 22px #ffe08acc;
  z-index: 3;
}
.crystal-cell.is-cursor:not(.is-selected) { outline: 2px dashed #ffffff66; outline-offset: -3px; }
@keyframes crystal-flash {
  from { transform: scale(.9); }
  to { transform: scale(1.06); }
}
.goal-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3cde9;
  font: 700 13px var(--display);
  box-shadow: 0 3px 8px #6a3d8d0c;
}
.goal-pill.is-done { background: #eafaf1; border-color: #54b282; color: #1e6c45; }
.goal-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 1px 0 #fff8; }

.game-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  background: #2f1a4b;
  box-shadow: inset 0 0 0 1px #ffffff22, 0 14px 32px #1a0c2e44;
  touch-action: none;
}

.slide-board {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 20px;
  background:
    radial-gradient(140px 90px at 100% 0%, #e9d5ff88, transparent 70%),
    linear-gradient(165deg, #3b2163, #2a1548);
  box-shadow: inset 0 1px 0 #ffffff22;
}
.slide-tile {
  min-width: 56px;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(155deg, #fffaf6 0%, #f3e8ff 55%, #e9d5ff 100%);
  color: #3b1764;
  font: 800 22px/1 var(--display);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 2px 0 #ffffffcc,
    inset 0 -3px 0 #c4b5fd88,
    0 4px 0 #5b21b655,
    0 8px 16px #1a0c2e33;
  transition: transform 120ms var(--ease);
}
.slide-tile:active { transform: translateY(2px); box-shadow: inset 0 2px 0 #fff, 0 2px 0 #5b21b655; }
.slide-tile.is-home {
  background: linear-gradient(155deg, #ddd6fe, #a78bfa 55%, #8b5cf6);
  color: #fff;
  text-shadow: 0 1px 2px #4c1d9588;
}
.slide-tile.is-empty {
  background: #4a2f6d55;
  border: 1.5px dashed #c4b5fd66;
  color: transparent;
  cursor: default;
  box-shadow: inset 0 0 12px #1a0c2e44;
}
.slide-tile.is-hint { outline: 3px solid #ffaa08; outline-offset: 1px; }

.board-2048 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  width: min(100%, 372px);
  padding: 12px;
  border-radius: 22px;
  background:
    radial-gradient(160px 100px at 0% 0%, #fbbf2466, transparent 60%),
    linear-gradient(165deg, #4c1d95, #2e1065 55%, #1e0b3a);
  box-shadow: inset 0 1px 0 #ffffff33, 0 14px 30px #1a0c2e44;
}
.tile-2048 {
  position: relative;
  aspect-ratio: 1;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font: 800 clamp(18px, 4.5vw, 26px)/1 var(--display);
  background: #5b3d82;
  color: transparent;
  box-shadow: inset 0 0 0 1px #ffffff14;
  overflow: hidden;
}
.tile-2048::after {
  content: '';
  position: absolute;
  top: 10%; left: 14%;
  width: 42%; height: 28%;
  border-radius: 50%;
  background: #ffffff33;
  pointer-events: none;
  opacity: 0;
}
.tile-2048[data-v]:not([data-v="0"])::after { opacity: 1; }
.tile-2048[data-v="2"] { background: linear-gradient(145deg, #fff7ed, #fed7aa); color: #431407; }
.tile-2048[data-v="4"] { background: linear-gradient(145deg, #ffedd5, #fdba74); color: #431407; }
.tile-2048[data-v="8"] { background: linear-gradient(145deg, #fdba74, #f97316); color: #fff7ed; text-shadow: 0 1px 1px #9a341288; }
.tile-2048[data-v="16"] { background: linear-gradient(145deg, #fb923c, #ea580c); color: #fff; }
.tile-2048[data-v="32"] { background: linear-gradient(145deg, #f472b6, #db2777); color: #fff; }
.tile-2048[data-v="64"] { background: linear-gradient(145deg, #e879f9, #c026d3); color: #fff; }
.tile-2048[data-v="128"] { background: linear-gradient(145deg, #c084fc, #9333ea); color: #fff; box-shadow: 0 0 14px #a855f866; }
.tile-2048[data-v="256"] { background: linear-gradient(145deg, #a78bfa, #7c3aed); color: #fff; box-shadow: 0 0 16px #8b5cf688; }
.tile-2048[data-v="512"] { background: linear-gradient(145deg, #818cf8, #4f46e5); color: #fff; box-shadow: 0 0 18px #6366f688; }
.tile-2048[data-v="1024"] { background: linear-gradient(145deg, #fbbf24, #d97706); color: #fffbeb; font-size: 18px; box-shadow: 0 0 20px #fbbf2499; }
.tile-2048[data-v="2048"] { background: linear-gradient(145deg, #fde68a, #f59e0b 40%, #fbbf24); color: #422006; font-size: 18px; box-shadow: 0 0 24px #fde68acc; }
.tile-2048.is-big { background: linear-gradient(145deg, #312e81, #1e1b4b); color: #fef3c7; font-size: 17px; box-shadow: 0 0 20px #818cf866; }
.tile-2048.is-new { animation: tile-spawn 220ms var(--ease); }
.tile-2048.is-merged { animation: tile-merge 240ms var(--ease); }
@keyframes tile-spawn {
  from { transform: scale(0.2); opacity: .2; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes tile-merge {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.dpad-controls { display: grid; grid-template-columns: repeat(3, 56px); gap: 8px; justify-content: center; margin-top: 4px; }
.dpad-spacer { visibility: hidden; }

/* Editorial column */
.game-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 32px;
  align-items: start;
  max-width: 1120px;
  margin-inline: auto;
}
.game-prose ul { padding-left: 22px; }
.game-prose li { margin-bottom: 8px; }
.game-rules-card {
  border: 1px solid #ead6f0;
  border-radius: 18px;
  padding: 18px 20px;
  background: linear-gradient(160deg, #fff9fd, #f6effc);
}
.game-worked {
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid #e4c8f0;
  background:
    radial-gradient(180px 100px at 0% 0%, #f3e8ff, transparent 70%),
    #fffaf6;
}
.worked-steps {
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: worked;
  display: grid;
  gap: 12px;
}
.worked-steps li {
  position: relative;
  padding: 12px 14px 12px 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ebd7f1;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
.worked-steps li::before {
  counter-increment: worked;
  content: counter(worked);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--game-accent), #6d28d9);
  color: #fff;
  font: 800 13px/1 var(--display);
}

.game-sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 112px; }
.game-side-card {
  padding: 20px;
  border: 1px solid #ead7ec;
  border-radius: 18px;
  background: #fffdf9;
}
.game-side-motif {
  padding: 14px;
  background: linear-gradient(165deg, #2a1544, #4a2a6e);
  border-color: #5b3a7a;
}
.game-side-motif svg { width: 100%; height: auto; display: block; }
.game-facts { margin: 0; display: grid; gap: 10px; }
.game-facts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1e3f3;
  font-size: 14px;
}
.game-facts div:last-child { padding-bottom: 0; border-bottom: 0; }
.game-facts dt { color: var(--muted); }
.game-facts dd { margin: 0; font-weight: 700; text-align: right; color: var(--ink); }
.game-guide-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.game-guide-links a {
  display: block;
  padding: 12px 14px;
  border: 1px solid #ead8ec;
  border-radius: 14px;
  background: #fff9fd;
  text-decoration: none;
  transition: border-color 160ms, background 160ms, transform 160ms;
}
.game-guide-links a:hover {
  border-color: #b785e3;
  background: #f8effd;
  transform: translateY(-1px);
}
.game-guide-links strong { display: block; font: 700 15px/1.3 var(--display); color: var(--ink); margin-bottom: 4px; }
.game-guide-links span { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; }

@media (max-width: 980px) {
  .puzzle-catalog,
  .puzzle-catalog-home,
  .puzzle-catalog-compact { grid-template-columns: minmax(0, 1fr); }
  .games-promise { grid-template-columns: minmax(0, 1fr); }
  .games-editorial-note { grid-template-columns: minmax(0, 1fr); padding: 22px; }
}
@media (max-width: 900px) {
  .game-editorial-grid { grid-template-columns: minmax(0, 1fr); }
  .game-sidebar { position: static; }
  .puzzle-tile-link { grid-template-columns: 132px minmax(0, 1fr); }
  .game-stage-layout { grid-template-columns: 1fr; }
  .game-stage-ads { display: none; }
  .game-stage-phone {
    justify-self: center;
    width: min(100%, 420px);
  }
  .phone-scale-wrap { justify-content: center; }
  .phone-device { margin-inline: auto; }
}
@media (max-width: 680px) {
  .game-shell { padding: 20px 14px 28px; margin-top: 20px; border-radius: 22px; }
  .game-header { margin-bottom: 18px; }
  .game-header .lead { font-size: 16px; }
  .game-stage-wrap { padding: 12px 10px 16px; border-radius: 18px; margin-bottom: 28px; }
  .game-board-surface { padding: 10px 6px; }
  .game-actions { gap: 6px; }
  .game-btn { padding: 8px 12px; font-size: 13px; }
  .flask-grid { gap: 10px 6px; padding: 6px 2px; }
  .flask-btn { width: clamp(44px, 12vw, 58px); height: clamp(140px, 34vw, 168px); padding: 10px 5px 8px; border-radius: 10px 10px 22px 22px; }
  .flask-btn::before { left: 16%; right: 16%; height: 8px; }
  .flask-btn::after { width: 7px; inset: 10px auto 12px 5px; }
  .flask-layer { height: 30px; font-size: 11px; }
  .nono-cell { width: 32px; height: 32px; min-width: 30px; min-height: 30px; font-size: 14px; }
  .slide-tile { min-width: 48px; min-height: 48px; font-size: 18px; }
  .crystal-cell { min-height: 40px; }
  .crystal-grid { gap: 5px; padding: 8px; }
  .puzzle-tile-link { grid-template-columns: 108px minmax(0, 1fr); }
  .puzzle-tile-body { padding: 14px 12px 14px; gap: 6px; }
  .puzzle-tile-desc { -webkit-line-clamp: 2; font-size: 13px; }
  .puzzle-tile-traits { display: none; }
}
@media (max-width: 420px) {
  .puzzle-tile-link { grid-template-columns: 1fr; }
  .puzzle-tile-art { padding: 16px 16px 4px; }
  .puzzle-tile-art svg { max-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .puzzle-tile,
  .puzzle-tile:hover,
  .game-btn,
  .game-banner,
  .logic-cell { transition: none; animation: none; transform: none; }
}

/* —— Cozy monetization / healing reward UI —— */
.cozy-wallet-chip {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  width: 100%; max-width: 440px; margin-bottom: 4px;
}
.cozy-coin, .cozy-streak {
  padding: 8px 14px; border-radius: 999px; font: 800 14px/1 var(--display);
  background: linear-gradient(180deg, #fff9e6, #ffe8a3); color: #7a4a00;
  border: 1px solid #f5d76e; box-shadow: 0 4px 12px #f0c14d33, inset 0 1px 0 #fff;
}
.cozy-streak { background: linear-gradient(180deg, #fff, #f3e8ff); color: #6d28d9; border-color: #e9d5ff; }

.cozy-item-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.cozy-item-btn {
  min-width: 52px; min-height: 52px; border-radius: 16px; border: 1px solid #ead7f5;
  background: linear-gradient(165deg, #fff, #faf5ff); box-shadow: 0 4px 10px #6a3d8d12;
  display: grid; place-items: center; gap: 2px; padding: 6px;
}
.cozy-item-btn span { font-size: 18px; line-height: 1; }
.cozy-item-btn em { font: 800 11px/1 var(--display); color: #7c3aed; font-style: normal; }
.cozy-item-btn:disabled { opacity: .38; }

.cozy-modal-layer {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 20px; background: radial-gradient(circle at 50% 20%, #ffd6f555, #2a1548cc 55%);
  opacity: 0; transition: opacity 240ms var(--ease);
}
.cozy-modal-layer.is-open { opacity: 1; }
.cozy-modal {
  position: relative; width: min(100%, 420px); padding: 28px 24px 22px;
  border-radius: 28px; border: 1px solid #ffffff66;
  background:
    radial-gradient(220px 140px at 100% 0%, #fde68a88, transparent 60%),
    radial-gradient(200px 120px at 0% 100%, #f0abfc66, transparent 55%),
    linear-gradient(165deg, #fffdf9, #f5e9ff);
  box-shadow: 0 24px 60px #1a0c2e66, inset 0 1px 0 #fff;
  transform: translateY(14px) scale(.96); transition: transform 280ms var(--ease);
  text-align: center; overflow: hidden;
}
.cozy-modal-layer.is-open .cozy-modal { transform: none; }
.cozy-modal-kicker {
  margin: 0 0 6px; font: 800 11px/1 var(--display); letter-spacing: .14em;
  text-transform: uppercase; color: #a855f7;
}
.cozy-modal h2 {
  margin: 0 0 8px; font: 800 clamp(1.45rem, 4vw, 1.85rem)/1.15 var(--display);
  letter-spacing: -.03em; color: #3b1764;
}
.cozy-modal-lead { margin: 0 0 16px; color: #6b4a7a; font-size: 15px; line-height: 1.5; }
.cozy-modal-note, .cozy-modal-footnote { margin: 12px 0 0; font-size: 12px; color: #9b7aad; }
.cozy-reward-pile, .cozy-settle-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 18px; }
.cozy-reward-pill, .cozy-settle-compare > div {
  padding: 14px 10px; border-radius: 18px; background: #fff; border: 1px solid #ead7f5;
  box-shadow: 0 8px 18px #7c3aed14;
}
.cozy-reward-pill strong, .cozy-settle-compare strong {
  display: block; font: 800 22px/1.1 var(--display); color: #6d28d9; margin-bottom: 4px;
}
.cozy-reward-pill span, .cozy-settle-compare span { font-size: 12px; color: #8b6b9a; }
.cozy-settle-compare .is-dream {
  background: linear-gradient(160deg, #fff7ed, #fde68a); border-color: #f5d76e;
}
.cozy-settle-compare .is-dream strong { color: #b45309; }
.cozy-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.cozy-btn {
  min-height: 52px; border-radius: 999px; border: 0; font: 800 16px/1 var(--display);
  padding: 0 18px; cursor: pointer;
}
.cozy-btn-ghost { background: #fff; color: #5b3d82; border: 1px solid #e9d5ff; }
.cozy-btn-glow {
  color: #3f1d09;
  background: linear-gradient(180deg, #ffe875 0%, #ffcb29 45%, #ff9f1a 100%);
  box-shadow: 0 0 0 1px #fff6c8, 0 0 22px #ffd36a99, 0 10px 24px #b4530933;
  animation: cozy-pulse 1.8s ease-in-out infinite;
}
.cozy-btn-glow:disabled { animation: none; opacity: .55; filter: grayscale(.2); }
@keyframes cozy-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px #fff6c8, 0 0 18px #ffd36a88, 0 10px 24px #b4530933; }
  50% { transform: scale(1.03); box-shadow: 0 0 0 1px #fff, 0 0 28px #ffe08acc, 0 12px 28px #b4530944; }
}
.cozy-modal-sparkles { pointer-events: none; position: absolute; inset: 0; }
.cozy-modal-sparkles span {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fde68a;
  animation: cozy-spark 2.4s linear infinite; opacity: .0;
}
.cozy-modal-sparkles span:nth-child(odd) { background: #f0abfc; }
.cozy-modal-sparkles span:nth-child(1) { left: 12%; top: 20%; animation-delay: 0s; }
.cozy-modal-sparkles span:nth-child(2) { left: 78%; top: 18%; animation-delay: .3s; }
.cozy-modal-sparkles span:nth-child(3) { left: 22%; top: 70%; animation-delay: .6s; }
.cozy-modal-sparkles span:nth-child(4) { left: 88%; top: 62%; animation-delay: .9s; }
.cozy-modal-sparkles span:nth-child(5) { left: 50%; top: 12%; animation-delay: 1.1s; }
.cozy-modal-sparkles span:nth-child(6) { left: 40%; top: 80%; animation-delay: 1.4s; }
@keyframes cozy-spark {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-28px) scale(1.2); opacity: 0; }
}
.cozy-settle-halo {
  width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%;
  background: radial-gradient(circle, #fde68a, #f0abfc 55%, transparent 70%);
  animation: cozy-pulse 2s ease-in-out infinite;
}
.cozy-ad-watch {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center;
  background: #1a0c2eee; padding: 20px;
}
.cozy-ad-watch-card {
  width: min(100%, 360px); padding: 28px 22px; border-radius: 24px; text-align: center;
  background: linear-gradient(165deg, #2e1065, #5b21b6); color: #fce7f3;
  box-shadow: 0 0 40px #f0abfc55;
}
.cozy-ad-watch-kicker { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.cozy-ad-watch-card h3 { margin: 8px 0 16px; font: 800 1.35rem/1.2 var(--display); color: #fff; }
.cozy-ad-watch-orb {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%;
  background: conic-gradient(from 120deg, #fde68a, #f472b6, #a78bfa, #fde68a);
  animation: cozy-spin 1.2s linear infinite; box-shadow: 0 0 24px #fde68a88;
}
@keyframes cozy-spin { to { transform: rotate(360deg); } }
.cozy-ad-watch-status { margin: 0 0 12px; font-size: 14px; }
.cozy-ad-watch-bar {
  height: 8px; border-radius: 999px; background: #ffffff22; overflow: hidden;
}
.cozy-ad-watch-bar span {
  display: block; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #fde68a, #f472b6);
}

/* —— Zen Block Puzzle (reference: deep navy + candy bevels) —— */
.theme-zen-blocks.game-root-live,
.theme-zen-blocks .game-chrome {
  width: min(100%, 440px);
  margin-inline: auto;
}
.theme-zen-blocks .game-chrome {
  padding: 14px 12px 18px;
  border-radius: 28px;
  background:
    radial-gradient(120% 70% at 50% -8%, #60a5fa44, transparent 52%),
    linear-gradient(180deg, #244b78 0%, #143556 38%, #0b1c33 100%);
  box-shadow: 0 24px 48px #0f172a66, inset 0 1px 0 #ffffff28;
  gap: 10px;
  display: flex; flex-direction: column;
}
/* Hide duplicate outer HUD — score lives inside the navy stage */
.theme-zen-blocks .game-hud { display: none; }
/* Board first (after wallet), tools below — closer to reference chrome */
.theme-zen-blocks .cozy-wallet-chip { order: 0; }
.theme-zen-blocks .game-board-shell { order: 1; }
.theme-zen-blocks .cozy-item-bar { order: 2; }
.theme-zen-blocks .game-actions { order: 3; }
.theme-zen-blocks .game-status { order: 4; }
.theme-zen-blocks .game-banner { order: 5; }
.theme-zen-blocks .game-subcontrols { order: 6; }
.theme-zen-blocks .game-board-shell,
.theme-zen-blocks .game-board-surface {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 100%;
  max-width: none;
}
.theme-zen-blocks .game-btn {
  background: linear-gradient(180deg, #ffffffee, #dbeafe);
  color: #0c4a6e; border: 0; box-shadow: 0 6px 14px #00000033;
  min-height: 40px; font-size: 13px;
}
.theme-zen-blocks .game-btn-primary {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  color: #fff;
}
.theme-zen-blocks .game-status { color: #bfdbfe; margin-top: 4px; }
.theme-zen-blocks .cozy-item-bar { gap: 10px; margin: 2px 0 4px; }
.theme-zen-blocks .cozy-item-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(160deg, #fff, #dbeafe);
  border: 3px solid #fff; box-shadow: 0 8px 16px #00000040, inset 0 2px 0 #fff;
}
.theme-zen-blocks .cozy-wallet-chip { margin-bottom: 2px; }
.theme-zen-blocks .cozy-wallet-chip .cozy-coin {
  background: linear-gradient(180deg, #fff7cc, #fbbf24);
  color: #78350f; border-color: #fde68a;
}
.theme-zen-blocks .cozy-wallet-chip .cozy-streak {
  background: linear-gradient(180deg, #ecfdf5, #a7f3d0);
  color: #065f46; border-color: #6ee7b7;
}

.zen-blocks-stage {
  display: grid; gap: 14px; justify-items: center; width: min(100%, 400px);
}
.zen-blocks-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  width: 100%; gap: 8px; padding: 0 4px;
}
.zen-crown {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start;
  padding: 6px 12px; border-radius: 999px;
  background: #06101ccc; color: #fff; font: 800 15px/1 var(--display);
  border: 1px solid #ffffff22;
}
.zen-crown-icon { font-size: 16px; filter: drop-shadow(0 2px 4px #0008); }
.zen-score-big {
  font: 800 clamp(2.2rem, 9vw, 3rem)/1 var(--display);
  color: #fff; letter-spacing: -.04em; text-shadow: 0 4px 18px #00000088;
  text-align: center;
}
.zen-level-pill {
  justify-self: end; padding: 6px 12px; border-radius: 999px;
  background: #06101ccc; color: #e0f2fe; font: 800 13px/1 var(--display);
  border: 1px solid #ffffff22;
}
.zen-blocks-grid {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px;
  width: min(100%, 380px); padding: 14px; border-radius: 18px;
  background: linear-gradient(180deg, #152238, #0a1424);
  box-shadow: inset 0 0 0 2px #ffffff18, inset 0 10px 28px #00000055, 0 16px 32px #02061766;
}
.zen-cell {
  aspect-ratio: 1; border: 0; border-radius: 5px; padding: 0;
  background: linear-gradient(160deg, #1a2b44, #0f1a2c);
  box-shadow: inset 0 1px 0 #ffffff10, inset 0 -2px 3px #00000055;
  cursor: pointer;
}
.zen-cell.has {
  box-shadow:
    inset 0 2px 0 #ffffff88, inset 1px 0 0 #ffffff44,
    inset 0 -4px 6px #00000055, 0 2px 4px #00000044;
}
.zen-cell.ghost-valid {
  box-shadow: inset 0 0 0 2px #ffffffcc, 0 0 10px #fde68a66;
  background: #ffffff33 !important;
}
.zen-cell.ghost-invalid {
  background: #7f1d1d66 !important;
  box-shadow: inset 0 0 0 2px #f87171;
}
.zen-tray {
  display: flex; justify-content: center; align-items: end; gap: 16px;
  flex-wrap: wrap; min-height: 96px; width: 100%;
}
.zen-piece {
  display: grid; gap: 3px; padding: 10px 12px; border-radius: 16px; border: 0;
  background: linear-gradient(180deg, #ffffff22, #ffffff10);
  box-shadow: inset 0 1px 0 #ffffff33, 0 8px 18px #00000033;
  cursor: pointer; touch-action: manipulation;
}
.zen-piece.is-empty {
  min-width: 72px; min-height: 72px; opacity: .25; pointer-events: none;
}
.zen-piece.is-selected {
  outline: 3px solid #fde68a; outline-offset: 3px;
  box-shadow: 0 0 22px #fbbf2466, inset 0 1px 0 #fff;
  transform: translateY(-4px);
}
.zen-piece-row { display: flex; gap: 3px; }
.zen-piece-cell {
  width: 24px; height: 24px; border-radius: 5px; background: transparent;
}
.zen-piece-cell.on {
  box-shadow:
    inset 0 2px 0 #ffffff99, inset 0 -3px 5px #00000044,
    0 2px 4px #00000033;
}
.zen-vibe {
  margin: 2px 0 0; font: 800 italic clamp(1.35rem, 5vw, 1.7rem)/1 var(--display);
  color: #fde68a; letter-spacing: .02em;
  text-shadow: 0 3px 0 #b45309, 0 8px 18px #00000055;
  transform: rotate(-2deg);
}

/* legacy cozy grid helpers (other games / older hooks) */
.cozy-grid-8 {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px;
  width: min(100%, 360px); padding: 10px; border-radius: 18px;
  background: linear-gradient(165deg, #1e3a5f, #0f172a);
  box-shadow: inset 0 1px 0 #ffffff22, 0 12px 28px #0f172a44;
}
.cozy-cell {
  aspect-ratio: 1; border-radius: 6px; background: #1e293b88;
  box-shadow: inset 0 0 0 1px #ffffff10;
}
.cozy-cell.has {
  box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 6px #00000033, 0 2px 4px #00000033;
}
.cozy-tray {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 12px;
  min-height: 88px;
}
.cozy-piece {
  display: grid; gap: 3px; padding: 8px; border-radius: 14px; border: 0;
  background: #ffffff18; cursor: grab; touch-action: none;
}
.cozy-piece:active { cursor: grabbing; }
.cozy-piece-cell { width: 22px; height: 22px; border-radius: 5px; }

.bus-lot {
  display: grid; gap: 6px; width: min(100%, 360px); padding: 12px; border-radius: 18px;
  background: linear-gradient(180deg, #fef3c7, #fde68a 40%, #86efac);
}
.bus-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; min-height: 52px; }
.bus-tile {
  border: 0; border-radius: 12px; min-height: 48px; font: 800 13px/1.1 var(--display); color: #fff;
  box-shadow: inset 0 2px 0 #ffffff55, 0 4px 10px #00000022;
}
.bus-tile.is-empty { background: #ffffff55; border: 1.5px dashed #ffffff99; color: transparent; box-shadow: none; }
.bus-queue { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.bus-queue span {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 800 11px/1 var(--display); color: #fff; box-shadow: 0 2px 6px #00000022;
}

.sand-stage {
  width: min(100%, 360px); padding: 14px; border-radius: 22px;
  background: linear-gradient(165deg, #4c1d95, #2e1065);
  box-shadow: 0 14px 32px #2e106555;
}
.sand-tank {
  height: 64px; border-radius: 14px; margin-bottom: 12px; overflow: hidden;
  border: 2px solid #ffffff33; display: flex; flex-direction: column-reverse;
}
.sand-layer { flex: 1; }
.sand-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sand-box {
  aspect-ratio: 1; border-radius: 14px; border: 2px solid #ffffff44; position: relative;
  background: #1e1b4b88; color: #fff; font: 800 12px/1 var(--display);
  display: grid; place-items: end center; padding-bottom: 8px; overflow: hidden;
}
.sand-box .fill {
  position: absolute; left: 0; right: 0; bottom: 0; transition: height 200ms var(--ease);
  opacity: .9;
}
.sand-box.is-active { outline: 3px solid #fde68a; outline-offset: 2px; }

.cat-board {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  width: min(100%, 340px); padding: 12px; border-radius: 20px;
  background: linear-gradient(180deg, #fffaf5, #ffe4e6);
}
.cat-cell {
  aspect-ratio: 1; border: 0; border-radius: 14px; font-size: 22px;
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #00000010;
}
.cat-rules { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.cat-rules span {
  padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid #fecdd3;
  font: 700 12px/1.2 var(--display); color: #9f1239;
}

/* --- Cozy game polish (blocks, bus, sand, cats) --- */
.cozy-blocks-stage { display: grid; gap: 10px; justify-items: center; width: min(100%, 400px); }
.cozy-grid-10 {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px;
  width: min(100%, 380px); padding: 12px; border-radius: 20px;
  background: linear-gradient(165deg, #0c1929, #0a1628 45%, #060d18);
  box-shadow: inset 0 2px 0 #ffffff14, inset 0 -8px 24px #00000055, 0 16px 36px #02061766;
}
.cozy-grid-10 .cozy-cell {
  aspect-ratio: 1; border-radius: 5px;
  background: linear-gradient(165deg, #1e293bcc, #0f172acc);
  box-shadow: inset 0 1px 0 #ffffff18, inset 0 -2px 4px #00000044, 0 0 0 1px #ffffff08;
}
.cozy-grid-10 .cozy-cell.has {
  box-shadow:
    inset 0 2px 0 #ffffff66, inset 0 -4px 8px #00000044,
    0 2px 6px #00000044, 0 0 0 1px #ffffff22;
}
.cozy-cell.is-ghost.preview-valid {
  background: color-mix(in srgb, var(--ghost-color, #38bdf8) 55%, #1e293b) !important;
  box-shadow: inset 0 0 0 2px #fde68acc, 0 0 12px color-mix(in srgb, var(--ghost-color, #38bdf8) 40%, transparent);
}
.cozy-cell.is-ghost.preview-invalid {
  background: #7f1d1d66 !important;
  box-shadow: inset 0 0 0 2px #f87171aa;
}
.cozy-piece.is-selected {
  outline: 3px solid #fde68a; outline-offset: 3px;
  background: #ffffff28; box-shadow: 0 0 18px #fbbf2444;
}
.cozy-tray-label {
  margin: 0; font: 800 13px/1 var(--display); letter-spacing: .12em;
  text-transform: uppercase; color: #7dd3fc; text-align: center; opacity: .9;
}

.bus-stage {
  width: min(100%, 360px); padding: 14px; border-radius: 22px;
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 35%, #fcd34d 55%, #d4a574 100%);
  box-shadow: inset 0 2px 0 #fff9, 0 14px 32px #78350f33;
  border: 2px solid #fbbf2488;
}
.bus-stage .bus-queue { margin-bottom: 10px; gap: 8px; }
.bus-queue-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 2px 0 #ffffff66, 0 3px 8px #00000028;
  border: 1.5px solid #ffffff88;
}
.bus-parking {
  display: flex; justify-content: center; gap: 10px; margin-bottom: 12px;
  padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(180deg, #fff8, #fff3);
  border: 1.5px dashed #ca8a04aa;
}
.bus-p-slot {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font: 800 14px/1 var(--display); color: #a16207;
  background: #ffffff66; border: 2px dashed #eab30899;
  box-shadow: inset 0 2px 6px #0000000a;
}
.bus-p-slot.is-filled { color: #15803d; border-style: solid; background: #dcfce7; }
.bus-grid { display: grid; gap: 6px; }
.bus-stage .bus-row { min-height: 52px; }
.bus-tile.bus-dust { position: relative; }
.bus-dust-puff {
  position: absolute; inset: -4px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle, #d6d3d188 0%, transparent 70%);
  animation: bus-dust-puff 500ms ease-out forwards;
}
@keyframes bus-dust-puff {
  0% { opacity: .9; transform: scale(.85); }
  100% { opacity: 0; transform: scale(1.35); }
}

.sand-tray-frame {
  position: relative;
  border: 2px solid #c4b5fd66;
  box-shadow: inset 0 0 0 1px #a78bfa44, 0 18px 40px #2e106577;
}
.sand-stream {
  position: relative; height: 28px; margin: -4px auto 8px; width: 48px;
  overflow: visible;
}
.sand-stream-core {
  position: absolute; left: 50%; top: 0; width: 10px; height: 100%;
  transform: translateX(-50%); border-radius: 0 0 8px 8px;
  filter: blur(0.5px);
  animation: sand-drip 0.35s ease-in-out infinite alternate;
}
@keyframes sand-drip {
  from { transform: translateX(-50%) scaleY(0.92); opacity: .85; }
  to { transform: translateX(-50%) scaleY(1.08); opacity: 1; }
}
.sand-particle {
  position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%;
  animation: sand-fall 0.85s ease-in forwards;
  box-shadow: 0 0 4px #00000033;
}
@keyframes sand-fall {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(72px) scale(0.4); opacity: 0; }
}
.sand-grid-5 {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 10px; margin-bottom: 10px; border-radius: 16px;
  background: linear-gradient(165deg, #1e1b4b99, #0f0a1e);
  box-shadow: inset 0 4px 12px #00000066, inset 0 0 0 1px #ffffff12;
}
.sand-grid-cell {
  aspect-ratio: 1; border-radius: 6px;
  background: #312e8133;
  box-shadow: inset 0 2px 4px #00000055, inset 0 -1px 0 #ffffff0a;
}
.sand-stage.is-pouring .sand-tank { box-shadow: 0 0 16px #fde68a44; }
.sand-stage .sand-slots { position: relative; z-index: 1; }

.cat-stage {
  display: grid; gap: 10px; justify-items: center;
  width: min(100%, 360px); padding: 4px 0;
}
.cat-board {
  box-shadow:
    inset 0 2px 0 #fff, inset 0 -6px 16px #fecdd344,
    0 14px 28px #fda4af33;
  border: 2px solid #fff;
  background: linear-gradient(180deg, #fffaf3, #fff1f2 55%, #fce7f3);
}
.cat-cell.has-cat {
  transform: scale(1.02);
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 #9f123922, 0 0 12px #fda4af55;
}
.cat-footer {
  margin: 4px 0 0; font: 800 clamp(1rem, 3.5vw, 1.2rem)/1.2 var(--display);
  letter-spacing: .06em; color: #be123c; text-align: center;
}

.sudoku-board {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px;
  width: min(100%, 360px); padding: 8px; border-radius: 16px; background: #e2e8f0;
}
.sudoku-cell {
  aspect-ratio: 1; border: 0; background: #fff; font: 800 16px/1 var(--display); color: #1e3a5f;
  border-radius: 4px;
}
.sudoku-cell.is-fixed { color: #0f172a; background: #f8fafc; }
.sudoku-cell.is-sel { background: #dbeafe; outline: 2px solid #3b82f6; }
.sudoku-cell.is-house { background: #eff6ff; }
.sudoku-nums { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; width: min(100%, 360px); margin-top: 10px; }
.sudoku-nums button {
  aspect-ratio: 1; border-radius: 12px; border: 0; background: #1d4ed8; color: #fff;
  font: 800 16px/1 var(--display); box-shadow: 0 4px 10px #1d4ed833;
}

.voxel-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  width: min(100%, 320px); margin-top: 10px;
}
.voxel-bot {
  aspect-ratio: 1; border: 0; border-radius: 16px; font: 800 18px/1 var(--display); color: #fff;
  box-shadow: inset 0 2px 0 #ffffff55, 0 6px 14px #00000022;
}
.voxel-snack {
  width: min(100%, 320px); height: 120px; border-radius: 18px;
  background: linear-gradient(180deg, #1e3a8a, #172554);
  position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px #ffffff22;
}

/* --- Cozy engine polish: carnival / beads / sudoku / voxel --- */
.carnival-board .game-canvas.carnival-canvas {
  width: min(100%, 360px); border-radius: 20px;
  box-shadow: 0 12px 28px #15803d33, inset 0 0 0 2px #ffffff55;
}
.calm-beads-board .calm-beads-canvas {
  width: min(100%, 360px); border-radius: 22px;
  box-shadow: 0 10px 24px #1d4ed833;
}

.lantern-sudoku-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.lantern-sudoku-board .sudoku-board {
  background: #f1f5f9;
  box-shadow: inset 0 0 0 2px #94a3b8, 0 10px 24px #0f172a12;
  gap: 1px; padding: 6px; border-radius: 12px;
}
.lantern-sudoku-board .sudoku-cell {
  background: #fff; color: #1e293b; font-size: clamp(15px, 4vw, 18px);
  box-shadow: inset 0 1px 0 #f8fafc;
}
.lantern-sudoku-board .sudoku-cell.is-fixed { color: #0f172a; font-weight: 800; background: #f8fafc; }
.lantern-sudoku-board .sudoku-cell.is-sel { background: #dbeafe; outline: 2px solid #2563eb; z-index: 1; }
.lantern-sudoku-board .sudoku-cell.is-house { background: #eff6ff; }
.lantern-sudoku-board .sudoku-cell.is-peer { color: #2563eb; }
.lantern-sudoku-board .sudoku-cell.is-wrong { color: #dc2626; background: #fef2f2; }
.lantern-sudoku-board .sudoku-cell.has-notes { font-size: 0; padding: 2px; }
.lantern-sudoku-board .sudoku-notes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  width: 100%; height: 100%; font: 700 8px/1.1 var(--display); color: #475569;
}
.lantern-sudoku-board .sudoku-notes em { font-style: normal; }
.lantern-sudoku-board .sudoku-notes .is-empty { opacity: 0; }
.lantern-sudoku-board .sudoku-nums button.sudoku-num {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
.lantern-sudoku-board .sudoku-cell[data-thick-l="1"] { box-shadow: inset 2px 0 0 #64748b; }
.lantern-sudoku-board .sudoku-cell[data-thick-t="1"] { box-shadow: inset 0 2px 0 #64748b; }
.lantern-sudoku-board .sudoku-cell[data-thick-l="1"][data-thick-t="1"] {
  box-shadow: inset 2px 0 0 #64748b, inset 0 2px 0 #64748b;
}

.voxel-feast-stage {
  position: relative; width: min(100%, 320px); margin: 0 auto;
}
.voxel-laser-canvas {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.voxel-burger { position: relative; width: 140px; height: 72px; margin: 18px auto 0; }
.voxel-cube {
  position: absolute; border-radius: 3px;
  box-shadow: inset 0 2px 0 #ffffff44, 2px 3px 0 #00000033;
}
.voxel-endless-tag {
  margin: 0; text-align: center; font: 800 11px/1 var(--display);
  letter-spacing: 0.12em; color: #fde68a; text-shadow: 0 1px 8px #facc1566;
}
.voxel-crumb {
  position: absolute; width: 10px; height: 10px; border-radius: 2px; opacity: 0.85;
}
.voxel-grid-host { width: 100%; display: flex; justify-content: center; }
.voxel-bot.is-turret {
  background: linear-gradient(165deg, #fde047, #eab308) !important;
  color: #713f12 !important;
  box-shadow: inset 0 2px 0 #fef9c3, 0 5px 12px #ca8a0433;
}
.voxel-bot.is-selected { outline: 3px solid #fde68a; outline-offset: 2px; }


/* —— Voxel Burger Merge (ref) —— */
.theme-voxel-feast .game-chrome {
  width: min(100%, 420px); margin-inline: auto; padding: 12px;
  border-radius: 28px;
  background: radial-gradient(100% 60% at 50% 0%, #1d4ed8aa, transparent 55%), linear-gradient(180deg, #1e3a8a, #0f172a);
  box-shadow: 0 20px 40px #02061766;
}
.theme-voxel-feast .game-board-shell, .theme-voxel-feast .game-board-surface {
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
}
.theme-voxel-feast .game-hud { display: none; }
.theme-voxel-feast .game-status { color: #bfdbfe; }
.theme-voxel-feast .game-actions { order: 3; }
.theme-voxel-feast .cozy-item-bar { order: 2; }
.theme-voxel-feast .game-board-shell { order: 1; }
.theme-voxel-feast .cozy-wallet-chip { order: 0; }
.theme-voxel-feast .game-chrome { display: flex; flex-direction: column; }
.voxel-stage { display: grid; gap: 12px; justify-items: center; width: min(100%, 360px); }
.voxel-snack-burger {
  position: relative; width: 100%; min-height: 140px; padding: 12px;
  display: grid; align-content: center; gap: 4px;
  border-radius: 20px; background: radial-gradient(circle at 50% 40%, #1e40af88, transparent 70%);
}
.voxel-burger-layer { display: flex; justify-content: center; gap: 3px; flex-wrap: wrap; }
.voxel-cube {
  width: 14px; height: 14px; border-radius: 3px;
  box-shadow: inset 1px 1px 0 #fff6, inset -1px -1px 0 #0005, 0 2px 4px #0006;
  animation: voxel-jitter 1.2s ease-in-out infinite;
}
@keyframes voxel-jitter {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.voxel-beams { position: absolute; inset: auto 0 0 0; height: 70%; pointer-events: none; }
.voxel-beam {
  position: absolute; bottom: 0; width: 6px; height: 100%; border-radius: 6px;
  background: linear-gradient(180deg, #fde68a, #f59e0b00);
  box-shadow: 0 0 12px #facc15cc; transform: translateX(-50%);
  animation: beam-pulse .35s ease-in-out infinite alternate;
}
@keyframes beam-pulse { from { opacity: .55; } to { opacity: 1; filter: brightness(1.2); } }
.voxel-active-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.voxel-turret {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font: 800 16px/1 var(--display); color: #1e1b4b;
  box-shadow: inset 0 3px 0 #fff8, 0 6px 14px #0006; border: 3px solid #fff;
}
.voxel-turret.is-empty { background: #0f172a88; border-style: dashed; opacity: .45; }
.voxel-turret.is-firing { animation: cozy-pulse 1s ease-in-out infinite; }
.voxel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.voxel-bot {
  aspect-ratio: 1; border: 0; border-radius: 18px; font: 800 18px/1 var(--display); color: #fff;
  box-shadow: inset 0 2px 0 #ffffff66, 0 6px 14px #00000033;
}
.voxel-bot.is-empty { background: #0f172a66; box-shadow: inset 0 0 0 2px #ffffff22; }
.voxel-bot.is-selected { outline: 3px solid #fde68a; outline-offset: 2px; }
.voxel-footer { display: flex; align-items: end; justify-content: space-between; width: 100%; gap: 8px; }
.voxel-mascot { font-size: 42px; filter: drop-shadow(0 6px 8px #0008); }
.voxel-vibe {
  margin: 0; font: 800 italic clamp(1.4rem, 6vw, 1.85rem)/1 var(--display); color: #fff;
  text-shadow: 0 3px 0 #1e3a8a, 0 8px 16px #0008; transform: rotate(-6deg);
}

/* —— Find the Cats (ref) —— */
.theme-pastel-cats .game-chrome {
  width: min(100%, 420px); margin-inline: auto; padding: 10px 12px 16px;
  border-radius: 28px; background: linear-gradient(180deg, #fffaf5, #fdf2f8 60%, #e0f2fe);
  box-shadow: 0 16px 36px #fda4af33;
}
.theme-pastel-cats .game-hud { display: none; }
.theme-pastel-cats .game-board-shell, .theme-pastel-cats .game-board-surface {
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
}
.theme-pastel-cats .game-status { color: #9f1239; }
.cat-headbar { text-align: center; width: 100%; }
.cat-level-title { margin: 0 0 8px; font: 800 1.15rem/1 var(--display); color: #7c2d12; }
.cat-progress-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: #fff; border: 1px solid #fecdd3; box-shadow: 0 4px 12px #fda4af33;
  font: 800 14px/1 var(--display); color: #16a34a;
}
.cat-hearts { color: #ef4444; letter-spacing: 2px; }
.cat-rules span.is-active { border-color: #fb7185; box-shadow: 0 0 0 2px #fb718533; }
.cat-foot-hill {
  width: 100%; margin-top: 8px; padding: 28px 12px 18px; border-radius: 50% 50% 18px 18px / 40% 40% 18px 18px;
  background:
    radial-gradient(circle at 22% 18%, #38bdf8 0 10px, transparent 11px),
    radial-gradient(circle at 78% 18%, #38bdf8 0 10px, transparent 11px),
    linear-gradient(180deg, #7dd3fc, #38bdf8);
  text-align: center; box-shadow: inset 0 8px 0 #ffffff33;
}
.cat-cta {
  margin: 0; font: 800 clamp(1.5rem, 6vw, 1.9rem)/1 var(--display); color: #1d4ed8;
  -webkit-text-stroke: 1px #fff; text-shadow: 0 3px 0 #fff, 0 6px 12px #1e3a8a44;
}
.cat-cta-en { margin: 4px 0 0; font: 700 12px/1 var(--display); color: #1e3a8acc; letter-spacing: .08em; text-transform: uppercase; }

/* —— Mobile / phone adaptation (all cozy H5 games) —— */
html { -webkit-text-size-adjust: 100%; }
.game-shell,
.game-stage-wrap,
.game-root,
.game-chrome,
.game-board-surface {
  max-width: 100%;
  box-sizing: border-box;
}
.game-root,
.game-chrome,
.game-board-shell,
.zen-blocks-stage,
.voxel-stage,
.cat-stage,
.bus-stage,
.sand-stage {
  min-width: 0;
}
.game-btn,
.cozy-item-btn,
.zen-cell,
.zen-piece,
.cat-cell,
.bus-tile,
.sand-box,
.voxel-bot,
.sudoku-cell,
.sudoku-nums button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.game-canvas {
  width: min(100%, 360px);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 680px) {
  .game-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 12px;
    padding: 14px 10px max(20px, env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
    overflow-x: clip;
  }
  .game-shell > .breadcrumbs { order: 0; margin-bottom: 8px; }
  .game-shell > .game-header { order: 1; margin-bottom: 12px; }
  .game-shell > .game-stage-wrap { order: 2; }
  .game-shell > .game-editorial-grid { order: 3; }
  .game-shell > .related,
  .game-shell > .game-related { order: 4; }

  .game-header h1 { font-size: clamp(1.45rem, 7vw, 1.85rem); }
  .game-header .lead {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 15px;
    margin-bottom: 8px;
  }
  .game-trait-row { gap: 6px; }
  .game-trait-row li { font-size: 11px; padding: 6px 10px; }
  .game-controls-line { font-size: 13px; }
  .game-jump {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    z-index: 6;
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ffffffee;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px #5e30801a;
    width: fit-content;
  }

  .game-stage-wrap {
    width: 100%;
    margin: 0 0 22px;
    padding: 10px 8px 14px;
    border-radius: 16px;
  }
  .game-stage-wrap.is-phone-stage {
    max-width: 100%;
    padding: 12px 8px 18px;
    background: linear-gradient(165deg, #1e1b4b, #4c1d95);
  }
  .game-stage-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .game-stage-ads { display: none; }
  .game-stage-phone {
    justify-self: center;
    width: min(100%, 420px);
  }
  .game-stage-label { font-size: 10px; margin-bottom: 8px; }

  .phone-scale-wrap { justify-content: center; }
  .phone-device {
    --phone-fit-h: min(860px, calc(100dvh - 72px));
    width: min(100%, 420px, calc(var(--phone-fit-h) * 9 / 19.5));
    margin-inline: auto;
    filter: drop-shadow(0 16px 28px #0f172a55);
  }
  .phone-bezel { border-radius: 36px; padding: 8px; }
  .phone-screen {
    border-radius: 28px;
    max-height: var(--phone-fit-h);
  }
  .phone-notch { width: 104px; height: 24px; top: 6px; }
  .has-phone-frame .game-chrome { padding: 32px 8px 6px; gap: 8px; }
  .phone-btn { display: none; }

  .game-chrome {
    width: 100% !important;
    max-width: 100%;
    gap: 10px;
    padding-left: 0;
    padding-right: 0;
  }
  .theme-zen-blocks .game-chrome,
  .theme-voxel-feast .game-chrome,
  .theme-pastel-cats .game-chrome {
    width: 100% !important;
    border-radius: 20px;
    padding: 10px 8px 14px;
  }

  .game-hud {
    max-width: 100%;
    gap: 6px;
  }
  .game-stat {
    padding: 8px 6px 9px;
    border-radius: 12px;
  }
  .game-stat span { font-size: 10px; }
  .game-stat strong { font-size: 16px; }

  .game-actions {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .game-btn {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .cozy-wallet-chip { gap: 8px; max-width: 100%; }
  .cozy-coin, .cozy-streak { padding: 7px 12px; font-size: 13px; }
  .cozy-item-bar {
    width: 100%;
    gap: 8px;
    justify-content: center;
  }
  .cozy-item-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 14px;
  }
  .theme-zen-blocks .cozy-item-btn,
  .theme-voxel-feast .cozy-item-btn {
    width: 48px;
    height: 48px;
  }

  .cozy-modal-layer {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    align-items: end;
  }
  .cozy-modal {
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 16px 16px;
    padding: 22px 16px 16px;
  }
  .cozy-btn { min-height: 48px; font-size: 15px; }
  .cozy-ad-watch { padding: 12px; }
  .cozy-ad-watch-card { width: 100%; }

  /* Boards fill phone width */
  .zen-blocks-stage,
  .zen-blocks-grid,
  .voxel-stage,
  .cat-stage,
  .cat-board,
  .bus-stage,
  .bus-lot,
  .sand-stage,
  .sudoku-board,
  .sudoku-nums,
  .voxel-grid,
  .voxel-snack-burger,
  .voxel-active-line {
    width: 100%;
    max-width: 100%;
  }
  .zen-blocks-grid { gap: 2px; padding: 10px; }
  .zen-piece-cell { width: clamp(18px, 5.2vw, 24px); height: clamp(18px, 5.2vw, 24px); }
  .zen-score-big { font-size: clamp(1.8rem, 10vw, 2.6rem); }
  .zen-vibe { font-size: clamp(1.15rem, 5.5vw, 1.5rem); }

  .cat-cell {
    min-height: 48px;
    font-size: clamp(20px, 6vw, 26px);
    border-radius: 12px;
  }
  .cat-rules { gap: 4px; }
  .cat-rules span { padding: 7px 10px; font-size: 11px; }
  .cat-cta { font-size: clamp(1.25rem, 6vw, 1.7rem); }

  .bus-tile { min-height: 48px; font-size: 12px; }
  .bus-row { min-height: 48px; }
  .sand-box { min-height: 64px; font-size: 11px; }
  .voxel-bot { min-height: 56px; font-size: 16px; border-radius: 14px; }
  .voxel-turret { font-size: 14px; }
  .voxel-vibe { font-size: clamp(1.2rem, 6vw, 1.7rem); }

  .lantern-sudoku-board .sudoku-board { width: 100%; }
  .lantern-sudoku-board .sudoku-cell {
    min-height: 36px;
    font-size: clamp(14px, 4.2vw, 17px);
  }
  .sudoku-nums { width: 100%; gap: 4px; }
  .sudoku-nums button,
  .lantern-sudoku-board .sudoku-nums button.sudoku-num {
    min-height: 44px;
    font-size: 16px;
    border-radius: 10px;
  }

  .game-canvas,
  .carnival-board .game-canvas.carnival-canvas,
  .calm-beads-board .calm-beads-canvas {
    width: 100%;
    max-width: 100%;
  }

  .game-status {
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
    padding: 0 4px;
  }
}

@media (max-width: 380px) {
  .game-shell { padding-inline: 8px; }
  .game-stage-wrap { padding: 8px 6px 12px; }
  .cozy-item-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .zen-piece { padding: 8px; }
  .cat-rules span { font-size: 10px; padding: 6px 8px; }
  .bus-tile { font-size: 11px; min-height: 44px; }
}

@media (max-width: 680px) and (orientation: landscape) {
  .game-shell > .game-header .lead,
  .game-shell > .game-header .game-trait-row,
  .game-shell > .game-header .game-controls-line { display: none; }
  .game-stage-wrap { margin-bottom: 12px; }
  .game-canvas { max-height: 70vh; width: auto; max-width: 100%; margin-inline: auto; }
}


/* —— App-grade booster dock + reward polish —— */
.cozy-booster-dock {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 4px 2px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cozy-booster {
  position: relative;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  background:
    radial-gradient(circle at 30% 25%, #ffffffcc, transparent 45%),
    linear-gradient(160deg, #fff, #e9d5ff 55%, #ddd6fe);
  box-shadow:
    0 8px 16px #5b21b633,
    inset 0 2px 0 #fff,
    inset 0 -3px 6px #7c3aed22;
  display: grid;
  place-items: center;
  padding: 0;
}
.cozy-booster-icon { font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 2px #0002); }
.cozy-booster-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  color: #fff;
  font: 800 11px/20px var(--display);
  text-align: center;
  box-shadow: 0 2px 6px #e11d4866, inset 0 1px 0 #fff6;
  font-style: normal;
}
.cozy-booster.is-empty,
.cozy-booster:disabled {
  filter: grayscale(.35);
  opacity: .55;
}
.cozy-booster:disabled .cozy-booster-badge { background: #94a3b8; box-shadow: none; }

.cozy-modal-hero-orb {
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 42px;
  background:
    radial-gradient(circle at 35% 30%, #fff9, transparent 45%),
    linear-gradient(160deg, #fde68a, #f472b6 55%, #a78bfa);
  box-shadow: 0 0 0 6px #fff8, 0 12px 28px #a855f766, 0 0 40px #fde68a88;
  animation: cozy-pulse 2s ease-in-out infinite;
}
.cozy-reward-coin {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 6px #0002);
}
.cozy-btn-glow {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 58px;
}
.cozy-btn-glow strong { font: 800 16px/1.1 var(--display); position: relative; z-index: 1; }
.cozy-btn-glow em {
  font: 700 11px/1 var(--display);
  font-style: normal;
  letter-spacing: .12em;
  opacity: .85;
  position: relative;
  z-index: 1;
}
.cozy-btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, #fff8 48%, transparent 56%);
  transform: translateX(-120%);
  animation: cozy-shine 2.4s ease-in-out infinite;
}
@keyframes cozy-shine {
  0%, 35% { transform: translateX(-120%); }
  55% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

/* 4-stat HUD (Sudoku) */
.has-phone-frame .game-hud:has(.game-stat:nth-child(4)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.has-phone-frame .game-hud:has(.game-stat:nth-child(4)) .game-stat strong { font-size: 16px; }

/* Sudoku native app layout inside phone */
.theme-sudoku-app .game-actions { display: none; }
.theme-sudoku-app .game-status { display: none; }
.theme-sudoku-app .cozy-booster-dock { display: none; }
.theme-sudoku-app .phone-screen {
  background: linear-gradient(180deg, #fff, #f8fafc 40%, #eff6ff);
}
.sudoku-app {
  display: grid;
  gap: 12px;
  width: 100%;
  justify-items: center;
}
.sudoku-app-title {
  margin: 0;
  font: 800 clamp(1.15rem, 4.5vw, 1.35rem)/1.15 var(--display);
  color: #1e3a5f;
  letter-spacing: -.02em;
  text-align: center;
}
.sudoku-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.sudoku-tool {
  position: relative;
  border: 0;
  border-radius: 16px;
  padding: 10px 4px 8px;
  background: #fff;
  box-shadow: 0 4px 12px #0f172a12, inset 0 1px 0 #fff;
  display: grid;
  gap: 4px;
  justify-items: center;
  color: #334155;
  min-height: 58px;
}
.sudoku-tool span { font-size: 20px; line-height: 1; }
.sudoku-tool em { font: 700 11px/1 var(--display); font-style: normal; color: #64748b; }
.sudoku-tool.is-on { outline: 2px solid #3b82f6; background: #eff6ff; }
.sudoku-tool-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font: 800 9px/1 var(--display);
  color: #fff;
  background: #2563eb;
  padding: 3px 5px;
  border-radius: 999px;
  font-style: normal;
}
.theme-sudoku-app .sudoku-board {
  width: 100%;
  background: #fff;
  gap: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 28px #0f172a14, inset 0 0 0 2px #94a3b8;
}
.theme-sudoku-app .sudoku-cell {
  border-radius: 0;
  min-height: 0;
  aspect-ratio: 1;
  font-size: clamp(13px, 3.6vw, 18px);
  background: #fff;
  color: #0f172a;
  box-shadow: inset 0 0 0 0.5px #cbd5e1;
}
.has-phone-frame .theme-sudoku-app .sudoku-board {
  width: min(100%, 100%);
  max-height: 100%;
}
.has-phone-frame .theme-sudoku-app .sudoku-num {
  min-height: clamp(34px, 7vh, 46px);
  font-size: clamp(15px, 3.8vw, 18px);
}
.has-phone-frame .sudoku-tool {
  min-height: clamp(44px, 7vh, 58px);
  padding: 6px 4px;
}
.theme-sudoku-app .sudoku-cell.is-fixed { color: #0f172a; font-weight: 800; background: #f8fafc; }
.theme-sudoku-app .sudoku-cell.is-house { background: #eff6ff; }
.theme-sudoku-app .sudoku-cell.is-sel { background: #dbeafe; outline: 2px solid #2563eb; z-index: 1; }
.theme-sudoku-app .sudoku-cell.is-peer { color: #2563eb; font-weight: 800; }
.theme-sudoku-app .sudoku-cell.is-wrong { color: #dc2626; background: #fef2f2; }
.theme-sudoku-app .sudoku-cell[data-thick-l="1"] { box-shadow: inset 2px 0 0 #475569, inset 0 0 0 0.5px #cbd5e1; }
.theme-sudoku-app .sudoku-cell[data-thick-t="1"] { box-shadow: inset 0 2px 0 #475569, inset 0 0 0 0.5px #cbd5e1; }
.theme-sudoku-app .sudoku-cell[data-thick-l="1"][data-thick-t="1"] {
  box-shadow: inset 2px 0 0 #475569, inset 0 2px 0 #475569, inset 0 0 0 0.5px #cbd5e1;
}
.theme-sudoku-app .sudoku-nums {
  width: 100%;
  gap: 6px;
  padding: 4px 0 2px;
}
.theme-sudoku-app .sudoku-num {
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #fff;
  font: 800 18px/1 var(--display);
  box-shadow: 0 6px 14px #1d4ed844, inset 0 1px 0 #ffffff55;
}
.theme-sudoku-app .sudoku-num.is-active {
  box-shadow: 0 0 0 3px #93c5fd, 0 8px 18px #1d4ed866;
  transform: translateY(-2px);
}

/* Phone chrome tighten for all themes */
.has-phone-frame .game-chrome { gap: 8px; }
.has-phone-frame .game-stat {
  background: #fff;
  border: 0;
  box-shadow: 0 4px 12px #0f172a10;
}
.has-phone-frame .cozy-wallet-chip { margin-bottom: 2px; }


/* —— Phase-1 visual polish: carnival / calm-beads / voxel (append-only) —— */
.theme-carnival-cannon .game-board-shell,
.carnival-board {
  position: relative;
}
.carnival-board .game-canvas.carnival-canvas {
  box-shadow: 0 14px 32px #15803d44, inset 0 0 0 2px #ffffff66;
}

.calm-beads-board .calm-beads-canvas {
  box-shadow: 0 12px 28px #1d4ed844, inset 0 0 0 1px #ffffff55;
}

.theme-voxel-feast .voxel-cube.is-chunky {
  width: 20px;
  height: 18px;
  border-radius: 4px;
  box-shadow:
    inset 2px 2px 0 #ffffff77,
    inset -2px -2px 0 #00000055,
    0 3px 0 #00000044,
    0 5px 10px #00000055;
}
.theme-voxel-feast .voxel-burger-layer {
  gap: 4px;
  margin-block: 1px;
}
.theme-voxel-feast .voxel-beams.is-strong {
  height: 85%;
  z-index: 2;
}
.theme-voxel-feast .voxel-beam.is-laser {
  width: 10px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff9c4 0%, #fde047 28%, #facc15 62%, #f59e0b00 100%);
  box-shadow:
    0 0 8px #fef08a,
    0 0 18px #facc15,
    0 0 28px #eab308cc,
    inset 0 0 4px #fff8;
  animation: voxel-laser-pulse 0.28s ease-in-out infinite alternate;
}
@keyframes voxel-laser-pulse {
  from { opacity: 0.7; filter: brightness(1); transform: translateX(-50%) scaleX(0.92); }
  to { opacity: 1; filter: brightness(1.35); transform: translateX(-50%) scaleX(1.08); }
}

.theme-voxel-feast .voxel-turret.is-cannon,
.theme-voxel-feast .voxel-bot.is-cannon {
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  overflow: visible;
  box-shadow:
    inset 0 3px 0 #ffffff88,
    0 0 0 2px #fef08a66,
    0 0 16px color-mix(in srgb, var(--bot, #facc15) 55%, transparent),
    0 8px 16px #00000055;
}
.theme-voxel-feast .voxel-cannon-glow {
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 30%, #fef08a66, transparent 65%);
  pointer-events: none;
  animation: cozy-pulse 1.1s ease-in-out infinite;
}
.theme-voxel-feast .voxel-cannon-icon {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 0 4px #fde68a);
}
.theme-voxel-feast .voxel-cannon-val {
  position: relative;
  z-index: 1;
  font: 800 15px/1 var(--display);
  color: #fff;
  text-shadow: 0 1px 2px #0009, 0 0 8px #facc1588;
}
.theme-voxel-feast .voxel-turret.is-cannon .voxel-cannon-val {
  font-size: 14px;
  color: #1e1b4b;
  text-shadow: 0 1px 0 #fff8;
}
.theme-voxel-feast .voxel-turret.is-firing.is-cannon {
  animation: voxel-cannon-throb 0.9s ease-in-out infinite;
}
@keyframes voxel-cannon-throb {
  0%, 100% { transform: translateY(0); box-shadow: inset 0 3px 0 #ffffff88, 0 0 0 2px #fef08a88, 0 0 14px #facc15aa, 0 8px 16px #0006; }
  50% { transform: translateY(-2px); box-shadow: inset 0 3px 0 #ffffffaa, 0 0 0 3px #fde68a, 0 0 22px #facc15ee, 0 10px 18px #0007; }
}
.theme-voxel-feast .voxel-vibe {
  letter-spacing: 0.02em;
}

.has-phone-frame .theme-voxel-feast .voxel-cube.is-chunky {
  width: 16px;
  height: 14px;
}
.has-phone-frame .theme-voxel-feast .voxel-beam.is-laser {
  width: 8px;
}
.has-phone-frame .theme-voxel-feast .voxel-cannon-icon {
  font-size: 11px;
}
.has-phone-frame .theme-voxel-feast .voxel-cannon-val {
  font-size: 13px;
}

/* —— Bus / Sand app-grade board chrome —— */
.bus-banner,
.sand-banner {
  margin: 0 0 10px;
  text-align: center;
  font: 800 clamp(0.95rem, 3.6vw, 1.15rem)/1.1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bus-banner {
  color: #92400e;
  text-shadow: 0 1px 0 #fff8, 0 2px 8px #fbbf2444;
}
.sand-banner {
  color: #fde68a;
  text-shadow: 0 0 16px #a78bfa88, 0 2px 0 #2e1065;
}
.bus-queue-chip {
  display: grid;
  place-items: center;
  width: 36px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fef3c7);
  border: 1.5px solid #fbbf2488;
  box-shadow: 0 3px 8px #78350f22;
}
.bus-queue-chip.is-next {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #fbbf2433, 0 4px 10px #78350f33;
}
.bus-stick {
  position: relative;
  width: 18px;
  height: 32px;
  display: block;
}
.bus-stick-head,
.bus-stick-body,
.bus-stick-legs {
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.bus-stick-head {
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e293b;
}
.bus-stick-body {
  top: 11px;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--stick, #ef4444);
  box-shadow: inset 0 1px 0 #fff6;
}
.bus-stick-legs {
  bottom: 0;
  width: 12px;
  height: 8px;
  background:
    linear-gradient(#1e293b, #1e293b) left / 3px 100% no-repeat,
    linear-gradient(#1e293b, #1e293b) right / 3px 100% no-repeat;
}
.bus-tile.is-bus {
  background: linear-gradient(165deg, color-mix(in srgb, var(--bus) 70%, #fff), var(--bus));
  position: relative;
  padding: 0;
  overflow: hidden;
}
.bus-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 48px;
  position: relative;
}
.bus-windshield {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e0f2fe, #7dd3fc88);
  box-shadow: inset 0 1px 0 #fff8;
}
.bus-arrow {
  position: relative;
  z-index: 1;
  font: 800 18px/1 var(--display);
  color: #fff;
  text-shadow: 0 2px 0 #0005;
  margin-top: 8px;
}
.bus-wheels {
  position: absolute;
  bottom: 4px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
}
.bus-wheels i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f172a;
  box-shadow: inset 0 0 0 2px #94a3b8;
}
.bus-tile.is-empty .bus-pad {
  font: 800 12px/1 var(--display);
  color: #a1620788;
}
.bus-shore {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf888, #7dd3fc, #38bdf888);
  box-shadow: 0 4px 0 #0ea5e944;
}
.theme-bus-parade .game-status { color: #92400e; }

.sand-spout {
  display: flex;
  justify-content: center;
  margin: -2px 0 0;
}
.sand-spout-rim {
  width: 36px;
  height: 10px;
  border-radius: 0 0 10px 10px;
  border: 2px solid #c4b5fd;
  border-top: 0;
  background: linear-gradient(180deg, #312e81, #1e1b4b);
  box-shadow: 0 4px 10px #0006;
}
.sand-box {
  border-color: color-mix(in srgb, var(--box, #fff) 55%, #ffffff44);
}
.sand-box-label {
  position: relative;
  z-index: 2;
  font: 800 12px/1 var(--display);
  color: #fff;
  text-shadow: 0 1px 2px #0009;
}
.sand-box-rim {
  position: absolute;
  inset: 3px;
  border-radius: 10px;
  border: 1.5px solid color-mix(in srgb, var(--box, #fff) 70%, transparent);
  pointer-events: none;
  z-index: 1;
}
.sand-box.is-full {
  box-shadow: 0 0 0 2px #fde68a, 0 0 16px color-mix(in srgb, var(--box) 50%, transparent);
}
.theme-sand-boxes .game-status { color: #e9d5ff; }

@media (max-width: 680px) {
  .bus-queue-chip { width: 32px; height: 40px; }
  .bus-arrow { font-size: 16px; }
  .sand-banner, .bus-banner { font-size: 0.9rem; }
}
