:root{--bg:#fafbf9;--ink:#273a34;--muted:#8b9690;--green:#287b60;--green-hover:#20684f;--soft:#eef3ee;--line:#e9ede8;--white:#fff;--ease:cubic-bezier(.2,.8,.2,1);font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;background:none;color:inherit;touch-action:manipulation}button{transition:background .2s,color .2s,transform .18s var(--ease),opacity .2s}button:active:not(:disabled){transform:scale(.97)}button:focus-visible,a:focus-visible{outline:3px solid #82bca7;outline-offset:3px}button:disabled{cursor:default;opacity:.45}input,textarea{min-width:0;color:var(--ink);outline:none;border:1px solid var(--line);background:#fff}input:focus,textarea:focus{border-color:#7eaf98;box-shadow:0 0 0 3px #287b600e}a{color:inherit;text-decoration:none}h1,h2,h3,p{margin:0}svg.icon{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icon-defs{position:absolute;width:0;height:0;overflow:hidden}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}button[hidden],[hidden]{display:none!important}
.app-shell{width:100%;max-width:480px;min-height:100svh;margin:auto;padding:env(safe-area-inset-top) 24px max(16px,env(safe-area-inset-bottom));display:flex;flex-direction:column}.app-header{height:84px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.brand{display:flex;align-items:center;gap:8px;font-size:22px;font-weight:800;letter-spacing:-1.2px}.brand img{width:29px;height:29px}.brand-dot{color:var(--green)}.header-actions{display:flex;gap:3px}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:14px;color:#728078}.icon-button:hover{background:var(--soft)}.icon-button.small{width:44px;height:44px}.icon-button.small .icon{width:18px;height:18px}.icon-button[aria-pressed=true]{color:var(--green);background:#edf4ed}
main{flex:1;display:flex;flex-direction:column}.wheel-heading{text-align:center;padding-top:23px}.eyebrow{font-size:13px;letter-spacing:-.3px;color:#88938c;margin-bottom:10px}h1{font-size:26px;font-weight:750;letter-spacing:-1.1px;line-height:1.4;overflow-wrap:anywhere}.choice-count{margin-top:7px;display:inline-flex;gap:6px;align-items:center;font-size:12px;color:#919b94;min-height:34px;padding:0 10px;border-radius:20px}.choice-count .icon{width:12px;height:12px}.wheel-stage{padding:28px 8px 14px;position:relative;flex-shrink:0}.wheel-shell{display:block;padding:0;width:100%;position:relative;max-width:360px;margin:auto;border-radius:50%;border:9px solid white;background:#fff;box-shadow:0 12px 40px #40534508,0 1px 5px #40534506;isolation:isolate}.wheel-shell::before{content:"";display:block;padding-top:100%}#wheelCanvas{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;border-radius:50%;will-change:transform;backface-visibility:hidden}.pointer{position:absolute;left:50%;top:-19px;width:26px;height:34px;background:#344c40;clip-path:path('M 3 0 L 23 0 Q 27 0 25 5 L 16 31 Q 13 38 10 31 L 1 5 Q -1 0 3 0 Z');transform:translateX(-50%);z-index:3;filter:drop-shadow(0 2px 1px #0001)}.wheel-center{position:absolute;left:50%;top:50%;width:60px;height:60px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#fff;box-shadow:0 3px 13px #263b3221;transform:translate(-50%,-50%);z-index:2;color:#4c6b5a}.wheel-center:active:not(:disabled){transform:translate(-50%,-50%) scale(.94)}.wheel-center:disabled{opacity:1}.wheel-center .icon{width:26px;height:26px;stroke-width:1.6}.main-controls{margin-top:8px}.wheel-status{text-align:center;font-size:12px;color:#929b95;min-height:32px;line-height:20px;padding-bottom:12px}.primary-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:54px;border-radius:16px;background:var(--green);color:#fff;font-size:16px;font-weight:650;padding:14px 20px;letter-spacing:-.3px}.primary-button:hover:not(:disabled){background:var(--green-hover)}.primary-button:disabled{background:#548e76;opacity:.7}.spin-button{width:100%;min-height:59px;font-size:17px;box-shadow:0 4px 10px #287b600e}.spin-button .icon{width:21px;height:21px}.is-spinning .spin-button .icon{animation:rotate 1.2s linear infinite}.secondary-actions{display:flex;align-items:center;justify-content:center;margin-top:8px;min-height:56px}.secondary-actions>button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-height:48px;font-size:13px;color:#728078;border-radius:12px}.secondary-actions>button:hover{background:var(--soft)}.secondary-actions .icon{width:17px;height:17px;stroke-width:1.5}.action-divider{width:1px;height:14px;background:#e0e7df}.tiny-count{font-size:11px;padding:2px 5px;border-radius:5px;background:#eaf0e9;color:#7b8a7e;min-width:18px}.fairness-note{align-self:center;display:flex;gap:6px;align-items:center;justify-content:center;min-height:44px;font-size:11px;color:#98a299;margin-top:10px}.fairness-note>span{width:5px;height:5px;background:#7fac8b;border-radius:50%}.fairness-note>.icon{height:13px;width:13px;margin-left:1px}.app-footer{padding:18px 0 3px;text-align:center;font-size:10px;color:#b6beb6;letter-spacing:.2px;flex-shrink:0}
.sheet{--sheet-bottom:max(24px,env(safe-area-inset-bottom));position:fixed;inset:auto 0 0;margin:0 auto;padding:10px 24px var(--sheet-bottom);border:0;border-radius:26px 26px 0 0;width:min(100%,480px);max-width:100%;max-height:90dvh;overflow:auto;overscroll-behavior:contain;background:#fff;color:var(--ink);box-shadow:0 -8px 60px #18382712;scrollbar-width:thin;scrollbar-color:#dce3dc transparent}.sheet[open]{animation:sheetIn .38s var(--ease) both}.sheet::backdrop{background:rgb(28 40 33 / 25%);backdrop-filter:blur(3px);animation:fadeIn .25s ease both}.sheet.is-closing{animation:sheetOut .21s ease-in both}.sheet.is-closing::backdrop{animation:fadeOut .21s ease-in both}.sheet-handle{width:34px;height:4px;border-radius:8px;background:#dbe1da;margin:0 auto 16px}.sheet-top{display:flex;align-items:center;justify-content:space-between;margin:0 -4px 20px 0;min-height:44px}.sheet h2{font-size:21px;letter-spacing:-.7px;font-weight:700}.sheet h3{font-size:14px;font-weight:650;letter-spacing:-.2px}.sheet-top>.icon-button{margin-right:-8px}.wide{width:100%}.modal-close{position:absolute;right:16px;top:22px}.text-button{display:flex;justify-content:center;align-items:center;min-height:48px;color:#7f8b82;font-size:14px;border-radius:14px}.text-button:hover{background:var(--soft)}.soft-button{padding:12px 20px;min-height:54px;border-radius:16px;background:var(--soft);color:#6e8074;font-weight:600}.modal-actions{display:flex;gap:10px;margin-top:24px}.modal-actions>*{flex:1}.modal-description{font-size:13px;color:#89968b;line-height:1.8;margin-bottom:20px}.panel-tabs{display:flex;align-items:center;gap:24px}.tab{display:flex;align-items:center;gap:6px;font-size:18px;font-weight:650;min-height:44px;padding:0;color:#a5afa6;position:relative}.tab.active{color:var(--ink)}.count-badge{font-size:11px;font-weight:500;padding:3px 6px;border-radius:6px;color:#96a096;background:#f3f5f1}.tab.active .count-badge{color:var(--green);background:#eaf2e9}fieldset{margin:0;padding:0;border:0;min-width:0}.field-label{font-size:11px;color:#9aa49b;display:block;margin:0 0 7px 2px}.title-input{width:100%;font-size:16px;font-weight:600;border:0;background:#f6f8f4;border-radius:12px;height:49px;padding:12px 14px}.preset-row{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 8px}.preset{font-size:12px;padding:0 12px;min-height:40px;border-radius:20px;background:#f5f7f3;color:#899588}.preset:hover,.preset.selected{background:#ecf3e9;color:#497456}.list-toolbar,.history-toolbar{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#9ca59a;min-height:50px}.list-toolbar>div,.history-toolbar>div{display:flex;align-items:center;gap:0}.small-tool{font-size:11px;color:#7a8a7d;min-height:44px;padding:0 8px;border-radius:10px}.small-tool:hover{background:var(--soft)}.entries-list{display:flex;flex-direction:column;gap:7px;max-height:31dvh;min-height:40px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#dee6db transparent;padding-right:2px}.entry-row{display:flex;align-items:center;background:#f8faf6;border:1px solid #f1f4ee;border-radius:12px;min-height:46px;flex-shrink:0;animation:rowIn .2s var(--ease)}.entry-dot{width:9px;height:9px;border-radius:50%;margin:0 13px 0 15px;flex-shrink:0}.entry-row input{flex:1;width:0;font-size:16px;padding:10px 0;border:0;background:transparent;border-radius:5px;box-shadow:none}.entry-row input:focus{box-shadow:none}.entry-row:focus-within{border-color:#a8c4a7;background:#fff}.entry-row>.icon-button{height:44px;width:44px;color:#bbc3b7}.entry-row>.icon-button .icon{height:15px;width:15px}.entry-row>.icon-button:hover{color:#a27668;background:#f8f0eb}.add-row{display:flex;gap:8px;margin-top:11px}.add-row input{width:100%;height:48px;font-size:16px;padding:12px 14px;border:1px dashed #d9e3d5;border-radius:12px;background:#fff}.add-row input::placeholder{font-size:13px;color:#a0aa9b}.add-button{display:flex;align-items:center;justify-content:center;background:#edf4e9;border-radius:12px;min-width:48px;color:#598161}.list-caption{display:flex;justify-content:space-between;font-size:10px;color:#a5afa0;margin:10px 0 4px}.remove-setting,.setting-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:21px 0}.remove-setting{border-top:1px solid var(--line);margin-top:20px}.remove-setting label,.setting-row label{font-size:14px;font-weight:550}.remove-setting p,.setting-row p{font-size:11px;color:#96a08f;margin-top:5px;line-height:1.5}.switch{position:relative;display:inline-flex;width:44px;height:26px;min-width:44px;cursor:pointer}.switch input{position:absolute;inset:-9px -2px;width:48px;height:44px;opacity:0;z-index:2;cursor:pointer;margin:0}.switch-track{display:block;width:44px;height:26px;border-radius:20px;background:#e5eae1;transition:background .22s}.switch-track:after{content:'';position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:white;box-shadow:0 1px 3px #0001;transition:transform .26s var(--ease)}.switch input:checked+.switch-track{background:var(--green)}.switch input:checked+.switch-track:after{transform:translateX(18px)}.switch input:focus-visible+.switch-track{outline:3px solid #9ac6a7;outline-offset:3px}.switch input:disabled+.switch-track{opacity:.5}.empty-state{padding:40px 15px;text-align:center;color:#9eaa9b;font-size:13px;line-height:1.8}.empty-state .icon{width:32px;height:32px;color:#bfcaba;display:block;margin:0 auto 14px}.history-list{list-style:none;padding:0;margin:0;min-height:240px;max-height:58dvh;overflow:auto;scrollbar-width:thin;scrollbar-color:#dce3dc transparent}.history-item{display:flex;gap:14px;align-items:center;padding:15px 0;border-bottom:1px solid var(--line)}.history-index{font-size:11px;color:#a7b29f;min-width:24px}.history-detail{flex:1;min-width:0}.history-detail strong{font-size:15px;font-weight:600;display:block;overflow-wrap:anywhere}.history-detail p{font-size:11px;color:#a5ae9e;margin-top:5px;overflow-wrap:anywhere}.history-time{font-size:11px;color:#a5ae9e;white-space:nowrap}.history-caption{text-align:center;color:#a5ae9e;font-size:10px;margin-top:20px}.setting-block{margin:10px 0 12px}.duration-options{display:flex;gap:8px;margin-top:13px}.duration-options button{flex:1;border:1px solid var(--line);border-radius:13px;padding:15px 8px;font-size:16px;color:#83937d}.duration-options button span{display:block;font-size:11px;margin-top:6px;font-weight:400;color:#a1ad9b}.duration-options button.selected{border-color:#95b59a;background:#f0f6ec;color:var(--green);font-weight:650}.setting-row{border-bottom:1px solid var(--line)}.settings-help{display:flex;align-items:center;justify-content:space-between;width:100%;font-size:12px;color:#8f9e88;padding:18px 0;margin:4px 0 16px;min-height:48px}.settings-help .icon{width:15px;height:15px}.help-section{margin:0 0 23px}.help-section p{color:#899580;font-size:13px;line-height:1.85;margin-top:8px}.help-sheet .sheet-top{margin-bottom:22px}.result-sheet{text-align:center;padding-top:10px;padding-bottom:max(18px,env(safe-area-inset-bottom))}.result-mark{display:flex;align-items:center;justify-content:center;width:46px;height:46px;margin:28px auto 20px;border-radius:50%;background:#eef5e8;color:#72996b}.result-mark .icon{width:23px;height:23px}.result-sheet h2{color:#8b9b80;font-size:14px;font-weight:400;letter-spacing:0}.winner-name{font-size:34px;line-height:1.35;font-weight:750;letter-spacing:-1px;margin:12px 0;overflow-wrap:anywhere}.winner-note{font-size:12px;color:#9eaa94;line-height:1.6;min-height:20px;margin:0 0 28px}.result-sheet .text-button{margin-top:6px}.confirm-sheet{padding-top:10px}.confirm-sheet h2{margin-top:28px}.confirm-sheet .modal-description{margin-top:10px}.sheet textarea{width:100%;resize:vertical;max-height:45dvh;font-size:16px;line-height:1.8;border-radius:14px;padding:14px;background:#f9fbf7}.batch-status{font-size:12px;color:#97a58e;min-height:22px;margin:9px 0 16px}.batch-status.error{color:#b16e58}.toast{position:fixed;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translate(-50%,14px);background:#304737;color:white;box-shadow:0 4px 20px #24342118;border-radius:14px;padding:13px 19px;font-size:12px;line-height:1.6;max-width:calc(100vw - 40px);width:max-content;opacity:0;pointer-events:none;z-index:100;transition:opacity .24s,transform .3s var(--ease)}.toast.visible{opacity:1;transform:translate(-50%,0)}.confetti-layer{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:10}.confetti-piece{position:absolute;top:0;left:50%;border-radius:2px;animation:confettiFall 1.9s var(--ease) forwards;opacity:0}.noscript{text-align:center;padding:24px;background:#fff8e7;font-size:14px}
@keyframes rotate{to{transform:rotate(360deg)}}@keyframes sheetIn{from{opacity:.4;transform:translateY(55px)}to{opacity:1;transform:translateY(0)}}@keyframes sheetOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(35px)}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes rowIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes confettiFall{0%{opacity:0;transform:translate(0,-10px) rotate(0)}15%{opacity:1}85%{opacity:.7}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--r))}}
@media(min-width:640px){body{background:#f0f3ef;padding:32px 16px}.app-shell{min-height:760px;max-width:440px;background:var(--bg);border:1px solid #e9eee6;border-radius:32px;padding:0 30px 18px;box-shadow:0 14px 70px #3d4c3408}.app-header{height:88px}.wheel-heading{padding-top:24px}.wheel-stage{padding-top:30px}.main-controls{margin-top:18px}.fairness-note{margin-top:20px}.app-footer{padding-top:20px}.sheet{inset:50% auto auto 50%;transform:translate(-50%,-50%);width:440px;max-height:86dvh;border-radius:25px;padding:24px}.sheet-handle{display:none}.sheet[open]{animation:desktopIn .32s var(--ease) both}.sheet.is-closing{animation:desktopOut .2s ease both}.entries-list{max-height:32dvh}.result-sheet{padding-top:24px}@keyframes desktopIn{from{opacity:0;transform:translate(-50%,calc(-50% + 18px)) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes desktopOut{from{opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,calc(-50% + 10px)) scale(.985)}}}
@media(max-width:360px){.app-shell{padding-left:20px;padding-right:20px}.app-header{height:70px}.wheel-heading{padding-top:14px}h1{font-size:23px}.wheel-stage{padding:21px 7px 12px}.sheet{padding-left:20px;padding-right:20px}.winner-name{font-size:30px}}
@media(max-height:750px) and (max-width:639px){.app-header{height:67px}.wheel-heading{padding-top:10px}.wheel-stage{max-width:330px;width:100%;align-self:center;padding-top:22px;padding-bottom:10px}.wheel-status{min-height:25px;padding-bottom:7px}.main-controls{margin-top:0}.fairness-note{margin-top:0}.app-footer{padding-top:7px}.spin-button{min-height:54px}}
.result-secondary-actions{display:flex;gap:8px}.result-secondary-actions>.text-button{flex:1;gap:6px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

html.has-sheet{overflow:hidden;overscroll-behavior:none}
body.has-sheet{position:fixed;top:var(--sheet-page-top,0px);left:0;right:0;overflow:hidden}
.editor-sheet .entries-list{overflow-anchor:none}
.editor-sheet .entry-row{animation:none}
.entries-list>.empty-state{display:flex;align-items:center;justify-content:center;flex:1;padding:40px 15px}
@media(max-width:639px){.app-header{height:64px}.wheel-heading{padding-top:12px}.eyebrow{font-size:12px;line-height:18px;margin-bottom:7px}h1{font-size:25px;line-height:1.35}.choice-count{min-height:28px;margin-top:3px}.wheel-stage{padding:23px 8px 12px;max-width:none;width:100%}.main-controls{margin-top:8px}.wheel-status{position:absolute;width:1px;height:1px;padding:0;min-height:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.spin-button{min-height:56px}.secondary-actions{min-height:50px;margin-top:7px}.fairness-note{margin-top:4px;min-height:34px}.app-footer{display:none}main{flex:0}}

@media(max-width:639px){.wheel-heading .eyebrow{display:none}}

.wheel-edit-area{position:absolute;inset:0;display:block;margin:0;padding:0;width:100%;height:100%;min-width:0;min-height:0;line-height:0;border-radius:50%;background:transparent;-webkit-appearance:none;appearance:none}.wheel-edit-area:disabled{opacity:1;cursor:default}.wheel-edit-area:active:not(:disabled){transform:none}.pointer{pointer-events:none}
.wheel-edit-hint{text-align:center;font-size:12px;line-height:20px;color:#68756d;max-height:52px;padding-bottom:12px;overflow:hidden;opacity:1;transition:opacity .25s ease,max-height .3s var(--ease),padding-bottom .3s var(--ease)}.wheel-edit-hint.is-dismissed{max-height:0;padding-bottom:0;opacity:0}.is-spinning .wheel-edit-hint{opacity:0}

.mode-switch{display:flex;align-self:center;gap:3px;padding:3px;width:224px;margin:2px auto 0;background:#edf1eb;border-radius:25px}.mode-switch button{flex:1;min-height:42px;padding:0 12px;border-radius:22px;font-size:13px;color:#778479;white-space:nowrap}.mode-switch button.selected{background:#fff;color:var(--green);font-weight:650;box-shadow:0 1px 4px #29442e0a}.mode-switch button:disabled{opacity:.7}.mode-switch button:active:not(:disabled){transform:none}.direction-dial{position:absolute;inset:0;border-radius:50%;overflow:hidden}.direction-face,.direction-arrow{display:block;position:absolute;inset:0;width:100%;height:100%}.direction-arrow{will-change:transform;backface-visibility:hidden}.direction-hint{font-size:12px;line-height:20px;color:#68756d;text-align:center;min-height:32px;padding-bottom:12px}.direction-result .direction-hint{color:var(--green)}.direction-result .wheel-shell{box-shadow:0 0 0 1px #b5cfb6,0 12px 40px #40534508;transition:box-shadow .35s ease}.direction-mode .fairness-note{margin-top:16px}.fairness-note>#fairnessText{width:auto;height:auto;background:none;border-radius:0}.mode-switch+.wheel-heading{padding-top:18px}
@media(max-width:639px){.mode-switch{margin-top:0}.mode-switch+.wheel-heading{padding-top:16px}}

@media(max-width:639px){
  .app-shell{padding-left:16px;padding-right:16px}.app-header{height:56px}.mode-switch+.wheel-heading{padding-top:12px}
  .wheel-stage{padding:22px 0 10px}.wheel-shell,.direction-mode .wheel-shell{width:100%;max-width:400px;border-width:7px}.main-controls{margin-top:4px}
  .editor-sheet[open]{display:flex;flex-direction:column;top:calc(var(--editor-viewport-top,0px) + max(8px,env(safe-area-inset-top)));bottom:auto;height:calc(var(--editor-viewport-height,100dvh) - max(8px,env(safe-area-inset-top)));max-height:calc(var(--editor-viewport-height,100dvh) - max(8px,env(safe-area-inset-top)));overflow:hidden;padding:10px 16px max(12px,env(safe-area-inset-bottom))}
  .editor-sheet>.sheet-handle{flex-shrink:0;margin-bottom:8px}.editor-sheet>.sheet-top{flex-shrink:0;margin:0 0 10px;min-height:44px}
  .editor-sheet #itemsPanel{display:flex;flex-direction:column;flex:1;min-height:0}.editor-sheet #editorFieldset{position:relative;flex:1;min-height:0}
  .editor-fields{position:absolute;inset:0;display:flex;flex-direction:column;min-height:0}.editor-fields>.field-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}
  .editor-fields>.title-input{height:44px;flex-shrink:0}.editor-fields>.preset-row{flex-shrink:0;flex-wrap:nowrap;gap:6px;margin:10px 0 4px;overflow-x:auto;scrollbar-width:none}.editor-fields>.preset-row::-webkit-scrollbar{display:none}.editor-fields .preset{flex-shrink:0;padding:0 10px}
  .editor-fields>.list-toolbar{min-height:44px;flex-shrink:0}.editor-fields>.entries-list{flex:1;min-height:0;max-height:none;gap:6px;scroll-padding-block:8px;padding-bottom:2px}
  .editor-fields>.list-caption{flex-shrink:0;margin:8px 0 0;min-height:14px}
  .editor-sheet #historyPanel{display:flex;flex-direction:column;flex:1;min-height:0}.editor-sheet .history-toolbar{flex-shrink:0;min-height:44px}.editor-sheet .history-list{flex:1;min-height:0;max-height:none}.editor-sheet .history-caption{flex-shrink:0;margin-top:12px}
}
@media(max-width:360px){.app-shell{padding-left:12px;padding-right:12px}}
@media(max-width:639px) and (max-height:520px){
  .editor-sheet:not(.editor-keyboard)[open]{overflow-y:auto}.editor-sheet:not(.editor-keyboard) #itemsPanel{min-height:360px;flex-shrink:0}.editor-sheet:not(.editor-keyboard) #historyPanel{min-height:240px;flex-shrink:0}
}

.editor-footer{position:sticky;bottom:0;z-index:2;flex-shrink:0;margin-top:12px;padding-top:12px;border-top:1px solid #dde6da;background:#fff}.editor-composer{margin-bottom:12px}.composer-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:26px;margin-bottom:10px}.composer-heading>label:first-child{font-size:13px;font-weight:650;color:#416c50}.composer-remove{display:flex;align-items:center;gap:8px;font-size:11px;color:#74836f;white-space:nowrap}.editor-composer .add-row{margin-top:0}.editor-composer .add-row input{height:48px;border:1px solid #a7bda5;background:#fff}.editor-composer .add-row input::placeholder{color:#84967e}.editor-composer .add-button{background:#deebd9;color:#3f7148}.editor-footer>.primary-button{min-height:54px}
@media(max-width:639px){
  .editor-sheet[open]{padding-bottom:0}.editor-footer{position:relative;margin:10px -16px 0;padding:12px 16px max(12px,env(safe-area-inset-bottom));background:#f5f8f2}.editor-fields>.list-caption{margin-top:6px}
}

/* The banner owns its space in normal flow; it never covers the game. */
.ad-region{display:flex;align-items:center;justify-content:center;flex:0 0 50px;height:50px;min-width:0;margin-bottom:8px;overflow:hidden;contain:layout paint}
.ad-banner{display:flex;align-items:center;justify-content:center;width:min(100%,320px);aspect-ratio:32/5;max-height:50px;overflow:hidden;border:1px solid #e8ece6;border-radius:4px;background:#f1f4ef;color:#a3aca0;font-size:10px;letter-spacing:1px}
.ad-banner iframe,.ad-banner img{display:block;max-width:100%;max-height:100%;border:0}

/* Spend the available height on the wheel before adding empty space. */
.app-shell{min-height:100svh;min-height:100dvh;padding-top:max(6px,env(safe-area-inset-top));padding-bottom:max(6px,env(safe-area-inset-bottom))}
.app-shell .app-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;height:48px}
.app-header .brand>span{display:none}.app-header .brand{width:29px;height:44px;justify-content:center}
.app-header .mode-switch{width:100%;max-width:224px;min-width:0;margin:0 auto;padding:2px;gap:2px}
.app-header .mode-switch button{min-width:0;min-height:44px;padding:0 6px;font-size:12px}
.app-shell>main{flex:1 0 auto;min-height:0}
.app-shell .wheel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:4px;text-align:left}
.app-shell .eyebrow{display:none}
.app-shell h1{flex:1;min-width:0;font-size:24px;line-height:1.25;letter-spacing:-.9px}
.app-shell .choice-count{flex:0 0 auto;max-width:48%;min-height:24px;margin:0;padding:0;font-size:11px;line-height:16px;text-align:right}
.app-shell .wheel-stage{display:flex;align-items:center;justify-content:center;width:100%;max-width:none;padding:18px 0 6px;flex:1 0 auto}
.app-shell .main-controls{flex-shrink:0;margin-top:0}
.app-shell .wheel-edit-hint,.app-shell .direction-hint{min-height:0;line-height:20px;padding-bottom:6px}
.app-shell .wheel-edit-hint.is-dismissed{padding-bottom:0}
.app-shell .spin-button{display:flex;width:min(100%,var(--wheel-diameter,100%));margin-inline:auto;min-height:54px}
.utility-controls{display:flex;align-items:center;justify-content:center;gap:4px;flex-shrink:0;margin-top:4px}
.utility-controls .secondary-actions{flex:1;min-width:0;min-height:44px;margin:0}
.utility-controls .secondary-actions>button{min-height:44px}
.app-shell .fairness-note{flex-shrink:0;width:44px;min-height:44px;margin:0;border-radius:12px}
.app-shell .fairness-note:hover{background:var(--soft)}
.app-shell .fairness-note>.fairness-dot{display:none}
.app-shell .fairness-note>.icon{width:18px;height:18px;margin:0}
.app-shell .fairness-note>#fairnessText{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}
.direction-mode .app-shell .fairness-note{width:auto;padding:0 12px}
.direction-mode .app-shell .fairness-note>#fairnessText{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}
.app-shell .app-footer{display:none}

/* Size both axes from the stage. The existing square keeps the canvas circular.
   A readable minimum allows normal page scrolling on very short/zoomed screens. */
@supports(container-type:size){
  .app-shell .wheel-stage{container-type:size;flex-basis:0;min-height:calc(min(260px,100vw - 32px) + 24px)}
  .app-shell .wheel-shell{flex:none;width:min(100cqw,100cqh,400px);max-width:100%;margin:0}
}
@media(min-width:640px){
  body{padding:12px 16px}
  .app-shell{min-height:calc(100svh - 24px);min-height:calc(100dvh - 24px);padding-top:12px;padding-bottom:12px}
}

.wheel-center .rotation-icon{width:30px;height:30px}

/* Switch keyboard layouts immediately; only the sheet's opening/closing fades. */
@media(max-width:639px){
  .editor-sheet[open]{animation-name:fadeIn;transition:none;overscroll-behavior:none}
  .editor-sheet.is-closing{animation-name:fadeOut}
  .editor-sheet.editor-keyboard[open]{padding-top:6px;overflow:hidden}
  .editor-keyboard>.sheet-handle{display:none}
  .editor-keyboard>.sheet-top{margin-bottom:4px}
  .editor-keyboard .preset-row,.editor-keyboard .list-toolbar,.editor-keyboard .list-caption{display:none}
  .editor-entry-typing .title-input{display:none}
  .editor-keyboard .entries-list{scroll-padding-block:0}
  .editor-keyboard .editor-footer{display:grid;grid-template-columns:minmax(0,1fr) 72px;align-items:end;gap:8px;margin-top:6px;padding:8px 16px}
  .editor-keyboard .editor-composer{margin:0;min-width:0}
  .editor-keyboard .composer-heading{min-height:20px;margin-bottom:4px}
  .editor-keyboard .composer-remove{display:none}
  .editor-keyboard .editor-footer>.primary-button{min-height:48px;padding:10px 12px;border-radius:12px;font-size:14px}
}

/* Keep the familiar single-column layout, with proportions for a wide screen.
   Only desktop rules change; the mobile keyboard and sheet sizing stay local. */
@media(min-width:960px){
  body{padding:16px 24px;background:var(--bg)}
  .app-shell{width:clamp(460px,calc(100dvh - 180px),680px);max-width:100%;height:calc(100dvh - 32px);min-height:600px;max-height:1080px;padding:8px 32px;border:0;border-radius:0;box-shadow:none}
  .app-shell .app-header{grid-template-columns:1fr auto 1fr;gap:16px;height:56px}
  .app-header .brand{width:34px}.app-header .brand img{width:32px;height:32px}
  .app-header .header-actions{justify-self:end;gap:6px}
  .app-header .mode-switch{width:248px;max-width:none}
  .app-header .mode-switch button{font-size:14px;padding:0 16px}
  .app-shell>main{flex:1;min-height:0}
  .app-shell .wheel-heading{flex-shrink:0;padding:8px 0 4px}
  .app-shell h1{font-size:clamp(26px,3dvh,30px);line-height:1.3}
  .app-shell .choice-count{font-size:12px;line-height:18px}
  .app-shell .wheel-stage{--wheel-bottom-space:clamp(24px,calc(25dvh - 126px),96px);flex:1 0 0;min-height:calc(260px + 24px + var(--wheel-bottom-space));padding:24px 0 var(--wheel-bottom-space)}
  .app-shell .wheel-shell{flex:none;width:min(100%,clamp(260px,calc(100dvh - 380px),600px));max-width:600px;margin:0}
  .wheel-center{width:clamp(60px,7.5dvh,80px);height:clamp(60px,7.5dvh,80px)}
  .wheel-center .rotation-icon{width:clamp(30px,3.6dvh,38px);height:clamp(30px,3.6dvh,38px)}
  .app-shell .main-controls{width:100%;align-self:center}
  .app-shell .wheel-edit-hint,.app-shell .direction-hint{font-size:13px;padding-bottom:8px}
  .app-shell .wheel-edit-hint.is-dismissed{padding-bottom:0}
  .app-shell .wheel-status{position:absolute;width:1px;height:1px;padding:0;min-height:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
  .app-shell .spin-button{min-height:58px;font-size:18px;border-radius:17px}
  .app-shell .utility-controls{width:100%;max-width:520px;align-self:center;margin-top:6px}
  .utility-controls .secondary-actions>button{font-size:14px;min-height:48px}
  .secondary-actions .icon{width:18px;height:18px}
  .sheet{width:500px;max-height:calc(100dvh - 48px);padding:28px;border-radius:26px}
  .sheet h2{font-size:22px}.tab{font-size:20px}.winner-name{font-size:38px}
  .editor-sheet{width:600px;height:min(860px,calc(100dvh - 48px));padding:24px;overflow:hidden}
  .editor-sheet[open]{display:flex;flex-direction:column}
  .editor-sheet>.sheet-top{flex-shrink:0;margin-bottom:12px}
  .editor-sheet #itemsPanel,.editor-sheet #historyPanel{display:flex;flex-direction:column;flex:1;min-height:0}
  .editor-sheet #editorFieldset{position:relative;flex:1;min-height:0}
  .editor-fields{position:absolute;inset:0;display:flex;flex-direction:column;min-height:0}
  .editor-fields>.field-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}
  .editor-fields>.title-input{height:48px;flex-shrink:0;font-size:17px}
  .editor-fields>.preset-row{flex-shrink:0;margin:12px 0 4px}
  .editor-fields .preset{font-size:13px;padding:0 14px}
  .editor-fields>.list-toolbar{min-height:44px;flex-shrink:0;font-size:12px}
  .editor-fields .small-tool{font-size:12px}
  .editor-fields>.entries-list{flex:1;min-height:0;max-height:none;gap:8px;scroll-padding-block:8px;padding-bottom:2px}
  .editor-fields .entry-row{min-height:48px}.editor-fields .entry-row input{font-size:17px}
  .editor-fields>.list-caption{flex-shrink:0;margin:8px 0 0;min-height:14px;font-size:11px}
  .editor-footer{position:relative;flex-shrink:0}
  .editor-composer .add-row input{height:50px;font-size:17px}
  .editor-composer .add-row input::placeholder{font-size:14px}
  .composer-heading>label:first-child{font-size:14px}
  .editor-sheet .history-toolbar{flex-shrink:0;min-height:44px}
  .editor-sheet .history-list{flex:1;min-height:0;max-height:none}
  .editor-sheet .history-caption{flex-shrink:0;margin-top:12px}
  @supports(container-type:size){
    .app-shell .wheel-shell{width:min(100cqw,100cqh,600px)}
  }
}

/* Leave room for the controls on shorter laptop windows, and for Done in dialogs. */
@media(min-width:960px) and (max-height:700px){
  body{padding-top:8px;padding-bottom:8px}
  .app-shell{height:calc(100dvh - 16px);min-height:580px;padding-top:0;padding-bottom:0}
  .app-shell .app-header{height:50px}.app-shell .wheel-heading{padding-top:4px}
  .app-shell .wheel-stage{min-height:calc(260px + 20px + var(--wheel-bottom-space));padding-top:20px}
  .app-shell .spin-button{min-height:54px;font-size:17px}
  .editor-sheet{height:calc(100dvh - 32px);max-height:calc(100dvh - 32px);padding:20px 24px}
  .editor-sheet>.sheet-top{margin-bottom:8px}
  .editor-fields>.title-input{height:44px}.editor-fields>.preset-row{margin:8px 0 0}
  .editor-footer{margin-top:8px;padding-top:8px}
  .editor-composer{margin-bottom:8px}.composer-heading{min-height:20px;margin-bottom:6px}
  .editor-footer>.primary-button{min-height:48px;padding-top:10px;padding-bottom:10px}
}
