@font-face {
  font-family: GameFace;
  src: url("./assets/fonts/russo-one.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #12151c;
  --bg-2: #1a2427;
  --ink: #151922;
  --paper: #fff4cb;
  --cream: #ffe39c;
  --gold: #f5bb45;
  --gold-dark: #925a20;
  --teal: #3fd4c5;
  --teal-dark: #157c78;
  --red: #e5575e;
  --red-dark: #84222e;
  --blue: #3e7bd2;
  --blue-dark: #1b407e;
  --panel: #24313c;
  --board-w: 336px;
  --board-h: 504px;
  --tile: 56px;
  --app-height: 100svh;
  --content-height: calc(var(--app-height, 100svh) - var(--vk-banner-bottom));
  --vk-safe-top: 0px;
  --vk-safe-right: 0px;
  --vk-safe-left: 0px;
  --vk-banner-bottom: 6px;
  --vk-native-banner-bottom: 86px;
}

html.vk-launch,
html.vk-reserve-banner,
html.vk-banner-visible,
body.banner-visible {
  --vk-banner-bottom: var(--vk-native-banner-bottom);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#app {
  width: 100%;
  max-width: 100vw;
  height: var(--app-height, 100svh);
  margin: 0;
}

html,
body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body {
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 228, 156, 0.08), transparent 30%),
    linear-gradient(145deg, #1f2d2f 0%, #12151c 52%, #251a23 100%);
  color: var(--paper);
  font-family: Arial Rounded MT Bold, Arial, system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

svg {
  display: block;
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon-defs symbol,
button svg,
.coin-pill svg,
.win-mark {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  height: var(--app-height, 100svh);
  min-width: 0;
  min-height: var(--app-height, 100svh);
  overflow: hidden;
  visibility: hidden;
}

.app-ready .app-shell {
  visibility: visible;
}

.screen {
  width: 100%;
  height: var(--app-height, 100svh);
  padding:
    max(10px, env(safe-area-inset-top), var(--vk-safe-top))
    max(10px, env(safe-area-inset-right), var(--vk-safe-right))
    max(4px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom)))
    max(10px, env(safe-area-inset-left), var(--vk-safe-left));
  overflow: hidden;
}

.menu-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
}

.gallery-screen {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.game-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 6px;
  padding-right: max(1px, env(safe-area-inset-right), var(--vk-safe-right));
  padding-left: max(1px, env(safe-area-inset-left), var(--vk-safe-left));
}

.menu-head,
.compact-head,
.topbar {
  position: relative;
  z-index: 3;
  display: grid;
  align-items: center;
  gap: 8px;
}

.menu-head {
  grid-template-columns: 1fr auto;
  min-height: 72px;
}

.compact-head,
.topbar {
  grid-template-columns: 50px 1fr auto;
  min-height: 52px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #8ff1e5;
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

h1,
h2,
.game-title-block strong,
.primary-action,
.secondary-action,
.hint-action,
.coin-pill,
.score-strip strong,
.progress-panel strong,
.ad-count {
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-weight: 400;
}

h1,
h2 {
  margin: 0;
  color: var(--paper);
  line-height: 0.95;
  text-shadow:
    0 3px 0 var(--ink),
    0 7px 14px rgba(0, 0, 0, 0.34);
  -webkit-text-stroke: 1px var(--ink);
}

h1 {
  font-size: 42px;
}

h2 {
  font-size: 27px;
  text-align: center;
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 92px;
  min-height: 44px;
  padding: 7px 11px;
  border: 3px solid var(--cream);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 40%),
    linear-gradient(180deg, #ffc85c, var(--gold));
  color: var(--ink);
  box-shadow: 0 5px 0 var(--gold-dark);
}

.coin-pill.small {
  min-width: 80px;
  min-height: 42px;
  font-size: 14px;
}

.coin-pill svg {
  width: 22px;
  height: 22px;
}

.icon-button,
.round-action,
.close-button {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border: 3px solid var(--cream);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 38%),
    linear-gradient(180deg, #f7c75d, var(--gold));
  box-shadow:
    0 5px 0 var(--gold-dark),
    0 12px 20px rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

.icon-button svg,
.round-action svg,
.close-button svg {
  width: 25px;
  height: 25px;
}

.icon-button.accent {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, #61ecd8, var(--teal));
  box-shadow:
    0 5px 0 var(--teal-dark),
    0 12px 20px rgba(0, 0, 0, 0.28);
}

.featured-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  border: 5px solid var(--cream);
  border-radius: 8px;
  background: #10141a;
  box-shadow:
    0 8px 0 #7a4a23,
    0 22px 40px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.featured-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.featured-info {
  display: grid;
  gap: 6px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(18, 21, 28, 0.32), rgba(18, 21, 28, 0.96)),
    rgba(18, 21, 28, 0.94);
}

.featured-info h2 {
  font-size: 24px;
  text-align: left;
}

.featured-info p {
  margin: 0;
  color: rgba(255, 244, 203, 0.82);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mode-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mode-chip {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  min-height: 58px;
  padding: 7px 8px;
  border: 3px solid rgba(255, 227, 156, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 44%),
    #24313c;
  color: rgba(255, 244, 203, 0.82);
  box-shadow: 0 4px 0 rgba(9, 16, 20, 0.72);
  text-align: left;
}

.mode-chip svg {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  color: #9ff1e7;
}

.mode-chip span {
  overflow: hidden;
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 0 var(--ink);
}

.mode-chip small {
  overflow: hidden;
  color: rgba(159, 241, 231, 0.88);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mode-chip.is-active {
  border-color: var(--cream);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 40%),
    linear-gradient(180deg, #e95d62, var(--red));
  color: var(--paper);
  box-shadow: 0 5px 0 var(--red-dark);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 2px solid rgba(255, 227, 156, 0.62);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: #9ff1e7;
  font-size: 11px;
  font-weight: 900;
}

.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-action,
.secondary-action,
.hint-action {
  min-height: 56px;
  border: 4px solid var(--cream);
  border-radius: 8px;
  color: var(--paper);
  line-height: 1;
  text-shadow: 0 2px 0 var(--ink);
}

.primary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 38%),
    linear-gradient(180deg, #ffd25f, #f18b3c);
  box-shadow: 0 6px 0 #98501b;
  font-size: 24px;
}

.secondary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(180deg, #4d83d6, var(--blue));
  box-shadow: 0 6px 0 var(--blue-dark);
  font-size: 19px;
}

.progress-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.progress-panel > div,
.score-strip > div {
  min-width: 0;
  padding: 8px 5px 7px;
  border: 3px solid rgba(255, 227, 156, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 44%),
    #233542;
  box-shadow: 0 4px 0 rgba(9, 16, 20, 0.66);
  text-align: center;
}

.progress-panel span,
.score-strip span {
  display: block;
  overflow: hidden;
  color: #9fece1;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-panel strong,
.score-strip strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
}

.gallery-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 3px solid rgba(255, 227, 156, 0.72);
  border-radius: 999px;
  background: rgba(9, 14, 20, 0.72);
}

.gallery-tabs button {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 244, 203, 0.78);
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 13px;
}

.gallery-tabs button.is-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%),
    linear-gradient(180deg, #e95d62, var(--red));
  color: #fff8dc;
  box-shadow: 0 4px 0 var(--red-dark);
}

.gallery-counter {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 244, 203, 0.88);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-list {
  display: flex;
  gap: 12px;
  min-height: 0;
  margin: 0 calc(max(10px, env(safe-area-inset-right), var(--vk-safe-right)) * -1) 0 calc(max(10px, env(safe-area-inset-left), var(--vk-safe-left)) * -1);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px max(10px, env(safe-area-inset-right), var(--vk-safe-right)) 16px max(10px, env(safe-area-inset-left), var(--vk-safe-left));
  scroll-padding: max(10px, env(safe-area-inset-left), var(--vk-safe-left));
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.gallery-list::-webkit-scrollbar {
  display: none;
}

.art-card {
  position: relative;
  display: grid;
  flex: 0 0 min(86vw, 370px);
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: min(86vw, 370px);
  height: 100%;
  min-height: 0;
  border: 4px solid rgba(255, 227, 156, 0.78);
  border-radius: 8px;
  background: #1f2b35;
  box-shadow:
    0 6px 0 rgba(8, 12, 18, 0.7),
    0 18px 26px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  scroll-snap-align: center;
  text-align: left;
}

.art-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 227, 156, 0.12), transparent 34%),
    #111820;
  filter: saturate(1.05) contrast(1.02);
}

.art-card.is-centered {
  border-color: var(--cream);
}

.art-card.is-selected {
  box-shadow:
    0 6px 0 var(--teal-dark),
    0 18px 28px rgba(0, 0, 0, 0.28);
}

.art-card.is-locked img {
  filter: grayscale(0.82) brightness(0.58);
}

.art-card-body {
  display: grid;
  gap: 5px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(18, 21, 28, 0.34), rgba(18, 21, 28, 0.96)),
    #1f2b35;
}

.art-card h3 {
  margin: 0;
  color: var(--paper);
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.08;
  text-shadow: 0 2px 0 var(--ink);
}

.art-card p {
  margin: 0;
  overflow: hidden;
  color: rgba(255, 244, 203, 0.76);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: #ffdc69;
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 12px;
}

.status-mark {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(63, 212, 197, 0.18);
  color: #9ff1e7;
  font-size: 11px;
  font-weight: 900;
}

.lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--cream);
  border-radius: 999px;
  background: var(--red);
  color: var(--paper);
  box-shadow: 0 4px 0 var(--red-dark);
}

.lock-badge svg {
  width: 19px;
  height: 19px;
}

.game-title-block {
  min-width: 0;
  text-align: center;
}

.game-title-block strong,
.game-title-block span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-title-block strong {
  color: var(--paper);
  font-size: 18px;
  text-shadow: 0 2px 0 var(--ink);
}

.game-title-block span {
  margin-top: 2px;
  color: #9ff1e7;
  font-size: 12px;
  font-weight: 900;
}

.score-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.play-area {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
}

.game-screen .topbar {
  min-height: 48px;
}

.game-screen .score-strip > div {
  padding: 6px 5px 5px;
}

.easel {
  position: absolute;
  inset: auto 0 10px;
  height: 58px;
  pointer-events: none;
}

.easel::before {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 2px;
  left: 18px;
  height: 26px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(90deg, #9b5d2a, #df9d53 36%, #8a4e25 100%);
  box-shadow:
    inset 0 -5px rgba(69, 34, 14, 0.34),
    0 8px 14px rgba(0, 0, 0, 0.22);
}

.easel span {
  position: absolute;
  bottom: -18px;
  width: 24px;
  height: 122px;
  border-radius: 12px 12px 0 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 38%),
    linear-gradient(180deg, #db9650, #74401f);
  box-shadow: inset -5px 0 rgba(70, 36, 16, 0.26);
}

.easel span:first-child {
  left: 16%;
  transform: rotate(4deg);
}

.easel span:last-child {
  right: 16%;
  transform: rotate(-4deg);
}

.puzzle-board {
  position: relative;
  z-index: 2;
  width: min(var(--board-w), calc(100vw - 6px));
  height: var(--board-h);
  border: 5px solid var(--cream);
  border-radius: 8px;
  background-color: #151922;
  background-repeat: no-repeat;
  box-shadow:
    0 8px 0 #7c4b23,
    0 22px 38px rgba(0, 0, 0, 0.46);
  overflow: hidden;
  touch-action: none;
}

.puzzle-board::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.tile {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: var(--tile-w);
  height: var(--tile-h);
  background-repeat: no-repeat;
  transition: filter 120ms ease;
  will-change: transform;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 1px solid rgba(255, 244, 203, 0.32);
  border-bottom: 1px solid rgba(255, 244, 203, 0.32);
  box-shadow: inset 0 0 0 1px rgba(20, 32, 42, 0.22);
  pointer-events: none;
}

.tile.active-strip {
  z-index: 5;
  filter: saturate(1.1) contrast(1.04);
}

.tile.hint-strip {
  z-index: 6;
  filter: brightness(1.42) saturate(1.25);
}

.tile.hint-strip::after {
  border: 2px solid #fff26d;
  box-shadow:
    inset 0 0 0 2px rgba(229, 87, 94, 0.62),
    0 0 18px rgba(255, 242, 109, 0.72);
}

.tile.strip-hidden {
  opacity: 0;
}

.puzzle-board.is-dragging .tile,
.puzzle-board.is-locked .tile {
  transition: none;
}

.puzzle-board.is-settling {
  pointer-events: none;
}

.drag-strip {
  position: absolute;
  z-index: 7;
  overflow: visible;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.drag-strip.is-snapping {
  transition: none;
}

.strip-tile {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tile-w);
  height: var(--tile-h);
  background-repeat: no-repeat;
  will-change: transform;
}

.strip-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 1px solid rgba(255, 244, 203, 0.28);
  border-bottom: 1px solid rgba(255, 244, 203, 0.28);
  box-shadow: inset 0 0 0 1px rgba(20, 32, 42, 0.18);
  pointer-events: none;
}

.move-guide {
  position: absolute;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 4px solid var(--cream);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 40%),
    linear-gradient(180deg, #ffdf66, #f28b3d);
  color: var(--ink);
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  text-shadow: none;
  box-shadow:
    0 5px 0 #9b4b1b,
    0 0 0 5px rgba(229, 87, 94, 0.42),
    0 18px 24px rgba(0, 0, 0, 0.36);
  animation: guide-pop 780ms ease-in-out infinite alternate;
}

.launch-error {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  color: var(--paper);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 0 var(--ink);
}

.game-dock {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
}

.round-action {
  justify-self: center;
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
}

.hint-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 38%),
    linear-gradient(180deg, #e95d62, var(--red));
  box-shadow: 0 6px 0 var(--red-dark);
  font-size: 16px;
}

.hint-action svg {
  width: 22px;
  height: 22px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top), var(--vk-safe-top))
    max(16px, env(safe-area-inset-right), var(--vk-safe-right))
    max(18px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom)))
    max(16px, env(safe-area-inset-left), var(--vk-safe-left));
  background: rgba(5, 9, 12, 0.78);
}

.preview-card {
  display: grid;
  gap: 10px;
  width: min(92vw, 430px);
  max-height: 86dvh;
  margin: 0;
}

.preview-card img {
  width: 100%;
  max-height: 75dvh;
  border: 5px solid var(--cream);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.56);
  object-fit: contain;
}

.preview-card figcaption {
  color: rgba(255, 244, 203, 0.9);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.close-button {
  position: fixed;
  top: max(12px, env(safe-area-inset-top), var(--vk-safe-top));
  right: max(12px, env(safe-area-inset-right), var(--vk-safe-right));
  z-index: 32;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 38%),
    linear-gradient(180deg, #ff7378, var(--red));
  box-shadow:
    0 5px 0 var(--red-dark),
    0 12px 20px rgba(0, 0, 0, 0.28);
}

.win-panel,
.ad-panel,
.confirm-panel {
  display: grid;
  justify-items: center;
  width: min(calc(100vw - 34px), 340px);
  padding: 22px 18px 18px;
  border: 5px solid var(--cream);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(180deg, #2e9f99, #1e596b);
  box-shadow:
    0 8px 0 #123743,
    0 24px 56px rgba(0, 0, 0, 0.52);
}

.ad-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(180deg, #40508f, #233057);
}

.confirm-panel {
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(180deg, #2e9f99, #1d5c68);
  text-align: center;
}

.win-mark {
  width: 66px;
  height: 66px;
  padding: 13px;
  border: 5px solid var(--cream);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(180deg, #f8cb5d, var(--gold));
  color: var(--ink);
  box-shadow: 0 6px 0 var(--gold-dark);
}

.win-panel h2,
.ad-panel h2,
.confirm-panel h2 {
  margin: 12px 0 8px;
  font-size: 33px;
}

.confirm-panel h2 {
  margin: 0;
}

.confirm-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--paper);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.18;
  text-shadow: 0 2px 0 var(--ink);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.confirm-actions .primary-action,
.confirm-actions .secondary-action {
  min-height: 54px;
}

.win-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  color: #d7fff8;
  font-size: 17px;
  font-weight: 900;
}

.reward-box {
  display: grid;
  justify-items: center;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  border: 3px solid rgba(255, 227, 156, 0.78);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.reward-box span {
  color: #9ff1e7;
  font-size: 12px;
  font-weight: 900;
}

.reward-box strong {
  color: #ffdc69;
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 2px 0 var(--ink);
}

.win-panel .primary-action,
.win-panel .secondary-action {
  width: 100%;
  margin-top: 8px;
}

.ad-panel p {
  margin: 0 0 14px;
  color: rgba(255, 244, 203, 0.86);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.ad-count {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 5px solid var(--cream);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(180deg, #ffca5b, #f28c3f);
  color: var(--paper);
  font-size: 32px;
  text-shadow: 0 2px 0 var(--ink);
  box-shadow: 0 6px 0 #9b4b1b;
}

@keyframes guide-pop {
  from {
    transform: var(--guide-transform) scale(0.94);
  }

  to {
    transform: var(--guide-transform) scale(1.08);
  }
}

.toast {
  position: fixed;
  right: 16px;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom)));
  left: 16px;
  z-index: 50;
  min-height: 48px;
  padding: 13px 16px;
  border: 3px solid var(--cream);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 40%),
    #22313d;
  color: var(--paper);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.44);
}

/* Art direction pass: lighter hierarchy, cleaner controls, painting-first game UI. */
:root {
  --bg: #0d1118;
  --bg-2: #16242b;
  --ink: #0b0f15;
  --paper: #fff2d3;
  --cream: #dfc078;
  --gold: #f4b640;
  --gold-dark: #9a6426;
  --teal: #48d8c7;
  --teal-dark: #127f7a;
  --red: #ed5a70;
  --red-dark: #8e2639;
  --blue: #5d8df0;
  --blue-dark: #274b94;
  --panel: #17212b;
  --panel-soft: rgba(23, 32, 42, 0.82);
  --line-soft: rgba(223, 192, 120, 0.38);
  --line-hot: rgba(255, 232, 167, 0.72);
  --shadow-soft: 0 18px 38px rgba(0, 0, 0, 0.32);
  --shadow-press: 0 4px 0 rgba(0, 0, 0, 0.38), 0 14px 26px rgba(0, 0, 0, 0.26);
}

body {
  position: relative;
  background:
    linear-gradient(180deg, rgba(72, 216, 199, 0.08), transparent 34%),
    linear-gradient(135deg, #101821 0%, #11131a 48%, #201622 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 242, 211, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 242, 211, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.45;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.screen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    linear-gradient(180deg, rgba(10, 15, 21, 0), rgba(10, 15, 21, 0.24));
}

.menu-screen {
  gap: 10px;
}

.menu-head {
  min-height: 68px;
}

.eyebrow {
  color: var(--teal);
  font-size: 10px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

h1,
h2 {
  -webkit-text-stroke: 0;
  color: var(--paper);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.78),
    0 12px 24px rgba(0, 0, 0, 0.42);
}

h1 {
  font-size: 44px;
}

h2 {
  font-size: 28px;
}

.coin-pill {
  min-height: 46px;
  border: 1px solid rgba(255, 232, 167, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, #ffd565, #d99334);
  box-shadow: var(--shadow-press);
}

.coin-pill.small {
  min-height: 40px;
}

.icon-button,
.round-action,
.close-button {
  border: 1px solid var(--line-hot);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(22, 31, 40, 0.9);
  box-shadow: var(--shadow-press);
  color: var(--paper);
}

.icon-button.accent {
  border-color: rgba(97, 236, 216, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #53dfcf, #1b9d98);
  color: #071114;
  box-shadow: 0 4px 0 #0d5f61, 0 14px 26px rgba(0, 0, 0, 0.26);
}

button:active {
  transform: translateY(2px);
}

.featured-card,
.art-card {
  border: 1px solid var(--line-hot);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(10, 14, 20, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    var(--shadow-soft);
}

.featured-card img {
  filter: saturate(1.04) contrast(1.02);
}

.featured-info,
.art-card-body {
  background:
    linear-gradient(180deg, rgba(11, 15, 21, 0.28), rgba(11, 15, 21, 0.96)),
    rgba(13, 18, 25, 0.94);
}

.featured-info {
  gap: 7px;
  padding: 12px 13px 13px;
}

.featured-info h2,
.art-card h3,
.game-title-block strong,
.progress-panel strong,
.score-strip strong {
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
}

.featured-info h2 {
  font-size: 23px;
  line-height: 1.05;
}

.featured-info p,
.art-card p {
  color: rgba(255, 242, 211, 0.72);
}

.tag,
.price,
.status-mark {
  border: 1px solid rgba(255, 232, 167, 0.28);
  background: rgba(8, 12, 18, 0.46);
  color: #b8fff4;
}

.mode-panel {
  gap: 7px;
}

.mode-chip {
  min-height: 56px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
    rgba(21, 31, 41, 0.88);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

.mode-chip span {
  font-size: 16px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.mode-chip.is-active {
  border-color: rgba(255, 224, 137, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.025)),
    linear-gradient(180deg, #ee6379, #ba314f);
  box-shadow: 0 4px 0 rgba(114, 24, 44, 0.88), 0 14px 24px rgba(0, 0, 0, 0.28);
}

.primary-action,
.secondary-action,
.hint-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border: 1px solid rgba(255, 232, 167, 0.84);
  border-radius: 8px;
  letter-spacing: 0;
  box-shadow: var(--shadow-press);
}

.primary-action svg,
.secondary-action svg,
.hint-action svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.primary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, #ffd76f, #e68e35);
  color: #15100a;
  font-size: 23px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
}

.secondary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, #669af7, #3162bd);
  font-size: 19px;
}

.hint-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.035)),
    linear-gradient(180deg, #f36a7f, #c22e4e);
  box-shadow: 0 4px 0 #852039, 0 14px 26px rgba(0, 0, 0, 0.26);
  font-size: 15px;
}

.progress-panel > div,
.score-strip > div,
.reward-box {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.015)),
    rgba(20, 31, 42, 0.84);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.035) inset,
    0 8px 18px rgba(0, 0, 0, 0.2);
}

.progress-panel span,
.score-strip span,
.game-title-block span {
  color: rgba(141, 241, 229, 0.88);
}

.gallery-tabs {
  border: 1px solid var(--line-soft);
  background: rgba(11, 16, 23, 0.68);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.gallery-tabs button.is-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #4dd5c6, #187f87);
  color: #071114;
  box-shadow: 0 3px 0 #0d5960;
}

.art-card.is-selected,
.art-card.is-centered {
  border-color: rgba(93, 141, 240, 0.9);
}

.lock-badge {
  border: 1px solid rgba(255, 232, 167, 0.76);
  background: linear-gradient(180deg, #f56d80, #b82d4a);
  box-shadow: 0 4px 0 rgba(112, 21, 41, 0.8);
}

.topbar {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
}

.game-title-block strong {
  font-size: 17px;
}

.score-strip {
  gap: 5px;
}

.easel {
  display: none;
}

.puzzle-board {
  box-sizing: content-box;
  border: 2px solid rgba(255, 229, 160, 0.92);
  border-radius: 8px;
  background-color: #0a0f15;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 0 rgba(105, 71, 34, 0.72),
    0 22px 38px rgba(0, 0, 0, 0.46);
}

.puzzle-board::after {
  border-color: rgba(255, 255, 255, 0.16);
}

.tile::after,
.strip-tile::after {
  border-right-color: rgba(255, 242, 211, 0.22);
  border-bottom-color: rgba(255, 242, 211, 0.22);
  box-shadow: inset 0 0 0 1px rgba(7, 11, 15, 0.18);
}

.move-guide {
  border: 1px solid rgba(255, 232, 167, 0.92);
  background:
    linear-gradient(180deg, #ffe36d, #f39b39);
  box-shadow:
    0 4px 0 rgba(135, 75, 20, 0.9),
    0 0 0 4px rgba(237, 90, 112, 0.34),
    0 18px 24px rgba(0, 0, 0, 0.36);
}

.overlay {
  background:
    linear-gradient(180deg, rgba(10, 15, 21, 0.84), rgba(10, 15, 21, 0.92));
}

.preview-card img {
  border: 1px solid var(--line-hot);
  border-radius: 8px;
}

.win-panel,
.ad-panel,
.confirm-panel {
  border: 1px solid var(--line-hot);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(19, 29, 39, 0.96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.54);
}

.win-mark,
.ad-count {
  border: 1px solid rgba(255, 232, 167, 0.84);
  box-shadow: var(--shadow-press);
}

.toast {
  border: 1px solid rgba(255, 232, 167, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(22, 31, 40, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
}

/* Generated asset pass: bitmap game pieces instead of app-like rectangles/icons. */
body {
  background:
    linear-gradient(180deg, rgba(5, 8, 12, 0.08), rgba(5, 8, 12, 0.14)),
    url("./assets/ui/museum-bg.webp") center / cover no-repeat,
    #0b1017;
}

body::before {
  display: none;
}

.coin-pill,
.primary-action,
.secondary-action,
.hint-action,
.icon-button,
.round-action,
.mode-chip,
.progress-panel > div,
.score-strip > div,
.win-panel,
.ad-panel,
.confirm-panel,
.toast {
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  box-shadow: none;
}

.coin-pill {
  min-width: 112px;
  min-height: 52px;
  padding: 8px 15px;
  background-image: url("./assets/ui/coin-plate.png");
  color: #130d08;
  flex-direction: column;
  gap: 0;
}

.coin-pill.small {
  min-width: 100px;
  min-height: 46px;
  padding: 7px 13px;
}

.coin-label {
  display: block;
  color: rgba(42, 22, 7, 0.82);
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 9px;
  line-height: 1;
}

.primary-action {
  background-image: url("./assets/ui/button-gold.png");
  color: #15100a;
}

.secondary-action {
  background-image: url("./assets/ui/button-blue.png");
}

.hint-action {
  background-image: url("./assets/ui/button-rose.png");
}

.icon-button,
.round-action {
  width: auto;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 0;
  background-image: url("./assets/ui/button-dark.png");
  color: var(--paper);
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: 9px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
}

.icon-button.accent {
  background-image: url("./assets/ui/button-teal.png");
  color: #071114;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.compact-head,
.topbar {
  grid-template-columns: 72px minmax(0, 1fr) 72px;
}

.game-screen .topbar {
  min-height: 46px;
}

.mode-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 58px;
  padding: 7px 8px;
  background-image: url("./assets/ui/button-dark.png");
  text-align: center;
}

.mode-chip.is-active {
  background-image: url("./assets/ui/button-rose.png");
}

.mode-chip span {
  font-size: 18px;
}

.mode-chip small {
  margin-top: 4px;
  font-size: 9px;
}

.menu-actions {
  gap: 12px;
}

.primary-action,
.secondary-action,
.hint-action {
  min-height: 60px;
}

.progress-panel > div,
.score-strip > div {
  background-image: url("./assets/ui/hud-cell.png");
}

.score-strip > div {
  padding: 5px 5px 4px;
}

.featured-card,
.art-card {
  border: 0;
  background:
    linear-gradient(180deg, rgba(6, 10, 14, 0.16), rgba(6, 10, 14, 0.62)),
    rgba(6, 10, 14, 0.28);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.featured-card img {
  border-radius: 7px 7px 0 0;
}

.featured-info,
.art-card-body {
  background: linear-gradient(180deg, rgba(7, 10, 15, 0.56), rgba(7, 10, 15, 0.94));
}

.tag,
.price,
.status-mark {
  border: 0;
  background: rgba(5, 9, 13, 0.62);
}

.art-card {
  background-image: url("./assets/ui/gallery-slab.png");
  background-size: 100% 100%;
  padding: 10px;
}

.art-card img {
  border-radius: 5px;
}

.puzzle-board {
  box-sizing: border-box;
  border: 0;
  border-radius: 5px;
  width: min(var(--board-w), calc(100vw - 6px));
  height: var(--board-h);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 240, 190, 0.12);
}

.puzzle-board::after {
  border: 0;
}

.game-dock {
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  gap: 6px;
  min-height: 54px;
}

.round-action,
.hint-action {
  min-height: 54px;
}

.hint-action {
  font-size: 17px;
}

.win-panel,
.ad-panel,
.confirm-panel {
  background-image: url("./assets/ui/modal-panel.png");
}

.toast {
  background-image: url("./assets/ui/button-dark.png");
}

.sprite-number {
  --num-h: 28px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  color: transparent;
  font-size: var(--num-h) !important;
  line-height: 1;
  overflow: visible !important;
  text-overflow: clip !important;
  vertical-align: -0.15em;
  white-space: nowrap;
}

.num-glyph {
  display: inline-block !important;
  flex: 0 0 auto;
  font-size: inherit !important;
  width: 0.8181818em;
  height: 1em;
  background-image: url("./assets/ui/digits-atlas.png");
  background-repeat: no-repeat;
  background-size: auto 1em;
}

.num-space {
  display: inline-block !important;
  font-size: inherit !important;
  width: 0.36em;
  height: 1em;
}

.num-text {
  display: inline-block;
  color: var(--paper);
  font-family: GameFace, Arial Black, system-ui, sans-serif;
  font-size: calc(var(--num-h) * 0.72);
  line-height: var(--num-h);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
}

.coin-pill .sprite-number {
  --num-h: 27px;
}

.coin-pill.small .sprite-number {
  --num-h: 24px;
}

.tag-number,
.counter-number {
  --num-h: 16px;
}

.button-number {
  --num-h: 23px;
}

.mode-number {
  --num-h: 28px;
}

.title-number {
  --num-h: 18px;
}

.inline-number {
  --num-h: 22px;
}

.score-strip strong.sprite-number,
.progress-panel strong.sprite-number {
  --num-h: 27px;
  display: inline-flex;
  overflow: visible;
  margin-top: 1px;
  color: transparent;
  white-space: nowrap;
}

.coin-pill strong.sprite-number,
.reward-box strong.sprite-number,
.ad-count.sprite-number {
  display: inline-flex;
  overflow: visible;
  color: transparent;
}

.ad-count.sprite-number {
  --num-h: 54px;
  gap: 1px;
}

.win-panel #win-reward.sprite-number,
.reward-box strong.sprite-number {
  --num-h: 38px;
}

@media (max-width: 350px) {
  .compact-head,
  .topbar {
    grid-template-columns: 46px 1fr auto;
  }

  .icon-button,
  .close-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .gallery-list {
    gap: 7px;
  }

  .mode-chip {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .mode-chip svg {
    width: 19px;
    height: 19px;
  }

  .art-card h3 {
    font-size: 15px;
  }

  .game-dock {
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    gap: 7px;
  }
}

/* Cohesive stripped layout: no badges, cards, tabs, frames, or helper text. */
:root {
  --quiet-text: rgba(246, 239, 219, 0.56);
  --main-text: #f5ecd4;
  --accent-text: #91d9ce;
}

body {
  background: linear-gradient(180deg, #161c1b 0%, #090b0e 54%, #06070a 100%);
  font-family: GameFace, Arial Black, Arial, system-ui, sans-serif;
}

.screen {
  padding:
    max(6px, env(safe-area-inset-top), var(--vk-safe-top))
    max(10px, env(safe-area-inset-right), var(--vk-safe-right))
    max(2px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom)))
    max(10px, env(safe-area-inset-left), var(--vk-safe-left));
}

.eyebrow,
.coin-label,
.mode-chip small,
.progress-panel,
.gallery-tabs,
.featured-info p,
.art-card p,
.meta-line,
.card-foot,
.status-mark,
.game-title-block > span {
  display: none !important;
}

.menu-screen {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
}

.menu-head {
  min-height: 46px;
  align-items: end;
}

h1 {
  font-size: clamp(42px, 13vw, 64px);
  line-height: 0.88;
}

h1,
h2,
.featured-info h2,
.art-card h3,
.game-title-block strong,
.primary-action,
.secondary-action,
.hint-action,
.coin-pill,
.score-strip strong {
  color: var(--main-text);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
  -webkit-text-stroke: 0;
}

.coin-pill {
  justify-content: end;
  color: var(--main-text);
}

.coin-pill strong {
  font-size: 28px;
}

.featured-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.featured-card img {
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  object-fit: contain;
  background: transparent !important;
}

.featured-info {
  width: 100%;
  padding: 8px 0 0;
}

.featured-info h2 {
  overflow: hidden;
  font-size: clamp(24px, 7vw, 36px);
  line-height: 1.02;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-panel {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  min-height: 32px;
}

.mode-chip {
  min-height: 32px;
  padding: 0;
  color: var(--quiet-text);
  font-size: 20px;
}

.mode-chip span,
.mode-chip .plain-number {
  font-size: 20px;
  line-height: 1;
}

.mode-chip.is-active {
  color: var(--main-text);
  background: none !important;
}

.menu-actions {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.primary-action,
.secondary-action {
  min-height: 50px;
  font-size: clamp(26px, 8vw, 38px);
  line-height: 1;
}

.secondary-action {
  color: #94bbff;
}

.gallery-screen {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.compact-head {
  grid-template-columns: 60px minmax(0, 1fr) 60px;
  min-height: 42px;
}

.compact-head .coin-pill {
  visibility: hidden;
}

.compact-head h2 {
  font-size: 30px;
}

.gallery-counter {
  min-height: 22px;
  color: var(--quiet-text);
  font-size: 15px;
  text-align: center;
}

.gallery-list {
  gap: 22px;
  padding: 0 13vw;
  align-items: start;
}

.art-card {
  flex: 0 0 74vw;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 0;
  overflow: visible;
  opacity: 0.48;
}

.art-card.is-centered {
  opacity: 1;
}

.art-card img {
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  object-fit: contain;
  background: transparent !important;
}

.art-card-body {
  padding: 8px 0 0;
}

.art-card h3 {
  overflow: hidden;
  font-size: 22px;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price {
  display: none !important;
  margin-top: 4px;
  color: var(--quiet-text);
  text-align: center;
}

.topbar {
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  min-height: 31px;
}

.icon-button,
.round-action,
.close-button {
  color: var(--quiet-text);
  font-size: 9px;
  text-shadow: none;
}

.game-title-block strong {
  font-size: 20px;
}

.score-strip {
  padding: 1px 24px 5px;
}

.score-strip span {
  display: none;
}

.score-strip strong {
  font-size: 20px;
}

.play-area {
  padding-top: 2px;
}

.puzzle-board {
  background: transparent !important;
  box-shadow: none !important;
}

.tile::after,
.strip-tile::after {
  border-right-color: rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.game-dock {
  min-height: 48px;
  padding: 0 20px 1px;
}

.hint-action {
  font-size: clamp(24px, 8vw, 36px);
}

.toast {
  display: none !important;
}

.featured-card,
.art-card,
.featured-card img,
.art-card img,
.puzzle-board {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.featured-card,
.art-card,
.featured-card img,
.art-card img {
  background: transparent !important;
}

.mode-chip,
.mode-chip.is-active {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

.score-strip span {
  display: none !important;
}

/* Reference layout pass: fixed artwork frames and light paper UI. */
:root {
  --paper-ui: #f7f5ef;
  --paper-line: rgba(55, 55, 55, 0.16);
  --paper-text: #4e4e4e;
  --paper-muted: #9b9b9b;
  --art-frame-ratio: 2 / 3;
}

body {
  background: var(--paper-ui) !important;
  color: var(--paper-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 300;
}

.screen {
  background: var(--paper-ui) !important;
}

h1,
h2,
.featured-info h2,
.art-card h3,
.game-title-block strong,
.primary-action,
.secondary-action,
.hint-action,
.coin-pill,
.score-strip strong,
.score-strip span,
.icon-button,
.round-action,
.close-button,
.gallery-counter,
.mode-chip {
  color: var(--paper-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 300 !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}

.menu-screen {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
}

.menu-head {
  min-height: 42px;
  align-items: center;
}

h1 {
  font-size: 42px;
  line-height: 1;
}

.coin-pill strong {
  font-size: 24px;
  font-weight: 300 !important;
}

.featured-card {
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: center;
  gap: 12px;
}

.featured-card img {
  width: min(72vw, 310px) !important;
  height: auto !important;
  aspect-ratio: var(--art-frame-ratio);
  object-fit: cover !important;
  object-position: center center;
}

.featured-info {
  width: min(82vw, 350px);
  padding: 0;
}

.featured-info h2 {
  font-size: 28px;
  line-height: 1.1;
  text-align: center;
}

.mode-panel {
  width: min(86vw, 380px);
  justify-self: center;
}

.mode-chip,
.mode-chip.is-active {
  color: var(--paper-muted) !important;
}

.mode-chip.is-active {
  color: var(--paper-text) !important;
}

.mode-chip span,
.mode-chip .plain-number {
  font-size: 20px;
  font-weight: 300 !important;
}

.menu-actions {
  width: min(88vw, 390px);
  justify-self: center;
}

.primary-action,
.secondary-action,
.hint-action {
  min-height: 44px;
  font-size: 22px;
  font-weight: 300 !important;
}

.gallery-screen {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.compact-head {
  grid-template-columns: 74px minmax(0, 1fr) 74px;
  min-height: 54px;
}

.compact-head h2 {
  font-size: 42px;
  line-height: 1;
}

.gallery-counter {
  min-height: 24px;
  color: var(--paper-muted) !important;
  font-size: 20px;
  line-height: 1;
}

.gallery-list {
  height: calc(var(--app-height, 100svh) - var(--vk-banner-bottom) - 162px);
  min-height: 440px;
  max-height: 640px;
  align-items: start;
  gap: 24px;
  padding: 18px 14vw 0;
}

.art-card {
  flex: 0 0 min(70vw, 320px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) 52px;
  width: min(70vw, 320px);
  height: 100%;
  min-height: 0;
  opacity: 0.34;
}

.art-card.is-centered {
  opacity: 1;
}

.art-card img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: var(--art-frame-ratio);
  object-fit: cover !important;
  object-position: center center;
}

.art-card-body {
  display: grid;
  align-items: center;
  min-height: 52px;
  padding: 0;
}

.art-card h3 {
  font-size: 28px;
  line-height: 1.05;
  text-align: center;
}

.game-screen {
  display: flex !important;
  flex-direction: column;
  gap: 0;
  padding:
    max(0px, env(safe-area-inset-top), var(--vk-safe-top))
    max(10px, env(safe-area-inset-right), var(--vk-safe-right))
    max(6px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom)))
    max(10px, env(safe-area-inset-left), var(--vk-safe-left));
}

.game-screen .score-strip {
  order: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: calc(100% + 20px);
  min-height: 54px;
  margin: 0 -10px;
  padding: 0 10px;
  align-items: center;
  border-bottom: 1px solid var(--paper-line);
}

.score-strip > div {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.score-strip span {
  display: inline !important;
  margin: 0;
  color: var(--paper-muted) !important;
  font-size: 18px;
  line-height: 1;
  text-transform: none;
}

.score-strip strong {
  font-size: 20px;
  line-height: 1;
}

.topbar {
  order: 2;
  grid-template-columns: 76px minmax(0, 1fr) 94px;
  min-height: 104px;
  padding: 0;
}

#home-button,
#preview-button {
  align-self: center;
}

#home-button span {
  display: none;
}

#home-button::before {
  content: "☰";
  color: var(--paper-text);
  font-size: 31px;
  line-height: 1;
}

#preview-button {
  justify-self: end;
  width: 72px;
  height: 48px;
  border: 1px solid var(--paper-line) !important;
  border-radius: 5px !important;
  color: var(--paper-text) !important;
  font-size: 18px;
}

.game-title-block strong {
  font-size: 20px;
  letter-spacing: 0;
}

.play-area {
  order: 3;
  flex: 1 1 auto;
  display: grid;
  place-items: start center;
  min-height: 0;
  padding-top: 0;
}

.puzzle-board {
  width: var(--board-w);
  height: var(--board-h);
  background-color: transparent !important;
  box-shadow: none !important;
}

.tile::after,
.strip-tile::after {
  border-right: 2px solid var(--paper-ui);
  border-bottom: 2px solid var(--paper-ui);
}

.game-dock {
  order: 4;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 66px;
  padding: 0;
}

.round-action,
.hint-action {
  justify-self: stretch;
  min-height: 52px;
  color: var(--paper-text) !important;
  font-size: 20px;
  font-weight: 300 !important;
}

.overlay {
  background: rgba(247, 245, 239, 0.86);
}

/* Minimal full-art pass. The painting is the interface. */
:root {
  --bg: #090b0e;
  --bg-2: #11161a;
  --paper: #f3ead1;
  --cream: #f3ead1;
  --teal: #8ee4d6;
  --ink: #07090b;
  --panel: transparent;
  --tile-w: var(--tile);
  --tile-h: var(--tile);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 34%),
    linear-gradient(160deg, #151b1b 0%, #080a0d 58%, #111015 100%);
  color: var(--paper);
  font-family: GameFace, Arial Black, Arial, system-ui, sans-serif;
}

.screen {
  padding:
    max(6px, env(safe-area-inset-top), var(--vk-safe-top))
    max(8px, env(safe-area-inset-right), var(--vk-safe-right))
    max(2px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom)))
    max(8px, env(safe-area-inset-left), var(--vk-safe-left));
}

.menu-screen {
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
}

.game-screen {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 3px;
  padding-right: 0;
  padding-left: 0;
}

.gallery-screen {
  gap: 8px;
}

h1,
h2,
.game-title-block strong,
.primary-action,
.secondary-action,
.hint-action,
.coin-pill,
.score-strip strong,
.progress-panel strong,
.ad-count {
  font-family: GameFace, Arial Black, Arial, system-ui, sans-serif;
}

h1,
h2,
.featured-info h2,
.art-card h3,
.game-title-block strong {
  color: #fff3d7;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  -webkit-text-stroke: 0;
}

h1 {
  font-size: clamp(36px, 10vw, 54px);
}

h2 {
  font-size: 24px;
}

.eyebrow,
.coin-label,
.mode-chip small,
.score-strip span,
.progress-panel span,
.game-title-block span {
  color: rgba(142, 228, 214, 0.9);
  font-family: GameFace, Arial Black, Arial, system-ui, sans-serif;
  text-shadow: none;
}

.coin-pill,
.primary-action,
.secondary-action,
.hint-action,
.icon-button,
.round-action,
.close-button,
.mode-chip,
.progress-panel > div,
.score-strip > div,
.tag,
.price,
.status-mark,
.featured-card,
.art-card,
.win-panel,
.ad-panel,
.confirm-panel,
.toast {
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

.coin-pill {
  min-width: 0;
  min-height: 0;
  padding: 0;
  align-items: flex-end;
  flex-direction: column;
  gap: 1px;
  color: #fff3d7;
  text-align: right;
}

.coin-pill strong {
  font-size: 22px;
}

.coin-label {
  font-size: 9px;
}

.menu-head {
  min-height: 58px;
  gap: 8px;
}

.featured-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.featured-card img,
.art-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

.featured-info,
.art-card-body {
  display: grid;
  gap: 5px;
  padding: 9px 0 0;
  background: transparent !important;
}

.featured-info h2 {
  font-size: 25px;
  line-height: 1.05;
}

.featured-info p,
.art-card p {
  margin: 0;
  color: rgba(243, 234, 209, 0.76);
  font-size: 12px;
  line-height: 1.22;
}

.meta-line {
  gap: 10px;
}

.tag,
.price,
.status-mark {
  min-height: 0;
  padding: 0;
  color: rgba(142, 228, 214, 0.9);
  font-size: 10px;
}

.mode-panel {
  gap: 0;
}

.mode-chip {
  min-height: 40px;
  padding: 0 4px 4px;
  color: rgba(243, 234, 209, 0.52);
  text-align: center;
}

.mode-chip span {
  font-size: 19px;
  text-shadow: none;
}

.mode-chip small {
  margin-top: 1px;
  font-size: 9px;
}

.mode-chip.is-active {
  color: #fff3d7;
  background:
    linear-gradient(180deg, transparent 0%, transparent calc(100% - 3px), rgba(142, 228, 214, 0.88) calc(100% - 3px)) !important;
}

.menu-actions {
  gap: 10px;
}

.primary-action,
.secondary-action,
.hint-action {
  min-height: 48px;
  color: #fff3d7;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.primary-action {
  font-size: 25px;
}

.secondary-action {
  color: #8fb9ff;
  font-size: 22px;
}

.hint-action {
  font-size: 22px;
}

.progress-panel,
.score-strip {
  gap: 8px;
}

.progress-panel > div,
.score-strip > div {
  min-width: 0;
  padding: 0;
  text-align: center;
}

.progress-panel span,
.score-strip span {
  display: block;
  margin-bottom: 1px;
  font-size: 9px;
  line-height: 1;
}

.progress-panel strong,
.score-strip strong {
  color: #fff3d7;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.58);
}

.compact-head,
.topbar {
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  min-height: 36px;
  padding: 0 8px;
}

.icon-button,
.round-action,
.close-button {
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: rgba(243, 234, 209, 0.78);
  font-size: 9px;
}

.icon-button.accent {
  color: rgba(142, 228, 214, 0.95);
}

.game-title-block strong {
  font-size: 18px;
  line-height: 1;
}

.game-title-block > span {
  margin-top: 1px;
  font-size: 11px;
}

.game-title-block .plain-number {
  display: inline !important;
  overflow: visible;
  text-overflow: clip;
  vertical-align: baseline;
  white-space: nowrap;
}

.score-strip {
  padding: 0 8px 2px;
}

.play-area {
  align-items: start;
  justify-items: center;
  overflow: hidden;
  padding-top: 5px;
}

.easel {
  display: none;
}

.puzzle-board {
  width: min(var(--board-w), 100vw);
  height: var(--board-h);
  border: 0 !important;
  border-radius: 0 !important;
  background-color: rgba(0, 0, 0, 0.32);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26) !important;
}

.puzzle-board::after {
  border: 0;
}

.tile,
.strip-tile {
  width: var(--tile-w);
  height: var(--tile-h);
}

.tile::after,
.strip-tile::after {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.tile.hint-strip {
  filter: brightness(1.25) saturate(1.15);
}

.tile.hint-strip::after {
  border: 2px solid rgba(142, 228, 214, 0.96);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.move-guide {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff3d7;
  box-shadow: none;
  text-shadow: none;
}

.game-dock {
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  min-height: 48px;
  gap: 4px;
  padding: 0 8px 1px;
}

.round-action {
  width: auto;
  min-width: 0;
  justify-self: stretch;
}

.gallery-list {
  gap: 12px;
}

.art-card {
  padding: 0;
}

.art-card img {
  min-height: 0;
}

.art-card.is-centered {
  transform: none;
}

.art-card h3 {
  color: #fff3d7;
}

.overlay {
  background: rgba(3, 5, 7, 0.74);
}

.win-panel,
.ad-panel,
.confirm-panel,
.preview-card {
  max-width: min(92vw, 420px);
  padding: 18px;
  background: rgba(7, 9, 12, 0.88) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.confirm-actions {
  gap: 16px;
}

.plain-number {
  color: inherit;
}

@media (max-width: 350px) {
  .compact-head,
  .topbar {
    grid-template-columns: 46px 1fr 46px;
  }

  .game-dock {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .primary-action {
    font-size: 22px;
  }

  .secondary-action,
  .hint-action {
    font-size: 19px;
  }
}

/* Tight mobile composition: no elastic dead zones around the artwork. */
.screen {
  padding-right: 0 !important;
  padding-left: 0 !important;
}

.menu-screen,
.gallery-screen {
  padding-right: max(12px, env(safe-area-inset-right), var(--vk-safe-right)) !important;
  padding-left: max(12px, env(safe-area-inset-left), var(--vk-safe-left)) !important;
}

.game-screen {
  justify-content: flex-start;
  padding-top: max(0px, env(safe-area-inset-top), var(--vk-safe-top)) !important;
  padding-bottom: max(2px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom))) !important;
}

.game-screen .score-strip {
  flex: 0 0 42px;
  min-height: 42px;
  padding: 0 18px !important;
  border-bottom: 1px solid var(--paper-line);
}

.score-strip > div {
  gap: 5px;
}

.score-strip span {
  display: inline !important;
  color: var(--paper-muted) !important;
  font-size: 13px !important;
}

.score-strip strong {
  color: var(--paper-text) !important;
  font-size: 26px !important;
}

.topbar {
  flex: 0 0 64px;
  grid-template-columns: 64px minmax(0, 1fr) 84px !important;
  min-height: 64px !important;
  padding: 0 14px !important;
}

.game-title-block strong {
  color: var(--paper-text) !important;
  font-size: 21px !important;
}

.game-title-block > span {
  display: none !important;
}

#home-button,
#preview-button,
.round-action {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#preview-button {
  width: auto !important;
  height: auto !important;
  min-height: 34px !important;
  color: var(--paper-text) !important;
}

.play-area {
  flex: 0 0 var(--board-h) !important;
  height: var(--board-h) !important;
  min-height: var(--board-h) !important;
  max-height: var(--board-h) !important;
  padding: 0 !important;
  place-items: start center !important;
}

.puzzle-board {
  width: var(--board-w) !important;
  max-width: 100vw !important;
  height: var(--board-h) !important;
}

.game-dock {
  flex: 0 0 50px;
  grid-template-columns: 72px minmax(0, 1fr) 72px !important;
  min-height: 50px !important;
  margin-top: 10px;
  padding: 0 20px !important;
}

.round-action,
.hint-action {
  min-height: 42px !important;
  color: var(--paper-text) !important;
}

.round-action {
  font-size: 12px !important;
}

.hint-action {
  font-size: 30px !important;
}

.gallery-screen {
  grid-template-rows: 50px 24px minmax(0, 1fr) !important;
  gap: 0 !important;
}

.compact-head {
  min-height: 50px !important;
}

.compact-head h2 {
  font-size: 40px !important;
}

.gallery-counter {
  min-height: 24px !important;
  font-size: 18px !important;
}

.gallery-list {
  height: calc(var(--app-height, 100svh) - var(--vk-banner-bottom) - 76px) !important;
  min-height: 0 !important;
  max-height: none !important;
  gap: 18px !important;
  padding: 8px 9vw 0 !important;
}

.art-card {
  flex: 0 0 min(82vw, 340px) !important;
  width: min(82vw, 340px) !important;
  grid-template-rows: minmax(0, 1fr) 46px !important;
}

.art-card-body {
  min-height: 46px !important;
}

.art-card h3 {
  font-size: 25px !important;
}

@media (max-width: 350px) {
  .game-screen .score-strip {
    flex-basis: 38px;
    min-height: 38px;
  }

  .topbar {
    flex-basis: 58px;
    min-height: 58px !important;
    grid-template-columns: 52px minmax(0, 1fr) 70px !important;
  }

  .game-dock {
    grid-template-columns: 58px minmax(0, 1fr) 58px !important;
    padding: 0 12px !important;
  }
}

/* Bigger board pass: the puzzle owns the screen. */
.game-screen {
  gap: 0 !important;
  padding-bottom: max(0px, calc(env(safe-area-inset-bottom) + var(--vk-banner-bottom))) !important;
}

.game-screen .score-strip {
  flex: 0 0 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
}

.score-strip > div {
  gap: 4px !important;
}

.score-strip span {
  font-size: 10px !important;
}

.score-strip strong {
  font-size: 22px !important;
}

.topbar {
  flex: 0 0 36px !important;
  grid-template-columns: 48px minmax(0, 1fr) 74px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
}

#home-button::before {
  font-size: 30px !important;
}

#preview-button {
  min-height: 28px !important;
  font-size: 17px !important;
}

.game-title-block strong {
  font-size: 19px !important;
  line-height: 1 !important;
}

.game-dock {
  flex: 0 0 38px !important;
  grid-template-columns: 74px minmax(0, 1fr) 74px !important;
  min-height: 38px !important;
  margin-top: 2px !important;
  padding: 0 4px !important;
}

.round-action,
.hint-action {
  min-height: 34px !important;
}

.round-action {
  font-size: 11px !important;
}

.hint-action {
  font-size: 29px !important;
  line-height: 1 !important;
}

@media (max-width: 350px) {
  .game-screen .score-strip {
    flex-basis: 28px !important;
    min-height: 28px !important;
  }

  .topbar {
    flex-basis: 34px !important;
    min-height: 34px !important;
    grid-template-columns: 42px minmax(0, 1fr) 64px !important;
  }

  .game-dock {
    grid-template-columns: 58px minmax(0, 1fr) 58px !important;
    min-height: 36px !important;
  }
}

/* Final alignment pass: no leftover app-style underlines or uneven stat rows. */
.game-screen .score-strip {
  align-items: center !important;
  border-bottom: 1px solid rgba(80, 80, 80, 0.16) !important;
}

.score-strip > div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  padding: 0 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.score-strip span,
.score-strip strong {
  display: inline-block !important;
  margin: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 300 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  vertical-align: baseline !important;
}

.score-strip span {
  color: #9d9d9d !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
}

.score-strip strong {
  color: #4d4d4d !important;
  font-size: 22px !important;
  line-height: 1.05 !important;
}

.topbar {
  align-items: center !important;
  border-bottom: 0 !important;
}

.icon-button,
.round-action,
.hint-action,
#home-button,
#preview-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#home-button {
  justify-self: start !important;
}

#home-button::before {
  display: block !important;
  line-height: 1 !important;
  transform: translateY(-1px);
}

#preview-button {
  justify-self: end !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.game-title-block {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
}

.game-title-block strong {
  display: block !important;
  margin: 0 !important;
  color: #4d4d4d !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 20px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.mode-chip,
.mode-chip.is-active {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.mode-chip.is-active {
  color: #4d4d4d !important;
}

.mode-chip.is-active::before,
.mode-chip.is-active::after,
.mode-chip::before,
.mode-chip::after {
  display: none !important;
  content: none !important;
}

.mode-chip small {
  color: #9d9d9d !important;
}

/* VK banner lock: the native bottom banner owns a fixed external slot.
   Game geometry does not react to banner visibility, so the puzzle cannot jump. */
html.vk-launch,
html.vk-banner-visible,
html.vk-native-banner-visible,
body.banner-visible {
  --vk-banner-bottom: var(--vk-native-banner-bottom) !important;
}

.game-screen {
  padding-right: 0 !important;
  padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
  padding-left: 0 !important;
}

.game-screen .score-strip,
.topbar,
.game-dock {
  margin-right: 0 !important;
  margin-left: 0 !important;
  width: 100% !important;
}

.play-area {
  width: 100% !important;
}

/* Gallery purchase readability: every artwork has a clear state without app-like badges. */
.compact-head .coin-pill {
  visibility: visible !important;
  display: grid !important;
  align-content: center !important;
  justify-items: end !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #5a5a5a !important;
}

.compact-head .coin-label {
  display: block !important;
  color: #9a9a9a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 10px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  text-shadow: none !important;
}

.compact-head .coin-pill strong {
  display: block !important;
  margin: 1px 0 0 !important;
  color: #4d4d4d !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  text-shadow: none !important;
}

.art-card {
  grid-template-rows: minmax(0, 1fr) 76px !important;
}

.art-image-wrap {
  position: relative !important;
  display: grid !important;
  min-width: 0 !important;
  min-height: 0 !important;
  place-items: center !important;
  overflow: hidden !important;
}

.art-image-wrap img {
  display: block !important;
}

.art-card.is-locked .art-image-wrap img {
  filter: grayscale(0.9) brightness(0.48) contrast(0.94) !important;
}

.art-card.is-locked.can-buy .art-image-wrap img {
  filter: grayscale(0.55) brightness(0.72) contrast(0.98) !important;
}

.lock-word {
  position: absolute !important;
  right: 0 !important;
  bottom: 10px !important;
  left: 0 !important;
  color: rgba(255, 255, 255, 0.82) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 300 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.84) !important;
}

.art-card-body {
  display: grid !important;
  grid-template-rows: minmax(0, auto) 22px !important;
  align-content: start !important;
  gap: 5px !important;
  min-height: 76px !important;
  padding: 10px 0 0 !important;
  background: transparent !important;
}

.art-card h3 {
  color: #4d4d4d !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 27px !important;
  font-weight: 300 !important;
  line-height: 1.05 !important;
  text-shadow: none !important;
}

.gallery-state {
  display: block !important;
  overflow: hidden !important;
  color: #7f7f7f !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.art-card.can-buy .gallery-state {
  color: #3d9086 !important;
}

.art-card.cant-buy .gallery-state {
  color: #aa5e5e !important;
}

.art-card.is-selected:not(.is-locked) .gallery-state {
  color: #3d9086 !important;
}

/* No internal banner gap. VK places the native ad outside the app viewport,
   so screens must use the full reported height. */
.screen,
.menu-screen,
.gallery-screen,
.game-screen {
  padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
}

.gallery-list {
  height: auto !important;
  align-self: stretch !important;
  padding-bottom: 0 !important;
}

.menu-screen {
  grid-template-rows: 54px minmax(0, 1fr) 40px 48px !important;
  gap: 6px !important;
}

.featured-card {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-content: stretch !important;
  justify-items: center !important;
  gap: 6px !important;
}

.featured-card img {
  width: min(92vw, 390px) !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.featured-info {
  width: min(92vw, 390px) !important;
  padding: 0 !important;
}

.featured-info h2 {
  margin: 0 !important;
  font-size: clamp(28px, 7.5vw, 36px) !important;
  line-height: 1.05 !important;
}

.mode-panel {
  align-self: stretch !important;
  height: 40px !important;
}

.menu-actions {
  align-self: stretch !important;
  height: 48px !important;
}

/* Real VK layout: the native bottom banner is inside the webview overlay,
   so the playable app surface must stop at the banner top. */
.app-shell {
  position: relative !important;
  height: var(--app-height, 100svh) !important;
  min-height: var(--app-height, 100svh) !important;
  background: #f7f5ef !important;
}

.screen,
.menu-screen,
.gallery-screen,
.game-screen {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  height: var(--content-height, calc(var(--app-height, 100svh) - var(--vk-banner-bottom))) !important;
  min-height: var(--content-height, calc(var(--app-height, 100svh) - var(--vk-banner-bottom))) !important;
  max-height: var(--content-height, calc(var(--app-height, 100svh) - var(--vk-banner-bottom))) !important;
  padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
  background: #f7f5ef !important;
}

.gallery-list {
  height: auto !important;
  max-height: none !important;
  align-self: stretch !important;
  padding-bottom: 0 !important;
}

.screen[hidden],
[hidden].screen {
  display: none !important;
  pointer-events: none !important;
}

/* Fixed VK banner surface: the app owns only the area above the native banner.
   The banner can appear later, but screen geometry and bottom controls do not move. */
html.vk-launch,
html.vk-reserve-banner,
html.vk-banner-visible,
html.vk-native-banner-visible,
body.banner-visible {
  --vk-banner-bottom: var(--vk-native-banner-bottom) !important;
}

.app-shell {
  position: relative !important;
  height: var(--app-height, 100svh) !important;
  min-height: var(--app-height, 100svh) !important;
  max-height: var(--app-height, 100svh) !important;
  overflow: hidden !important;
}

.screen,
.menu-screen,
.gallery-screen,
.game-screen {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  left: 0 !important;
  height: var(--content-height, calc(var(--app-height, 100svh) - var(--vk-banner-bottom))) !important;
  min-height: var(--content-height, calc(var(--app-height, 100svh) - var(--vk-banner-bottom))) !important;
  max-height: var(--content-height, calc(var(--app-height, 100svh) - var(--vk-banner-bottom))) !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
}

.menu-screen {
  grid-template-rows: 54px minmax(0, 1fr) 40px 48px !important;
  gap: 6px !important;
}

.menu-actions {
  align-self: end !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.game-screen {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 0 !important;
}

.game-dock {
  flex: 0 0 38px !important;
  min-height: 38px !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.play-area {
  flex: 0 0 var(--board-h) !important;
  height: var(--board-h) !important;
  min-height: var(--board-h) !important;
  max-height: var(--board-h) !important;
}
