.ark-game-body { min-width: 0; }

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

.game-2048-stage {
  min-width: 0;
  place-items: stretch;
}

.ark-game-heading > p {
  max-width: 40rem;
  color: rgb(244 246 246 / 66%);
  line-height: 1.65;
}

.ark-game-heading h1 span { color: var(--ark-signal, #18d1ff); }

.game-2048-stage > .ark-game-hud,
.game-2048-stage > .ark-game-live { width: 100%; }

.ark-game-brief ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ark-game-brief li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgb(244 246 246 / 14%);
}

.ark-game-brief li strong {
  color: var(--ark-paper, #f4f6f6);
  text-align: end;
}

.game-2048-board-frame {
  position: relative;
  width: min(100%, 42rem);
  margin-inline: auto;
  padding: clamp(.55rem, 1.6vw, .9rem);
  border: 1px solid rgb(244 246 246 / 42%);
  background:
    linear-gradient(rgb(24 209 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(24 209 255 / 5%) 1px, transparent 1px),
    #050708;
  background-size: 2rem 2rem;
  box-shadow:
    .7rem .7rem 0 rgb(24 209 255 / 14%),
    inset 0 0 0 1px rgb(24 209 255 / 7%);
  isolation: isolate;
}

.game-2048-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.35rem, 1.2vw, .65rem);
  aspect-ratio: 1;
  touch-action: none;
  user-select: none;
  outline: none;
}

.game-2048-board:focus-visible {
  outline: 2px solid var(--ark-signal, #18d1ff);
  outline-offset: 6px;
}

.game-2048-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid rgb(244 246 246 / 17%);
  background: rgb(244 246 246 / 4%);
  color: var(--ark-paper, #f4f6f6);
  font-family: var(--ark-display, "Arial Narrow", sans-serif);
  font-size: clamp(1.25rem, 6.5vw, 3.5rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.05em;
  overflow: hidden;
}

.game-2048-tile::after {
  content: attr(data-cell);
  position: absolute;
  inset: auto .25rem .2rem auto;
  color: rgb(244 246 246 / 26%);
  font-family: var(--ark-mono, Consolas, monospace);
  font-size: clamp(.42rem, 1.2vw, .58rem);
  font-weight: 400;
  letter-spacing: .06em;
}

.game-2048-tile[data-value="0"] { color: transparent; }
.game-2048-tile[data-tier="1"] { background: rgb(244 246 246 / 12%); }
.game-2048-tile[data-tier="2"] { background: rgb(244 246 246 / 20%); }
.game-2048-tile[data-tier="3"] { border-color: rgb(24 209 255 / 38%); background: rgb(24 209 255 / 14%); }
.game-2048-tile[data-tier="4"] { border-color: rgb(24 209 255 / 55%); background: rgb(24 209 255 / 22%); }
.game-2048-tile[data-tier="5"] { border-color: rgb(24 209 255 / 72%); background: rgb(24 209 255 / 30%); }
.game-2048-tile[data-tier="6"] { border-color: #18d1ff; background: rgb(24 209 255 / 42%); }
.game-2048-tile[data-tier="7"] { border-color: #18d1ff; background: #18d1ff; color: #080a0b; }
.game-2048-tile[data-tier="8"] { border-color: #f4f6f6; background: #f4f6f6; color: #080a0b; }
.game-2048-tile[data-tier="9"] { border: 2px solid #18d1ff; background: #f4f6f6; color: #080a0b; }
.game-2048-tile[data-tier="10"] { border: 3px double #18d1ff; background: #f4f6f6; color: #080a0b; }
.game-2048-tile[data-tier="11"] { border-color: #c8eb21; background: #c8eb21; color: #080a0b; }
.game-2048-tile[data-tier="12"] { border-color: #c8eb21; background: #080a0b; color: #c8eb21; }
.game-2048-tile[data-tier="13"],
.game-2048-tile[data-tier="14"],
.game-2048-tile[data-tier="15"],
.game-2048-tile[data-tier="16"] { border: 2px solid #c8eb21; background: #080a0b; color: #c8eb21; }

.game-2048-tile[data-tier="10"],
.game-2048-tile[data-tier="11"],
.game-2048-tile[data-tier="12"],
.game-2048-tile[data-tier="13"],
.game-2048-tile[data-tier="14"],
.game-2048-tile[data-tier="15"],
.game-2048-tile[data-tier="16"] {
  font-size: clamp(1rem, 6.2vw, 2.4rem);
  letter-spacing: -.08em;
}

.game-2048-tile.is-new { animation: game-2048-enter 190ms ease-out; }
.game-2048-tile.is-merged { animation: game-2048-merge 230ms ease-out; }

@keyframes game-2048-enter {
  from { clip-path: inset(50%); transform: scale(.72); }
  to { clip-path: inset(0); transform: scale(1); }
}

@keyframes game-2048-merge {
  45% { transform: scale(1.08); box-shadow: 0 0 0 .22rem rgb(24 209 255 / 26%); }
}

.game-2048-pause-overlay {
  position: absolute;
  z-index: 5;
  inset: 38% 0 auto;
  padding: 1.2rem 1rem;
  border-left: .45rem solid var(--ark-signal, #18d1ff);
  background: rgb(8 10 11 / 88%);
  color: var(--ark-paper, #f4f6f6);
  text-align: center;
}

.game-2048-pause-overlay strong,
.game-2048-pause-overlay span { display: block; }

.game-2048-pause-overlay strong {
  font-family: var(--ark-display, "Arial Narrow", sans-serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1;
}

.game-2048-pause-overlay span {
  margin-top: .5rem;
  color: rgb(244 246 246 / 62%);
  font-family: var(--ark-mono, Consolas, monospace);
  font-size: .62rem;
  letter-spacing: .14em;
}

.game-2048-corner {
  position: absolute;
  z-index: 3;
  width: 1.1rem;
  height: 1.1rem;
  border-color: var(--ark-signal, #18d1ff);
  pointer-events: none;
}

.game-2048-corner-a {
  inset: -.35rem auto auto -.35rem;
  border-top: 2px solid;
  border-left: 2px solid;
}

.game-2048-corner-b {
  inset: auto -.35rem -.35rem auto;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.game-2048-dpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(3rem, 1fr));
  grid-template-rows: repeat(2, 3.2rem);
  gap: .45rem;
  max-width: 15rem;
}

.game-2048-dpad button {
  min-width: 3rem;
  min-height: 3rem;
  border: 1px solid rgb(244 246 246 / 38%);
  background: rgb(244 246 246 / 5%);
  color: var(--ark-paper, #f4f6f6);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.game-2048-dpad button[data-direction="up"] { grid-column: 2; grid-row: 1; }
.game-2048-dpad button[data-direction="left"] { grid-column: 1; grid-row: 2; }
.game-2048-dpad button[data-direction="down"] { grid-column: 2; grid-row: 2; }
.game-2048-dpad button[data-direction="right"] { grid-column: 3; grid-row: 2; }

.game-2048-dpad button:is(:hover, :focus-visible) {
  border-color: var(--ark-signal, #18d1ff);
  background: var(--ark-signal, #18d1ff);
  color: var(--ark-ink, #080a0b);
}

.game-2048-dpad button:active { transform: translateY(2px); }

.game-2048-result {
  width: min(calc(100% - 2rem), 34rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgb(244 246 246 / 48%);
  border-left: .55rem solid var(--ark-signal, #18d1ff);
  border-radius: 0;
  background: #0c0f10;
  color: var(--ark-paper, #f4f6f6);
  box-shadow: 1rem 1rem 0 rgb(24 209 255 / 18%);
}

.game-2048-result::backdrop { background: rgb(8 10 11 / 78%); }

.game-2048-result h2 {
  margin: .35rem 0 .85rem;
  font-family: var(--ark-display, "Arial Narrow", sans-serif);
  font-size: clamp(2.2rem, 8vw, 4.25rem);
  line-height: .92;
}

.game-2048-result > p:not(.ark-game-panel-label) {
  max-width: 35rem;
  color: rgb(244 246 246 / 72%);
  line-height: 1.7;
}

@media (max-width: 700px), (orientation: portrait) {
  .game-2048-board-frame {
    width: 100%;
    box-shadow: .4rem .4rem 0 rgb(24 209 255 / 12%);
  }

  .game-2048-dpad {
    width: min(100%, 18rem);
    max-width: none;
    margin-inline: auto;
    grid-template-rows: repeat(2, 3.6rem);
  }

  .game-2048-dpad button { min-height: 3.5rem; }
}

@media (max-width: 420px) {
  .game-2048-board-frame { padding: .4rem; }
  .game-2048-board { gap: .3rem; }
  .game-2048-tile { font-size: clamp(1.05rem, 9.6vw, 2.35rem); }
}

@media (prefers-reduced-motion: reduce) {
  .game-2048-tile,
  .game-2048-dpad button { animation: none; transition: none; }
}
