:root{color-scheme:light}body{margin:0;background:#fffdf6;color:#272219}
.g-flipper-2048{--ink:#272219;--paper:#fffdf6;--muted:#857456;--blue:#3679e7;--red:#d54830;--pink:#e2588a;--yellow:#f8d84a;position:relative;box-sizing:border-box;width:100%;max-width:520px;margin:0 auto;padding:20px 16px 16px;background:var(--paper);color:var(--ink);font:14px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans SC",sans-serif;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.g-flipper-2048 *{box-sizing:border-box}.g-flipper-2048 button{font:inherit;color:inherit;cursor:pointer}.g-flipper-2048 button:focus-visible,.g-flipper-2048 summary:focus-visible{outline:3px solid var(--blue);outline-offset:3px}.g-flipper-2048 [hidden]{display:none!important}
.g-flipper-2048 .fp-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;margin-bottom:14px}.g-flipper-2048 .fp-eyebrow{display:block;color:var(--muted);font:9px/1.4 ui-monospace,monospace;letter-spacing:1.6px}
.g-flipper-2048 h1{margin:4px 0 0;font-size:26px;line-height:1.2;font-weight:800;letter-spacing:-1px}.g-flipper-2048 h1 span{display:block;margin-top:3px;font:600 9px ui-monospace,monospace;letter-spacing:2.4px;color:var(--muted)}
.g-flipper-2048 .fp-scores{display:flex;gap:8px}.g-flipper-2048 .fp-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-flipper-2048 .fp-scores .fp-best{background:var(--yellow);transform:rotate(2deg)}.g-flipper-2048 .fp-scores small{display:block;font-size:10px;color:var(--muted)}.g-flipper-2048 .fp-scores strong{display:block;font:800 19px/1.2 ui-monospace,monospace}
.g-flipper-2048 .fp-scores strong.fp-bump{animation:fp-bump .35s ease-out}

.g-flipper-2048 .fp-deal{display:flex;align-items:center;gap:12px;margin-bottom:8px;font-size:11px}
.g-flipper-2048 .fp-deal>div{display:flex;align-items:center;gap:6px}.g-flipper-2048 .fp-deal small{color:var(--muted);font-size:11px}
.g-flipper-2048 .fp-orb{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--color,#f8d84a);border:2.5px solid var(--ink);box-shadow:3px 3px var(--ink);font:800 17px ui-monospace,monospace;background-image:radial-gradient(circle at 32% 28%,#fff9 0 14%,transparent 15%)}
.g-flipper-2048 .fp-orb-sm{width:32px;height:32px;font-size:12px;box-shadow:2px 2px var(--ink)}
.g-flipper-2048 .fp-orb.fp-stone{color:transparent;background-color:#9b9285;border-radius:44% 56% 48% 52%/52% 44% 56% 48%;background-image:linear-gradient(135deg,transparent 45%,#5d564c 46% 50%,transparent 51%)}
.g-flipper-2048 .fp-pips{display:flex;gap:3px}.g-flipper-2048 .fp-pips i{width:10px;height:10px;border:2px solid var(--ink);border-radius:2px;background:#fff9ed}
.g-flipper-2048 .fp-pips i.on{background:#9b9285}.g-flipper-2048 .fp-strain.hot .fp-pips i.on{background:var(--red)}
.g-flipper-2048 .fp-moves{margin-left:auto;color:var(--muted);white-space:nowrap}
.g-flipper-2048 .fp-icon{display:grid;place-items:center;width:44px;height:44px;padding:0;background:#fff9ed;border:2px solid var(--ink);box-shadow:2px 2px var(--ink)}
.g-flipper-2048 .fp-icon svg{width:22px;height:22px;fill:none;stroke:var(--ink);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.g-flipper-2048 .fp-icon svg path:first-child{fill:var(--ink)}
.g-flipper-2048 .fp-icon .fp-mute{display:none}.g-flipper-2048 .fp-icon[aria-pressed="false"] .fp-mute{display:inline}.g-flipper-2048 .fp-icon[aria-pressed="false"] .fp-wave{display:none}.g-flipper-2048 .fp-icon[aria-pressed="false"]{background:#eee4cf}

.g-flipper-2048 .fp-stage{position:relative;padding:6px;background:#efe3c7;border:2px solid var(--ink);box-shadow:4px 4px var(--ink)}
.g-flipper-2048 .fp-entries{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin-bottom:4px;touch-action:none}
.g-flipper-2048 .fp-entry{position:relative;display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:46px;padding:0;border:2px solid var(--ink);border-radius:6px 6px 14px 14px;background:#fff9ed;touch-action:none;transition:transform .12s,background-color .12s}
.g-flipper-2048 .fp-entry-num{font:800 15px ui-monospace,monospace}
.g-flipper-2048 .fp-entry .fp-marble{display:none}
.g-flipper-2048 .fp-entry[aria-pressed="true"]{background:var(--yellow);box-shadow:inset 0 -3px var(--blue);transform:translateY(2px)}
.g-flipper-2048 .fp-entry[aria-pressed="true"] .fp-entry-num{position:absolute;top:1px;left:4px;font-size:10px}
.g-flipper-2048 .fp-entry[aria-pressed="true"] .fp-marble{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--color);border:2px solid var(--ink);font:800 12px ui-monospace,monospace;font-style:normal;overflow:hidden}
.g-flipper-2048 .fp-entry[aria-pressed="true"] .fp-marble.fp-stone{color:transparent;background:#9b9285;border-radius:44% 56% 48% 52%/52% 44% 56% 48%}
.g-flipper-2048 .fp-entry.danger{background:#ffd9cf}.g-flipper-2048 .fp-entry[aria-pressed="true"].danger{background:#f7a593;box-shadow:inset 0 -3px var(--red)}
.g-flipper-2048 .fp-entry:disabled{cursor:default}
.g-flipper-2048 .fp-entry:not([aria-pressed="true"])::after{content:'';position:absolute;bottom:6px;left:50%;width:8px;height:8px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:translateX(-50%) rotate(45deg)}
.g-flipper-2048 .fp-entry:not([aria-pressed="true"]) .fp-entry-num{margin-bottom:8px}
.g-flipper-2048 .fp-board{position:relative;width:100%;aspect-ratio:600/570;border-radius:8px;overflow:hidden;touch-action:manipulation}
.g-flipper-2048 .fp-canvas{position:absolute;inset:0;width:100%!important;height:100%!important;display:block}
.g-flipper-2048 .fp-loading{position:absolute;inset:0;display:grid;place-items:center;margin:0;color:var(--muted);font-size:13px;background:#fff4dc}
.g-flipper-2048 .fp-loading.fp-error{color:#a33224;padding:20px;text-align:center}

.g-flipper-2048 .fp-prediction{display:flex;align-items:center;margin:8px 0 0;padding:5px 9px;min-height:36px;border:1.5px dashed #8cba67;background:#f3f5e9;font-size:12px;line-height:1.35}
.g-flipper-2048 .fp-prediction.danger{color:#a33224;border-color:var(--red);background:#fff0e9;font-weight:700}
.g-flipper-2048 .fp-prediction.combo{border-color:var(--pink);background:#fdeef3}
.g-flipper-2048 .fp-foot{display:flex;align-items:center;gap:12px;margin:10px 0}.g-flipper-2048 .fp-foot p{flex:1;font-size:12px;color:var(--muted);margin:0;min-height:40px}
.g-flipper-2048 .fp-primary{padding:10px 12px;min-height:44px;background:var(--yellow);border:2px solid var(--ink);box-shadow:3px 3px var(--ink);font-weight:800;flex:none}.g-flipper-2048 .fp-primary:disabled{opacity:.45;cursor:default}
.g-flipper-2048 .fp-restart{min-height:44px;padding:8px 10px;background:var(--paper);border:2px solid var(--ink);font-size:12px}.g-flipper-2048 .fp-restart:disabled{opacity:.5;cursor:default}
.g-flipper-2048 .fp-over,.g-flipper-2048 .fp-tour{position:absolute;inset:0;z-index:8;display:grid;place-items:center;padding:16px;background:#fff9edc7;backdrop-filter:blur(2px)}
.g-flipper-2048 .fp-tour{place-items:end center;background:linear-gradient(#fff9ed00 30%,#fff9edd9 60%);backdrop-filter:none}
.g-flipper-2048 .fp-card{width:min(100%,320px);padding:20px 18px;text-align:center;background:var(--paper);border:2px solid var(--ink);box-shadow:6px 6px var(--ink);animation:fp-card .28s cubic-bezier(.2,1.4,.4,1)}
.g-flipper-2048 .fp-card h2{margin:6px 0;font-size:24px}.g-flipper-2048 .fp-card p{font-size:13px;margin:6px 0 10px}.g-flipper-2048 .fp-card .fp-primary{width:100%}
.g-flipper-2048 .fp-record{color:var(--pink);font-weight:800}
.g-flipper-2048 .fp-tour .fp-card{text-align:left}.g-flipper-2048 .fp-tour h2{font-size:20px}
.g-flipper-2048 .fp-tour-actions{display:flex;gap:10px}.g-flipper-2048 .fp-tour-actions .fp-primary{flex:1;width:auto}
.g-flipper-2048 .fp-help{font-size:12px;color:var(--muted)}
.g-flipper-2048 .fp-help summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700}
.g-flipper-2048 .fp-help p{margin:6px 0;line-height:1.55}.g-flipper-2048 .fp-keys{font-size:10px}
.g-flipper-2048 .fp-settings{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:10px 0;color:var(--ink)}
.g-flipper-2048 .fp-settings label{display:flex;align-items:center;gap:6px;min-height:40px;cursor:pointer}.g-flipper-2048 .fp-settings input{width:18px;height:18px;accent-color:var(--blue)}
.g-flipper-2048 .fp-link{min-height:40px;padding:0;background:none;border:0;text-decoration:underline;color:var(--blue)}
@keyframes fp-bump{40%{transform:scale(1.25)}}
@keyframes fp-card{from{transform:translateY(12px) scale(.96);opacity:0}}

.g-flipper-2048[data-compact="true"]{padding:6px 8px 8px}
.g-flipper-2048[data-compact="true"] .fp-head{align-items:center;margin-bottom:6px;gap:8px}
.g-flipper-2048[data-compact="true"] .fp-head .fp-eyebrow,.g-flipper-2048[data-compact="true"] h1 span{display:none}
.g-flipper-2048[data-compact="true"] h1{margin:0;font-size:18px;letter-spacing:0;white-space:nowrap}
.g-flipper-2048[data-compact="true"] .fp-scores{gap:6px}
.g-flipper-2048[data-compact="true"] .fp-scores>div{display:flex;align-items:center;gap:5px;min-width:0;padding:2px 6px;box-shadow:1px 1px var(--ink)}
.g-flipper-2048[data-compact="true"] .fp-scores strong{font-size:15px}
.g-flipper-2048[data-compact="true"] .fp-deal{gap:9px;margin-bottom:6px}
.g-flipper-2048[data-compact="true"] .fp-orb{width:38px;height:38px;font-size:15px;box-shadow:2px 2px var(--ink)}
.g-flipper-2048[data-compact="true"] .fp-orb-sm{width:28px;height:28px;font-size:11px}
.g-flipper-2048[data-compact="true"] .fp-deal small{font-size:10px}
.g-flipper-2048[data-compact="true"] .fp-pips i{width:8px;height:8px;border-width:1.5px}
.g-flipper-2048[data-compact="true"] .fp-stage{padding:3px;box-shadow:2px 2px var(--ink)}
.g-flipper-2048[data-compact="true"] .fp-entries{gap:3px;margin-bottom:3px}
.g-flipper-2048[data-compact="true"] .fp-entry{min-height:44px}
.g-flipper-2048[data-compact="true"] .fp-prediction{margin-top:5px;min-height:34px;padding:3px 7px;font-size:11.5px}
.g-flipper-2048[data-compact="true"] .fp-foot{margin:4px 0 0;justify-content:flex-end;min-height:44px}
.g-flipper-2048[data-compact="true"] .fp-foot>p{position:absolute;width:1px;height:1px;min-height:0;overflow:hidden;clip-path:inset(50%)}
.g-flipper-2048[data-compact="true"] .fp-foot>#fpDrop{display:none}
.g-flipper-2048[data-compact="true"] .fp-restart{min-width:96px;font-size:13px}
.g-flipper-2048[data-compact="true"] .fp-help{position:relative;margin-top:-44px;max-width:calc(100% - 104px);font-size:13px}
.g-flipper-2048[data-compact="true"] .fp-help[open]{max-width:none}
.g-flipper-2048[data-compact="true"] .fp-help[open] summary{width:calc(100% - 104px)}
.g-flipper-2048[data-compact="true"] .fp-keys{display:none}
.g-flipper-2048[data-compact="true"] .fp-card{padding:14px 14px}
/* Desktop: wrappers are transparent unless the host is wide (>= 900px), then board left, panel right. */
.g-flipper-2048 .fp-side,.g-flipper-2048 .fp-main{display:contents}
.g-flipper-2048[data-compact="false"][data-wide="false"]{max-width:600px}
.g-flipper-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-flipper-2048[data-wide="true"] .fp-side,.g-flipper-2048[data-wide="true"] .fp-main{display:block;min-width:0}
.g-flipper-2048[data-wide="true"] .fp-main{grid-column:1;grid-row:1/3;align-self:start}
.g-flipper-2048[data-wide="true"] .fp-side-top{grid-column:2;grid-row:1}
.g-flipper-2048[data-wide="true"] .fp-side-bottom{grid-column:2;grid-row:2;align-self:start}
.g-flipper-2048[data-wide="true"] .fp-stage{width:min(100%,calc(clamp(495px,calc(100vh - 300px),820px) / 0.95 + 20px));margin:0 auto;padding:8px;box-shadow:6px 6px var(--ink)}
.g-flipper-2048[data-wide="true"] .fp-entries{gap:6px;margin-bottom:6px}
.g-flipper-2048[data-wide="true"] .fp-entry{min-height:54px}
.g-flipper-2048[data-wide="true"] .fp-entry-num{font-size:18px}
.g-flipper-2048[data-wide="true"] .fp-entry[aria-pressed="true"] .fp-marble{width:40px;height:40px;font-size:14px}
.g-flipper-2048[data-wide="true"] h1{font-size:34px}
.g-flipper-2048[data-wide="true"] .fp-deal{flex-wrap:wrap;gap:12px 14px;margin-bottom:12px;font-size:12px}
.g-flipper-2048[data-wide="true"] .fp-deal small{font-size:12px}
.g-flipper-2048[data-wide="true"] .fp-orb{width:58px;height:58px;font-size:22px}
.g-flipper-2048[data-wide="true"] .fp-orb-sm{width:40px;height:40px;font-size:15px}
.g-flipper-2048[data-wide="true"] .fp-prediction{margin-top:4px;font-size:14px;padding:10px 12px;min-height:64px}
.g-flipper-2048[data-wide="true"] .fp-foot{flex-wrap:wrap}
.g-flipper-2048[data-wide="true"] .fp-foot>p{flex:1 0 100%;font-size:13px;min-height:0}
.g-flipper-2048[data-wide="true"] .fp-foot .fp-primary{flex:1;min-height:52px;font-size:16px}
.g-flipper-2048[data-wide="true"] .fp-restart{min-height:52px;padding:8px 14px;font-size:13px}
.g-flipper-2048[data-wide="true"] .fp-help{font-size:13px}
.g-flipper-2048[data-wide="true"] .fp-card{width:min(100%,360px)}
@media(pointer:coarse){.g-flipper-2048 .fp-keys{display:none}}
@media(prefers-reduced-motion:reduce){.g-flipper-2048 *{animation:none!important;transition:none!important}}
