:root{font-family:"Pretendard","Noto Sans KR","Malgun Gothic",system-ui,sans-serif;color:#352f47;background:#e3e1eb;font-synthesis:none;--purple:#7655d9;--purple-dark:#5d3db9}
*{box-sizing:border-box}body{margin:0}button{font:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation;cursor:pointer}button:focus-visible{outline:4px solid #5932bd;outline-offset:4px}button svg{flex:none}svg{display:block}[hidden]{display:none!important}button:disabled,button[aria-disabled=true]{cursor:default}
.app-shell{height:100vh;height:100dvh;min-height:380px;max-width:1920px;margin:auto;padding:0 clamp(22px,4vw,76px) max(20px,env(safe-area-inset-bottom));display:flex;flex-direction:column}
.site-header{height:clamp(70px,8dvh,88px);flex:none;display:flex;align-items:center;justify-content:space-between;gap:16px}
.difficulty-selector{display:flex;align-items:center;gap:5px;padding:5px;background:#f7f5fb;border:1px solid #d2cbdc;border-radius:15px}
.difficulty-selector button{display:flex;align-items:center;gap:7px;justify-content:center;min-height:42px;padding:8px 19px;border:0;border-radius:10px;background:transparent;color:#776888;font-size:16px;font-weight:800;white-space:nowrap;transition:background .15s,color .15s}
.difficulty-selector button span{font-size:12px;font-weight:650;opacity:.8}.difficulty-selector button[aria-pressed=true]{background:var(--purple);color:#fff;box-shadow:0 2px 4px #58429120}.difficulty-selector button:not(:disabled):not([aria-pressed=true]):hover{background:#e9e0f4}.difficulty-selector button:disabled:not([aria-pressed=true]){opacity:.45}
.header-actions{display:flex;gap:10px}.utility-button{display:flex;align-items:center;justify-content:center;gap:9px;padding:11px 15px;min-height:44px;border:1px solid #d5ccdf;border-radius:13px;background:#f8f6fb;color:#6b5c84;font-size:14px;font-weight:700}.utility-button:hover{background:#eee7fb}.utility-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.sound-slash{display:none}[aria-pressed=false] .sound-waves{display:none}[aria-pressed=false] .sound-slash{display:block}
.game{width:min(1100px,100%);margin:0 auto;flex:1;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) clamp(82px,10dvh,110px);padding-top:8px}
.board-wrap{position:relative;min-height:0;padding:5px 4px 9px}.board{height:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:clamp(18px,2.6dvh,28px)}
.board[data-colors="6"]{grid-template-columns:repeat(3,minmax(0,1fr))}.board[data-colors="8"]{grid-template-columns:repeat(4,minmax(0,1fr))}
.color-button{--tile:#f17b7b;--edge:#d45f64;--ink:#792b32;container-type:size;position:relative;isolation:isolate;display:grid;place-items:center;min-height:0;min-width:0;border:4px solid transparent;border-radius:clamp(18px,2.6dvh,28px);background:var(--tile);color:var(--ink);box-shadow:0 7px 0 var(--edge),inset 0 2px 0 #ffffff30;user-select:none;-webkit-user-select:none;transition:filter .09s,box-shadow .09s,transform .09s,border-color .09s;overflow:visible}
.yellow{--tile:#f4ce62;--edge:#d7b044;--ink:#70500b}.green{--tile:#77cda9;--edge:#53ad88;--ink:#175b44}.blue{--tile:#7ab4eb;--edge:#5793ce;--ink:#234f7f}.orange{--tile:#eda866;--edge:#cd8344;--ink:#794514}.violet{--tile:#ab8adf;--edge:#8965bf;--ink:#4b2d78}.pink{--tile:#df88b7;--edge:#bf6495;--ink:#74234f}.cyan{--tile:#65c4cd;--edge:#429fa8;--ink:#155d65}
.color-button:before{content:"";position:absolute;inset:8px;border:1px solid #ffffff2a;border-radius:calc(clamp(18px,2.6dvh,28px) - 10px);pointer-events:none}
.symbol{position:relative;display:grid;place-items:center;width:min(70cqw,70cqh,202px);height:min(70cqw,70cqh,202px)}.symbol svg{width:100%;height:100%;fill:#fffaf1;filter:drop-shadow(0 3px 0 #00000009)}.number{position:absolute;inset:0;display:grid;place-items:center;font:800 min(34cqw,34cqh,92px)/1 system-ui,sans-serif;letter-spacing:-2px;padding-right:2px}
.color-button.lit{filter:brightness(1.17) saturate(1.1);border-color:#fff;box-shadow:0 0 0 4px var(--ink),0 8px 0 var(--edge),0 0 32px #ffffffb3,inset 0 0 30px #ffffff60;transform:scale(1.025);z-index:2}.color-button.lit .symbol{animation:note-pop .22s ease-out}.color-button[aria-disabled=false]:hover:not(.lit){filter:brightness(1.035)}
.countdown-overlay{position:absolute;inset:0;z-index:4;display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:none;background:#e3e1eb38;border-radius:24px;backdrop-filter:blur(3px)}.countdown-overlay:before{content:"";position:absolute;z-index:-1;width:clamp(150px,24dvh,235px);aspect-ratio:1;border-radius:50%;background:#fffc;box-shadow:0 10px 60px #39235425;border:5px solid white}.countdown-overlay>span{font-size:clamp(16px,2.4dvh,24px);font-weight:750;color:#8e7da9;margin-top:6px}.countdown-overlay strong{font:850 clamp(74px,13dvh,140px)/1.1 system-ui,sans-serif;color:var(--purple);animation:count-pop .2s ease-out}
.success-pop{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3;background:#fff;border:5px solid #eee7fc;border-radius:50%;padding:17px;box-shadow:0 6px 30px #45307328;animation:check-pop .3s ease-out}.success-pop svg{width:52px;height:52px;fill:none;stroke:var(--purple);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.game-footer{display:flex;justify-content:flex-end;align-items:center;gap:20px;padding:12px 5px 0}.primary-button{border:0;border-radius:17px;color:white;background:var(--purple);font-size:clamp(22px,2vw,29px);font-weight:800;min-height:66px;padding:14px 28px;display:flex;justify-content:center;align-items:center;gap:15px;box-shadow:0 5px 0 var(--purple-dark);transition:background .15s,transform .15s}.primary-button:hover{background:#6846ca}.primary-button:active{transform:translateY(2px);box-shadow:0 3px 0 var(--purple-dark)}.start-button{width:clamp(210px,25vw,310px)}.start-button svg{width:22px;height:22px;fill:currentColor}.start-button:disabled{opacity:.6}
.input-progress{display:flex;align-items:baseline;gap:10px;color:#806997;font-size:clamp(18px,2vw,28px);font-weight:600;padding:12px 25px;background:#f1ebfc;border-radius:18px;white-space:nowrap}.input-progress strong{font-size:clamp(33px,4dvh,48px);color:var(--purple);line-height:1}.phase-pill{color:#756587;background:#f1edf6;border-radius:100px;padding:13px 25px;font-size:20px;font-weight:750;white-space:nowrap}body[data-phase=success] .phase-pill{background:#e1f3e8;color:#21785b}
dialog{padding:0;width:780px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #e8def5;border-radius:34px;background:#fffdfa;color:#352f47;box-shadow:0 30px 100px #30204730}dialog::backdrop{background:#30244366;backdrop-filter:blur(7px)}.result-content{position:relative;z-index:1;text-align:center;padding:clamp(24px,5dvh,52px) clamp(20px,5vw,56px)}.result-icon{color:var(--purple);display:grid;place-items:center;width:88px;height:88px;background:#efe7fb;border-radius:28px;margin:0 auto 22px;font-size:58px;line-height:1}.result-content h2{font-size:clamp(27px,3.3vw,48px);font-weight:850;letter-spacing:-1.8px;line-height:1.35;margin:0;word-break:keep-all}.result-content>p{font-size:clamp(17px,1.9vw,26px);line-height:1.5;color:#82748f;margin:14px 0 28px;word-break:keep-all}.result-stats{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 28px}.result-stats p{display:flex;flex-direction:column;align-items:center;gap:9px;margin:0;padding:22px 10px;background:#f4effc;border-radius:22px}.result-stats p>span{font-size:clamp(17px,1.7vw,24px);font-weight:650;color:#7b6892}.result-stats strong{color:var(--purple);font-size:clamp(42px,6dvh,68px);line-height:1.1;font-weight:850}.result-stats small{font-size:.4em;margin-left:5px}.result-actions{display:grid;grid-template-columns:1fr 1.5fr;gap:16px}.secondary-button{border:1.5px solid #e0d5f0;border-radius:17px;background:#fffdfa;color:#7b6695;font-size:clamp(19px,1.8vw,25px);font-weight:750;min-height:64px}.secondary-button:hover{background:#f4effa}.result-actions .primary-button{font-size:clamp(21px,2vw,28px)}.result-actions .primary-button>span{font-size:32px;font-weight:500}.notice{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:12px 22px;background:#463556;color:white;border-radius:12px;z-index:20;max-width:90vw;text-align:center}.expanded-view{position:fixed;inset:0;z-index:20;background:#e3e1eb}:fullscreen{background:#e3e1eb}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes note-pop{50%{transform:scale(1.055)}}@keyframes count-pop{from{transform:scale(.8);opacity:.5}to{transform:scale(1);opacity:1}}@keyframes check-pop{from{transform:translate(-50%,-50%) scale(.5)}to{transform:translate(-50%,-50%) scale(1)}}
@media(min-width:1600px){.game{width:min(1250px,100%)}}
@media(max-width:760px){.utility-button{width:44px;height:44px;padding:10px}.utility-button>span{display:none}.header-actions{gap:7px}.difficulty-selector button{padding:8px 12px}}
@media(max-width:600px){.app-shell{padding:0 16px max(16px,env(safe-area-inset-bottom))}.site-header{height:72px;gap:8px}.difficulty-selector{padding:4px;gap:2px;border-radius:12px}.difficulty-selector button{min-height:43px;padding:6px 9px;gap:2px;flex-direction:column;font-size:14px;border-radius:8px;line-height:1.2}.difficulty-selector button span{font-size:10px}.game{grid-template-rows:minmax(0,1fr) 72px;padding-top:2px}.board{gap:16px}.board[data-colors="6"]{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}.board[data-colors="8"]{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr))}.board-wrap{padding:4px 3px 8px}.color-button{border-width:3px;border-radius:18px}.color-button:before{border-radius:10px;inset:6px}.game-footer{gap:10px;padding:12px 3px 0;justify-content:center}.start-button{width:100%;min-height:48px;border-radius:14px;padding:9px 20px;font-size:21px;box-shadow:0 4px 0 var(--purple-dark)}.input-progress{padding:7px 19px;font-size:17px;border-radius:12px}.input-progress strong{font-size:27px}.phase-pill{padding:8px 20px;font-size:16px}.result-content{padding:28px 20px}.result-content h2{font-size:29px;letter-spacing:-1.4px}.result-icon{width:64px;height:64px;font-size:43px;margin-bottom:20px;border-radius:22px}.result-stats{gap:10px;margin-bottom:23px}.result-stats p{padding:18px 6px;border-radius:17px}.result-stats p>span{font-size:15px}.result-actions{gap:10px}.result-actions button{min-height:55px;padding:10px;font-size:18px;border-radius:14px}.success-pop{padding:12px}.success-pop svg{width:38px;height:38px}}
@media(max-height:600px){.app-shell{padding-bottom:12px}.site-header{height:62px}.game{grid-template-rows:minmax(0,1fr) 62px;padding-top:2px}.board{gap:14px}.primary-button{min-height:48px;padding:10px 20px;font-size:21px}.phase-pill{font-size:16px;padding:10px 18px}.input-progress strong{font-size:28px}.game-footer{padding-top:8px}.result-content{padding:20px 28px}.result-icon{width:45px;height:45px;font-size:32px;border-radius:15px;margin-bottom:10px}.result-content h2{font-size:30px}.result-content>p{font-size:18px;margin:8px 0 14px}.result-stats{margin-bottom:14px}.result-stats p{padding:12px}.result-stats strong{font-size:36px}.result-stats p>span{font-size:17px}.result-actions button{min-height:48px}.result-actions .primary-button{font-size:21px}}
@media(max-width:360px){.app-shell{padding-left:10px;padding-right:10px}.site-header{gap:5px}.difficulty-selector button{padding:6px 7px;font-size:13px}.header-actions{gap:5px}.utility-button{width:38px;min-height:42px;padding:8px}.result-content h2{font-size:26px}.result-stats p>span{font-size:14px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}.color-button.lit{transform:none}}
