:root {
  --puzzle-ink: #f2f3ed;
  --puzzle-muted: #a3adbf;
  --puzzle-lime: #d8f879;
  --puzzle-board: #222a37;
  --puzzle-cell: #303a4a;
}
body[data-page="2048"] {
  min-height: 100vh;
  margin: 0;
  color: var(--puzzle-ink);
  background:
    radial-gradient(720px 520px at 82% 10%, rgba(95, 83, 164, .18), transparent 68%),
    radial-gradient(600px 500px at 8% 55%, rgba(68, 105, 116, .14), transparent 70%),
    linear-gradient(180deg, #111624 0%, #0a0e17 68%, #090c13 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.puzzle-shell { width: min(960px, 100%); margin: 0 auto; padding: 0 30px; }
.puzzle-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(211,223,243,.1); }
.puzzle-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--puzzle-ink); font-size: 16px; font-weight: 780; letter-spacing: -.06em; text-decoration: none; }
.brand-mark { position: relative; display: grid; width: 32px; height: 32px; place-items: center; overflow: hidden; border: 1px solid rgba(216,248,121,.58); border-radius: 10px; color: var(--puzzle-lime); background: rgba(216,248,121,.09); font-size: 15px; font-weight: 850; }
.brand-mark i { position: absolute; width: 7px; height: 7px; right: 5px; bottom: 5px; border-radius: 2px; background: var(--puzzle-lime); transform: rotate(45deg); }
.brand-period { color: var(--puzzle-lime); }
.puzzle-back { color: #abb5c6; text-decoration: none; font-size: 12px; transition: color .18s ease; }
.puzzle-back:hover { color: var(--puzzle-lime); }
.puzzle-back span { margin-right: 7px; color: var(--puzzle-lime); }
.puzzle-main { padding: 44px 0 55px; }
.puzzle-intro { margin-bottom: 24px; }
.puzzle-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: #bdc8d9; font-size: 9px; font-weight: 760; letter-spacing: .18em; }
.puzzle-eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--puzzle-lime); box-shadow: 0 0 12px rgba(216,248,121,.7); }
.puzzle-intro h1 { margin: 0; font-size: clamp(48px, 6vw, 68px); line-height: .98; letter-spacing: -.075em; }
.puzzle-intro h1 span { color: var(--puzzle-lime); }
.puzzle-intro > p:last-child { margin: 10px 0 0; color: var(--puzzle-muted); font-size: 13px; line-height: 1.6; }
.puzzle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; gap: 16px; }
.puzzle-board-wrap, .puzzle-panel { border: 1px solid rgba(211,223,243,.13); border-radius: 20px; background: linear-gradient(155deg, rgba(25,33,51,.91), rgba(14,19,30,.96)); box-shadow: 0 24px 70px rgba(0,0,0,.23); }
.puzzle-board-wrap { padding: 17px; }
.puzzle-board-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 1px 12px; color: #919db0; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.puzzle-board-top span:last-child { color: #828da1; font-size: 10px; font-weight: 450; letter-spacing: 0; }
.puzzle-board { display: grid; width: min(100%, 500px); aspect-ratio: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.25vw, 11px); margin-inline: auto; padding: clamp(9px, 1.5vw, 14px); border: 1px solid rgba(211,223,243,.08); border-radius: 16px; background: #202938; touch-action: none; user-select: none; }
.puzzle-cell { display: grid; min-width: 0; place-items: center; border-radius: 10px; color: #f7f5ee; background: #303a4a; font-size: clamp(19px, 4.5vw, 36px); font-weight: 800; letter-spacing: -.06em; line-height: 1; transition: transform .11s ease, background .14s ease, color .14s ease; }
.puzzle-cell:not(.tile-empty) { animation: tile-pop .13s ease-out; }
.puzzle-cell.tile-empty { color: transparent; background: rgba(115,130,153,.12); }
.tile-1 { color: #4c473f; background: #e9e2d6; }
.tile-2 { color: #4c473f; background: #dfd3bd; }
.tile-3 { color: #fff8e9; background: #efa86a; }
.tile-4 { color: #fff8e9; background: #f18b5b; }
.tile-5 { color: #fff9ee; background: #ed7154; }
.tile-6 { color: #fff9ee; background: #db5b58; }
.tile-7 { color: #fff9ee; background: #c85270; }
.tile-8 { color: #fff9ee; background: #a95791; }
.tile-9 { color: #fff9ee; background: #825da8; }
.tile-10 { color: #fff9ee; background: #6674b4; }
.tile-11 { color: #26301d; background: var(--puzzle-lime); box-shadow: 0 0 28px rgba(216,248,121,.22); }
.tile-high { color: #fff9ee; background: #566a82; font-size: clamp(16px, 3.6vw, 28px); }
@keyframes tile-pop { from { transform: scale(.88); } to { transform: scale(1); } }
.puzzle-status { min-height: 20px; margin: 12px 4px 0; color: #aeb9ca; font-size: 11px; line-height: 1.5; text-align: center; }
.continue-button { display: block; margin: 8px auto 0; padding: 7px 13px; border: 1px solid rgba(216,248,121,.35); border-radius: 9px; color: var(--puzzle-lime); background: rgba(216,248,121,.08); font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.continue-button[hidden] { display: none; }
.puzzle-panel { display: flex; flex-direction: column; gap: 13px; padding: 14px; }
.puzzle-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.puzzle-scores > div { display: grid; gap: 5px; padding: 12px; border: 1px solid rgba(211,223,243,.09); border-radius: 13px; background: rgba(5,9,16,.26); }
.puzzle-scores span, .puzzle-panel-label { color: #8996aa; font-size: 8px; font-weight: 760; letter-spacing: .14em; }
.puzzle-scores strong { overflow: hidden; color: #f3f4ed; font-size: 22px; letter-spacing: -.045em; text-overflow: ellipsis; }
.puzzle-copy { padding: 12px; border: 1px solid rgba(211,223,243,.09); border-radius: 13px; background: rgba(5,9,16,.22); }
.puzzle-copy p { margin: 8px 0 0; color: #a5b0c2; font-size: 10px; line-height: 1.65; }
.key-row { display: flex; gap: 4px; margin-top: 10px; }
.key-row kbd { display: inline-grid; min-width: 22px; height: 22px; place-items: center; border: 1px solid rgba(211,223,243,.15); border-radius: 6px; color: #c1ccdc; background: rgba(255,255,255,.035); font: inherit; font-size: 11px; }
.puzzle-new { display: flex; min-height: 41px; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; color: #151b12; background: var(--puzzle-lime); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.puzzle-new:hover { transform: translateY(-1px); background: #e4ff9a; }
.puzzle-new span { font-size: 16px; }
.puzzle-undo { min-height: 36px; border: 1px solid rgba(211,223,243,.13); border-radius: 10px; color: #cad2df; background: rgba(255,255,255,.025); font: inherit; font-size: 10px; cursor: pointer; transition: border-color .18s ease, color .18s ease; }
.puzzle-undo:not(:disabled):hover { border-color: rgba(216,248,121,.35); color: var(--puzzle-lime); }
.puzzle-undo:disabled { color: #667184; cursor: default; }
.puzzle-note { margin: 0; color: #778398; font-size: 9px; line-height: 1.5; text-align: center; }
.puzzle-footer { display: flex; align-items: center; gap: 20px; min-height: 68px; border-top: 1px solid rgba(211,223,243,.1); color: #7e899c; font-size: 10px; }
.puzzle-footer > span:first-child { color: #c5ccda; font-weight: 750; }
.puzzle-footer > a { margin-left: auto; color: #c8d1df; text-decoration: none; }
.puzzle-footer > a:hover { color: var(--puzzle-lime); }
.puzzle-footer b { margin-left: 5px; color: var(--puzzle-lime); }
@media (max-width: 700px) {
  .puzzle-shell { padding-inline: 19px; }
  .puzzle-main { padding-top: 35px; }
  .puzzle-layout { grid-template-columns: minmax(0, 1fr) 225px; gap: 11px; }
  .puzzle-board-wrap { padding: 12px; }
  .puzzle-panel { padding: 10px; gap: 9px; }
  .puzzle-scores > div { padding: 9px; }
  .puzzle-copy { padding: 10px; }
}
@media (max-width: 560px) {
  .puzzle-shell { padding-inline: 14px; }
  .puzzle-main { padding-top: 30px; }
  .puzzle-layout { grid-template-columns: 1fr; }
  .puzzle-board-wrap { padding: 12px; }
  .puzzle-board { width: min(100%, 430px); gap: clamp(5px, 2vw, 9px); padding: clamp(8px, 2.4vw, 12px); border-radius: 14px; }
  .puzzle-cell { border-radius: 8px; font-size: clamp(20px, 8.5vw, 34px); }
  .tile-high { font-size: clamp(17px, 6.5vw, 27px); }
  .puzzle-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .puzzle-scores, .puzzle-copy { grid-column: 1 / -1; }
  .puzzle-panel-label { font-size: 9px; }
  .puzzle-copy p { font-size: 11px; }
  .puzzle-note { align-self: center; }
}
@media (max-width: 360px) {
  .puzzle-shell { padding-inline: 9px; }
  .puzzle-board { gap: 5px; padding: 7px; }
  .puzzle-board-top { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="2048"] *, body[data-page="2048"] *::before, body[data-page="2048"] *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
