:root{--bg: #f5f3ef;--surface: rgba(255, 253, 249, .95);--surface-solid: #fffdf9;--border: rgba(74, 66, 56, .12);--text: #3a3630;--text-muted: #7d7569;--star: #e8b339;--green: #2e8b63;--orange: #e27d3b;--danger: #b5454c;--shadow-sm: 0 4px 14px rgba(58, 54, 48, .08);--shadow-md: 0 12px 32px rgba(58, 54, 48, .14);--radius-sm: 12px;--radius-md: 18px;--radius-lg: 26px}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#root{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--text);font-family:Inter,Hiragino Kaku Gothic ProN,Hiragino Sans,Yu Gothic,sans-serif;user-select:none;-webkit-user-select:none;touch-action:none}.ios-top-blur-fix{position:fixed;top:0;left:0;right:0;height:11px;z-index:2147483647;pointer-events:none;background-color:var(--bg);-webkit-background-clip:text;background-clip:text}button{font-family:inherit;color:inherit;border:none;background:none;cursor:pointer;padding:0;transition:transform .12s ease,opacity .15s ease,background-color .15s ease}button:active:not(:disabled){transform:scale(.94)}button:disabled{opacity:.36;cursor:default}.screen{position:relative;width:100%;height:100%;overflow:hidden}.icon-circle-btn{position:relative;width:44px;height:44px;border-radius:50%;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow-sm);display:inline-flex;align-items:center;justify-content:center;color:var(--text);flex-shrink:0}.icon-circle-danger{color:var(--danger)}.icon-circle-hint{color:#8a5a12;background:#fff9eb;border-color:#e8b3396b}.hint-badge{position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:var(--star);color:#fffdf9;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center}.star-inline{color:var(--star);flex-shrink:0}.title-diorama{position:absolute;inset:0;z-index:0}.title-top-actions{position:absolute;top:calc(14px + env(safe-area-inset-top,0px));right:calc(14px + env(safe-area-inset-right,0px));z-index:10;display:flex;gap:10px}.title-card-wrap{position:absolute;left:0;right:0;bottom:calc(20px + env(safe-area-inset-bottom,0px));z-index:10;display:flex;justify-content:center;padding:0 16px;pointer-events:none}.title-card{width:100%;max-width:340px;background:var(--surface);backdrop-filter:blur(10px);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:20px 18px 18px;display:flex;flex-direction:column;align-items:center;gap:14px;pointer-events:auto}.title-brand{text-align:center;cursor:pointer}.title-eyebrow{font-size:10px;font-weight:800;letter-spacing:.14em;color:var(--text-muted)}.title-logo{margin:4px 0;font-size:24px;font-weight:800;letter-spacing:-.02em;color:var(--text)}.title-sub{margin:0;font-size:12px;color:var(--text-muted)}.title-play-wrap{display:flex;flex-direction:column;align-items:center;gap:6px}.title-play-btn{width:84px;height:84px;border-radius:50%;background:var(--green);color:#fffdf9;box-shadow:0 10px 24px #2e8b6357;display:flex;align-items:center;justify-content:center}.title-play-caption{font-size:13px;font-weight:700;color:var(--green)}.title-sub-pills{width:100%;display:flex;gap:10px}.pill-btn{flex:1;height:44px;padding:0 14px;border-radius:999px;font-size:13px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}.pill-lg{height:48px;font-size:14px;padding:0 18px}.pill-neutral{background:var(--surface-solid);border:1px solid var(--border);box-shadow:var(--shadow-sm);color:var(--text)}.pill-random{background:#fbf7ef;border:1.5px solid rgba(226,125,59,.34);color:#8a4b1f;box-shadow:var(--shadow-sm)}.pill-green{background:var(--green);color:#fffdf9;box-shadow:0 8px 18px #2e8b6347}.pill-count{display:inline-flex;align-items:center;gap:2px;font-size:11px;color:var(--text-muted)}.select-screen,.random-screen{display:flex;flex-direction:column;background:var(--bg)}.select-header{display:flex;align-items:center;justify-content:space-between;padding:calc(12px + env(safe-area-inset-top,0px)) calc(16px + env(safe-area-inset-right,0px)) 10px calc(16px + env(safe-area-inset-left,0px));flex-shrink:0}.select-header-title{font-size:17px;font-weight:800;display:inline-flex;align-items:center;gap:6px}.star-pill{height:36px;padding:0 12px;border-radius:999px;background:var(--surface-solid);border:1px solid var(--border);box-shadow:var(--shadow-sm);font-size:13px;font-weight:800;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}.mode-toggle-wrap{padding:0 16px 10px;display:flex;flex-direction:column;align-items:center;gap:6px;flex-shrink:0}.mode-toggle{display:inline-flex;background:#e8e3da;border-radius:999px;padding:3px;gap:3px}.mode-toggle.compact{align-self:center}.mode-toggle-btn{height:34px;padding:0 18px;border-radius:999px;font-size:13px;font-weight:700;color:var(--text-muted);white-space:nowrap}.mode-toggle-btn.active{background:var(--text);color:#fffdf9;box-shadow:0 2px 8px #3a36302e}.mode-toggle-desc{margin:0;font-size:11.5px;color:var(--text-muted);text-align:center}.select-scroll{flex:1;overflow-y:auto;touch-action:pan-y;-webkit-overflow-scrolling:touch;padding:6px calc(16px + env(safe-area-inset-right,0px)) calc(28px + env(safe-area-inset-bottom,0px)) calc(16px + env(safe-area-inset-left,0px))}.difficulty-section{max-width:720px;margin:0 auto 22px}.section-heading{display:flex;align-items:center;gap:8px;margin-bottom:10px}.section-stars{display:inline-flex;gap:2px}.section-label{font-size:14px;font-weight:800;color:var(--text)}.stage-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px}.stage-card{background:var(--surface-solid);border:1.5px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:8px;display:flex;flex-direction:column;align-items:center;gap:4px;min-height:122px}.stage-card.cleared-green{background:linear-gradient(180deg,#fffdf9,#eff8f3);border-color:#2e8b636b}.stage-card.cleared-gold{background:linear-gradient(180deg,#fffdf9,#fdf6e3);border-color:#e8b3398f}.stage-card-top{width:100%;display:flex;align-items:center;justify-content:space-between}.stage-num-badge{width:22px;height:22px;border-radius:50%;background:#ede9e1;color:var(--text-muted);font-size:11px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}.stage-clear-badge{width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fffdf9}.badge-green{background:var(--green)}.badge-gold{background:var(--star)}.stage-card-preview{width:100%;height:62px;display:flex;align-items:center;justify-content:center}.stage-preview-svg{width:100%;height:100%}.stage-card-title{font-size:11.5px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.stage-card-random{background:#fbf7ef;border:1.5px dashed rgba(226,125,59,.48);color:#8a4b1f;justify-content:center;gap:8px}.random-card-label{font-size:12px;font-weight:800}.random-body{flex:1;max-width:440px;width:100%;margin:0 auto;padding:6px 16px calc(24px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:14px}.diff-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.diff-tab{background:var(--surface-solid);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 4px;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--text-muted)}.diff-tab.active{background:var(--text);border-color:var(--text);color:#fffdf9}.diff-tab-stars{display:inline-flex;gap:1px;color:var(--star)}.diff-tab-label{font-size:11px;font-weight:700;white-space:nowrap}.random-preview-card{position:relative;flex:1;min-height:200px;background:#efece6;border:1px solid var(--border);border-radius:var(--radius-lg);display:flex;align-items:center;justify-content:center;padding:18px}.random-preview-svg{width:100%;height:100%;max-height:280px}.random-piece-badge{position:absolute;right:12px;bottom:12px;padding:4px 10px;border-radius:999px;background:var(--surface);border:1px solid var(--border);font-size:11.5px;font-weight:700;color:var(--text-muted)}.random-actions{display:flex;gap:10px}.play-canvas-wrap{position:absolute;inset:0;z-index:0}.play-hud{position:absolute;inset:0;z-index:10;pointer-events:none;display:flex;flex-direction:column;justify-content:space-between}.play-top-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:calc(12px + env(safe-area-inset-top,0px)) calc(12px + env(safe-area-inset-right,0px)) 0 calc(12px + env(safe-area-inset-left,0px))}.hud-col{display:flex;flex-direction:column;gap:8px;pointer-events:auto}.sample-card{pointer-events:auto;width:min(172px,48vw);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:6px 10px 8px;display:flex;flex-direction:column;gap:4px;transition:width .2s ease,transform .12s ease}.sample-card.expanded{width:min(290px,72vw);box-shadow:var(--shadow-md)}.sample-card-header{display:flex;align-items:center;justify-content:space-between;gap:6px}.sample-card-title{font-size:12px;font-weight:800;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sample-mode-tag{font-size:10px;font-weight:700;padding:2px 6px;border-radius:999px;background:#ede9e1;color:var(--text-muted);white-space:nowrap}.sample-card-body{width:100%;height:82px;background:#efece6;border-radius:10px;padding:4px;display:flex;align-items:center;justify-content:center}.sample-card.expanded .sample-card-body{height:170px}.sample-preview-svg{width:100%;height:100%}.play-bottom-dock{display:flex;flex-direction:column;align-items:center;gap:8px;padding:0 calc(10px + env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) calc(10px + env(safe-area-inset-left,0px))}.piece-tray{pointer-events:auto;width:100%;max-width:440px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:6px;display:grid;grid-template-columns:repeat(6,1fr);gap:4px}.tray-piece-btn{height:50px;border-radius:12px;background:#f5f2eb;display:flex;align-items:center;justify-content:center;padding:4px}.tray-piece-btn:hover{background:#ece7dc}.tray-piece-svg{width:100%;height:100%;max-width:44px;max-height:40px}.play-toolbar{pointer-events:auto;background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow-sm);padding:4px 6px;display:inline-flex;gap:4px}.tool-btn{min-width:56px;height:46px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--text)}.tool-btn:hover:not(:disabled){background:#3a36300f}.tool-btn span{font-size:10px;font-weight:700;white-space:nowrap}.tool-btn-jog{position:relative;touch-action:none}.tool-btn-jog.scrubbing{background:var(--text);color:#fffdf9;transform:scale(1.04)}.jog-hint-pill{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translate(-50%);padding:4px 10px;border-radius:999px;background:var(--text);color:#fffdf9;font-size:11px!important;font-weight:800;box-shadow:var(--shadow-sm);pointer-events:none;white-space:nowrap}.piece-delete-chip{width:30px;height:30px;border-radius:50%;background:#fffdf9;color:var(--danger);border:1.5px solid rgba(181,69,76,.36);box-shadow:0 4px 12px #3a36302e;display:inline-flex;align-items:center;justify-content:center;pointer-events:auto;animation:chipPop .16s cubic-bezier(.22,1,.36,1)}.piece-delete-chip:hover{background:#fdf0f0}@keyframes chipPop{0%{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}.clear-overlay{position:absolute;inset:0;z-index:30;pointer-events:none;display:flex;align-items:flex-end;justify-content:center;padding:16px 16px calc(22px + env(safe-area-inset-bottom,0px))}.clear-card{pointer-events:auto;width:100%;max-width:320px;background:var(--surface);backdrop-filter:blur(10px);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:18px 20px 20px;display:flex;flex-direction:column;align-items:center;gap:12px;animation:popUp .28s cubic-bezier(.22,1,.36,1)}@keyframes popUp{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}.clear-stars{display:flex;align-items:flex-end;gap:6px;color:var(--star)}.clear-title{font-size:18px;font-weight:800;color:var(--text)}.clear-actions{display:flex;align-items:center;gap:16px}.circle-primary-btn{width:76px;height:76px;border-radius:50%;background:var(--green);color:#fffdf9;box-shadow:0 10px 22px #2e8b6352;display:inline-flex;align-items:center;justify-content:center}.circle-sub-btn{width:56px;height:56px;border-radius:50%;background:var(--surface-solid);border:1px solid var(--border);box-shadow:var(--shadow-sm);color:var(--text);display:inline-flex;align-items:center;justify-content:center}.modal-backdrop{position:fixed;inset:0;z-index:50;pointer-events:auto;background:#3a363057;backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;padding:20px}.modal-card{width:100%;max-width:340px;background:var(--surface-solid);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:22px 20px 20px;display:flex;flex-direction:column;align-items:center;gap:14px}.modal-title{margin:0;font-size:18px;font-weight:800}.modal-sub{margin:0;font-size:13px;color:var(--text-muted);text-align:center;line-height:1.5}.howto-list{width:100%;display:flex;flex-direction:column;gap:10px}.howto-item{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:14px;background:#f7f4ee}.howto-badge{width:36px;height:36px;border-radius:11px;color:#fffdf9;display:flex;align-items:center;justify-content:center;flex-shrink:0}.howto-green .howto-badge{background:var(--green)}.howto-orange .howto-badge{background:var(--orange)}.howto-blue .howto-badge{background:#3a66b0}.howto-head{font-size:13px;font-weight:800;margin-bottom:2px}.howto-desc{font-size:11.5px;color:var(--text-muted);line-height:1.4}.reset-icon-circle{width:52px;height:52px;border-radius:50%;background:#fdf0f0;color:var(--danger);display:flex;align-items:center;justify-content:center}.modal-actions{width:100%;display:flex;gap:10px}.btn-dark-pill,.btn-soft-pill,.btn-danger-pill{flex:1;height:44px;padding:0 18px;border-radius:999px;font-size:14px;font-weight:800;white-space:nowrap}.btn-dark-pill{background:var(--text);color:#fffdf9;width:100%}.btn-soft-pill{background:#ede9e1;color:var(--text)}.btn-danger-pill{background:var(--danger);color:#fffdf9}.editor-top-panel{pointer-events:auto;margin:calc(10px + env(safe-area-inset-top,0px)) calc(10px + env(safe-area-inset-right,0px)) 0 calc(10px + env(safe-area-inset-left,0px));background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:8px 10px;display:flex;flex-direction:column;gap:8px;max-width:680px;align-self:center;width:calc(100% - 20px)}.editor-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.editor-input{flex:1;min-width:110px;height:36px;border-radius:10px;border:1px solid var(--border);background:#fffdf9;padding:0 10px;font-size:13px;font-weight:700;color:var(--text)}.editor-select{height:36px;border-radius:10px;border:1px solid var(--border);background:#fffdf9;padding:0 8px;font-size:13px;color:var(--star);font-weight:800}.editor-status{font-size:11.5px;font-weight:800;padding:4px 9px;border-radius:999px;white-space:nowrap}.editor-status.ok{background:#e6f5ed;color:var(--green)}.editor-status.warn{background:#fdf2e6;color:#a6571f}.editor-actions-row{justify-content:space-between}.editor-mini-previews{display:flex;gap:6px}.editor-mini-box{width:48px;height:40px;border-radius:8px;background:#efece6;padding:3px}.editor-mini-svg{width:100%;height:100%}.editor-btn-group{display:flex;gap:6px;flex-wrap:wrap}.editor-pill-btn{height:34px;padding:0 11px;border-radius:999px;background:#ede9e1;color:var(--text);font-size:12px;font-weight:700;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}.editor-pill-btn.primary{background:var(--green);color:#fffdf9}.editor-toast{position:fixed;top:calc(128px + env(safe-area-inset-top,0px));left:50%;transform:translate(-50%);background:var(--text);color:#fffdf9;padding:8px 16px;border-radius:999px;font-size:12.5px;font-weight:700;box-shadow:var(--shadow-md);white-space:nowrap;z-index:60}.editor-json-modal{max-width:440px}.editor-textarea{width:100%;border-radius:12px;border:1px solid var(--border);background:#f7f4ee;padding:10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;color:var(--text);resize:vertical;user-select:text;-webkit-user-select:text}@media(max-width:410px){.play-toolbar{max-width:calc(100vw - 16px);padding:4px;gap:2px}.tool-btn{min-width:48px;padding:0 2px}.sample-card-body{height:70px}}
