:root{--paper:#f8f5ef;--ink:#756258;--muted:#aa9689;--line:#e9e1d7;--accent:#ba8759;--pink:#eaa4b9;--blue:#a6ccec;--green:#b5d995;--yellow:#f7d477;--lavender:#bdb8e4;--orange:#edb681;--teal:#a0d7cf;--rose:#ecc4cf;--sand:#ddd29f;font-family:'Inter',system-ui,sans-serif;color:var(--ink);background:#ede9e2}
*{box-sizing:border-box}body{margin:0;min-height:100dvh;display:flex;align-items:center;flex-direction:column;padding:35px 20px 22px;background:radial-gradient(ellipse at 50% 40%,#faf7f1 0,#efeae2 70%)}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button:disabled{opacity:.35;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #7ba0bb;outline-offset:4px}button{touch-action:manipulation}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.desktop-brand{display:flex;align-items:center;gap:12px;margin-bottom:24px}.desktop-brand>img{width:51px;height:51px}.desktop-brand>span{font-family:'Fredoka',sans-serif;font-weight:600;font-size:30px;letter-spacing:-1px;color:#826345}.desktop-brand small{display:block;font-family:'Inter',sans-serif;font-size:10px;font-weight:400;letter-spacing:1px;margin-top:3px;color:var(--muted)}
.game-shell{width:420px;max-width:100%;background:var(--paper);border-radius:27px;overflow:hidden;box-shadow:0 18px 70px #8a6a4520,0 1px 3px #8a6a4510;border:1px solid #fff;position:relative}.game-header{display:flex;align-items:center;justify-content:space-between;padding:20px 23px 8px}.game-header h1{font-size:19px;font-weight:650;letter-spacing:-.6px;margin:0}.icon-button{border:0;border-radius:50%;background:#ffffff8c;width:34px;height:34px;display:grid;place-items:center;text-decoration:none;font-size:25px;color:#978176}.icon-button svg{width:20px;height:20px}.icon-button:hover{background:#efe7dd}.status-bar{display:flex;gap:28px;align-items:center;justify-content:center;padding:16px 0 21px;font-size:13px}.dog-count{display:flex;gap:3px;align-items:center}.dog-count img{width:24px;height:24px;margin-right:3px}.dog-count b{font-weight:600}.dog-count>span{color:var(--muted)}.hearts{font-size:21px;letter-spacing:3px;color:#e47e82;line-height:1}.hearts .empty{color:#e8ddd6}time{font-variant-numeric:tabular-nums;color:var(--muted);font-size:11px}.rule-strip{display:grid;grid-template-columns:repeat(3,1fr);margin:0 24px;background:#fff9;border:1px solid white;border-radius:9px;box-shadow:0 2px 5px #9d877010}.rule-strip span{text-align:center;font-size:10px;line-height:1.5;padding:7px 0;color:var(--muted)}.rule-strip span+span{border-left:1px solid var(--line)}.rule-strip b{font-weight:500;color:var(--ink)}.play-area{padding:24px 27px 0}.level-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.level-meta>span{font-size:9px;letter-spacing:1.4px;color:var(--muted)}.level-meta button{font-weight:600;font-size:11px;border:1px solid #dfd5ca;border-radius:50%;width:19px;height:19px;background:none;padding:0;color:#a69486}.board-wrap{background:#fffcf9;padding:5px;border-radius:9px;box-shadow:0 2px 6px #8a6a4514;border:1px solid #e7ded2}.board{display:grid;grid-template-columns:repeat(var(--size,5),1fr);gap:3px;aspect-ratio:1;user-select:none}.cell{padding:0;border:0;border-radius:3px;position:relative;background:var(--region);display:grid;place-items:center;min-width:0;min-height:0;transition:filter .15s;aspect-ratio:1}.cell:hover{filter:brightness(1.04)}.cell .mark{position:absolute;inset:0;font-size:0;color:#fffef6;opacity:.96;pointer-events:none}.cell .mark::before,.cell .mark::after{content:"";position:absolute;left:7%;top:47.5%;width:86%;height:5%;border-radius:999px;background:currentColor;transform:rotate(45deg)}.cell .mark::after{transform:rotate(-45deg)}.cell img{width:94%;height:94%;object-fit:contain;filter:drop-shadow(0 3px 2px #69472735);pointer-events:none;animation:pop .2s ease-out}.cell.hinted{box-shadow:inset 0 0 0 3px #fff7a4}.cell.wrong{animation:shake .35s;box-shadow:inset 0 0 0 3px #ce5258}.message{margin:17px -9px 0;min-height:34px;text-align:center;font-size:11px;line-height:1.5;color:var(--muted)}.message.error{color:#ba6261}.tools{display:flex;align-items:center;justify-content:center;gap:35px;padding:15px 25px 27px}.tools button{display:flex;flex-direction:column;align-items:center;gap:6px;border:0;background:none;font-size:10px;color:#958071;min-width:46px}.tool-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:50%;background:#f0eae2;border:1px solid #e9e0d5;font-size:28px;line-height:1}.tool-icon svg{width:23px;height:23px}.tools button:hover .tool-icon{background:#e8ded2}.bottom-nav{position:relative;display:flex;justify-content:space-between;align-items:end;background:#d9eaf1;padding:19px 25px 17px;border-radius:50% 50% 0 0 / 20px 20px 0 0;margin-top:4px}.bottom-nav>button{display:flex;gap:5px;flex-direction:column;align-items:center;background:none;border:0;font-size:9px;z-index:1;color:#8099a5;padding:0;min-width:42px}.bottom-nav>button svg{width:21px;height:21px}.bottom-nav>button.active{color:#4e7f95}.find-dogs{position:absolute;left:50%;transform:translateX(-50%);top:-14px;display:flex;align-items:center;flex-direction:column;white-space:nowrap}.find-dogs img{width:44px;height:44px;margin-bottom:2px;filter:drop-shadow(0 2px 1px #fff)}.find-dogs span{font-family:'Fredoka',sans-serif;font-size:19px;font-weight:600;color:#649ab2;text-shadow:0 2px white,1px 0 white,-1px 0 white}.desktop-note{font-size:11px;color:#b19d8d;margin:24px 0 0;text-align:center;line-height:1.9}.desktop-note span{display:block;font-size:9px;letter-spacing:.5px}
dialog{border:1px solid #fff;border-radius:24px;width:380px;max-width:calc(100vw - 32px);padding:32px 27px;color:var(--ink);background:var(--paper);box-shadow:0 20px 100px #4f382640;max-height:85dvh}dialog::backdrop{background:#54443460;backdrop-filter:blur(4px)}.close-modal{position:absolute;right:15px;top:10px;background:none;border:0;font-size:27px;color:var(--muted)}dialog h2{font-family:'Fredoka',sans-serif;font-size:27px;font-weight:500;text-align:center;margin:5px 0 8px}dialog p{color:var(--muted);font-size:12px;line-height:1.7;text-align:center}dialog .mascot{display:block;width:78px;height:78px;margin:0 auto 12px}dialog .primary{border:0;background:#9c7856;color:white;border-radius:12px;width:100%;padding:13px;font-size:13px;margin-top:17px}dialog .secondary{background:none;border:1px solid var(--line);border-radius:12px;width:100%;padding:11px;font-size:12px;margin-top:9px}.instructions{list-style:none;padding:0;margin:22px 0 0;counter-reset:rule}.instructions li{counter-increment:rule;font-size:12px;line-height:1.6;display:flex;gap:12px;align-items:center;margin:15px 0}.instructions li::before{content:counter(rule);background:#e9dfd2;flex:0 0 26px;height:26px;border-radius:50%;display:grid;place-items:center;color:#997653;font-size:12px}.settings-row{display:flex;align-items:center;justify-content:space-between;padding:15px 0;font-size:12px;border-bottom:1px solid var(--line);gap:10px}.settings-row input{accent-color:#9c7856;width:19px;height:19px}.settings-row select{background:white;border:1px solid var(--line);padding:8px;border-radius:8px;color:var(--ink);font:inherit}.level-tabs{display:flex;gap:6px;margin:20px 0}.level-tabs button{flex:1;border:1px solid var(--line);background:none;border-radius:9px;font-size:11px;padding:9px 0}.level-tabs button.selected{background:#9c7856;color:#fff;border-color:#9c7856}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.level-grid button{aspect-ratio:1;background:#eee6dc;border:1px solid transparent;border-radius:10px;font-size:13px;position:relative}.level-grid button.done{background:#dbe7d0}.level-grid button.done::after{content:'✓';font-size:8px;position:absolute;right:4px;bottom:3px;color:#719061}.level-grid button.current{border:2px solid #9c7856}.win-stats{display:flex;justify-content:center;gap:30px;text-align:center;font-size:17px;margin:24px 0}.win-stats small{display:block;font-size:10px;color:var(--muted);margin-top:6px}.confetti{position:fixed;pointer-events:none;z-index:5;top:-10px;width:8px;height:12px;animation:fall 2.5s linear forwards}
@keyframes pop{from{transform:scale(.5)}to{transform:scale(1)}}@keyframes shake{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}@keyframes fall{to{transform:translateY(105dvh) rotate(540deg)}}@media(max-width:500px){body{padding:0;background:var(--paper)}.desktop-brand,.desktop-note{display:none}.game-shell{border:0;box-shadow:none;border-radius:0;width:420px;min-height:100dvh;display:flex;flex-direction:column}.game-header{padding-top:max(20px,env(safe-area-inset-top))}.play-area{margin-top:auto}.bottom-nav{margin-top:auto;padding-bottom:max(17px,env(safe-area-inset-bottom))}.tools{padding-bottom:34px}.board{gap:3px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.confetti{display:none}}


@media(max-height:760px) and (min-width:501px){body{padding:12px 20px}.desktop-brand{margin-bottom:10px}.desktop-brand>img{width:34px;height:34px}.desktop-brand>span{font-size:24px}.game-shell{width:320px}.game-header{padding:10px 20px 3px}.status-bar{padding:8px 0 10px}.rule-strip span{padding:4px 0}.play-area{padding:10px 24px 0}.level-meta{margin-bottom:6px}.message{margin-top:10px;min-height:28px;font-size:10px}.tools{padding:0 25px 14px}.tools button{font-size:9px;gap:4px}.tool-icon{width:36px;height:36px;font-size:25px}.bottom-nav{padding:14px 20px 11px}.desktop-note{margin-top:10px;line-height:1.6}}

.board{touch-action:none}.cell.given{box-shadow:inset 0 0 0 3px #584a3e}.cell.drag-mark::after{content:'×';font-size:3rem;color:#fffef6}.account-nav{display:flex;justify-content:center;gap:24px;margin-top:16px}.account-nav button{background:transparent;border:0;text-decoration:underline;color:#695d51;font:inherit;cursor:pointer}.save-status{font-size:.75rem;text-align:center;color:#756b61;margin:8px}.ranking-row{padding:10px;border-bottom:1px solid #e8dfd3;text-align:left}#practice-board{margin:20px auto;max-width:320px}#practice-board .cell:disabled{opacity:1}

/* The guided first game keeps one board visible throughout all eight lessons. */
dialog.ftue-modal{padding:0;width:520px;max-width:100vw;max-height:100dvh;border-radius:24px;background:#3b3a39;overflow:auto}.ftue-modal .close-modal{z-index:3;color:#73675d;background:#fff;border-radius:50%;width:30px;height:30px;line-height:24px}.ftue{padding:42px 28px 24px;background:#3b3a39;min-height:620px;display:flex;flex-direction:column;align-items:center;gap:25px}.ftue.light{background:#faf4e9}.ftue-heading{background:#fffaf2;border-radius:22px;padding:20px;width:100%;text-align:center;box-sizing:border-box;min-height:132px;display:flex;flex-direction:column;justify-content:center}.ftue-heading small{font-size:10px;letter-spacing:2px;color:#917c69}.ftue-heading h2{font-size:25px;line-height:1.3;margin:12px 0 0;color:#473b32}.ftue-board{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;width:min(100%,380px);aspect-ratio:1;touch-action:none}.ftue-cell{position:relative;display:grid;place-items:center;min-width:0;aspect-ratio:1;border:0;border-radius:10px;background:var(--tile);padding:0;opacity:1;transition:filter .2s;cursor:pointer}.ftue-cell.dim{filter:brightness(.38)}.ftue-cell img{width:76%;height:76%;pointer-events:none}.ftue-cell span{font:400 clamp(36px,12vw,76px)/1 Arial;color:#fff;pointer-events:none}.ftue-cell.spotlight{outline:4px solid #ffdf6e;outline-offset:-2px;z-index:1;box-shadow:0 0 20px #ffdf6e60}.ftue-cell:focus-visible{outline:4px solid white;outline-offset:2px}.ftue-cell.pointed::after{content:'☝';position:absolute;font-size:42px;right:-9px;bottom:-20px;color:white;text-shadow:0 2px 3px #0008;pointer-events:none;animation:ftue-tap 1.5s infinite;z-index:2}.ftue-cell.swipe-cue::after{animation:ftue-swipe 2s infinite}.ftue-cell.tapped{box-shadow:inset 0 0 0 6px #fff8}.ftue-footer{width:100%;min-height:115px;text-align:center;margin-top:auto}.ftue-footer p{color:#fff4df;font-size:14px;line-height:1.5;margin:0 0 12px}.ftue.light .ftue-footer p{color:#756354}.ftue-footer .primary{font-size:17px;background:#83a866;max-width:280px;margin:0;cursor:pointer}.ftue-footer .primary[hidden]{display:none}.hint-preview .ftue-footer{background:#fff3d4;padding:16px;border-radius:16px;box-sizing:border-box}.celebrate .ftue-heading::before{content:'✦  ✨  ✦';font-size:25px;color:#dca247}.celebrate .ftue-board{animation:pop .35s ease-out}@keyframes ftue-tap{0%,100%{transform:translateY(6px) rotate(-12deg)}40%,65%{transform:translateY(-4px) rotate(-12deg)}}@keyframes ftue-swipe{0%,100%{transform:translate(0,0)}60%{transform:translate(0,-45px)}}@media(max-width:520px){dialog.ftue-modal{width:100%;border-radius:0}.ftue{padding:44px 22px 20px;min-height:min(740px,100dvh);box-sizing:border-box;gap:22px}.ftue-heading{min-height:120px}.ftue-heading h2{font-size:23px}}@media(max-height:700px){.ftue{min-height:0;gap:16px;padding-top:38px}.ftue-heading{min-height:95px;padding:12px}.ftue-heading h2{font-size:21px}.ftue-board{max-width:300px}.ftue-footer{min-height:80px}}

.treats{display:flex;align-items:center;gap:5px;color:#9c7856;font-size:18px}.treats small{font-size:10px}.attempt-meta{display:flex;justify-content:space-between;gap:8px;font-size:9px;color:#897965;margin-bottom:12px}.treat-reward{background:#f0e3c9;border-radius:12px;padding:10px;color:#826345!important}

.treat-icon{width:42px;height:24px;object-fit:cover;vertical-align:middle;flex-shrink:0}.treat-reward .treat-icon{width:48px;height:28px;margin-right:4px}

/* Reference layout: stacked level/score, two status pills, illustrated rules. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.game-header{display:grid;grid-template-columns:44px 1fr 1fr 44px;gap:10px;padding:12px 10px 15px;color:#a16b6a;align-items:center}.game-header .header-stat{font-family:inherit;display:flex;flex-direction:column;align-items:center;font-size:20px;line-height:1.15;font-weight:400;margin:0;letter-spacing:0}.header-stat b{font-size:26px;font-weight:750;margin-top:3px}.game-header .icon-button{width:40px;height:40px;background:white;color:#a16b6a;box-shadow:0 4px 7px #e7b08a35;font-size:34px}.game-header .icon-button svg{width:25px;height:25px;stroke-width:3}
.status-bar{padding:7px 26px 10px;gap:13px;justify-content:space-between}.dog-markers{display:flex;align-items:center;justify-content:space-evenly;gap:3px;background:white;border-radius:999px;padding:5px 8px;flex:1;min-width:0;height:35px}.dog-marker{display:block;width:25px;max-width:100%;aspect-ratio:1;background:var(--marker);mask:url('dog-corgi.png') center/contain no-repeat;opacity:.7;flex:0 1 25px}.dog-marker.placed{mask:none;background:none;opacity:1}.dog-marker img{width:100%;height:100%;object-fit:contain}.status-bar .treats{background:white;border-radius:999px;padding:3px 8px;height:35px;flex:0 0 auto}.treat-icons{display:flex;gap:0}.treat-icons .treat-icon{width:30px;height:24px;object-fit:cover;transform:rotate(-12deg)}.treat-icons .spent{opacity:.18;filter:grayscale(1)}
.rule-strip{margin:0 7px;gap:6px;padding:8px;background:white;box-shadow:none;border:0;border-radius:13px;grid-template-columns:repeat(3,minmax(0,1fr))}.rule-card{display:flex;align-items:center;gap:5px;background:#faf3ef;border-radius:7px;padding:6px;min-height:50px}.rule-strip .rule-card span{padding:0;border:0;text-align:left;font-size:11px;line-height:1.18;font-weight:600;color:#a16b6a}.rule-diagram{width:35px;height:35px;min-width:35px;stroke:none;flex-shrink:0}.play-area .attempt-meta{margin:12px 0 0;font-size:10px}.play-area{padding-top:18px}
@media(max-width:370px){.status-bar{padding-left:14px;padding-right:14px;gap:8px}.rule-strip{gap:4px;padding:6px}.rule-card{padding:4px;gap:3px}.rule-diagram{width:28px;height:28px;min-width:28px}.rule-strip .rule-card span{font-size:10px}.game-header .header-stat{font-size:18px}}

/* Deduction preview: blue explanation, focused board, explicit Apply. */
dialog.hint-modal{width:420px;padding:44px 22px 24px;background:#283c55;color:white;max-height:96dvh;border:1px solid #607e99}.hint-modal::backdrop{background:#172d4bdd;backdrop-filter:blur(2px)}.hint-modal .close-modal{color:#fff;z-index:2}.hint-preview-shell{display:flex;flex-direction:column;align-items:center;gap:18px}.hint-modal h2.hint-explanation{background:#a1defb;color:#405f7b;border-radius:17px;padding:18px;text-align:left;font-family:inherit;font-size:16px;font-weight:500;line-height:1.45;margin:0;width:100%;box-shadow:0 4px 18px #92dbff55}.hint-board{display:grid;grid-template-columns:repeat(var(--size),1fr);gap:4px;width:100%;aspect-ratio:1;max-width:min(360px,50dvh)}.hint-preview-cell{pointer-events:none}.hint-preview-cell.hint-dim{filter:brightness(.35);opacity:.65}.hint-preview-cell.hint-target{box-shadow:inset 0 0 0 3px #fff4a4,0 0 15px #b3eaff66;z-index:1}.hint-preview-cell.hint-target .mark{color:#fff5ab}.hint-modal .hint-caption{font-size:11px;color:#d5e3ef;margin:0}.hint-modal #apply-hint,.hint-modal .apply-hint{background:#f5bf42;color:white;border-radius:999px;font-size:23px;font-weight:750;width:86%;margin:5px 0 0;padding:12px;box-shadow:0 5px 20px #0002}.hint-preview-cell img{animation:none}

.attempt-meta[hidden]{display:none}.message.sr-only{margin:0;min-height:0}

.level-meta[hidden]{display:none}

/* Settings controls share the warm, rounded game palette. */
.game-header #settings svg{width:26px;height:26px;stroke-width:1.8}
dialog.settings-modal{padding:0;width:440px;max-width:calc(100vw - 24px);border-radius:28px;background:#fffcf8;color:#9e6265;overflow:auto;max-height:calc(100dvh - 24px)}
.settings-modal h2{margin:0;padding:16px 55px;background:#faece1;color:#735861;font-size:36px;line-height:1.3;text-align:center}
.settings-modal .close-modal{top:14px;right:15px;font-size:42px;width:40px;height:40px;line-height:35px;color:#ac7a7a}
.settings-body{padding:32px 23px 28px}.settings-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.setting-switch{border:1.5px solid #e9d7cb;border-radius:19px;background:transparent;color:#9e6265;display:flex;align-items:center;padding:12px 8px;gap:8px;font-weight:700}
.setting-tile{flex-direction:column;min-width:0}.setting-tile svg{width:34px;height:34px;stroke-width:2.6}.setting-label{font-size:13px}.setting-switch:disabled{opacity:.55}.switch-track{display:flex;align-items:center;gap:4px;border-radius:30px;padding:3px;background:#cbb79c;color:white;font-size:14px;font-weight:500;line-height:22px;min-width:64px;justify-content:space-between}.switch-knob{width:22px;height:22px;border-radius:50%;background:#fffcf8;flex-shrink:0}.switch-word{padding:0 3px}.setting-switch[aria-checked="true"] .switch-track{background:#42b755;flex-direction:row-reverse}.setting-wide{justify-content:space-between;width:100%;margin-top:15px;padding:14px 16px}.setting-wide .setting-label{font-size:22px}.settings-modal .settings-note{font-size:11px;margin:10px 0 0;color:#8e7970}.settings-modal .settings-help,.settings-modal .settings-restart{width:100%;border-radius:999px;font-size:29px;font-weight:750;padding:15px;margin:0}.settings-modal .settings-help{margin-top:38px;margin-bottom:17px;background:transparent;border:2px solid #c7783d;color:#c7783d}.settings-modal .settings-restart{background:#f49618;color:white;border:0;box-shadow:0 5px 15px #efac4966}
@media(max-width:370px){.settings-body{padding:24px 14px}.settings-tiles{gap:6px}.setting-label{font-size:11px}}

/* First screen: saved treats, daily reset, and a direct return to play. */
[hidden]{display:none!important}.at-home .desktop-brand,.at-home .desktop-note{display:none}.at-home{padding:0;background:#f8f5ef}.home-screen{position:relative;isolation:isolate;overflow:hidden;width:min(100%,460px);min-height:640px;height:100dvh;max-height:940px;background:#f8f5ef;color:#905d3e;padding:22px 22px 18px;display:flex;flex-direction:column;align-items:center}.home-tiles{position:absolute;inset:-30px -55px;z-index:-1;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(6,1fr);gap:5px;opacity:.5;mask-image:linear-gradient(#000,transparent 48%,transparent 82%,#0003)}.home-tiles i{border:4px solid #f4e2d1;border-radius:23px}.home-tiles i:nth-child(7n):after{content:'';display:block;width:70%;height:70%;margin:15%;background:#f2dfcc;mask:url('dog-corgi.png') center/contain no-repeat}.home-header{display:flex;width:100%;align-items:center;justify-content:space-between;gap:18px}.home-avatar{width:62px;height:62px;border-radius:15px;background:#d5eaa2;border:4px solid #93bc59;box-shadow:0 2px 0 #769c44;padding:2px}.home-avatar img{width:100%;height:100%;object-fit:contain}.home-wallet{display:flex;align-items:center;justify-content:center;gap:12px;min-width:122px;padding:9px 20px;border-radius:40px;background:white;box-shadow:0 5px 8px #dfad7830;font-size:28px;color:#b96610}.home-wallet img{width:40px;height:29px;object-fit:cover;transform:rotate(-22deg)}.home-header .icon-button{width:46px;height:46px;background:white;color:#a16b6a;box-shadow:0 5px 8px #dfad7830}.home-header svg{width:28px;height:28px}.home-logo{display:flex;flex-direction:column;align-items:center;font-family:'Fredoka',Arial,sans-serif;font-size:clamp(66px,19vw,91px);font-weight:750;letter-spacing:-5px;line-height:.88;margin:clamp(55px,9vh,100px) 0 38px;transform:rotate(-1deg)}.home-logo>span{display:block}.logo-paw{color:#a499ef}.logo-ring{color:#f39820;position:relative}.logo-ring:after{content:'';position:absolute;width:37px;height:20px;border-bottom:9px solid #905d3e;border-radius:0 0 40px 40px;bottom:-9px;left:30px;transform:rotate(-24deg)}.home-leaderboard{align-self:center;background:none;border:0;padding:0;margin:20px 0;display:flex;flex-direction:column;align-items:center}.home-podium{display:flex;align-items:flex-end;gap:2px;height:61px;padding:0 4px;background:radial-gradient(ellipse at bottom,#ffe69c,transparent 70%)}.home-podium i{font-style:normal;border-radius:8px 8px 4px 4px;color:white;text-shadow:0 2px 1px #9c703b66;box-shadow:inset 0 2px 3px #fff9,0 3px 3px #87633a33;display:grid;place-items:center;width:29px;height:37px;background:#afa5e7;font-size:25px;font-weight:800}.home-podium i:nth-child(2){height:56px;width:36px;background:#ffc12f;font-size:32px}.home-podium i:nth-child(3){height:31px;background:#f9a34b}.home-leaderboard time{background:#716661;color:white;font-size:17px;font-weight:750;line-height:1.3;padding:2px 7px;border-radius:18px;font-variant-numeric:tabular-nums}.home-actions{margin-top:auto;width:100%;display:flex;flex-direction:column;align-items:center;gap:18px;padding:15px 14px 0}.home-actions>button{border:0;border-radius:999px;width:100%;min-height:65px;font-size:clamp(24px,6vw,31px);font-weight:750;color:white}.home-play{background:#f49618;box-shadow:0 5px 16px #f3b25788}.home-daily{background:#a69add;box-shadow:0 4px 10px #a69add33}.home-arcade{color:#a69385;font-size:11px;text-decoration:none;margin-top:2px}.home-actions>button:focus-visible{outline-color:#905d3e}@media(max-height:700px){.home-screen{min-height:540px;padding-top:14px}.home-logo{margin-top:40px;font-size:70px;margin-bottom:12px}.home-leaderboard{margin-top:8px;margin-bottom:8px}.home-actions{gap:12px}.home-actions>button{min-height:55px}}

/* Character selection previews locally; Confirm saves the avatar and frame. */
dialog.profile-modal{padding:0;width:440px;max-width:calc(100vw - 24px);border-radius:28px;background:#fffcf8;color:#9e6265;overflow:auto;max-height:calc(100dvh - 24px)}.profile-modal h2{margin:0;padding:16px 55px;background:#faece1;color:#735861;font-size:36px;line-height:1.3;text-align:center}.profile-modal .close-modal{top:14px;right:15px;font-size:42px;width:40px;height:40px;line-height:35px;color:#ac7a7a}.profile-body{padding:28px 22px 20px}.profile-identity{display:flex;gap:16px;align-items:center;margin-bottom:28px}.avatar-preview{width:76px;height:76px;border:5px solid;border-radius:14px;overflow:hidden;background:#d6e9b5;flex-shrink:0;box-shadow:inset 0 0 0 2px #fff8}.avatar-preview img{width:100%;height:100%;object-fit:cover}.profile-player-name{background:#faece1;border-radius:12px;padding:17px 12px;text-align:center;flex:1;min-width:0;font-size:23px;font-weight:750;overflow-wrap:anywhere}.profile-tabs{display:flex;gap:5px}.profile-tabs button{flex:1;border:0;background:#eedbcd;color:#ba9988;font-size:24px;font-weight:750;padding:12px;border-radius:18px 18px 0 0}.profile-tabs button[aria-selected="true"]{background:#ba8661;color:white}.profile-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:20px 15px;background:#faece1;border-radius:0 0 17px 17px;min-height:115px;align-content:start}.profile-choice{position:relative;aspect-ratio:1;padding:0;background:#d7e7bd;border:3px solid transparent;border-radius:11px;min-width:0}.profile-choice img{width:100%;height:100%;object-fit:cover;display:block;border-radius:7px}.profile-choice[aria-pressed="true"]{outline:3px solid #47b96b;outline-offset:2px}.profile-choice.frame-choice{border-width:6px}.avatar-check{position:absolute;right:-9px;bottom:-9px;border-radius:50%;background:#0cbd63;color:white;font-size:19px;font-weight:800;line-height:26px;width:26px;box-shadow:0 0 0 2px #fffcf8}.profile-modal #confirm-profile{width:100%;border:0;border-radius:999px;font-size:30px;font-weight:750;padding:16px;margin:28px 0 10px;background:#f49618;color:white;box-shadow:0 5px 15px #efac4966}.profile-account{display:block;margin:auto;border:0;background:none;color:#a17c65;font-size:12px;padding:10px}.home-avatar{overflow:hidden}.home-avatar img{border-radius:7px}.profile-tabs button:focus-visible,.profile-choice:focus-visible{outline:3px solid #735861;outline-offset:3px}@media(max-width:370px){.profile-body{padding:22px 15px}.profile-choices{gap:10px;padding:17px 10px}.profile-player-name{font-size:19px}.profile-identity{gap:10px}}

/* Daily podium and ranked player cards. All positions and scores come from the service. */
dialog.leaderboard-modal{width:520px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:0;border-radius:27px;background:linear-gradient(#ffe3a6,#fff7df 40%,#faf7ef);color:#9e6265;overflow:auto}.leaderboard-modal .close-modal{z-index:2;top:12px;right:12px;background:#fff;border-radius:50%;width:35px;height:35px;font-size:29px;color:#a16b6a}.leaderboard-heading{text-align:center;padding:23px 48px 0}.leaderboard-heading h2{position:relative;background:#ffc33e;color:white;font-size:29px;padding:11px 8px;margin:0;border-radius:13px;box-shadow:0 4px 0 #e8a620,0 6px 10px #d69f3033}.leaderboard-heading>p{background:#fffaf4;border-radius:0 0 15px 15px;display:inline-block;margin:4px 0 0;padding:5px 15px;font-size:19px;font-weight:800;font-variant-numeric:tabular-nums}.leaderboard-body{padding:12px 15px 24px}.ranking-filters{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.ranking-filters .level-tabs{margin:6px 0;gap:3px}.ranking-filters button{font-size:12px;padding:6px 12px}.leaderboard-modal .ranking-period{font-size:10px;margin:2px 0 15px}.ranking-podium{display:flex;justify-content:center;align-items:flex-end;gap:7px;margin:18px 0 16px}.podium-place{flex:1;min-width:0;text-align:center;display:flex;align-items:center;flex-direction:column}.ranking-portrait{width:51px;height:51px;object-fit:cover;border:4px solid;border-radius:12px;background:#f4e3c5;flex-shrink:0}.podium-place>.ranking-portrait,.podium-empty{width:69px;height:69px;z-index:1;margin-bottom:-2px}.podium-empty{display:grid;place-items:center;border:4px solid #efbf70;border-radius:15px;background:#fff5d2;font-size:30px;font-weight:750;color:#ddba7c}.podium-1>.ranking-portrait,.podium-1>.podium-empty{width:83px;height:83px}.podium-plinth{width:100%;position:relative;background:linear-gradient(#ffd259,#fff5ce);border-top:9px solid #fbb831;border-radius:50% 50% 15px 15px / 14px 14px 10px 10px;padding:22px 4px 10px;min-height:112px;display:flex;flex-direction:column;align-items:center;gap:7px}.podium-2 .podium-plinth{background:linear-gradient(#beb4ef,#f5f0ff);border-color:#8fa4e7;min-height:91px}.podium-3 .podium-plinth{background:linear-gradient(#ffb578,#fff0df);border-color:#f58b4b;min-height:82px}.podium-medal{position:absolute;top:-12px;background:#f7b21e;border:3px solid #ffe184;border-radius:50%;width:30px;height:34px;color:white;font-size:20px;display:grid;place-items:center}.podium-2 .podium-medal{background:#6d9edb;border-color:#c9dcfa}.podium-3 .podium-medal{background:#e88842;border-color:#ffd39c}.podium-plinth strong{font-size:15px;overflow-wrap:anywhere;max-width:100%}.podium-plinth>span{font-size:13px;background:#fffaf1;border-radius:20px;padding:3px 10px;font-weight:750}.ranking-list{background:white;border-radius:18px;padding:9px;max-height:290px;overflow:auto;font-size:14px}.rank-card{display:flex;align-items:center;gap:9px;padding:9px;background:#fbf3ed;border-radius:12px;margin-bottom:7px;min-width:0}.rank-card:last-child{margin-bottom:0}.rank-badge{color:#c88948;font-size:20px;min-width:24px;text-align:center}.rank-identity{min-width:0;flex:1;display:flex;flex-direction:column;text-align:left;gap:3px}.rank-identity strong{font-size:16px;overflow-wrap:anywhere}.rank-identity small{font-size:10px;color:#638e52}.rank-score{font-size:14px;font-weight:750;background:#fffdf3;border-radius:18px;padding:4px 8px;white-space:nowrap}.rank-card.is-player{background:#ffe1b9}.ranking-me{margin-top:8px;border:3px solid white;border-radius:15px}.ranking-info{font-size:11px;text-align:center;margin:15px 0;color:#9b7a66}.ranking-info summary{cursor:pointer}.ranking-info p{font-size:12px}.leaderboard-modal #ranking-play{display:block;width:90%;margin:18px auto 0;background:#f49618;color:white;border:0;border-radius:999px;padding:14px;font-size:23px;font-weight:750;box-shadow:0 5px 15px #efac4966}@media(max-width:370px){.leaderboard-heading{padding-left:38px;padding-right:38px}.leaderboard-heading h2{font-size:24px}.ranking-portrait{width:39px;height:39px}.rank-card{gap:6px;padding:7px}.rank-identity strong{font-size:13px}.rank-score{font-size:11px;padding:4px 6px}.podium-plinth strong{font-size:12px}.leaderboard-body{padding-left:10px;padding-right:10px}}

.ranking-filters .level-tabs button{white-space:nowrap;flex:none}.ranking-filters .level-tabs{flex:initial}
@media(max-height:780px){.leaderboard-heading{padding-top:15px}.leaderboard-heading h2{font-size:25px;padding:8px}.leaderboard-body{padding-top:5px;padding-bottom:14px}.leaderboard-modal .ranking-period{margin-bottom:6px}.ranking-podium{margin:10px 0}.podium-place>.ranking-portrait,.podium-empty{width:55px;height:55px}.podium-1>.ranking-portrait,.podium-1>.podium-empty{width:67px;height:67px}.podium-plinth{min-height:85px;padding-top:20px}.podium-2 .podium-plinth{min-height:75px}.podium-3 .podium-plinth{min-height:65px}.ranking-list{max-height:180px}.rank-card{padding:6px}.ranking-portrait{width:43px;height:43px}.ranking-info{margin:9px 0}.leaderboard-modal #ranking-play{margin-top:10px;padding:11px;font-size:21px}}

/* Tutorial hints share the gameplay preview styles and Apply action. */
.ftue-modal.hint-modal .ftue{padding:0;min-height:0;background:transparent;gap:18px}
.ftue-modal.hint-modal .ftue-heading{background:none;padding:0;min-height:0;box-shadow:none}
.ftue-modal.hint-modal #ftue-progress{display:none}
.ftue-modal.hint-modal .ftue-footer{background:none;padding:0;min-height:0;margin:0}
.ftue-modal.hint-modal .hint-caption{margin-bottom:18px}
.ftue-modal.hint-modal .ftue-cell{background:var(--tile);border-radius:7px;opacity:1}
.ftue-modal.hint-modal .ftue-cell.hint-dim{opacity:.65}
.ftue-modal.hint-modal .ftue-cell img{width:76%;height:76%}

.ftue-modal.hint-modal .close-modal{background:transparent;color:white}

/* Keep rankings immediately above campaign play, with flexible space above. */
.home-leaderboard{margin-top:auto;margin-bottom:12px}
.home-actions{margin-top:0;padding-top:0}
/* Treat races, podium gifts, and the illustrated rewards guide. */
.leaderboard-modal .close-modal{left:12px;right:auto}.ranking-info-button{position:absolute;z-index:3;right:12px;top:12px;border:0;border-radius:50%;background:white;color:#a16b6a;width:35px;height:35px;font-size:27px;font-weight:800;font-family:Georgia,serif}.rank-treats{display:inline-flex!important;align-items:center;justify-content:center;gap:5px;white-space:nowrap;font-size:19px!important;font-weight:800;background:#fffaf0;border-radius:99px;padding:3px 9px!important}.rank-treats img{width:27px;height:19px;object-fit:contain}.rank-gift{width:42px;height:45px;object-fit:contain;flex-shrink:0}.podium-plinth>.rank-gift{width:52px;height:54px}.podium-plinth{gap:5px}.rank-card .rank-gift{margin-left:0}.ranking-identity small{display:block}.ranking-info{font-size:11px}#ranking-gifts{display:block;margin:12px auto 0;border-radius:30px;border:1px solid #dfba7d;padding:9px 25px;background:#fff6df;color:#9e6265;font-weight:750}.reward-frame{border-style:double!important;border-width:6px!important;box-shadow:0 0 0 2px #fff4bf,0 0 10px #ffc34766}.weekly-frame{outline:2px dashed #a387d7;outline-offset:2px}.profile-choice:disabled{cursor:not-allowed;opacity:.58;filter:grayscale(.35)}.avatar-lock{position:absolute;right:-3px;bottom:-3px;font-size:20px}.gift-list{max-height:330px;overflow:auto}.gift-row{display:flex;align-items:center;gap:14px;text-align:left;background:#fff3dd;border-radius:12px;padding:8px;margin-bottom:8px;font-size:14px}.gift-row .rank-gift{width:56px;height:58px}
.leaderboard-modal.rewards-open{overflow:hidden}.rewards-overlay{position:absolute;inset:0;z-index:8;background:#fffaf1;color:#76554c;display:flex;flex-direction:column;border-radius:25px;overflow:hidden;text-align:left}.rewards-header{position:relative;flex-shrink:0;padding:23px 42px 20px;background:linear-gradient(120deg,#ffe99b,#ffcf76);border-bottom:3px solid #fff0ca;text-align:center}.rewards-overlay h2{font-size:24px;color:#865335;margin:0;line-height:1.2;text-shadow:0 2px #fff5d1}.rewards-header button{position:absolute;left:12px;top:18px;border:0;border-radius:50%;background:#fff9e9;color:#aa7256;width:32px;height:32px;font-size:28px;line-height:1}.reward-flow{overflow-y:auto;flex:1;min-height:0;padding:13px 13px 8px}.reward-step{display:flex;align-items:center;gap:16px;padding:12px 14px;margin-bottom:9px;border-radius:20px;background:#eee5ff;border:2px solid #e4d6ff;min-height:114px}.reward-step:nth-child(2){flex-direction:row-reverse;background:#fff1c7;border-color:#ffe4a0}.reward-step:nth-child(3){background:#e2f3ff;border-color:#cbe8ff}.reward-step:nth-child(4){flex-direction:row-reverse;background:#eaf6d6;border-color:#d8edb8}.reward-art{width:103px;flex:0 0 103px;height:103px;display:grid;place-items:center;border-radius:50%;background:#fff9;box-shadow:0 4px 0 #ffffff60}.reward-copy{flex:1;min-width:0}.rewards-overlay h3{font-size:18px;line-height:1.2;margin:0 0 7px;color:#86526a}.rewards-overlay .reward-copy p{text-align:left;font-size:13px;line-height:1.45;margin:0;color:#806c64}.reward-mini-board{display:grid;grid-template-columns:repeat(3,1fr);width:83px;height:83px;gap:3px;background:white;padding:4px;border-radius:10px;transform:rotate(-7deg);box-shadow:0 4px 7px #a88ac044}.reward-mini-board>*{width:100%;height:100%;min-height:0;min-width:0;background:#9e85df;border-radius:3px;color:white;font-size:25px;line-height:1;text-align:center;object-fit:contain}.reward-mini-board>*:nth-child(3n){background:#efc84e}.reward-mini-board>*:nth-child(3n + 1){background:#ed96b6}.reward-big-treat{width:91px;height:78px;object-fit:contain;filter:drop-shadow(0 4px 3px #d88c3644);transform:rotate(-23deg)}.reward-mini-podium{display:flex;justify-content:center;align-items:flex-end;gap:3px;height:76px}.reward-mini-podium span{width:25px;height:48px;border-radius:8px 8px 4px 4px;background:#a494e3;display:grid;place-items:center;font-size:27px;color:white;font-weight:800;box-shadow:inset 0 3px 4px #fff9,0 3px 0 #b58b6644}.reward-mini-podium span:nth-child(2){height:72px;background:#ffc33e}.reward-mini-podium span:last-child{height:40px;background:#f79b54}.reward-prize-preview{display:flex;justify-content:center;align-items:center;width:105px;height:100px}.reward-prize-preview>img:first-child{width:75px;height:85px;filter:drop-shadow(0 3px 5px #e5ab5266)}.reward-prize-preview>img:last-child{width:49px;height:49px;border:5px double #ffd154;border-radius:12px;margin-left:-28px;margin-top:40px}.rewards-overlay .reward-rules{font-size:11px;line-height:1.5;text-align:center;margin:12px 4px;color:#99816c}.rewards-footer{flex-shrink:0;padding:13px 19px 17px;background:#fffaf1;border-top:2px solid #f7e9d5}.rewards-overlay #rewards-continue{width:100%;border:0;border-radius:30px;padding:13px;background:linear-gradient(#ffa725,#f28a10);box-shadow:0 4px 0 #dc7914,0 6px 13px #f6a13240;color:white;font-size:23px;font-weight:800}.rewards-overlay button:focus-visible{outline:3px solid #8c72cd;outline-offset:3px}
.leaderboard-modal .rank-identity{min-width:0}.leaderboard-modal .rank-card{gap:6px}.leaderboard-modal .rank-identity strong{font-size:14px}.leaderboard-modal .rank-card .rank-treats{font-size:17px!important}
@media(max-width:370px){.rank-card .rank-gift{width:32px;height:37px}.rank-card .rank-treats img{width:22px}.rank-card .rank-treats{gap:3px;padding:3px 6px!important}.rewards-header{padding:22px 44px 18px}.rewards-overlay h2{font-size:20px}.reward-step{gap:12px;padding:15px 10px}.reward-art{width:86px;height:86px;flex-basis:86px}.rewards-overlay h3{font-size:16px}.rewards-overlay .reward-copy p{font-size:12px}.reward-mini-board{width:71px;height:71px}.reward-big-treat{width:78px}}
#friends-board:disabled{opacity:.4;filter:grayscale(1);cursor:not-allowed;background:#e8dfd0;color:#9b9081}

/* Keep the short rewards guide balanced at phone and desktop widths. */
.leaderboard-modal.rewards-open{height:min(780px,calc(100dvh - 16px))}.rewards-open .reward-flow{display:flex;flex-direction:column;gap:12px;padding:16px 13px 10px}.rewards-open .reward-step{flex:1;margin:0;min-height:108px;gap:18px;padding:14px}.rewards-open .reward-copy h3{font-size:19px;margin-bottom:9px}.rewards-open .reward-copy p{font-size:15px;line-height:1.45}.rewards-open .reward-rules{flex-shrink:0;margin:1px 0 0;font-size:11px}.rewards-open .reward-art{width:100px;height:100px;flex-basis:100px}@media(max-width:370px){.rewards-open .reward-step{gap:12px;padding:12px}.rewards-open .reward-art{width:83px;height:83px;flex-basis:83px}.rewards-open .reward-copy h3{font-size:17px}.rewards-open .reward-copy p{font-size:14px}}

/* Native account entry: warm cream and caramel, with a clear edge on pale artwork. */
.home-account{display:flex;flex-direction:column;align-items:center;gap:8px;margin:-12px 0 16px;flex-shrink:0}
.home-sign-in{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:46px;padding:10px 25px;border:1.5px solid #b98251;border-radius:999px;background:linear-gradient(160deg,#fffdf7,#f4dfbe);box-shadow:inset 0 2px 1px #fff,0 3px 0 #d0a77a,0 5px 12px #8c603f20;color:#754724;font-size:17px;font-weight:750}
.home-sign-in svg{width:23px;height:23px;fill:currentColor;stroke:none}
.home-sign-in:hover{background:linear-gradient(160deg,#fff8e9,#ecd0a5)}
.home-sign-in:active{transform:translateY(1px);box-shadow:inset 0 1px 1px #fff,0 2px 0 #d0a77a}
.home-sign-in:focus-visible{outline:3px solid #754724;outline-offset:4px}
.home-account p{margin:0;color:#795a43;font-size:11px;text-align:center;line-height:1.4}
@media(max-height:740px){.home-screen:has(.home-account:not([hidden])) .home-logo{margin-top:30px;margin-bottom:25px}}

/* Keep native navigation reachable on short phones and with enlarged text. */
.home-screen{overflow-y:auto}
.home-actions{flex-shrink:0}
.home-arcade{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:6px 12px}
@media(max-height:640px){
  .home-screen:has(.home-account:not([hidden])) .home-logo{font-size:60px;margin-top:12px;margin-bottom:18px}
  .home-account{gap:6px;margin-bottom:10px}
  .home-actions{gap:8px}
}
