/* Adbin 2048 — isolated game presentation layer */

.game-2048-host:empty {
  display: none;
}

.game-2048-experience {
  position: fixed;
  z-index: 140;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 12% 10%, rgb(41 202 255 / 15%), transparent 30%),
    radial-gradient(circle at 88% 18%, rgb(167 139 250 / 16%), transparent 33%),
    radial-gradient(circle at 50% 95%, rgb(255 79 225 / 10%), transparent 38%),
    linear-gradient(180deg, #07142f 0%, #081a3c 55%, #061126 100%);
  color: #f7f9ff;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.game-2048-experience::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.26;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(255 255 255 / 2.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2.5%) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 75%), transparent 80%);
}

.game-2048-screen {
  width: min(100%, 620px);
  min-height: 100%;
  margin: 0 auto;
  padding:
    calc(12px + var(--safe-top))
    calc(14px + var(--safe-right))
    calc(26px + var(--safe-bottom))
    calc(14px + var(--safe-left));
}

.game-2048-topbar {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) auto minmax(84px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  margin-bottom: 14px;
}

.game-2048-topbar-title {
  color: #fff;
  font-size: 1.06rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-align: center;
}

.game-2048-topbar-tools {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.game-2048-icon-button {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 13px;
  background: linear-gradient(145deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 4%));
  color: #e8efff;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    0 8px 20px rgb(0 0 0 / 18%);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.game-2048-icon-button .icon {
  width: 20px;
  height: 20px;
}

.game-2048-icon-button:active {
  transform: scale(0.93);
}

.game-2048-back {
  justify-self: start;
  border-color: rgb(74 207 255 / 24%);
  color: #bceeff;
}

.game-2048-sound {
  grid-auto-flow: column;
  gap: 4px;
  min-width: 48px;
}

.game-2048-sound-mark {
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
}

.game-2048-sound-state {
  color: #88e5ff;
  font-size: 0.48rem;
  font-weight: 950;
  letter-spacing: 0.07em;
}

.game-2048-sound.is-muted {
  color: #8795ae;
}

.game-2048-sound.is-muted .game-2048-sound-state {
  color: #8795ae;
}

.game-2048-hero {
  margin: 12px 2px 18px;
  text-align: center;
}

.game-2048-eyebrow,
.game-2048-dialog-kicker {
  display: inline-block;
  color: #76dcff;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.game-2048-hero h1 {
  max-width: 460px;
  margin: 7px auto 6px;
  color: #fff;
  font-size: clamp(1.45rem, 6vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.game-2048-hero p {
  max-width: 470px;
  margin: 0 auto;
  color: #aebed9;
  font-size: 0.75rem;
  line-height: 1.55;
}

.game-2048-mode-list {
  display: grid;
  gap: 11px;
}

.game-2048-mode-card {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 28px;
  gap: 13px;
  width: 100%;
  min-height: 116px;
  padding: 14px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 3%));
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    0 14px 30px rgb(0 0 0 / 20%);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.game-2048-mode-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  top: -54px;
  right: -32px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(2px);
  pointer-events: none;
}

.game-2048-mode-card.tone-quick {
  border-color: rgb(57 208 255 / 24%);
}
.game-2048-mode-card.tone-quick::after {
  background: #28cfff;
}
.game-2048-mode-card.tone-classic {
  border-color: rgb(167 139 250 / 28%);
}
.game-2048-mode-card.tone-classic::after {
  background: #9a7cff;
}
.game-2048-mode-card.tone-extended {
  border-color: rgb(255 97 217 / 25%);
}
.game-2048-mode-card.tone-extended::after {
  background: #ff5bd7;
}

.game-2048-mode-card:active {
  transform: scale(0.978);
}

.game-2048-mode-preview {
  --mini-gap: 3px;
  display: grid;
  width: 80px;
  height: 80px;
  gap: var(--mini-gap);
  padding: 7px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 16px;
  background: rgb(3 13 32 / 64%);
  box-shadow: inset 0 0 18px rgb(0 0 0 / 24%);
}

/* attr() is not consistently supported for grid counts, so sizes are explicit. */
.game-2048-mode-preview[data-board-size="3"] { grid-template-columns: repeat(3, 1fr); }
.game-2048-mode-preview[data-board-size="4"] { grid-template-columns: repeat(4, 1fr); }
.game-2048-mode-preview[data-board-size="5"] { grid-template-columns: repeat(5, 1fr); --mini-gap: 2px; }

.game-2048-mode-preview-cell {
  border-radius: 4px;
  background: rgb(255 255 255 / 7%);
}
.game-2048-mode-preview-cell.has-tile {
  background: linear-gradient(145deg, #2a92e6, #6654d9);
  box-shadow: 0 2px 5px rgb(0 0 0 / 22%);
}
.game-2048-mode-preview-cell[data-exponent="3"],
.game-2048-mode-preview-cell[data-exponent="4"] {
  background: linear-gradient(145deg, #8c62ef, #d14cc3);
}
.game-2048-mode-preview-cell[data-exponent="5"] {
  background: linear-gradient(145deg, #ef8f42, #e3548f);
}

.game-2048-mode-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.game-2048-mode-heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.game-2048-mode-heading strong {
  color: #fff;
  font-size: 1.17rem;
  font-weight: 950;
}
.game-2048-mode-heading span {
  color: #8fdcff;
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.game-2048-mode-description {
  color: #c1cce0;
  font-size: 0.7rem;
  line-height: 1.42;
}
.game-2048-mode-best {
  color: #8d9db8;
  font-size: 0.61rem;
  font-weight: 750;
}
.game-2048-mode-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: rgb(255 255 255 / 7%);
  color: #dbe7fb;
}
.game-2048-mode-arrow .icon {
  width: 12px;
  height: 12px;
}

.game-2048-mode-footnote {
  margin: 14px 4px 0;
  color: #7486a4;
  font-size: 0.61rem;
  line-height: 1.45;
  text-align: center;
}

.game-2048-board-title {
  display: grid;
  justify-items: center;
  line-height: 1;
}
.game-2048-board-title strong {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 950;
}
.game-2048-board-title span {
  margin-top: 4px;
  color: #8ca0be;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game-2048-hud {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  width: min(100%, 460px);
  margin: 4px auto 11px;
}

.game-2048-score-card {
  position: relative;
  display: grid;
  min-height: 65px;
  padding: 9px 12px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 16px;
  background: linear-gradient(145deg, rgb(255 255 255 / 8%), rgb(255 255 255 / 3%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
}
.game-2048-score-card.is-current {
  border-color: rgb(74 207 255 / 20%);
}
.game-2048-score-card > span {
  color: #7f91af;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.game-2048-score-card > strong {
  color: #f7fbff;
  font-size: 1rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.game-2048-score-pop {
  position: absolute;
  top: -2px;
  right: 10px;
  color: #7ee7ff;
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 950;
  animation: game-2048-score-rise 620ms ease-out both;
}

.game-2048-board-shell {
  position: relative;
  width: min(100%, 460px);
  margin: 0 auto;
}

.game-2048-board {
  --game-2048-size: 4;
  --game-2048-gap: 8px;
  display: grid;
  grid-template-columns: repeat(var(--game-2048-size), minmax(0, 1fr));
  gap: var(--game-2048-gap);
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 10px;
  touch-action: none;
  user-select: none;
  border: 1px solid rgb(128 196 255 / 18%);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% -10%, rgb(53 148 255 / 14%), transparent 42%),
    linear-gradient(145deg, rgb(9 31 69 / 96%), rgb(6 21 48 / 98%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    inset 0 -14px 28px rgb(0 0 0 / 16%),
    0 22px 42px rgb(0 0 0 / 31%);
  outline: none;
}

.game-2048-board:focus-visible {
  box-shadow:
    0 0 0 3px rgb(74 207 255 / 35%),
    inset 0 1px 0 rgb(255 255 255 / 10%),
    0 22px 42px rgb(0 0 0 / 31%);
}

.game-2048-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: visible;
  border: 1px solid rgb(255 255 255 / 4%);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 5.5%), rgb(255 255 255 / 2.5%));
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 16%);
}

.game-2048-tile {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 14px;
  color: #fff;
  font-size: clamp(1.02rem, 7.8vw, 2.05rem);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 5px rgb(0 0 0 / 22%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 30%),
    inset 0 -8px 14px rgb(0 0 0 / 10%),
    0 7px 14px rgb(0 0 0 / 23%);
  will-change: transform, opacity;
}

.game-2048-board[data-board-size="3"] .game-2048-tile {
  font-size: clamp(1.35rem, 11vw, 2.6rem);
}
.game-2048-board[data-board-size="5"] {
  --game-2048-gap: 6px;
  padding: 8px;
  border-radius: 21px;
}
.game-2048-board[data-board-size="5"] .game-2048-cell,
.game-2048-board[data-board-size="5"] .game-2048-tile {
  border-radius: 10px;
}
.game-2048-board[data-board-size="5"] .game-2048-tile {
  font-size: clamp(0.72rem, 5vw, 1.45rem);
}

.game-2048-tile.digits-5 { font-size: 0.82em; }
.game-2048-tile.digits-6 { font-size: 0.7em; }
.game-2048-tile.digits-7 { font-size: 0.59em; }
.game-2048-tile.digits-8 { font-size: 0.51em; letter-spacing: -0.07em; }

.game-2048-tile[data-exponent="1"] { background: linear-gradient(145deg, #316bd8, #2454b8); color: #eff8ff; }
.game-2048-tile[data-exponent="2"] { background: linear-gradient(145deg, #287fdc, #3662c8); }
.game-2048-tile[data-exponent="3"] { background: linear-gradient(145deg, #268fd7, #3b68d2); }
.game-2048-tile[data-exponent="4"] { background: linear-gradient(145deg, #4a7fe4, #6658d8); }
.game-2048-tile[data-exponent="5"] { background: linear-gradient(145deg, #7865e8, #874fc9); }
.game-2048-tile[data-exponent="6"] { background: linear-gradient(145deg, #9a5cdf, #b647c1); }
.game-2048-tile[data-exponent="7"] { background: linear-gradient(145deg, #c451c5, #d5479e); }
.game-2048-tile[data-exponent="8"] { background: linear-gradient(145deg, #db4b9a, #e95478); }
.game-2048-tile[data-exponent="9"] { background: linear-gradient(145deg, #eb5c70, #ef7655); }
.game-2048-tile[data-exponent="10"] { background: linear-gradient(145deg, #ef7b4d, #e99a3c); }
.game-2048-tile[data-exponent="11"] { background: linear-gradient(145deg, #e99d3b, #d6aa35); }
.game-2048-tile[data-exponent="12"] { background: linear-gradient(145deg, #d5aa3c, #b9a540); }
.game-2048-tile[data-exponent="13"] { background: linear-gradient(145deg, #9ba94b, #58a86a); }
.game-2048-tile[data-exponent="14"] { background: linear-gradient(145deg, #50a875, #2ba89d); }
.game-2048-tile[data-exponent="15"] { background: linear-gradient(145deg, #2aa9aa, #278eb8); }
.game-2048-tile[data-exponent="16"] { background: linear-gradient(145deg, #288dbc, #495fc4); }
.game-2048-tile[data-exponent="17"] { background: linear-gradient(145deg, #5261c6, #794dc1); }
.game-2048-tile[data-exponent="18"] { background: linear-gradient(145deg, #8050c2, #ad47b2); }
.game-2048-tile[data-exponent="19"] { background: linear-gradient(145deg, #b249ae, #d54585); }
.game-2048-tile[data-exponent="20"] { background: linear-gradient(145deg, #d84981, #e96061); }
.game-2048-tile[data-exponent]:not([data-exponent="1"]):not([data-exponent="2"]):not([data-exponent="3"]):not([data-exponent="4"]):not([data-exponent="5"]):not([data-exponent="6"]):not([data-exponent="7"]):not([data-exponent="8"]):not([data-exponent="9"]):not([data-exponent="10"]):not([data-exponent="11"]):not([data-exponent="12"]):not([data-exponent="13"]):not([data-exponent="14"]):not([data-exponent="15"]):not([data-exponent="16"]):not([data-exponent="17"]):not([data-exponent="18"]):not([data-exponent="19"]):not([data-exponent="20"]) {
  background: linear-gradient(145deg, #de526f, #8b54d4 55%, #3b7fd2);
}

.game-2048-tile.is-shifted.move-left { animation: game-2048-slide-left 145ms cubic-bezier(.2,.78,.28,1) both; }
.game-2048-tile.is-shifted.move-right { animation: game-2048-slide-right 145ms cubic-bezier(.2,.78,.28,1) both; }
.game-2048-tile.is-shifted.move-up { animation: game-2048-slide-up 145ms cubic-bezier(.2,.78,.28,1) both; }
.game-2048-tile.is-shifted.move-down { animation: game-2048-slide-down 145ms cubic-bezier(.2,.78,.28,1) both; }
.game-2048-tile.is-spawned { animation: game-2048-spawn 210ms cubic-bezier(.2,.9,.35,1.25) both !important; }
.game-2048-tile.is-merged { animation: game-2048-merge 245ms cubic-bezier(.18,.9,.28,1.28) both !important; z-index: 2; }

.game-2048-board-screen[data-animation="enter"] .game-2048-board-shell,
.game-2048-board-screen[data-animation="restart"] .game-2048-board-shell {
  animation: game-2048-board-enter 280ms cubic-bezier(.18,.82,.28,1) both;
}

.game-2048-board-shell.is-invalid .game-2048-board {
  animation: game-2048-invalid 170ms ease-in-out;
}

.game-2048-gesture-hint {
  display: flex;
  gap: 7px;
  margin: 10px 0 0;
  align-items: center;
  justify-content: center;
  color: #7e90ad;
  font-size: 0.59rem;
  text-align: center;
}
.game-2048-swipe-glyph {
  color: #8ddfff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.game-2048-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  width: min(100%, 460px);
  margin: 13px auto 0;
}

.game-2048-control {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  min-height: 58px;
  padding: 9px 11px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 15px;
  background: linear-gradient(145deg, rgb(255 255 255 / 8%), rgb(255 255 255 / 3%));
  color: #e9f1ff;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
}
.game-2048-control:active:not(:disabled) {
  transform: scale(0.975);
}
.game-2048-control:disabled {
  opacity: 0.42;
}
.game-2048-control-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: rgb(74 207 255 / 9%);
  color: #8ddfff;
}
.game-2048-control-icon .icon {
  width: 18px;
  height: 18px;
}
.game-2048-control-copy {
  display: grid;
  gap: 2px;
}
.game-2048-control-copy strong {
  font-size: 0.72rem;
}
.game-2048-control-copy span {
  color: #7f91ae;
  font-size: 0.55rem;
}

.game-2048-layer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding:
    calc(18px + var(--safe-top))
    calc(15px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(15px + var(--safe-left));
  place-items: center;
  background: rgb(2 8 23 / 76%);
  backdrop-filter: blur(11px);
}

.game-2048-dialog-card {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border: 1px solid rgb(117 188 255 / 20%);
  border-radius: 23px;
  background:
    radial-gradient(circle at 90% 4%, rgb(116 102 255 / 15%), transparent 34%),
    linear-gradient(160deg, #102a58, #091c40);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 11%),
    0 28px 70px rgb(0 0 0 / 50%);
}
.game-2048-dialog-card h2 {
  margin: 6px 0 7px;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.game-2048-dialog-copy {
  margin: 0;
  color: #b9c5d9;
  font-size: 0.71rem;
  line-height: 1.5;
}
.game-2048-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}
.game-2048-dialog-primary {
  width: 100%;
  margin-top: 15px;
}
.game-2048-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.game-2048-tutorial-demo {
  display: flex;
  gap: 7px;
  margin: 17px 0;
  align-items: center;
  justify-content: center;
}
.tutorial-demo-tile {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 13px;
  background: linear-gradient(145deg, #3574df, #525bcf);
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 0 8px 16px rgb(0 0 0 / 22%);
}
.tutorial-demo-tile.is-result {
  background: linear-gradient(145deg, #8365e5, #a34ec7);
}
.tutorial-demo-plus,
.tutorial-demo-arrow {
  color: #8da0bc;
  font-weight: 950;
}

.game-2048-tutorial-steps {
  display: grid;
  gap: 8px;
}
.game-2048-tutorial-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  align-items: start;
  border-radius: 13px;
  background: rgb(255 255 255 / 4%);
}
.tutorial-step-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: rgb(74 207 255 / 11%);
  color: #8de1ff;
  font-size: 0.65rem;
  font-weight: 950;
}
.tutorial-step-copy {
  display: grid;
  gap: 2px;
}
.tutorial-step-copy strong {
  font-size: 0.7rem;
}
.tutorial-step-copy p {
  margin: 0;
  color: #91a2bd;
  font-size: 0.61rem;
  line-height: 1.43;
}

.game-2048-game-over {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  border-radius: 24px;
  background: rgb(4 15 35 / 70%);
  backdrop-filter: blur(6px);
  animation: game-2048-game-over-in 260ms ease-out both;
}
.game-2048-game-over-card {
  width: min(100%, 310px);
  padding: 20px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 20px;
  background: linear-gradient(155deg, rgb(22 54 105 / 96%), rgb(10 29 65 / 98%));
  text-align: center;
  box-shadow: 0 22px 50px rgb(0 0 0 / 38%);
}
.game-2048-game-over-card h2 {
  margin: 6px 0 4px;
  font-size: 1.35rem;
}
.game-2048-game-over-card p {
  margin: 0;
  color: #aebbd0;
  font-size: 0.67rem;
}
.game-2048-game-over-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.game-2048-catalog-card {
  border-color: rgb(117 101 255 / 27%);
  background:
    radial-gradient(circle at 96% 5%, rgb(151 109 255 / 14%), transparent 33%),
    linear-gradient(145deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 4%));
}
.game-2048-catalog-card .phase23-game-icon {
  background: linear-gradient(145deg, rgb(75 174 255 / 18%), rgb(137 87 255 / 18%));
  color: #9bddff;
}

@keyframes game-2048-slide-left {
  from { opacity: 0.72; transform: translateX(16%) scale(0.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes game-2048-slide-right {
  from { opacity: 0.72; transform: translateX(-16%) scale(0.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes game-2048-slide-up {
  from { opacity: 0.72; transform: translateY(16%) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes game-2048-slide-down {
  from { opacity: 0.72; transform: translateY(-16%) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes game-2048-spawn {
  0% { opacity: 0; transform: scale(0.52); }
  70% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes game-2048-merge {
  0% { transform: scale(0.86); filter: brightness(1); }
  55% { transform: scale(1.13); filter: brightness(1.16); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes game-2048-score-rise {
  0% { opacity: 0; transform: translateY(7px) scale(0.9); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px) scale(1.03); }
}
@keyframes game-2048-board-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes game-2048-invalid {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
}
@keyframes game-2048-game-over-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (min-width: 560px) {
  .game-2048-mode-list {
    gap: 13px;
  }
  .game-2048-mode-card {
    min-height: 124px;
  }
}

@media (max-width: 420px) {
  .game-2048-screen {
    padding-right: calc(10px + var(--safe-right));
    padding-left: calc(10px + var(--safe-left));
  }
  .game-2048-topbar {
    grid-template-columns: 72px auto 72px;
    gap: 5px;
  }
  .game-2048-icon-button {
    min-width: 38px;
    height: 38px;
    padding: 0 7px;
    border-radius: 12px;
  }
  .game-2048-topbar-tools {
    gap: 5px;
  }
  .game-2048-mode-card {
    grid-template-columns: 72px minmax(0, 1fr) 22px;
    gap: 10px;
    min-height: 106px;
    padding: 11px;
    border-radius: 17px;
  }
  .game-2048-mode-preview {
    width: 68px;
    height: 68px;
    padding: 6px;
  }
  .game-2048-mode-heading strong {
    font-size: 1rem;
  }
  .game-2048-mode-description {
    font-size: 0.64rem;
  }
  .game-2048-board {
    --game-2048-gap: 6px;
    padding: 8px;
    border-radius: 20px;
  }
  .game-2048-cell,
  .game-2048-tile {
    border-radius: 11px;
  }
  .game-2048-board[data-board-size="5"] {
    --game-2048-gap: 4px;
    padding: 6px;
  }
  .game-2048-board[data-board-size="5"] .game-2048-cell,
  .game-2048-board[data-board-size="5"] .game-2048-tile {
    border-radius: 8px;
  }
  .game-2048-controls {
    gap: 7px;
  }
  .game-2048-control {
    grid-template-columns: 33px minmax(0, 1fr);
    gap: 7px;
    min-height: 54px;
    padding: 8px 9px;
  }
  .game-2048-control-icon {
    width: 32px;
    height: 32px;
  }
  .game-2048-dialog-card {
    padding: 19px;
  }
}

@media (max-width: 340px) {
  .game-2048-mode-card {
    grid-template-columns: 60px minmax(0, 1fr) 18px;
  }
  .game-2048-mode-preview {
    width: 58px;
    height: 58px;
    padding: 5px;
  }
  .game-2048-mode-description {
    display: none;
  }
  .game-2048-hud {
    gap: 6px;
  }
  .game-2048-score-card {
    min-height: 58px;
  }
  .game-2048-gesture-hint {
    font-size: 0.54rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-2048-tile,
  .game-2048-score-pop,
  .game-2048-board-shell,
  .game-2048-game-over,
  .game-2048-board-shell.is-invalid .game-2048-board {
    animation: none !important;
    transition: none !important;
  }
}
