:root{--bg: #0f172a;--panel: #1e293b;--panel2: #334155;--text: #f8fafc;--muted: #94a3b8;--accent: #6366f1;--accent2: #22c55e;color-scheme:dark}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overscroll-behavior:none}.app{max-width:480px;margin:0 auto;min-height:100%;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 16px env(safe-area-inset-bottom)}.center{flex:1;display:flex;flex-direction:column;justify-content:center;gap:16px;padding:24px 0}h1{font-size:28px;margin:0 0 4px}.muted{color:var(--muted);font-size:14px}button{font:inherit;border:none;border-radius:12px;padding:14px 18px;background:var(--accent);color:#fff;font-weight:600;cursor:pointer}button:disabled{opacity:.5}button.secondary{background:var(--panel2)}button.ghost{background:transparent;color:var(--muted);padding:8px}input{font:inherit;border:none;border-radius:12px;padding:14px;background:var(--panel);color:var(--text);width:100%}.card{background:var(--panel);border-radius:16px;padding:18px}.topbar{display:flex;justify-content:space-between;align-items:center;padding:12px 0}.stat{display:flex;gap:16px}.stat b{font-size:18px}.board{background:var(--panel2);border-radius:12px;padding:8px;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;aspect-ratio:1;touch-action:none;-webkit-user-select:none;user-select:none}.tile{display:flex;align-items:center;justify-content:center;border-radius:8px;background:#475569;font-weight:800;font-size:clamp(16px,6vw,30px);aspect-ratio:1}.tile.v0{background:#3b4759}.tile.v2{background:#64748b}.tile.v4{background:#7c86a0}.tile.v8{background:#f59e0b}.tile.v16{background:#f97316}.tile.v32{background:#ef4444}.tile.v64{background:#dc2626}.tile.v128{background:#eab308;font-size:clamp(14px,5.5vw,26px)}.tile.v256{background:#ca8a04;font-size:clamp(14px,5.5vw,26px)}.tile.v512{background:#16a34a;font-size:clamp(14px,5.5vw,26px)}.tile.v1024{background:#059669;font-size:clamp(12px,5vw,22px)}.tile.v2048{background:#6366f1;font-size:clamp(12px,5vw,22px)}.banner{border-radius:12px;padding:14px;text-align:center;font-weight:700}.banner.win{background:#22c55e33;color:#4ade80}.banner.info{background:#6366f133;color:#a5b4fc}.error{color:#f87171;font-size:14px}.notice{background:#f59e0b1f;color:#fcd34d;border-radius:12px;padding:12px 14px;font-size:14px;line-height:1.5}.cat-title{font-size:13px;color:var(--muted);margin:0 0 6px}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{background:var(--panel);color:var(--text);padding:8px 14px;border-radius:999px;font-size:14px;font-weight:500;border:2px solid transparent}.chip.on{background:#6366f133;border-color:var(--accent);color:#c7d2fe}.ad{background:var(--panel2);border:1px dashed var(--muted);border-radius:12px;min-height:64px;display:flex;align-items:center;justify-content:center;margin:16px 0}.result-img{width:100%;border-radius:12px;margin-top:12px;display:block}.gallery-root{position:fixed;top:0;right:0;bottom:0;left:0;max-width:480px;margin:0 auto;background:#000;overflow:hidden}.gallery-scroll{height:100%;overflow-y:scroll;scroll-snap-type:y mandatory;scrollbar-width:none}.gallery-scroll::-webkit-scrollbar{display:none}.gallery-topbar{position:absolute;top:0;left:0;right:0;z-index:10;display:flex;align-items:center;gap:8px;padding:calc(env(safe-area-inset-top) + 8px) 12px 24px;background:linear-gradient(to bottom,rgba(0,0,0,.6),transparent);pointer-events:none}.gallery-topbar>*{pointer-events:auto}.mode-tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}.mode-tab{background:#ffffff1f;color:var(--text);padding:6px 14px;border-radius:999px;font-size:14px;font-weight:600;white-space:nowrap}.mode-tab.on{background:var(--accent)}.slide{height:100dvh;scroll-snap-align:start;position:relative;display:flex;align-items:center;justify-content:center}.slide-img{width:100%;height:100%;object-fit:contain;display:block}.gallery-msg{color:var(--muted);text-align:center;padding:0 24px}.slide-ad{background:var(--bg)}.slide-actions{position:absolute;right:12px;bottom:96px;display:flex;flex-direction:column;gap:16px;z-index:5}.icon-btn{background:transparent;padding:0;display:flex;flex-direction:column;align-items:center;gap:2px}.icon-btn .icon{font-size:34px;filter:drop-shadow(0 1px 3px rgba(0,0,0,.7))}.icon-btn .count{font-size:13px;font-weight:700;text-shadow:0 1px 3px rgba(0,0,0,.8)}.slide-tags{position:absolute;left:12px;right:72px;bottom:24px;display:flex;flex-wrap:wrap;gap:6px;z-index:5}.tag-chip{background:#00000073;color:#fff;padding:6px 12px;border-radius:999px;font-size:13px;font-weight:600;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.tag-chip.locked{color:#cbd5e1;border:1px solid rgba(255,255,255,.4)}.toast{position:fixed;left:50%;bottom:40px;transform:translate(-50%);background:#000000d9;color:#fff;padding:10px 18px;border-radius:999px;font-size:14px;z-index:20;max-width:90%;text-align:center}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:flex-end;justify-content:center;z-index:30}.sheet{background:var(--panel);width:100%;max-width:480px;border-radius:16px 16px 0 0;padding:16px 16px calc(env(safe-area-inset-bottom) + 16px);display:flex;flex-direction:column;gap:10px}.sheet-title{text-align:center;font-weight:700;padding:4px 0 8px}.ad-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#000000eb;display:flex;flex-direction:column;padding:calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px)}.ad-close{align-self:flex-end;background:#ffffff26;width:40px;height:40px;border-radius:999px;padding:0;font-size:18px}.ad-stage{flex:1;margin:12px 0;border:1px dashed var(--muted);border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.ad-badge{background:var(--panel2);color:var(--muted);padding:4px 12px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.1em}.ad-foot{min-height:52px;display:flex;align-items:center}.gen-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#0f172ae6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;font-weight:600}.spinner{width:44px;height:44px;border-radius:999px;border:4px solid var(--panel2);border-top-color:var(--accent);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
