:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color:#183042;background:#f7faf9;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;--board-max: min(86vw, 620px, calc(100svh - 340px) )}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:linear-gradient(90deg,rgba(255,255,255,.34) 1px,transparent 1px),linear-gradient(180deg,rgba(255,255,255,.28) 1px,transparent 1px),linear-gradient(180deg,#fffaebeb,#ecf9faf5),linear-gradient(135deg,rgba(255,210,104,.22),transparent 42%),linear-gradient(315deg,rgba(95,184,196,.2),transparent 46%);background-size:34px 34px,34px 34px,auto,auto,auto}button,select{font:inherit}button{touch-action:manipulation}button:disabled,input:disabled{cursor:wait;opacity:.68}.shell{width:min(760px,100%);min-height:100vh;margin:0 auto;padding:22px 18px 26px;display:grid;grid-template-rows:auto auto 1fr auto;gap:16px}.game-shell{grid-template-rows:auto auto auto auto 1fr;gap:12px;padding-bottom:calc(98px + env(safe-area-inset-bottom))}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px}.topbar>div:first-child{min-width:0}.top-actions{display:grid;justify-items:end;gap:8px;flex:0 0 auto}.eyebrow{margin:0 0 4px;color:#d36c61;font-size:15px;font-weight:700}.subline{margin:8px 0 0;color:#607988;font-size:14px;font-weight:700}h1{margin:0;font-size:clamp(27px,6.2vw,42px);line-height:1.08;letter-spacing:0;overflow-wrap:anywhere}.status{min-width:86px;height:58px;border-radius:8px;display:grid;place-items:center;background:#fff;border:1px solid #dae6e8;box-shadow:0 8px 24px #15303c14}.status span{font-size:24px;font-weight:800}.status small{margin-top:-16px;color:#6a8290;font-weight:700}.status.done{background:#e4f8ef;border-color:#81d39f}.account-entry{min-width:70px;height:36px;border:1px solid #d2e0e3;border-radius:8px;background:#1d82e8;color:#fff;font-weight:800;box-shadow:0 8px 20px #1d82e833}.toolbar{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}.game-shell .toolbar{position:fixed;left:50%;right:auto;bottom:calc(12px + env(safe-area-inset-bottom));z-index:10;width:min(520px,calc(100vw - 28px));padding:10px;border-radius:18px;border:2px solid rgba(255,255,255,.9);background:#ffffffe6;box-shadow:0 16px 36px #15303c29,inset 0 -3px #254e580a;transform:translate(-50%);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.game-shell .toolbar .text-button{flex:1 1 0;min-width:0}.score-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px;border-radius:18px;border:2px solid rgba(255,255,255,.9);background:linear-gradient(135deg,#fffffff0,#f8fdfae6),linear-gradient(90deg,#ffcf5847,#5fb8c42e);box-shadow:0 12px 28px #4856461f,inset 0 -3px #254e580d}.score-board div{min-width:0;min-height:70px;display:grid;place-items:center;gap:4px;padding:8px;border-radius:14px;background:#fff;box-shadow:0 6px 16px #15303c12}.score-board span{color:#607988;font-size:13px;font-weight:900}.score-board strong{color:#183042;font-size:clamp(28px,7vw,42px);line-height:.95}.score-board div:nth-child(2) strong{color:#2b9b8f}.score-board div:nth-child(3) strong{color:#d36c61}.score-board.done{border-color:#81d39f;background:#e4f8ef}.home-shell{width:min(860px,100%);grid-template-rows:auto auto;align-content:start;gap:18px}.home-hero{display:grid;grid-template-columns:minmax(0,1fr) 230px;align-items:center;gap:20px;padding:22px;border-radius:22px;background:linear-gradient(135deg,#fffffff2,#fafef7e6),linear-gradient(120deg,#ffcd5c73,#65beca42 55%,#d7aaeb38);border:2px solid rgba(255,255,255,.92);box-shadow:0 18px 46px #48564624,inset 0 -4px #254e580f}.home-hero h1{max-width:9em;color:#183042;text-shadow:0 3px 0 rgba(255,255,255,.68)}.home-actions{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap;margin-top:14px}.home-mascot{min-height:208px;border-radius:20px;display:grid;place-items:center;position:relative;background:linear-gradient(135deg,#ffe39a,#d6f2ed 56%,#d9d2ff);border:1px solid rgba(255,255,255,.9);box-shadow:inset 0 0 0 1px #ffffff94,0 14px 32px #4a68712e;overflow:hidden}.home-mascot:before,.home-mascot:after{content:"";position:absolute;border-radius:999px;background:#ffffff8c}.home-mascot:before{width:72px;height:24px;left:14px;top:18px}.home-mascot:after{width:54px;height:18px;right:20px;top:46px}.mini-board{width:146px;display:grid;grid-template-columns:repeat(3,1fr);gap:6px;transform:rotate(-3deg);position:relative;z-index:1}.mini-board span{aspect-ratio:1;border-radius:12px;display:grid;place-items:center;background:#ffffffdb;color:#fff;font-size:24px;font-weight:950;box-shadow:0 4px 10px #234a5621}.mini-board .accent:nth-child(1){background:#f2c75c}.mini-board .accent:nth-child(5){background:#5fb8c4}.mini-board .accent:nth-child(9){background:#c895d7}.mascot-badge{position:absolute;right:18px;bottom:16px;width:54px;height:54px;border-radius:18px;display:grid;place-items:center;background:#fff;font-size:27px;box-shadow:0 10px 22px #234a562e;z-index:2}.mode-card{display:grid;gap:14px;align-content:start;padding:18px;border:2px solid rgba(255,255,255,.9);border-radius:22px;background:#ffffffe0;box-shadow:0 18px 46px #4856461f,inset 0 -4px #254e580a}.mode-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:6px;border-radius:16px;background:#edf7ed;border:1px solid rgba(212,229,216,.9)}.mode-tab{min-height:48px;border:0;border-radius:13px;background:transparent;color:#687a6c;font-weight:900;cursor:pointer}.mode-tab.active{background:#fff;color:#21485b;box-shadow:0 7px 18px #4856461f,inset 0 -3px #f2c75c7a}.mode-panel{display:grid;grid-template-columns:170px minmax(0,1fr);gap:16px;align-items:start}.mode-panel .settings-form,.mode-panel .panel-heading,.mode-panel .hard-summary,.mode-panel .hard-levels,.mode-panel>.submit-button{grid-column:2}.mode-illustration{grid-row:1 / span 4;min-height:192px;border-radius:18px;display:grid;gap:8px;padding:14px;border:1px solid rgba(220,229,221,.96);box-shadow:inset 0 0 0 1px #ffffff8c}.easy-illustration{grid-template-columns:repeat(2,1fr);background:#fff2c8}.hard-illustration{grid-template-columns:repeat(2,1fr);background:#e7f2f0}.specified-illustration{grid-template-columns:repeat(2,1fr);background:#f3edf8}.mode-illustration span{border-radius:12px;display:grid;place-items:center;min-height:62px;background:#fff;color:#fff;font-weight:950;font-size:26px;box-shadow:0 5px 12px #234a561a}.easy-illustration span:nth-child(1),.hard-illustration span:nth-child(1),.specified-illustration span:nth-child(2){background:#5fb8c4}.easy-illustration span:nth-child(2),.hard-illustration span:nth-child(2),.specified-illustration span:nth-child(1){background:#f2c75c}.easy-illustration span:nth-child(5),.hard-illustration span:nth-child(3),.specified-illustration span:nth-child(4){background:#c895d7}.hard-illustration span:nth-child(4),.specified-illustration span:nth-child(3){background:#e7867a}.panel-heading{display:grid;gap:4px}.panel-heading strong{color:#173c52;font-size:18px}.panel-heading span{color:#607988;font-size:13px;font-weight:750;line-height:1.4}.hard-levels{display:grid;gap:8px}.hard-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hard-summary div{display:grid;gap:4px;padding:12px;border:1px solid #d2e0e3;border-radius:12px;background:#f6fafa}.hard-summary span{color:#607988;font-size:13px;font-weight:800}.hard-summary strong{color:#173c52;font-size:24px;line-height:1}.hard-level{min-height:52px;border:1px solid #d2e0e3;border-radius:12px;background:#fff;color:#1c4359;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;text-align:left;box-shadow:0 6px 18px #15303c12;cursor:pointer}.hard-level span{font-weight:850}.hard-level strong{color:#d36c61}.hard-level.done{background:#e4f8ef;border-color:#81d39f}.icon-button,.text-button,select{height:42px;border:1px solid #d2e0e3;background:#fff;color:#1c4359;box-shadow:0 6px 18px #15303c12}.submit-button{min-height:46px;border:0;border-radius:14px;padding:0 18px;display:inline-grid;place-items:center;background:linear-gradient(180deg,#ffcf58,#f2a93d);color:#533015;font-weight:950;box-shadow:0 10px 22px #d67d263d,inset 0 -3px #84481529;cursor:pointer}.submit-button:hover,.text-button:hover,.account-entry:hover,.hard-level:hover,.mode-tab:hover{transform:translateY(-1px)}.submit-button,.text-button,.account-entry,.hard-level,.mode-tab{transition:transform .12s ease,box-shadow .12s ease,filter .12s ease}.icon-button{width:42px;border-radius:12px;font-size:30px;line-height:1;font-weight:800}.icon-button.active,.text-button.active{background:#1d82e8;border-color:#1d82e8;color:#fff}.text-button,select{border-radius:12px;padding:0 14px;font-weight:750}select{max-width:150px}.hint-panel{display:none;padding:10px 12px;border-radius:8px;border:1px solid #c8dfe8;background:#ffffffe0;color:#21485b;font-size:14px;font-weight:750;line-height:1.45;box-shadow:0 8px 22px #15303c14}.hint-panel.show{display:block}.account-row,.auth-tabs,.auth-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.account-row{justify-content:space-between}.settings-panel{display:grid;gap:10px;padding:12px;border:1px solid #d2e0e3;border-radius:8px;background:#f6fafaeb}.settings-panel strong{color:#173c52;font-size:14px}.settings-panel label{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:10px;color:#607988;font-size:13px;font-weight:800}.settings-panel select{width:100%;max-width:none;box-shadow:none}.account-row div{display:grid;gap:2px}.account-row strong{color:#173c52;font-size:15px}.account-row span,.account-message,.score-summary span{color:#607988;font-size:13px;font-weight:700}.text-button.compact{height:34px;padding:0 11px;font-size:13px}.auth-form input{min-width:0;height:44px;width:100%;border:1px solid #d2e0e3;border-radius:8px;padding:0 10px;background:#fff;color:#183042;font:inherit;font-size:14px;font-weight:650}.auth-form input::placeholder{color:#7c93a0}.leaderboard{margin:0;padding:0;list-style:none;display:grid;gap:6px}.leaderboard li{display:flex;justify-content:space-between;gap:12px;color:#38596a;font-size:13px;font-weight:750}.leaderboard strong{color:#173c52;white-space:nowrap}.leaderboard .muted{color:#7d94a0}.score-summary{display:flex;align-items:center;justify-content:space-between;gap:12px}.score-summary strong{color:#173c52}.account-message{margin:0}.modal-backdrop,.settings-backdrop,.leaderboard-backdrop,.tutorial-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;display:grid;place-items:start center;padding:max(24px,env(safe-area-inset-top)) 16px 24px;background:#0e243257}.account-modal,.tutorial-card{width:min(420px,100%);margin-top:42px;padding:18px;border-radius:10px;border:1px solid rgba(210,224,227,.96);background:#fff;box-shadow:0 24px 80px #0e243247;display:grid;gap:14px}.settings-form{display:grid;gap:12px}.settings-form label{display:grid;gap:6px;color:#607988;font-size:13px;font-weight:800}.settings-form input,.settings-form select{width:100%;max-width:none;box-shadow:none}.settings-form input{min-width:0;height:42px;border:1px solid #d2e0e3;border-radius:8px;padding:0 10px;background:#fff;color:#183042;font:inherit;font-weight:800}.seed-field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.tutorial-card{width:min(460px,100%)}.modal-header{display:flex;justify-content:space-between;gap:12px}.modal-header h2{margin:0;color:#173c52;font-size:24px;letter-spacing:0}.modal-eyebrow{margin:0 0 4px;color:#d36c61;font-size:13px;font-weight:800}.modal-close{width:36px;height:36px;border:1px solid #d2e0e3;border-radius:8px;background:#fff;color:#38596a;font-size:24px;line-height:1;font-weight:600}.modal-close:disabled{cursor:wait}.tutorial-goal,.tutorial-controls{margin:0;color:#496879;font-weight:750;line-height:1.45}.tutorial-diagrams{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tutorial-diagram{display:grid;justify-items:center;gap:8px;padding:10px;border-radius:8px;border:1px solid #d2e0e3;background:#f6fafaeb}.tutorial-diagram p{margin:0;color:#21485b;font-size:13px;font-weight:850;line-height:1.25;text-align:center}.tap-demo{display:grid;grid-template-columns:repeat(2,44px);gap:8px}.tap-demo span,.nine-demo span{aspect-ratio:1;border-radius:7px;display:grid;place-items:center;background:#e7c34f;color:#fff;font-size:24px;font-weight:900;box-shadow:inset 0 0 0 1px #ffffff6b}.tap-demo span:first-child{background:#a9bfd7}.nine-demo{width:112px;display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.nine-demo span{background:#d8e5e8;font-size:20px}.nine-demo .center{background:#e7c34f;box-shadow:inset 0 0 0 2px #ffffffe6,0 0 0 2px #1d82e880}.tutorial-steps{display:grid;gap:10px}.tutorial-steps div{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:10px;padding:10px;border-radius:8px;border:1px solid #d2e0e3;background:#f6fafaeb}.tutorial-steps span{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:#1d82e8;color:#fff;font-weight:900}.tutorial-steps p{margin:0;color:#21485b;font-size:14px;font-weight:800;line-height:1.35}.account-modal .auth-form{display:grid;gap:10px}.account-modal .auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px}.account-modal .auth-tabs .text-button,.account-modal .auth-form .text-button,.account-modal .submit-button{width:100%;height:44px;display:inline-grid;place-items:center;text-align:center}.submit-button.loading:after{content:"";width:14px;height:14px;margin-left:8px;border-radius:999px;border:2px solid rgba(255,255,255,.55);border-top-color:#fff;animation:spin .7s linear infinite}.submit-button.loading{grid-auto-flow:column;justify-content:center}@keyframes spin{to{transform:rotate(360deg)}}.account-modal .text-button.active{width:100%}.play-area{display:grid;place-items:center;min-height:0}.board{width:max(280px,var(--board-max));max-width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(var(--size),minmax(0,1fr));grid-template-rows:repeat(var(--size),minmax(0,1fr));gap:clamp(1px,calc(18px / var(--size)),6px);padding:clamp(2px,calc(18px / var(--size)),6px);touch-action:none}.cell{min-width:0;min-height:0;border:0;border-radius:clamp(3px,calc(44px / var(--size)),7px);background:var(--cell-color);color:#fff;display:grid;place-items:center;font-size:clamp(10px,calc(58vw / var(--size)),38px);font-weight:900;line-height:1;cursor:pointer;box-shadow:inset 0 0 0 1px #ffffff61,0 2px 7px #0e273214;-webkit-user-select:none;user-select:none;transition:transform .12s ease,filter .12s ease,box-shadow .12s ease}.cell:hover{transform:translateY(-1px);filter:saturate(1.06)}.cell.invalid{box-shadow:inset 0 0 0 4px #dc254ce0,0 2px 7px #0e273214}.cell.answer{box-shadow:inset 0 0 0 3px #ffffffeb,0 0 0 2px #1d82e8a6,0 2px 7px #0e273214}.cell.hint{animation:hintPulse 1.2s ease-in-out infinite;box-shadow:inset 0 0 0 3px #fffffff2,0 0 0 3px #1f87c5b8,0 8px 18px #1f87c52e}.cell.wrong-flash{animation:wrongPop .52s ease both;box-shadow:inset 0 0 0 4px #b93656d9,0 8px 18px #b936562e}@keyframes hintPulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@keyframes wrongPop{0%{transform:scale(.9)}32%{transform:scale(1.08)}to{transform:scale(1)}}.rules{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;color:#496879;font-size:14px;font-weight:700}.rules span{padding:8px 10px;border-radius:8px;background:#ffffffb8;border:1px solid rgba(204,220,224,.84)}.toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,18px);opacity:0;pointer-events:none;padding:12px 18px;border-radius:8px;background:#163c52;color:#fff;font-weight:800;box-shadow:0 12px 26px #15303c33;transition:opacity .16s ease,transform .16s ease}.toast.show{opacity:1;transform:translate(-50%)}.celebration{position:fixed;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;opacity:0;background:#f7faf9c7;transition:opacity .18s ease}.celebration.show{opacity:1}.burst{position:absolute;color:#e7b936;font-size:min(42vw,260px);line-height:1;animation:burstSpin 1.4s ease both}.celebration-card{position:relative;min-width:min(78vw,320px);padding:24px 28px;border-radius:10px;background:#fff;border:1px solid rgba(210,224,227,.95);box-shadow:0 22px 60px #15303c33;display:grid;justify-items:center;gap:8px;transform:translateY(10px) scale(.96);animation:cardCelebrate .56s ease .12s both}.celebration-card strong{font-size:28px;color:#173c52}.celebration-card span{color:#607988;font-weight:800}@keyframes burstSpin{0%{transform:scale(.35) rotate(0);opacity:0}35%{opacity:.9}to{transform:scale(1.2) rotate(42deg);opacity:0}}@keyframes cardCelebrate{to{transform:translateY(0) scale(1)}}@media (max-width: 520px){:root{--board-max: min(94vw, calc(100svh - 318px) )}.shell{padding:16px 12px 20px;gap:12px}.topbar{align-items:flex-start;gap:10px}.game-shell{gap:10px;padding-bottom:calc(92px + env(safe-area-inset-bottom))}.game-shell .toolbar{width:calc(100vw - 20px);bottom:calc(8px + env(safe-area-inset-bottom));padding:8px;gap:7px;border-radius:16px}.game-shell .toolbar .text-button{padding:0 8px}.top-actions{min-width:76px}.home-hero{grid-template-columns:1fr}.home-actions{justify-content:flex-start}.mode-card{padding:12px}.mode-panel{grid-template-columns:1fr}.mode-panel .settings-form,.mode-panel .panel-heading,.mode-panel .hard-summary,.mode-panel .hard-levels,.mode-panel>.submit-button{grid-column:auto}.mode-illustration{grid-row:auto;min-height:132px}.home-mascot{min-height:168px}h1{font-size:clamp(24px,9vw,34px)}.subline{font-size:13px}.status{min-width:70px;height:52px}.score-board{gap:7px;padding:8px;border-radius:14px}.score-board div{min-height:58px;border-radius:11px;padding:6px}.score-board span{font-size:12px}select{margin-left:0;flex:1}.account-modal,.tutorial-card{margin-top:12px}.tutorial-diagrams{grid-template-columns:1fr}}
