@charset "UTF-8";
:root{--paper:#fbf7f0;--card:#fffdf8;--ink:#34413a;--muted:#6d776e;--green:#3f7567;--green-deep:#285548;--line:#e3dfd4;--peach:#e9b58a;--shadow:0 8px 28px #394a3610;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;overscroll-behavior-y:none}body{background:radial-gradient(ellipse at 8% 0,#e5eddf90,transparent 55%),var(--paper)}button,input,select{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{color:inherit;cursor:pointer;border:0;background:transparent;touch-action:manipulation}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #287ab5;outline-offset:4px}a{color:var(--green)}button{transition:transform .14s,background .14s}button:active:not(:disabled){transform:scale(.97)}p{line-height:1.8}h1,h2,h3,p{margin-top:0}h1,h2,h3{font-weight:750}small{font-size:14px}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}button svg{flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;white-space:nowrap;border:0}[hidden]{display:none!important}
.shell{max-width:920px;margin:0 auto;min-height:100dvh;padding:var(--safe-top) 22px calc(100px + var(--safe-bottom))}.topbar{height:72px;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{display:flex;gap:9px;align-items:center;text-decoration:none;color:var(--ink);font-size:23px;font-weight:800;letter-spacing:.08em}.brand img{width:38px;height:38px;border-radius:12px}.top-actions{display:flex;gap:8px}.icon-button{width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:#fffdf9d9;display:inline-flex;align-items:center;justify-content:center}.eyebrow{font-size:13px;letter-spacing:.2em;font-weight:700;color:var(--green);text-transform:uppercase}.muted{color:var(--muted);font-size:14px}.hero{position:relative;overflow:hidden;border-radius:28px;background:#e6d5bd url('./art/room.webp') center 62%/cover;aspect-ratio:1.8;box-shadow:var(--shadow);min-height:290px;border:1px solid #d8d4c8}.hero-copy{position:absolute;top:7%;left:6%;right:6%;text-align:center}.hero h1{font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:clamp(32px,5vw,48px);letter-spacing:.12em;margin:6px 0}.hero p{font-size:15px;margin:0}.hero .eyebrow{font-size:12px}.home-play{position:relative;z-index:1;width:min(420px,90%);margin:-26px auto 0}.primary{display:flex;align-items:center;justify-content:center;gap:12px;min-height:56px;border-radius:18px;padding:14px 24px;background:var(--green);color:white;font-weight:750;font-size:17px;box-shadow:0 5px 0 #285448;line-height:1.5;text-decoration:none}.primary:hover{background:var(--green-deep)}.primary small{display:block;font-size:13px;color:#deeee7;font-weight:400}.primary:active{box-shadow:0 2px 0 #285448;transform:translateY(3px)}.secondary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:12px 18px;background:#efeee3;border:1px solid #d9ddcf;border-radius:14px;font-weight:650;text-decoration:none;color:var(--ink)}.secondary:hover{background:#e5eadb}.text-button{padding:12px 10px;text-decoration:underline;text-underline-offset:4px;color:var(--muted);font-size:14px}.welcome{text-align:center;margin:22px 0 24px;font-size:14px;color:var(--muted)}.welcome strong{color:var(--ink)}.home-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.feature-card{position:relative;text-align:left;padding:22px;border:1px solid var(--line);border-radius:22px;background:var(--card);box-shadow:var(--shadow);overflow:hidden}.feature-card h2{font-size:19px;margin:9px 0 6px}.feature-card p{font-size:14px;color:var(--muted);margin:0}.feature-card .card-icon{display:inline-flex;width:44px;height:44px;border-radius:14px;background:#ece7d6;align-items:center;justify-content:center;color:var(--green)}.feature-card .arrow{position:absolute;right:19px;top:22px;color:#8b9b89}.daily-card{background:linear-gradient(135deg,#eff2e4,#f9f6eb)}.collection-card{display:flex;align-items:center;margin-top:15px;gap:18px;padding:12px 24px;min-height:112px;width:100%}.collection-card .cat-sprite{width:90px;height:90px;flex-shrink:0}.collection-card .copy{flex:1}.collection-card h2{margin:0 0 6px;font-size:18px}.collection-card p{font-size:14px;margin:0;color:var(--muted)}.quiet-note{display:flex;justify-content:center;align-items:center;gap:8px;margin:20px 0;color:var(--muted);font-size:14px}.quiet-note svg{width:18px;height:18px}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(640px,100%);z-index:20;padding:9px 12px calc(9px + var(--safe-bottom));background:#fffdf7f5;border:1px solid var(--line);border-bottom:0;border-radius:22px 22px 0 0;display:flex;justify-content:space-around;box-shadow:0 -8px 30px #34413a08;backdrop-filter:blur(12px)}.bottom-nav button{display:flex;align-items:center;gap:5px;flex-direction:column;min-width:54px;font-size:12px;color:var(--muted);padding:6px 4px}.bottom-nav button.active{color:var(--green);font-weight:750}.bottom-nav button.active svg{stroke-width:2.4}.page-heading{margin:24px 0}.page-heading h1{font-size:29px;letter-spacing:.04em;margin:0 0 10px}.page-heading p{color:var(--muted);font-size:15px;margin-bottom:0}.progress-track{height:7px;background:#e5e7dc;border-radius:8px;overflow:hidden;margin:16px 0 8px}.progress-track i{display:block;height:100%;background:var(--green);border-radius:inherit}.chapter{margin:24px 0}.chapter h2{font-size:17px;display:flex;justify-content:space-between;align-items:center}.level-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}.level{border:1px solid var(--line);background:#fffdf8;border-radius:16px;min-height:80px;display:flex;align-items:center;justify-content:center;flex-direction:column;font-size:20px;font-weight:700}.level small{display:block;letter-spacing:1px;color:#b28047;font-size:12px;margin-top:5px}.level.complete{background:#eef1e5;border-color:#ced8c5}.level.next{background:var(--green);color:white;border-color:var(--green);box-shadow:0 4px 0 #285548}.level.locked{color:#a9afa7;background:#f0efe8}.level.locked svg{width:18px;height:18px}.calendar{padding:22px;background:var(--card);border:1px solid var(--line);border-radius:24px}.calendar-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.calendar-header h2{font-size:19px;margin:0}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:7px;text-align:center}.calendar-grid .week{color:var(--muted);font-size:13px;line-height:28px}.day{position:relative;aspect-ratio:1;min-height:38px;border-radius:12px;font-size:16px;background:#f3f1e8}.day.today{border:2px solid var(--green);font-weight:800}.day.done{background:var(--green);color:white}.day.done:after{content:'·';position:absolute;bottom:-2px;left:0;right:0;font-size:28px}.daily-stats{display:flex;justify-content:center;gap:30px;padding:22px 0}.daily-stats strong{font-size:25px;display:block}.daily-stats span{font-size:14px;color:var(--muted)}.cats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.cat-card{padding:14px 10px 18px;text-align:center;border:1px solid var(--line);background:var(--card);border-radius:22px}.cat-card.selected{border:2px solid var(--green);background:#eff3e8}.cat-card .cat-sprite{width:100%;aspect-ratio:1}.cat-card h2{font-size:16px;margin:5px 0}.cat-card p{font-size:13px;color:var(--muted);margin:0}.cat-card.locked .cat-sprite{filter:grayscale(1);opacity:.35}.cat-sprite{display:block;background-image:url('./art/cats.webp');background-size:300% 200%;background-position:var(--cat-x,0%) var(--cat-y,0%);background-repeat:no-repeat}.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.stat-card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:24px}.stat-card strong{font-size:30px;display:block;margin:8px 0}.stat-card span{color:var(--muted);font-size:14px}.history-list{margin-top:24px;border-top:1px solid var(--line)}.history-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 2px;border-bottom:1px solid var(--line);font-size:14px}.history-row .stars{color:#b28047;letter-spacing:2px}.section-note{padding:18px;border-radius:16px;background:#eeeede;color:#596454;font-size:14px;line-height:1.8;margin:20px 0}.more-row{display:flex;justify-content:center;margin:24px 0}.guide{margin:28px 0;background:#fffdf8;border:1px solid var(--line);border-radius:20px;padding:22px;font-size:14px;line-height:1.9}.guide summary{cursor:pointer;font-weight:700;font-size:16px}.guide h3{margin:20px 0 6px;font-size:16px}.guide p:last-child{margin-bottom:0}
/* Play occupies its own viewport; site chrome and the menu navigation are absent. */
.play-shell{max-width:650px;margin:auto;padding:var(--safe-top) 18px calc(16px + var(--safe-bottom));min-height:100dvh;display:flex;flex-direction:column}.game-top{height:65px;flex-shrink:0;display:flex;align-items:center;gap:12px}.game-title{flex:1;text-align:center}.game-title small{font-size:12px;letter-spacing:.12em;color:var(--green);display:block}.game-title strong{font-size:19px}.game-status{display:flex;align-items:center;justify-content:space-between;gap:12px;height:45px;font-size:14px}.hearts{display:flex;gap:5px;color:#cd806b}.hearts svg{width:21px;height:21px;fill:currentColor;stroke:none}.hearts .empty{color:#ddd8ce}.game-timer{font-variant-numeric:tabular-nums;color:var(--muted)}.cat-progress{font-weight:700;display:flex;align-items:center;gap:6px}.cat-progress svg{color:var(--green);width:20px}.board-wrap{width:100%;position:relative;margin:8px auto 0;flex-shrink:0}.board{display:grid;grid-template-columns:repeat(var(--n),1fr);border:3px solid #4c574e;border-radius:12px;overflow:hidden;box-shadow:0 7px 0 #d9d7c7,0 14px 32px #34413a12;background:#4c574e;touch-action:none;user-select:none;-webkit-user-select:none;aspect-ratio:1;isolation:isolate}.cell{position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:0;background:var(--region);border-right:1px solid #34413a25;border-bottom:1px solid #34413a25;border-radius:0;transition:background .14s,filter .14s;outline-offset:-4px!important;touch-action:none}.cell.edge-right{border-right:2px solid #4c574e}.cell.edge-bottom{border-bottom:2px solid #4c574e}.cell .cat-sprite{position:absolute;inset:1px;pointer-events:none;z-index:2}.cell .cross{position:absolute;inset:33%;pointer-events:none}.cross:before,.cross:after{content:'';position:absolute;left:calc(50% - 1.4px);top:0;width:2.8px;height:100%;border-radius:3px;background:#34413a80;transform:rotate(45deg)}.cross:after{transform:rotate(-45deg)}.cell.auto .cross:before,.cell.auto .cross:after{background:#34413a40}.cell .trial{opacity:.5;filter:saturate(.4)}.cell .trial:after{content:'?';position:absolute;right:2px;top:0;font-size:14px;line-height:1;font-weight:800;color:#34413a;background:#fff6;border-radius:50%}.cell.given:after{content:'◆';position:absolute;right:3px;bottom:2px;font-size:8px;color:#3f7567;z-index:3}.cell .region-label{position:absolute;top:2px;left:4px;font-size:10px;line-height:1.2;color:#34413a99;font-weight:750;pointer-events:none}.cell.patterns{background-image:radial-gradient(#ffffff48 1px,transparent 1.5px);background-size:8px 8px}.cell.pop .cat-sprite{animation:cat-land .36s cubic-bezier(.2,.8,.2,1.2)}@keyframes cat-land{0%{transform:scale(.35) translateY(-20%);opacity:.3}65%{transform:scale(1.12,.88)}100%{transform:none;opacity:1}}.cell.wrong{animation:wrong .45s;background:#da8d81!important}@keyframes wrong{20%,60%{transform:translateX(-3px)}40%,80%{transform:translateX(3px)}}.cell.hint-source{box-shadow:inset 0 0 0 3px #fff,inset 0 0 0 5px #426e5b;z-index:4}.cell.hint-target{box-shadow:inset 0 0 0 3px #e3a542;z-index:4;animation:hint-glow 1.2s ease-in-out infinite alternate}@keyframes hint-glow{to{filter:brightness(1.12)}}.board-note{font-size:13px;color:var(--muted);text-align:center;min-height:22px;margin:13px 0 8px;line-height:1.5}.input-modes{display:flex;gap:5px;padding:5px;background:#eaeade;border-radius:15px;margin:4px auto 12px;width:100%;max-width:430px}.input-modes button{display:flex;align-items:center;justify-content:center;gap:6px;flex:1;min-height:38px;border-radius:11px;font-size:14px;white-space:nowrap}.input-modes button.active{background:#fffdf7;box-shadow:0 2px 5px #34413a16;font-weight:700;color:var(--green)}.input-modes svg{width:19px;height:19px}.game-tools{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:0 auto;width:100%;max-width:460px}.tool{min-height:66px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;border:1px solid var(--line);border-radius:16px;background:#fffdf8;font-size:13px;box-shadow:0 3px 0 #e4e3d8}.tool.active{color:var(--green);border-color:var(--green);background:#edf3e7}.tool svg{width:23px;height:23px}.hint-card{background:#fffdf6;border:1px solid #c4d3bd;border-radius:18px;padding:16px;margin:14px 0;box-shadow:var(--shadow)}.hint-card h2{font-size:16px;margin:0 0 8px}.hint-card p{font-size:14px;margin:0 0 12px}.hint-actions{display:flex;gap:8px}.hint-actions button{flex:1;font-size:14px;min-height:42px;padding:9px;border-radius:11px}.hint-actions .primary{box-shadow:none}.tutorial-band{padding:16px 18px;border-radius:18px;background:#eaf0e0;border:1px solid #cbd8bb;margin:14px 0 2px}.tutorial-band h2{font-size:16px;margin:0 0 5px}.tutorial-band p{font-size:14px;margin:0;line-height:1.75}.tutorial-band button{margin-top:10px}.game-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:16px;font-size:12px;color:var(--muted)}.game-footer button{font-size:13px;text-decoration:underline}.game-footer svg{width:14px;height:14px}.pause-veil{position:fixed;inset:0;background:#fbf7f0e8;backdrop-filter:blur(12px);z-index:80;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;text-align:center}.pause-veil h2{font-size:28px;margin-bottom:10px}.pause-veil .cat-sprite{width:160px;height:160px}.pause-veil .primary{min-width:230px;margin:12px}.loading{min-height:80dvh;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:25px}.loading h1{font-size:36px;letter-spacing:.15em}.loading-paw{color:var(--green);font-size:42px;animation:hint-glow 1s infinite alternate}.loading p{color:var(--muted);font-size:15px}.loading a{margin-top:18px}.fatal{max-width:480px;margin:10vh auto;padding:24px;text-align:center}.fatal .primary{margin-top:24px}.save-warning{background:#fff1cf;color:#624b22;padding:12px 16px;border-radius:12px;font-size:14px;line-height:1.6;margin:10px 0}.connection-note{font-size:13px;color:var(--muted);text-align:center;margin-top:12px}
dialog{width:min(470px,calc(100% - 30px));max-height:calc(100dvh - 44px);border:1px solid #d4dbc8;border-radius:26px;padding:0;background:var(--paper);color:var(--ink);box-shadow:0 22px 90px #182a3a30;overscroll-behavior:contain}dialog::backdrop{background:#27372d78;backdrop-filter:blur(4px)}.dialog-head{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:18px 22px 10px;background:var(--paper);z-index:2}.dialog-head h2{font-size:20px;margin:0}.dialog-head .icon-button{width:36px;height:36px}.dialog-body{padding:10px 24px 24px;line-height:1.8}.dialog-body p{font-size:15px}.dialog-body .primary,.dialog-body .secondary{width:100%;margin-top:12px;font-size:15px}.setting{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 0;border-bottom:1px solid var(--line);font-size:15px}.setting span small{display:block;color:var(--muted);font-size:13px;line-height:1.6;margin-top:4px}.switch{appearance:none;width:46px;height:28px;border-radius:20px;background:#d3d8ca;flex-shrink:0;position:relative;cursor:pointer;transition:background .2s}.switch:before{content:'';position:absolute;left:4px;top:4px;width:20px;height:20px;border-radius:50%;background:white;box-shadow:0 1px 3px #0002;transition:transform .2s}.switch:checked{background:var(--green)}.switch:checked:before{transform:translateX(18px)}.rule-item{display:flex;gap:12px;align-items:flex-start;margin:15px 0}.rule-number{background:var(--green);color:white;width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:14px}.rule-item strong{font-size:15px}.rule-item p{font-size:14px;color:var(--muted);margin:3px 0}.rules-mini{display:grid;grid-template-columns:repeat(4,1fr);width:150px;height:150px;border:2px solid #4c574e;margin:18px auto;border-radius:8px;overflow:hidden}.rules-mini span{display:flex;align-items:center;justify-content:center;border:1px solid #4c574e40;background:#e4d9bc;font-size:19px}.rules-mini .sample-cat{background:#b8d5bd}.rules-mini .sample-x{background:#edc2ae;color:#65584b}.win-art{width:170px;height:170px;margin:0 auto}.win-heading{text-align:center;font-size:28px;margin:0 0 4px}.win-desc{text-align:center;color:var(--muted);font-size:14px!important}.win-stars{text-align:center;letter-spacing:9px;font-size:32px;color:#c18b4d;margin:10px 0}.win-stats{display:flex;justify-content:space-around;gap:10px;margin:20px 0;padding:15px 0;border-block:1px solid var(--line);text-align:center}.win-stats b{display:block;font-size:20px}.win-stats span{font-size:12px;color:var(--muted)}.unlock-box{padding:14px;border-radius:15px;background:#edf1df;display:flex;align-items:center;gap:12px;font-size:14px}.unlock-box .cat-sprite{width:65px;height:65px;flex-shrink:0}.share-links{display:flex;gap:8px;margin-top:12px}.share-links a,.share-links button{flex:1;text-align:center;text-decoration:none;padding:10px 4px;border-radius:12px;background:#eeeee2;font-size:14px;color:var(--ink)}.stats-details{font-size:14px;color:var(--muted)}.import-input{display:none}#toast{position:fixed;left:50%;bottom:calc(100px + var(--safe-bottom));transform:translate(-50%,15px);background:#34473cf2;color:white;border-radius:14px;padding:14px 20px;font-size:14px;line-height:1.7;max-width:calc(100% - 32px);width:max-content;z-index:150;pointer-events:none;opacity:0;transition:.2s}#toast.visible{opacity:1;transform:translate(-50%,0)}.confetti{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:100}.confetti i{position:absolute;top:-10px;width:7px;height:12px;background:var(--color);border-radius:3px;animation:fall 1.8s ease-in forwards;animation-delay:var(--delay)}@keyframes fall{to{transform:translate(var(--drift),105dvh) rotate(660deg);opacity:0}}.reduced *, .reduced *:before,.reduced *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(min-width:700px){.shell{padding-top:12px}.home-grid{gap:18px}.hero{aspect-ratio:2.05}.hero-copy{top:8%}.cats-grid{gap:22px}.game-top{height:72px}.play-shell{max-width:560px}.board-wrap{max-width:min(520px,calc(100dvh - 330px))}.board-note{font-size:14px}.input-modes{margin-top:10px}.game-tools{max-width:390px}}
@media(max-width:480px){.shell{padding-inline:16px}.topbar{height:66px}.brand{font-size:21px}.hero{min-height:280px;border-radius:24px;background-position:48% 65%}.hero-copy{top:7%}.hero h1{font-size:34px}.hero p{font-size:13px}.feature-card{padding:18px}.feature-card h2{font-size:17px}.feature-card p{font-size:13px}.feature-card .arrow{right:12px;top:16px}.level-grid{grid-template-columns:repeat(5,1fr);gap:8px}.level{min-height:72px}.cats-grid{grid-template-columns:repeat(2,1fr)}.cat-card .cat-sprite{max-width:150px;margin:auto}.calendar{padding:16px}.calendar-grid{gap:5px}.play-shell{padding-inline:13px}.game-top{height:60px}.game-tools{gap:7px}.tool{font-size:12px;min-height:63px}.board-note{margin-top:11px}.game-status{height:38px}.game-footer{margin-top:13px}.input-modes{margin-bottom:10px}.dialog-body{padding:8px 20px 22px}}
@media(max-height:740px) and (max-width:600px){.play-shell{padding-top:0}.game-top{height:52px}.game-status{height:32px}.board-wrap{max-width:min(100%,calc(100dvh - 270px - var(--safe-bottom)))}.board-note{margin:10px 0 5px;font-size:12px}.input-modes{margin:2px auto 7px}.input-modes button{min-height:32px}.tool{min-height:55px}.game-footer{margin-top:10px}.tutorial-band{padding:10px 13px;margin-top:12px}.tutorial-band p{font-size:13px}}
@media(orientation:landscape) and (max-height:550px){.play-shell{max-width:850px;display:grid;grid-template-columns:minmax(240px,1fr) minmax(220px,.8fr);gap:0 24px;padding:8px 22px}.game-top{grid-column:2;grid-row:1;height:55px}.game-status{grid-column:2;grid-row:2;height:32px}.board-wrap{grid-column:1;grid-row:1/8;max-width:calc(100dvh - 35px);margin:auto}.board-note{grid-column:2;grid-row:3}.input-modes{grid-column:2;grid-row:4;max-height:48px}.game-tools{grid-column:2;grid-row:5}.game-footer{grid-column:2;grid-row:6}.tutorial-band,.hint-card{grid-column:2;grid-row:7}.game-title strong{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.hero{width:100%;background-image:linear-gradient(180deg,#fbf7f0ed 0%,#fbf7f0c2 31%,#fbf7f000 60%),url('./art/room.webp')}.home-play>.primary{width:100%}.hero-copy p{color:#34413a;font-weight:600}.cat-card,.feature-card,.calendar,.game-title{min-width:0}.play-shell>.board-wrap{width:100%}.input-modes button{min-width:0}.cell:focus-visible{z-index:6}.hint-source:not(.hint-target){filter:brightness(1.08)}


/* 20261018: bright toy puzzle presentation. */
:root{--paper:#faf7f3;--card:#fff;--ink:#805659;--muted:#8b7374;--green:#368bb3;--green-deep:#28799f;--line:#eee3df;--shadow:0 5px 16px #a8786610;font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic',Meiryo,sans-serif}
body{background:var(--paper)}
.shell{max-width:580px;padding:var(--safe-top) 20px calc(88px + var(--safe-bottom))}
.topbar{height:62px}.brand{font-size:19px;letter-spacing:.05em}.brand img{display:none}.brand:before{content:'✦';font-size:20px;color:#e6ad5e}.top-actions{gap:10px}
.icon-button{border:0;background:white;box-shadow:0 4px 10px #d7b3a426;color:var(--ink);width:44px;height:44px}.icon-button svg{stroke-width:2.5}
.eyebrow{letter-spacing:.03em;color:var(--muted)}
.cat-sprite{background-image:url('./art/cats-v4.webp')}
.home-scene{text-align:center;padding:0 0 20px}.home-cat{width:170px;height:170px;margin:0 auto -12px}.home-scene h1{font-size:38px;letter-spacing:.1em;margin:0 0 8px;color:var(--ink)}.home-scene p{font-size:14px;margin:0;color:var(--muted)}
.home-play{width:100%;max-width:420px;margin:0 auto}.primary{background:var(--green);border-radius:18px;box-shadow:0 4px #216f93;font-size:17px;min-height:56px}.primary:hover{background:var(--green-deep)}.primary:active{box-shadow:0 2px #216f93}.primary small{color:#fff;font-size:13px}.secondary{background:#f6eeeb;border:1px solid #ecdeda;color:var(--ink)}.secondary:hover{background:#f0e2de}
.home-progress{text-align:center;font-size:13px;color:var(--muted);margin:22px 0 18px}.home-progress strong{color:var(--ink)}.home-grid{gap:12px}.feature-card{padding:16px;border-radius:20px;box-shadow:var(--shadow);border:0;background:white}.feature-card h2{font-size:16px;margin:10px 0 4px}.feature-card p{font-size:13px}.feature-card .card-icon{width:38px;height:38px;background:#e0f1fb;color:#388db6}.daily-card .card-icon{background:#ffe8b0;color:#9b681c}.feature-card .arrow{right:12px;top:15px;color:var(--muted)}
.collection-card{padding:6px 14px;min-height:88px;gap:8px;margin-top:12px}.collection-card .cat-sprite{width:78px;height:78px}.collection-card h2{font-size:15px}.collection-card p{font-size:13px}.quiet-note{margin:16px 0;font-size:12px}.bottom-nav{max-width:580px;border:0;border-top:1px solid var(--line);border-radius:0;background:#fffdfbfa;box-shadow:none;padding:6px 8px calc(6px + var(--safe-bottom))}.bottom-nav button{min-height:50px;font-size:12px}.bottom-nav button.active{background:#e7f3fb;border-radius:16px;min-width:62px;color:#26779e}
.play-shell{width:100%;max-width:550px;padding:var(--safe-top) 16px calc(8px + var(--safe-bottom));min-height:100dvh;display:flex;flex-direction:column;gap:0}
.game-top{height:58px;flex-shrink:0}.game-title small{display:none}.game-title strong{font-size:23px;letter-spacing:.03em}.game-status{height:48px;justify-content:center;gap:15px;flex-shrink:0;padding:0}.hearts,.cat-progress{background:white;border-radius:30px;min-height:34px;padding:3px 12px;display:flex;align-items:center;justify-content:center}.hearts{color:#ef5c67;gap:5px}.hearts svg{height:24px;width:24px;filter:drop-shadow(0 2px 1px #cc405530)}.hearts .empty{color:#e9dfdc}.cat-progress{font-size:18px;gap:2px;min-width:90px}.cat-progress .cat-sprite{width:38px;height:38px;margin:-5px 3px -5px -8px}.cat-progress b{color:#3f9266;font-size:20px}
.quick-rules{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:#fff;border-radius:16px;padding:6px;margin:10px 0 14px;flex-shrink:0}.quick-rule{min-width:0;border:1px solid transparent;border-radius:10px;background:#f9f2ed;display:flex;align-items:center;justify-content:center;gap:3px;flex-direction:column;font-size:13px;line-height:1.5;padding:7px 2px;min-height:50px;font-weight:650}.quick-rule:hover,.quick-rule:focus-visible{border-color:var(--ink);background:#f4e9e4}.quick-rule svg{height:16px;width:16px;stroke-width:2}
.play-shell>.board-wrap{width:min(100%,calc(100dvh - 325px - var(--safe-top) - var(--safe-bottom)));max-width:none;margin:0 auto;flex-shrink:0}.board{gap:clamp(3px,.9vw,6px);padding:7px;background:#fff;border:0;border-radius:16px;box-shadow:0 6px 20px #c6aca318;overflow:visible;aspect-ratio:1}
.cell,.cell.edge-right,.cell.edge-bottom{border:0;border-radius:5px;background:var(--region);box-shadow:inset 0 2px 3px #ffffff20;aspect-ratio:1;transition:filter .14s;overflow:visible}.cell:active:not(:disabled){transform:none;filter:brightness(.94)}.cell .cat-sprite{position:absolute;inset:-8%;width:auto;height:auto;pointer-events:none;z-index:1;filter:drop-shadow(0 2px 1px #493c2720)}.cell.given:after{content:'';border:0;box-shadow:none;background:none}.cell .region-label{display:none}.cell.patterns .region-label{display:block;background:#fffde9eb;color:#5b4850;font-size:10px;line-height:15px;width:15px;height:15px;border-radius:4px;left:2px;top:2px;position:absolute;z-index:2}
.cell .cross{inset:27%;opacity:1}.cell .cross:before,.cell .cross:after{background:#fff;border-radius:5px;height:6px;box-shadow:0 1px 1px #96775a20}.cell .cross:before{transform:translateY(-50%) rotate(45deg)}.cell .cross:after{transform:translateY(-50%) rotate(-45deg)}.cell.auto .cross{opacity:.65}.cell.hint-target{box-shadow:inset 0 0 0 3px #805659;animation:target-pulse 1.5s ease-in-out infinite;z-index:3}.cell.hint-source{box-shadow:inset 0 0 0 2px #fff;filter:brightness(1.06)}
@keyframes target-pulse{50%{box-shadow:inset 0 0 0 3px #805659,0 0 0 3px #80565930}}
.board-note{margin:12px 0 8px;text-align:center;font-size:13px;line-height:20px;min-height:20px;color:var(--muted)}.input-modes{display:flex;max-width:390px;width:100%;margin:0 auto 9px;padding:3px;gap:3px;border:0;border-radius:14px;background:#eee6e2;flex-shrink:0}.input-modes button{display:flex;align-items:center;justify-content:center;gap:5px;flex:1;min-width:0;min-height:35px;font-size:13px;line-height:1.4;border-radius:11px;padding:5px 6px}.input-modes button svg{height:17px;width:17px}.input-modes button.active{background:white;color:var(--ink);box-shadow:0 2px 4px #a478681a}
.game-tools{display:grid;grid-template-columns:repeat(4,1fr);width:100%;max-width:380px;margin:0 auto;gap:12px;flex-shrink:0}.tool{background:transparent;border:0;box-shadow:none;border-radius:14px;min-height:57px;padding:6px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:12px;color:var(--ink)}.tool svg{height:25px;width:25px;padding:0;stroke-width:2}.tool.active{background:#f0e1da}.tool:last-child{background:#ffe5a1;box-shadow:0 3px #e7c674;color:#7e5c25}.game-footer{display:flex;align-items:center;justify-content:center;gap:18px;min-height:32px;margin:8px 0 0;font-size:12px;color:var(--muted)}.game-footer>span{display:flex;align-items:center;gap:5px}.game-footer svg{height:14px;width:14px}.game-footer .text-button{font-size:12px;padding:8px;min-height:32px}.game-timer{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.hint-card{position:fixed;z-index:30;left:50%;transform:translateX(-50%);bottom:max(12px,var(--safe-bottom));width:min(500px,calc(100% - 24px));max-height:36dvh;overflow:auto;border:2px solid #e6c779;border-radius:22px;background:#fffaf0;box-shadow:0 8px 50px #7d534433;padding:15px 18px;margin:0}.hint-card h2{display:flex;gap:6px;align-items:center;font-size:17px;margin:0 0 7px}.hint-card p{font-size:14px;line-height:1.7;margin:0 0 12px}.hint-actions{display:flex;gap:10px;position:sticky;bottom:-15px;padding:5px 0;background:#fffaf0}.hint-actions button{min-height:44px;font-size:14px;padding:9px;flex:1}
.pause-veil{background:#faf7f3f5}.pause-veil .cat-sprite{width:160px;height:160px}.pause-veil h2{font-size:23px}.dialog-head .icon-button{height:44px;width:44px}.dialog-head{padding:16px 20px 8px}.dialog-body{padding:8px 20px 24px}.dialog-body .secondary{box-shadow:none}.rule-number{background:#b78281}.rules-mini{background:white;border:6px solid white;border-radius:12px;gap:4px;width:180px;height:180px}.rules-mini span{border:0;border-radius:4px;background:#ffcf48;font-size:23px}.rules-mini .sample-cat{background:#a9d788}.rules-mini .sample-x{background:#ffcf48;color:white;font-weight:800}.rule-example{width:210px;height:210px;grid-template-columns:repeat(4,1fr)}.rule-example .cat-sprite{width:100%;height:100%;background-color:transparent}.rule-example span.sample-cat{padding:0}.win-art{width:180px;height:180px;margin:0 auto -10px}.win-stars{color:#d6a02d}.level.complete{background:#eaf5e8;border-color:#d0e5ca}.level.next{box-shadow:0 4px #216f93}.cat-card.selected{background:#e9f5fc}.section-note{background:#f1e8e3;color:var(--ink)}.unlock-box{background:#fef0cb}.share-links button{background:#f1e8e3}.audio-volume{display:block;padding:12px 0}.audio-volume>span{display:flex;justify-content:space-between;font-size:14px;margin-bottom:8px}.audio-volume input{width:100%;height:28px;accent-color:#368bb3}.audio-credit{font-size:12px;color:var(--muted);line-height:1.7;padding:12px;background:#f2ebe6;border-radius:12px}.sound-status{color:var(--muted);font-size:12px;margin:0}.audio-volume output{font-variant-numeric:tabular-nums}#toast{background:#805659f5;bottom:calc(80px + var(--safe-bottom))}
@media(max-height:740px) and (orientation:portrait){.game-top{height:50px}.game-status{height:38px}.quick-rules{margin:6px 0 10px}.quick-rule{min-height:44px;padding:4px 2px;font-size:12px}.play-shell>.board-wrap{width:min(100%,calc(100dvh - 290px - var(--safe-top) - var(--safe-bottom)))}.board-note{margin:8px 0 5px;font-size:12px}.input-modes{margin-bottom:6px}.input-modes button{min-height:32px}.tool{min-height:52px}.game-footer{margin-top:3px;min-height:30px}.home-cat{width:120px;height:120px}.home-scene h1{font-size:32px}.home-scene{padding-bottom:16px}.home-progress{margin:17px 0 13px}.collection-card{min-height:72px}.collection-card .cat-sprite{width:65px;height:65px}}
@media(orientation:landscape) and (max-height:600px){.play-shell{max-width:1050px;min-height:100dvh;display:grid;grid-template-columns:minmax(220px,1fr) minmax(270px,.9fr);grid-template-rows:50px 40px 64px auto 45px 62px 1fr;column-gap:22px;padding:0 18px 6px}.game-top{grid-column:2;grid-row:1;height:50px}.game-title strong{font-size:20px}.game-status{grid-column:2;grid-row:2;height:40px}.quick-rules{grid-column:2;grid-row:3;margin:5px 0}.quick-rule{min-height:42px;font-size:12px}.play-shell>.board-wrap{grid-column:1;grid-row:1/8;align-self:center;margin:auto;width:min(100%,calc(100dvh - 24px));max-width:none}.board-note{grid-column:2;grid-row:4;align-self:center;margin:4px 0;font-size:12px}.input-modes{grid-column:2;grid-row:5;margin:2px auto}.game-tools{grid-column:2;grid-row:6;align-self:center;gap:6px}.game-footer{grid-column:2;grid-row:7;margin:0;align-self:end}.hint-card{left:auto;right:12px;transform:none;width:46vw;max-height:80dvh}.tool{min-height:54px}.board{gap:4px;padding:6px}}
@media(prefers-reduced-motion:reduce){.cell.hint-target{animation:none}}

@media(max-height:680px) and (orientation:portrait){.play-shell>.board-wrap{width:min(100%,calc(100dvh - 350px - var(--safe-top) - var(--safe-bottom)))}}

/* Explicit zero-minimum tracks prevent WebKit retaining the prior portrait cell size after rotation. */
.board{grid-template-columns:repeat(var(--n),minmax(0,1fr));grid-template-rows:repeat(var(--n),minmax(0,1fr))}.board>.cell{min-width:0;min-height:0;width:100%;height:100%;aspect-ratio:auto}

/* Quiet paper palette; one illustration system at every scale. */
:root{--ink:#514a4b;--muted:#8c8181;--bg:#fbf8f3}
body{background:var(--bg);color:var(--ink)}
.cat-sprite.paper-cat{background:none!important;display:inline-block;aspect-ratio:1;filter:none!important}
.paper-cat>svg{width:100%;height:100%;display:block;fill:none;stroke:none;stroke-width:0;overflow:visible}
.home-scene{background:radial-gradient(ellipse at 50% 100%,#f1e8db 0 30%,transparent 31%),#fbf8f3;border:0;box-shadow:none;border-radius:32px}
.home-cat.paper-cat{width:154px;height:154px;margin:4px auto -8px}
.home-scene h1{font-size:37px;letter-spacing:.12em;color:#615350}
.home-scene p{color:#8d7972;font-size:14px}
.home-play .primary{background:#6f927e;box-shadow:0 4px #567762;color:white;border-radius:18px}
.collection-progress{display:flex;gap:12px;align-items:center;margin:18px auto;padding:14px 16px;max-width:440px;border-radius:20px;background:#f0eade;text-align:left}
.collection-progress .cat-sprite{width:60px;height:60px;flex:0 0 60px}
.collection-progress>div{flex:1;min-width:0}.collection-progress b{display:block;font-size:14px}.collection-progress small{font-size:12px;color:#887a72}.collection-progress .progress-track{height:6px;margin:8px 0;background:#dcd1c3}.collection-progress .progress-track i{background:#88ac8d}
.play-shell{max-width:540px;padding:8px 14px max(8px,var(--safe-bottom));gap:0}
.game-top{height:48px}.game-title strong{font-size:20px;letter-spacing:.06em}.game-top .icon-button{background:#fff;box-shadow:0 2px 7px #705e4710;width:42px;height:42px}
.game-status{height:43px;gap:14px}.cat-progress{background:transparent;padding:0;min-width:74px;font-size:16px}.cat-progress .paper-cat{height:35px;width:35px}.cat-progress b{font-size:19px;color:#688c75}.hearts{background:transparent;padding:0}.hearts svg{height:21px;width:21px;filter:none}
.quick-rules{margin:4px 0 12px;padding:0;background:transparent;gap:6px}.quick-rule{min-height:38px;padding:5px 1px;background:#f1ece5;border-radius:10px;font-size:11px;flex-direction:row;line-height:1.2;gap:4px}.quick-rule svg{height:15px;width:15px;flex:0 0 15px}
.play-shell>.board-wrap{width:min(100%,calc(100dvh - 282px - var(--safe-top) - var(--safe-bottom)));max-width:492px}
.board{gap:0;padding:3px;border-radius:17px;border:2px solid #7d7471;background:#7d7471;overflow:hidden;box-shadow:0 6px 0 #e0d9d0,0 10px 24px #7b66540e}
.cell,.cell.edge-right,.cell.edge-bottom{border:0;border-radius:0;box-shadow:inset -1px -1px #6f636921;overflow:hidden;transition:filter .12s;background:var(--region)}
.cell.edge-right{border-right:2px solid #7d7471}.cell.edge-bottom{border-bottom:2px solid #7d7471}.cell.edge-right.edge-bottom{border-right:2px solid #7d7471;border-bottom:2px solid #7d7471}
.cell .paper-cat{inset:5%;width:90%;height:90%;z-index:2;filter:none}.cell .trial{opacity:.45}.cell.given:after{content:'•';position:absolute;bottom:0;left:0;width:15px;height:15px;display:grid;place-content:center;font-size:18px;color:#5d645c;z-index:3}
.cell .cross{inset:36%;opacity:.8}.cell .cross:before,.cell .cross:after{height:3px;background:#635f68;box-shadow:none}.cell.auto .cross{opacity:.4}
.cell.hint-source{box-shadow:inset 0 0 0 3px #fff9;filter:brightness(1.03)}.cell.hint-target{box-shadow:inset 0 0 0 3px #6f8370}
.placement-ring{position:absolute;inset:12%;border:2px solid white;border-radius:50%;animation:placement-ring .6s ease-out forwards;z-index:4;pointer-events:none}
@keyframes placement-ring{to{transform:scale(1.6);opacity:0}}
.board-note{margin:11px 0 7px;font-size:12px}.input-modes{background:#eee8e1;max-width:390px;margin-bottom:7px}.input-modes button{font-size:12px;min-height:32px}.game-tools{gap:9px}.tool{min-height:54px;font-size:11px}.tool:last-child{background:#eddbad;box-shadow:0 3px #d0bc8d}.game-footer{margin-top:5px;gap:10px;min-height:28px}
.cat-card{border:1px solid #e5ddd5;background:#fffdf8;border-radius:22px;box-shadow:0 3px #ece4db}.cat-card.selected{border:2px solid #87a992;background:#f1f6ed}.cat-card .paper-cat{max-width:100px}.cat-card.locked .paper-cat{filter:grayscale(1)!important;opacity:.4}
.win-art.paper-cat{width:134px;height:134px;margin:0 auto}.win-stars{color:#d6a951;letter-spacing:8px}.win-stats{border-radius:16px;background:#f4efe7}.dialog-body>.primary{background:#6f927e;border-radius:16px}
.reduced .placement-ring{animation:none;display:none}
@media(prefers-reduced-motion:reduce){.placement-ring{animation:none;display:none}}
@media(max-height:700px) and (orientation:portrait){.game-top{height:42px}.game-status{height:37px}.quick-rules{margin-bottom:8px}.quick-rule{min-height:32px;font-size:10px}.play-shell>.board-wrap{width:min(100%,calc(100dvh - 262px - var(--safe-top) - var(--safe-bottom)))}.game-footer{margin-top:3px}.tool{min-height:47px}.board-note{margin-top:9px}}
@media(orientation:landscape) and (max-height:550px){.play-shell{max-width:900px}.play-shell>.board-wrap{width:min(100%,calc(100dvh - 30px));max-width:none}.quick-rules{margin:0}.game-top{height:42px}.game-status{height:36px}.quick-rule{min-height:34px;font-size:10px}.input-modes button{font-size:11px}.game-tools{gap:6px}.tool{min-height:44px}.game-footer{gap:4px}.board-note{margin:5px 0}}

.plaza-return{display:inline-flex;align-items:center;min-height:44px;margin:0 0 4px;padding:8px 12px;color:#60564b;text-decoration:none;border-radius:12px;background:#fff9;position:relative;z-index:1;font-size:14px}.plaza-return:focus-visible,.plaza-pause:focus-visible{outline:2px solid #927e53;outline-offset:2px}.plaza-pause{display:block;min-height:44px;margin-top:10px;text-align:center;padding:10px}

/* INPUT1019: draw a centered X; old overrides left each stroke at 2.8 x 3 px, above center. */
.cell .cross:before,.cell .cross:after{left:0;top:50%;width:100%;height:3px;transform-origin:50% 50%;border-radius:3px}
.cell .cross:before{transform:translateY(-50%) rotate(45deg)}
.cell .cross:after{transform:translateY(-50%) rotate(-45deg)}

/* Stable touch coordinates while the board is redrawn. */
.play-shell,.board-wrap,.board{overflow-anchor:none}
