:root{--bg:#0f172a;--surface:#1e293b;--surface-2:#273449;--text:#f1f5f9;--muted:#94a3b8;--accent:#f97316;--accent-text:#111827;--blue:#3b82f6;--danger:#f87171;--warn-bg:#3b2a10;--radius:12px;--tap:44px;--safe-bottom:env(safe-area-inset-bottom,0px);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body{background:var(--bg);height:100%;color:var(--text);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}h1,h2,h3{margin:.4em 0}h2{font-size:1.05rem}h3{color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-top:1.2em;font-size:.85rem}a{color:inherit}.muted{color:var(--muted)}.small{font-size:.82rem}.center{text-align:center;place-content:center;gap:1rem;min-height:60vh;display:grid}.btn{min-height:var(--tap);min-width:var(--tap);background:var(--surface-2);color:var(--text);font:inherit;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;border:1px solid #334155;border-radius:10px;justify-content:center;align-items:center;gap:6px;padding:0 14px;font-size:.95rem;font-weight:600;text-decoration:none;display:inline-flex}.btn:disabled{opacity:.4;cursor:default}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.btn.on{background:#1d4ed8;border-color:#3b82f6}.btn.danger{color:var(--danger)}.btn.icon{padding:0;font-size:1.2rem}.btn.wide{min-width:64px}.btn.small{min-height:36px;padding:0 10px;font-size:.85rem}.btn.big{width:100%;min-height:56px;font-size:1.1rem}select.btn{appearance:none;padding:0 12px}.chip{background:var(--surface-2);min-height:40px;color:var(--text);font:inherit;cursor:pointer;white-space:nowrap;touch-action:manipulation;border:1px solid #334155;border-radius:999px;padding:0 14px;font-size:.9rem;font-weight:600;position:relative}.chip.active{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.chip.add{background:0 0;border-style:dashed}.chip.ghost{background:0 0}.chip:disabled{opacity:.4}.chip .dot{background:#ef4444;border-radius:50%;width:8px;height:8px;position:absolute;top:4px;right:4px}.input{width:100%;min-height:40px;color:var(--text);font:inherit;background:#0b1220;border:1px solid #334155;border-radius:8px;padding:8px 10px;font-size:16px}textarea.input{resize:vertical}.field{color:var(--muted);gap:4px;font-size:.82rem;display:grid}.row{align-items:center;gap:8px;display:flex}.row.wrap{flex-wrap:wrap}.grow{flex:1}.link{color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;padding:0;text-decoration:underline}.card{background:var(--surface);border-radius:var(--radius);gap:10px;padding:12px;display:grid}.card p{margin:0}.card.warn{background:var(--warn-bg);border:1px solid #a16207}.hint{gap:6px;display:grid}.banner.error{background:#7f1d1d;padding:8px 12px;font-size:.85rem}.home{max-width:640px;padding:16px 16px calc(32px + var(--safe-bottom));gap:16px;margin:0 auto;display:grid}.home-head h1{margin-bottom:0;font-size:1.8rem}.home-head p{color:var(--muted);margin:4px 0 0}.template-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px;display:grid}.play-list{gap:8px;margin:0;padding:0;list-style:none;display:grid}.play-item{background:var(--surface);border-radius:var(--radius);align-items:center;gap:8px;padding:8px;display:flex}.play-link{min-height:var(--tap);flex:1;align-items:center;gap:12px;text-decoration:none;display:flex}.play-link>span{gap:2px;display:grid}.thumb{border-radius:6px;flex:none;width:72px;line-height:0;overflow:hidden}.thumb svg{width:100%;height:auto}.editor,.viewer-page{flex-direction:column;height:100dvh;display:flex;overflow:hidden}.topbar{padding:6px 8px;padding-top:max(6px, env(safe-area-inset-top));background:var(--bg);border-bottom:1px solid #1f2a3d;align-items:center;gap:6px;display:flex}.topbar .btn.icon{background:0 0;border:none}.topbar .title{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:1.05rem;overflow:hidden}.title-input{min-width:0;color:var(--text);font:inherit;background:0 0;border:1px solid #0000;border-radius:8px;flex:1;padding:8px;font-size:16px;font-weight:700}.title-input:focus{border-color:#334155;outline:none}.stage{flex-direction:column;flex:1;min-height:0;display:flex}.court-area{height:min(64dvh, calc(100vw * var(--court-aspect,.8)));flex-direction:column;flex:none;display:flex;position:relative}.editor-canvas{flex:1;min-height:0;display:flex;position:relative}.court-wrap{flex:1;justify-content:center;align-items:center;min-width:0;min-height:0;display:flex;overflow:hidden}.court-wrap svg{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.mode-move{cursor:grab}.mode-draw{cursor:crosshair}.zoom-controls{opacity:.85;gap:4px;display:flex;position:absolute;bottom:6px;right:6px}.correction{background:#0f172aeb;border-radius:999px;gap:6px;max-width:calc(100% - 12px);padding:6px;display:flex;position:absolute;top:6px;left:50%;overflow-x:auto;transform:translate(-50%);box-shadow:0 4px 16px #0006}.panel{flex:1;align-content:start;gap:8px;min-height:0;padding:8px 8px 12px;display:grid;overflow-y:auto}.phasebar{align-items:flex-start;gap:6px;display:flex}.phase-list{scrollbar-width:thin;flex:1;gap:6px;min-width:0;padding-bottom:4px;display:flex;overflow-x:auto}.phasebar .chip.add{flex:none}.toolbar-wrap{position:relative}.toolbar{padding:8px;padding-bottom:calc(8px + var(--safe-bottom));background:var(--bg);border-top:1px solid #1f2a3d;align-items:center;gap:6px;display:flex}.toolbar .btn.primary{margin-left:auto}.segmented{border:1px solid #334155;border-radius:10px;display:flex;overflow:hidden}.segmented button{min-height:var(--tap);background:var(--surface-2);color:var(--text);font:inherit;cursor:pointer;touch-action:manipulation;border:none;padding:0 12px;font-weight:600}.segmented button.on{background:var(--accent);color:var(--accent-text)}.popover{background:var(--surface);border-radius:var(--radius);z-index:5;flex-wrap:wrap;gap:6px;padding:10px;display:flex;position:absolute;bottom:100%;left:8px;right:8px;box-shadow:0 -6px 24px #00000073}.player{min-height:0;padding:0 8px calc(8px + var(--safe-bottom));flex-direction:column;flex:1;gap:8px;display:flex}.player-court{flex:1;min-height:0;display:flex}.player-court .court-wrap{align-items:flex-start}.player-caption{gap:2px;min-height:2.8em;font-size:.95rem;display:grid}.scrub{width:100%;accent-color:var(--accent);height:28px}.controls{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.sheet-backdrop{z-index:20;background:#00000080;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.sheet{background:var(--surface);width:100%;max-width:560px;max-height:85dvh;padding:12px 16px calc(16px + var(--safe-bottom));border-radius:16px 16px 0 0;overflow-y:auto}.sheet-head{justify-content:space-between;align-items:center;display:flex}.sheet details{margin-top:10px}.sheet summary{cursor:pointer;align-items:center;min-height:36px;display:flex}.action-list{gap:4px;margin:0;padding:0;list-style:none;display:grid}.action-row{background:#0b1220;border:1px solid #0000;border-radius:8px;align-items:center;gap:4px;display:flex}.action-row.selected{border-color:var(--blue);background:#13233f}.action-row.hidden{opacity:.55}.action-text{min-height:40px;color:var(--text);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;flex:1;align-items:center;gap:8px;padding:6px 10px;font-size:.92rem;display:flex}.action-text .dot{background:#ef4444;border-radius:50%;flex:none;width:8px;height:8px}.action-row .btn.icon{color:var(--muted);background:0 0;border:none}.account-bar{background:var(--surface);border-radius:var(--radius);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:8px 10px;display:flex}.sync-dot{background:var(--muted);border-radius:50%;flex:none;width:12px;height:12px;margin:0 8px}.sync-dot.synced{background:#22c55e}.sync-dot.syncing{background:#facc15}.sync-dot.offline,.sync-dot.error{background:#f97316}.sync-dot.local{border:2px solid var(--muted);background:0 0}@media (min-width:900px) and (min-aspect-ratio:1){.stage{flex-direction:row}.court-area{flex:1;height:auto}.phase-list{flex-wrap:wrap;overflow-x:visible}.panel{border-left:1px solid #1f2a3d;flex:0 0 360px}.toolbar{justify-content:center}.toolbar .btn.primary{margin-left:24px}.popover{max-width:560px;left:50%;right:auto;transform:translate(-50%)}.player{width:100%;max-width:900px;margin:0 auto}}
