:root{color-scheme:light}body{margin:0;background:#fffdf6;color:#272219}
.g-arrow-2048{--ink:#272219;--paper:#fffdf6;--muted:#857456;--echo:#7b5cc4;position:relative;box-sizing:border-box;width:100%;max-width:452px;--size:4;margin:0 auto;padding:22px 16px 18px;background:var(--paper);color:var(--ink);font:14px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
.g-arrow-2048 *{box-sizing:border-box}.g-arrow-2048 button{font:inherit;color:inherit;cursor:pointer}.g-arrow-2048 button:focus-visible{outline:3px solid #3679e7;outline-offset:3px}.g-arrow-2048 [hidden]{display:none!important}
.g-arrow-2048 .ar-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;margin-bottom:18px}.g-arrow-2048 .ar-eyebrow{display:block;color:var(--muted);font:9px/1.4 ui-monospace,monospace;letter-spacing:1.6px}
.g-arrow-2048 h1{margin:4px 0 0;font-size:26px;line-height:1.2;font-weight:800;letter-spacing:-1px}.g-arrow-2048 h1 span{display:block;margin-top:3px;font:600 9px ui-monospace,monospace;letter-spacing:2.4px;color:var(--muted)}
.g-arrow-2048 .ar-scores{display:flex;gap:8px}.g-arrow-2048 .ar-scores>div{min-width:64px;padding:5px 10px 4px;text-align:center;background:#fff9ed;border:2px solid var(--ink);box-shadow:2px 2px var(--ink)}.g-arrow-2048 .ar-scores .ar-best{background:#f8d84a;transform:rotate(2deg)}.g-arrow-2048 .ar-scores small{display:block;font-size:10px;color:var(--muted)}.g-arrow-2048 .ar-scores strong{font:800 19px/1.2 ui-monospace,monospace}

.g-arrow-2048 .ar-deal{display:flex;align-items:center;gap:12px;font-size:12px;margin-bottom:10px}
.g-arrow-2048 .ar-next-wrap{display:flex;align-items:center;gap:8px}
.g-arrow-2048 .ar-next{position:relative;display:block;width:46px;height:46px}
.g-arrow-2048 .ar-next .ar-face{box-shadow:3px 3px var(--ink)}
.g-arrow-2048 .ar-moves{margin-left:auto;color:var(--muted);font-size:11px;white-space:nowrap}

.g-arrow-2048 .ar-stage{position:relative;padding:8px;background:radial-gradient(#dfd3b8 1px,transparent 1px) 0 0/16px 16px;border:2px solid var(--ink);box-shadow:4px 4px var(--ink)}
.g-arrow-2048 .ar-board{position:relative;width:100%;max-width:400px;margin:0 auto;aspect-ratio:1}
.g-arrow-2048 .ar-cells{position:absolute;inset:0;display:grid;grid-template-columns:repeat(var(--size,4),minmax(0,1fr));grid-template-rows:repeat(var(--size,4),minmax(0,1fr));touch-action:none}
.g-arrow-2048 .ar-cell{position:relative;min-width:0;min-height:0;margin:0;padding:0;border:0;background:none;touch-action:none}
.g-arrow-2048 .ar-cell::before{content:'';position:absolute;inset:3px;border:1.5px dashed #cdbd9c;border-radius:6px;background:#fffdf680}
.g-arrow-2048 .ar-cell:focus-visible{outline-offset:-2px}
.g-arrow-2048 .ar-cell.ar-cursor::before{border:2px solid #3679e7;background:#3679e714}
.g-arrow-2048 .ar-cell.ar-path::before{border-style:solid;border-color:#3679e7;background:#97bbf155}

.g-arrow-2048 .ar-tiles{position:absolute;inset:0;pointer-events:none}
.g-arrow-2048 .ar-tile{--dur:0s;position:absolute;left:0;top:0;width:calc(100% / var(--size,4));height:calc(100% / var(--size,4));padding:4px;transform:translate(calc(var(--c) * 100%),calc(var(--r) * 100%));transition:transform var(--dur) cubic-bezier(.3,.1,.3,1)}
.g-arrow-2048 .ar-face{position:relative;display:grid;place-items:center;width:100%;height:100%;background:var(--color,#fff9ed);border:2px solid var(--ink);border-radius:7px;box-shadow:2px 2px var(--ink);font:800 clamp(18px,7vw,32px) ui-monospace,monospace;overflow:hidden}
.g-arrow-2048 .ar-face[data-digits="3"]{font-size:clamp(16px,6vw,27px)}.g-arrow-2048 .ar-face[data-digits="4"]{font-size:clamp(13px,4.8vw,22px)}.g-arrow-2048 .ar-face[data-digits="5"]{font-size:clamp(11px,3.8vw,17px)}
.g-arrow-2048 .ar-num{position:relative;z-index:1}
.g-arrow-2048 .ar-dir{position:absolute;inset:0;transform:rotate(var(--angle,0deg));transition:transform .14s ease-out}
.g-arrow-2048 .ar-dir svg{position:absolute;left:50%;top:4%;width:40%;height:23%;transform:translateX(-50%);fill:var(--ink)}
.g-arrow-2048 .ar-next .ar-face{font-size:18px}
.g-arrow-2048 .ar-badge{position:absolute;z-index:2;right:-3px;top:-4px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 4px;background:var(--echo);color:#fff;border:2px solid var(--ink);border-radius:10px;font:800 11px/1 ui-monospace,monospace}
.g-arrow-2048 .ar-tile.ar-target .ar-face{box-shadow:0 0 0 3px #d54830,2px 2px var(--ink)}
.g-arrow-2048 .ar-tile.ar-new .ar-face{animation:ar-new .2s ease-out}
.g-arrow-2048 .ar-tile.ar-merged .ar-face{animation:ar-pop .18s ease-out}
.g-arrow-2048 .ar-tile.ar-shake .ar-face{animation:ar-shake .28s ease-in-out}
.g-arrow-2048 .ar-tile.ar-eaten{z-index:0}.g-arrow-2048 .ar-tile.ar-moving{z-index:3}

.g-arrow-2048 .ar-prediction{margin:12px 0 0;padding:8px 9px;border:1px dashed #8cba67;background:#f3f5e9;font-size:12px;min-height:40px}
.g-arrow-2048 .ar-prediction.ar-bad{color:#a33224;border-color:#d54830;background:#fff0e9}
.g-arrow-2048 .ar-prediction.ar-good{border-color:#d54830;background:#fff6dc}
.g-arrow-2048 .ar-foot{display:flex;align-items:center;gap:12px;margin:12px 0}
.g-arrow-2048 .ar-foot p{flex:1;font-size:12px;color:var(--muted);margin:0;min-height:40px}
.g-arrow-2048 .ar-primary{padding:10px 12px;min-height:44px;background:#f8d84a;border:2px solid var(--ink);box-shadow:3px 3px var(--ink);font-weight:800;flex:none}.g-arrow-2048 .ar-primary:disabled{opacity:.45;cursor:default}
.g-arrow-2048 .ar-restart{min-height:44px;padding:8px;background:var(--paper);border:2px solid var(--ink);font-size:12px}
.g-arrow-2048 .ar-restart:disabled{opacity:.5;cursor:default}
.g-arrow-2048 .ar-over{position:absolute;inset:0;z-index:8;display:grid;place-items:center;padding:16px;background:#fff9edc7;backdrop-filter:blur(2px)}.g-arrow-2048 .ar-card{width:min(100%,290px);padding:22px 18px;text-align:center;background:var(--paper);border:2px solid var(--ink);box-shadow:6px 6px var(--ink)}.g-arrow-2048 .ar-card h2{margin:8px 0;font-size:24px}.g-arrow-2048 .ar-card .ar-primary{width:100%}.g-arrow-2048 .ar-card p{font-size:12px}
.g-arrow-2048 .ar-help{font-size:12px;color:var(--muted)}
.g-arrow-2048 .ar-help summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700}
.g-arrow-2048 .ar-help p{margin:6px 0;line-height:1.55}.g-arrow-2048 .ar-help b{color:var(--ink)}
.g-arrow-2048 .ar-keys{font-size:10px}
@keyframes ar-new{from{transform:scale(.4);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes ar-pop{50%{transform:scale(1.16)}}
@keyframes ar-shake{20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
@keyframes ar-rise{to{transform:translate(-50%,-30px);opacity:0}}

/* Phone layout: the board takes the full width, secondary text shrinks. */
.g-arrow-2048[data-compact="true"]{padding:8px 10px}
.g-arrow-2048[data-compact="true"] .ar-head{align-items:center;margin-bottom:8px;gap:8px}
.g-arrow-2048[data-compact="true"] .ar-head .ar-eyebrow,.g-arrow-2048[data-compact="true"] h1 span{display:none}
.g-arrow-2048[data-compact="true"] h1{margin:0;font-size:20px;letter-spacing:0;white-space:nowrap}
.g-arrow-2048[data-compact="true"] .ar-scores{gap:6px}
.g-arrow-2048[data-compact="true"] .ar-scores>div{display:flex;align-items:center;gap:5px;min-width:0;padding:3px 6px;box-shadow:1px 1px var(--ink)}
.g-arrow-2048[data-compact="true"] .ar-scores strong{font-size:16px}
.g-arrow-2048[data-compact="true"] .ar-deal{margin-bottom:8px;gap:10px}
.g-arrow-2048[data-compact="true"] .ar-next{width:40px;height:40px}
.g-arrow-2048[data-compact="true"] .ar-stage{padding:4px;box-shadow:3px 3px var(--ink)}
.g-arrow-2048[data-compact="true"] .ar-prediction{margin-top:8px;padding:5px 7px;min-height:36px}
.g-arrow-2048[data-compact="true"] .ar-foot{margin:6px 0 0;justify-content:flex-end;min-height:44px}
.g-arrow-2048[data-compact="true"] .ar-foot>p{position:absolute;width:1px;height:1px;min-height:0;overflow:hidden;clip-path:inset(50%)}
.g-arrow-2048[data-compact="true"] .ar-restart{min-width:96px;font-size:13px}
.g-arrow-2048[data-compact="true"] .ar-help{position:relative;margin-top:-44px;max-width:calc(100% - 160px);font-size:13px}
.g-arrow-2048[data-compact="true"] .ar-help[open]{max-width:none}
.g-arrow-2048[data-compact="true"] .ar-help summary{min-height:44px}
.g-arrow-2048[data-compact="true"] .ar-help[open] summary{width:calc(100% - 160px)}
.g-arrow-2048[data-compact="true"] .ar-keys{display:none}
/* Desktop: wrappers are transparent unless the host is wide (>= 900px), then board left, panel right. */
.g-arrow-2048 .ar-side,.g-arrow-2048 .ar-main{display:contents}
.g-arrow-2048[data-compact="false"] .ar-board{container-type:inline-size}
.g-arrow-2048[data-compact="false"] .ar-board .ar-face{font-size:8cqw;border-radius:1.6cqw}
.g-arrow-2048[data-compact="false"] .ar-board .ar-face[data-digits="3"]{font-size:6.6cqw}
.g-arrow-2048[data-compact="false"] .ar-board .ar-face[data-digits="4"]{font-size:5.4cqw}
.g-arrow-2048[data-compact="false"] .ar-board .ar-face[data-digits="5"]{font-size:4.2cqw}
.g-arrow-2048[data-compact="false"][data-wide="false"]{max-width:560px}
.g-arrow-2048[data-compact="false"][data-wide="false"] .ar-board{max-width:500px}
.g-arrow-2048[data-wide="true"]{display:grid;grid-template-columns:minmax(0,1fr) 340px;grid-template-rows:auto 1fr;column-gap:40px;max-width:1240px;padding:28px 32px 24px}
.g-arrow-2048[data-wide="true"] .ar-side,.g-arrow-2048[data-wide="true"] .ar-main{display:block;min-width:0}
.g-arrow-2048[data-wide="true"] .ar-main{grid-column:1;grid-row:1/3;align-self:start}
.g-arrow-2048[data-wide="true"] .ar-side-top{grid-column:2;grid-row:1}
.g-arrow-2048[data-wide="true"] .ar-side-bottom{grid-column:2;grid-row:2;align-self:start;margin-top:6px}
.g-arrow-2048[data-wide="true"] h1{font-size:34px}
.g-arrow-2048[data-wide="true"] .ar-deal{font-size:13px;gap:14px}
.g-arrow-2048[data-wide="true"] .ar-next{width:58px;height:58px}
.g-arrow-2048[data-wide="true"] .ar-next .ar-face{font-size:22px}
.g-arrow-2048[data-wide="true"] .ar-stage{width:min(100%,calc(clamp(400px,calc(100vh - 300px),760px) + 24px));margin:0 auto;padding:10px;background-size:20px 20px;box-shadow:6px 6px var(--ink)}
.g-arrow-2048[data-wide="true"] .ar-board{max-width:none}
.g-arrow-2048[data-wide="true"] .ar-board .ar-face{border-width:3px;box-shadow:3px 3px var(--ink)}
.g-arrow-2048[data-wide="true"] .ar-cell::before{inset:5px;border-radius:9px}
.g-arrow-2048[data-wide="true"] .ar-badge{min-width:26px;height:26px;border-radius:13px;font-size:14px}
.g-arrow-2048[data-wide="true"] .ar-prediction{margin-top:4px;font-size:14px;padding:12px;min-height:64px}
.g-arrow-2048[data-wide="true"] .ar-foot{flex-wrap:wrap}
.g-arrow-2048[data-wide="true"] .ar-foot>p{flex:1 0 100%;font-size:13px;min-height:0}
.g-arrow-2048[data-wide="true"] .ar-foot .ar-primary{flex:1;min-height:52px;font-size:16px}
.g-arrow-2048[data-wide="true"] .ar-restart{min-height:52px;padding:8px 14px;font-size:13px}
.g-arrow-2048[data-wide="true"] .ar-help{font-size:13px}
@media(pointer:coarse){.g-arrow-2048 .ar-keys{display:none}}
@media(max-width:360px){.g-arrow-2048 .ar-moves{display:none}}

/* ---- v2: adjustments, live slide preview, win card ---- */
.g-arrow-2048 .ar-adjust{display:flex;align-items:center;gap:8px;min-height:44px;padding:6px 12px;background:#fff9ed;border:2px solid var(--ink);box-shadow:2px 2px var(--ink);font-weight:700;font-size:13px}
.g-arrow-2048 .ar-pips{display:flex;gap:5px}
.g-arrow-2048 .ar-pips i{display:block;width:14px;height:14px;border:2px solid var(--ink);border-radius:50%;background:#3679e7;transition:background .15s,transform .15s}
.g-arrow-2048 .ar-pips i.used{background:transparent;transform:scale(.8)}
.g-arrow-2048 .ar-adjust[data-left="0"]{background:#ffe9a8}
.g-arrow-2048[data-auto="true"] .ar-adjust{animation:ar-pulse .65s ease-in-out infinite}
.g-arrow-2048 .ar-cell.ar-path::before{border-style:solid;border-color:#97bbf1;background:#97bbf133}
.g-arrow-2048 .ar-cell.ar-cursor::before{border:2px solid #3679e7;background:#3679e714}
.g-arrow-2048 .ar-ghosts{position:absolute;inset:0;pointer-events:none}
.g-arrow-2048 .ar-ghost{position:absolute;left:0;top:0;width:calc(100% / var(--size,4));height:calc(100% / var(--size,4));padding:4px;transform:translate(calc(var(--c) * 100%),calc(var(--r) * 100%))}
.g-arrow-2048 .ar-ghost::before{content:'';position:absolute;inset:4px;border:2.5px dashed #3679e7;border-radius:8px;background:#97bbf122}
.g-arrow-2048 .ar-ghost b{position:absolute;right:9px;bottom:6px;font:800 12px ui-monospace,monospace;color:#3679e7}
.g-arrow-2048 .ar-ghost-merge::before{border:3px solid #d54830;background:#f3a6bf44}
.g-arrow-2048 .ar-ghost-merge b{color:#d54830;font-size:13px}
.g-arrow-2048 .ar-tiles{z-index:2}
.g-arrow-2048 .ar-ghost-merge{z-index:3}
.g-arrow-2048 .ar-tile.ar-target .ar-face{box-shadow:0 0 0 3px #d54830,2px 2px var(--ink)}
.g-arrow-2048 .ar-tile.ar-turned .ar-face{box-shadow:0 0 0 3px #3679e7,2px 2px var(--ink)}
.g-arrow-2048 .ar-tile.ar-still .ar-face{filter:saturate(.75)}
.g-arrow-2048 .ar-tile.ar-spin .ar-face{animation:ar-tap .2s ease-out}
.g-arrow-2048 .ar-badge{position:absolute;z-index:2;right:-2px;top:-4px;display:grid;place-items:center;min-width:24px;height:20px;padding:0 4px;background:#3679e7;color:#fff;border:2px solid var(--ink);border-radius:10px;font:800 11px/1 ui-monospace,monospace}
.g-arrow-2048 .ar-face[data-big="true"]{color:#f8d84a}
.g-arrow-2048 .ar-face[data-big="true"] .ar-dir svg{fill:#f8d84a}
.g-arrow-2048 .ar-fx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:6}
.g-arrow-2048 .ar-actions{display:flex;gap:10px;margin-top:10px}
.g-arrow-2048 .ar-actions .ar-primary{flex:1;font-size:16px}
.g-arrow-2048 .ar-ghost-btn{min-height:44px;padding:8px 12px;background:var(--paper);border:2px solid var(--ink);font-size:13px;font-weight:700}
.g-arrow-2048 .ar-ghost-btn:disabled{opacity:.4;cursor:default}
.g-arrow-2048 .ar-icon{width:44px;height:44px;flex:none;background:var(--paper);border:2px solid var(--ink);font-size:18px;font-weight:800}
.g-arrow-2048 .ar-icon[aria-pressed="false"]{opacity:.45;text-decoration:line-through}
.g-arrow-2048 .ar-newbest{color:#d54830;font-weight:800}
.g-arrow-2048 .ar-win{background:#fff3c4d9}
.g-arrow-2048 .ar-win .ar-card{box-shadow:6px 6px #d54830}
.g-arrow-2048 .ar-win .ar-win-new{width:100%;margin-top:8px}
@keyframes ar-pulse{50%{transform:scale(1.05)}}
@keyframes ar-tap{40%{transform:scale(.9)}}
.g-arrow-2048[data-compact="true"] .ar-actions{margin-top:8px}
.g-arrow-2048[data-compact="true"] .ar-adjust{padding:4px 8px;min-height:40px}
.g-arrow-2048[data-wide="true"] .ar-actions .ar-primary,.g-arrow-2048[data-wide="true"] .ar-ghost-btn{min-height:52px}
.g-arrow-2048[data-wide="true"] .ar-ghost,.g-arrow-2048[data-wide="true"] .ar-tile{padding:6px}
.g-arrow-2048[data-wide="true"] .ar-ghost b{font-size:16px;right:14px;bottom:10px}
.g-arrow-2048[data-wide="true"] .ar-pips i{width:18px;height:18px}
@media(prefers-reduced-motion:reduce){.g-arrow-2048 .ar-fx{display:none}.g-arrow-2048 .ar-pips i{transition:none}.g-arrow-2048[data-auto="true"] .ar-adjust{animation:none}}
