/* Polly the cat game: room stage, wardrobe shop, partner, 3D home, memes */
.pet-page { display: grid; gap: 18px; padding-block: 18px; }
.pet-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.pet-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pet-name input { font: inherit; font-size: 1.4rem; width: 9em; padding: .1em .4em; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.pet-link { appearance: none; border: 0; background: none; color: var(--accent); font: 500 .85rem var(--font-body); cursor: pointer; padding: 0; }
.pet-meters { display: flex; align-items: center; gap: 16px; }
.pet-meter { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); min-width: 140px; }
.pet-meter .bar { display: block; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pet-meter .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff7aa8, #ffb627); transition: width .5s; }
.pet-gems, .pg-gem-row { display: inline-flex; align-items: center; gap: 6px; font: 700 1.15rem var(--font-target); }
.pg-gem { width: 1em; height: 1em; fill: var(--c1); vertical-align: -.12em; flex: none; }

.pet-stage {
  position: relative; height: clamp(300px, 52vw, 420px); border-radius: 24px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(#fde9c9 0 66%, #c99a6b 66% 100%);
  box-shadow: var(--shadow), inset 0 -2px 0 rgb(0 0 0 / .06);
}
:root[data-theme="dark"] .pet-stage { background: linear-gradient(#2c3352 0 66%, #6b4f37 66% 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pet-stage { background: linear-gradient(#2c3352 0 66%, #6b4f37 66% 100%); } }
.pet-stage.laser-on { cursor: none; }
.pet-window { position: absolute; top: 10%; inset-inline-start: 8%; width: 22%; aspect-ratio: 1.15; border-radius: 12px; background: linear-gradient(#9fd8ff, #d8f1ff); border: 8px solid #fff7ea; box-shadow: 0 2px 0 rgb(0 0 0 / .08); }
.pet-window::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent calc(50% - 3px), #fff7ea 0 calc(50% + 3px), transparent 0), linear-gradient(transparent calc(50% - 3px), #fff7ea 0 calc(50% + 3px), transparent 0); }
.pet-shelf { position: absolute; top: 24%; inset-inline-end: 9%; width: 20%; height: 10px; border-radius: 4px; background: #b07a4f; box-shadow: 0 -26px 0 -2px transparent; }
.pet-shelf::before { content: ''; position: absolute; bottom: 10px; inset-inline-start: 10%; width: 70%; height: 30px; background: linear-gradient(90deg, #e2463b 0 18%, transparent 0 22%, #3fb56b 0 38%, transparent 0 42%, #2f6fe0 0 58%, transparent 0 62%, #ffb627 0 80%, transparent 0); border-radius: 3px 3px 0 0; }
.pet-rug { position: absolute; bottom: 7%; left: 50%; width: 62%; height: 15%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(#ffd0e4 0 45%, #ff9cc4 46% 58%, #ffd0e4 59%); opacity: .85; }
.pet-actors { position: absolute; inset: 0; }
.pet-actor { position: absolute; bottom: 3%; left: 50%; width: clamp(210px, 36vw, 320px); transform: translateX(calc(-50% + var(--cat-x, 0px))); cursor: grab; }
.pet-actor.mila { width: clamp(185px, 31vw, 280px); }
.cat-rig, .cat-rig svg { display: block; width: 100%; height: auto; overflow: visible; }
.pet-laser { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #ff2d2d; box-shadow: 0 0 10px 4px rgb(255 45 45 / .6); pointer-events: none; }
.pet-hint { position: absolute; top: 10px; inset-inline-end: 12px; max-width: 46%; background: rgb(255 255 255 / .8); color: #33240f; padding: .35em .8em; border-radius: 10px; }
.pet-bowl { position: absolute; bottom: 5%; left: 50%; transform: translateX(calc(-50% + var(--bx))); width: 64px; height: 30px; background: #e2463b; border-radius: 6px 6px 30px 30px; display: grid; place-items: start center; font-size: 26px; line-height: 0; }
.pet-bubble { position: absolute; bottom: 92%; left: calc(50% + 24% * var(--cat-face, 1)); transform: translateX(-50%); width: max-content; max-width: 240px; background: #fff; color: #161d2e; border-radius: 16px; padding: .5em .9em; box-shadow: 0 6px 20px rgb(0 0 0 / .15); display: grid; gap: 2px; text-align: center; animation: pet-pop .3s cubic-bezier(.2, 1.4, .4, 1); z-index: 2; }
.pet-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; }
.pet-bubble .tgt { font: 600 1rem var(--font-target); }
.pet-bubble .tr { font-size: .8rem; color: #5a6479; }
.pet-heart { position: absolute; top: 14%; left: calc(50% + 24% * var(--cat-face, 1)); color: #ff4f87; font-size: 26px; pointer-events: none; animation: pet-heart 1.4s ease-out forwards; }
@keyframes pet-heart { from { transform: translate(-50%, 0) scale(.4); opacity: 0; } 20% { opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), -110px) scale(1.2); opacity: 0; } }
@keyframes pet-pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

.pet-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pet-tool { appearance: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .55em 1.05em; font: 500 .95rem var(--font-body); cursor: pointer; box-shadow: var(--shadow); }
.pet-tool:hover { border-color: var(--accent); }
.pet-tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.pt-ic { font-size: 1.15em; }

.pet-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pet-card { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.pet-card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pet-card .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pet-card.unlock { grid-template-columns: 100px 1fr; align-items: center; }
.pet-card.locked { opacity: .7; }
.pet-card.locked .pc-art { filter: grayscale(1); }
.pc-art svg { width: 100px; height: auto; display: block; }
.pc-emoji { font-size: 54px; display: grid; place-items: center; }
.pet-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pet-tasks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; font-size: .92rem; }
.pet-tasks li.done span:nth-child(2) { color: var(--muted); text-decoration: line-through; }
.pt-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; font-size: .75rem; color: #fff; }
.pet-tasks li.done .pt-check { background: var(--ok); border-color: var(--ok); }
.pt-rew { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: .85rem; }

.pet-shop { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.shop-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.shop-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.shop-cats button { appearance: none; border: 1px solid var(--rule); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: .4em .95em; font: 500 .9rem var(--font-body); cursor: pointer; white-space: nowrap; }
.shop-cats button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.shop-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(140px, 42%), 1fr)); }
.pet-item { border: 2px solid var(--rule); border-radius: 14px; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; gap: 6px; justify-items: center; text-align: center; background: var(--bg); }
.pet-item.on { border-color: var(--ok); background: var(--ok-soft); }
.si-art svg { width: 130px; height: auto; display: block; }
.si-name { font-size: .88rem; }
.si-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.si-act .btn { display: inline-flex; align-items: center; gap: 4px; }

.pet-cheer { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-block: 10px; }
.pet-cheer .pc-art svg { width: 140px; }

.pet-modal { position: fixed; inset: 0; background: rgb(10 14 26 / .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.pm-card { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 22px; max-width: 420px; width: 100%; display: grid; gap: 10px; text-align: center; box-shadow: var(--shadow); }
.pm-art svg { width: 190px; margin: 0 auto; display: block; }
.pm-word { font-size: 1.3rem; }
.pm-word .tgt, .pm-ex .tgt { font-family: var(--font-target); font-weight: 600; }
.speak-inline { appearance: none; border: 0; background: var(--surface-2); border-radius: 50%; width: 2em; height: 2em; cursor: pointer; }

/* 3D home */
.home-page { display: grid; gap: 14px; padding-block: 18px; }
.home-view { position: relative; height: clamp(360px, 62vw, 560px); border-radius: 22px; overflow: hidden; background: linear-gradient(#bfe3ff, #eaf6ff); box-shadow: var(--shadow); touch-action: none; }
.home-view canvas { display: block; width: 100%; height: 100%; }
.home-hud { position: absolute; top: 10px; inset-inline-start: 10px; inset-inline-end: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.home-hud > * { pointer-events: auto; }
.home-hud .btn { box-shadow: var(--shadow); }
.home-tip { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgb(255 255 255 / .85); color: #1f2440; padding: .35em .9em; border-radius: 999px; font-size: .82rem; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.home-pad { position: absolute; bottom: 44px; inset-inline-end: 12px; display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
.home-pad button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgb(255 255 255 / .85); font-size: 18px; cursor: pointer; }
.house-list, .furn-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.house-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.furn-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.house-card, .furn-card { border: 2px solid var(--rule); border-radius: 14px; padding: 10px; background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; gap: 6px; text-align: center; justify-items: center; }
.house-card.on, .furn-card.sel { border-color: var(--accent); }
.house-plan { width: 100%; height: 90px; }
.furn-ic { font-size: 30px; line-height: 1.1; }
.furn-card .muted { font-size: .78rem; }
.furn-card .btn { display: inline-flex; align-items: center; gap: 4px; }
.paint-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.paint-row button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--rule); cursor: pointer; }

/* memes */
.meme-page { display: grid; gap: 16px; padding-block: 18px; }
.meme-main { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 720px) { .meme-main { grid-template-columns: 1fr; } }
.meme-frame { background: var(--surface); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.meme-frame > svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.meme-frame > canvas { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.meme-arch canvas { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 8px; background: var(--surface-2); }
.meme-style { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.meme-style .pill.hot { background: #fff1e6; color: #b5480b; }
.meme-en { font-size: 1.05rem; line-height: 1.45; white-space: pre-line; margin: 0; }
.meme-side { display: grid; gap: 10px; }
.meme-tr { font-size: 1.02rem; }
.meme-note { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.meme-note .tgt { font-family: var(--font-target); font-weight: 600; }
.meme-arch { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.meme-arch button { appearance: none; border: 2px solid var(--rule); border-radius: 12px; padding: 4px; background: var(--surface); cursor: pointer; width: 100%; display: grid; gap: 2px; color: var(--muted); font-size: .75rem; }
.meme-arch button.on { border-color: var(--accent); }
.meme-arch button > svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.meme-side .lv-chip { justify-self: start; }
@media (max-width: 560px) { .pet-hint { max-width: 62%; font-size: .75rem; } .home-pad { bottom: 40px; } }
.btn.primary .pg-gem { fill: currentColor; }

/* yarn ball */
.pet-yarn { position: absolute; left: 50%; bottom: 0; width: 38px; height: 38px; border-radius: 50%; cursor: grab; touch-action: none; z-index: 3;
  background: repeating-linear-gradient(35deg, #e0457b 0 4px, #c2335f 4px 6px), #e0457b;
  box-shadow: inset -6px -6px 10px rgb(0 0 0 / .25), inset 4px 4px 8px rgb(255 255 255 / .25), 0 4px 6px rgb(0 0 0 / .2); }
.pet-yarn::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .35); border-left-color: transparent; border-bottom-color: transparent; }
.pet-yarn:active { cursor: grabbing; }

/* daily login gift */
.login-row { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.login-row li { border: 2px solid var(--rule); border-radius: 12px; padding: 6px 2px; display: grid; justify-items: center; gap: 2px; font-size: .8rem; background: var(--bg); }
.login-row li .pg-gem { width: 14px; height: 14px; }
.login-row li.got { opacity: .55; background: var(--surface-2); }
.login-row li.got::after { content: "✓"; color: var(--accent); font-weight: 700; }
.login-row li.now { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* word game */
.pm-card.wg { max-width: 460px; gap: 8px; }
.wg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wg-top h2 { margin: 0; font-size: 1.15rem; }
.wg-top .icon-btn { font-size: 1.4rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--muted); }
.wg-stage { position: relative; height: 168px; border-radius: 14px; overflow: hidden; background: linear-gradient(#dfe8f7 0 70%, #d8bf9c 70%); }
.wg-a { position: absolute; bottom: 2%; left: 50%; width: 190px; transform: translateX(-50%); }
.wg-stage:has(.mila) .wg-a { left: 64%; }
.wg-stage .wg-a.mila { left: 30%; width: 165px; }
.wg-mila { margin: 0; color: #c2477e; font-weight: 600; font-size: .9rem; }
.wg-hint { justify-self: center; }
.wg-opts .btn.gone { opacity: .25; text-decoration: line-through; }
.wg-dots { display: flex; justify-content: center; gap: 6px; }
.wg-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.wg-dots i.done { background: var(--accent); }
.wg-dots i.now { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.wg-ask { font-size: 1.1rem; margin: 4px 0 0; }
.wg-ask .tgt { font-family: var(--font-target); font-weight: 700; font-size: 1.3rem; }
.wg-ask .speak-inline { background: none; border: 0; cursor: pointer; font-size: 1.1rem; }
.wg-img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; margin: 0 auto; }
.wg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wg-opts .btn { justify-content: center; min-height: 46px; }
.wg-opts .btn.right { border-color: #2e9d5b; background: color-mix(in srgb, #2e9d5b 18%, var(--surface)); }
.wg-opts .btn.wrong { border-color: #d9475a; background: color-mix(in srgb, #d9475a 18%, var(--surface)); }
.wg-score { font-size: 1.3rem; font-weight: 700; }
.login-row .lg-n { display: inline-flex; align-items: center; gap: 3px; }
#pet-login .actions { justify-content: flex-start; }
@media (max-width: 560px) {
  .login-row { gap: 4px; counter-reset: lg; }
  .login-row li { font-size: .72rem; padding: 5px 0; counter-increment: lg; }
  .login-row li > .small { display: none; }
  .login-row li::before { content: counter(lg); font-weight: 700; color: var(--muted); }
  .login-row .lg-n { flex-direction: column; gap: 0; }
  .login-row li .pg-gem { width: 11px; height: 11px; }
}

/* sticker album */
.pet-album { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pet-album li { border: 2px dashed var(--rule); border-radius: 16px; padding: 10px; display: grid; gap: 4px; justify-items: center; text-align: center; background: var(--bg); }
.pet-album li .st-ic { font-size: 30px; line-height: 1.1; filter: grayscale(1); opacity: .45; }
.pet-album li.got { border-style: solid; border-color: #f6c445; background: color-mix(in srgb, #f6c445 12%, var(--surface)); }
.pet-album li.got .st-ic { filter: none; opacity: 1; animation: st-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.pet-album li strong { font-size: .92rem; }
.pet-album li .muted { font-size: .76rem; }
.st-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.st-rew { color: #b07a00; font-weight: 600; }
.pet-item .pill.small { font-size: .72rem; }
@keyframes st-pop { from { transform: scale(.4); } }

/* photo studio */
.pm-card.ps { max-width: 520px; gap: 8px; max-height: calc(100vh - 32px); overflow: auto; }
.ps-view > svg { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow); }
.ps-row { display: grid; gap: 4px; justify-items: start; text-align: start; }
.ps-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-opts button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--rule); background: var(--bg); font-size: 22px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ps-opts button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.ps-mila { display: flex; gap: 6px; align-items: center; justify-self: start; }

/* saved looks */
.pet-looks { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.pet-looks .look { display: grid; justify-items: center; gap: 0; }
.pet-looks .look-art, .pet-looks .look.empty { width: 78px; height: 64px; border-radius: 12px; border: 2px solid var(--rule); background: var(--bg); cursor: pointer; padding: 2px; display: grid; place-items: center; }
.pet-looks .look-art:hover { border-color: var(--accent); }
.pet-looks .look-art svg { width: 100%; height: 100%; }
.pet-looks .look.empty { border-style: dashed; font-size: 24px; color: var(--muted); }

/* meme maker */
.meme-maker .meme-main { margin-top: 6px; }
.mk-form { display: grid; gap: 6px; align-content: start; }
.mk-form label { display: grid; gap: 3px; color: var(--muted); }
.mk-form input { font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--rule); background: var(--bg); color: var(--ink); text-transform: uppercase; }
.mk-form input:focus { border-color: var(--accent); outline: none; }
.mk-form .ps-opts button { width: 36px; height: 36px; font-size: 19px; }
.mk-warn { color: #c2477e; margin: 0; }

/* brushing */
.pet-stage.brush-on, .pet-stage.brush-on .pet-actor { cursor: none; touch-action: none; }
.pet-brush { position: absolute; width: 46px; height: 46px; transform: translate(-50%, -85%) rotate(-20deg); pointer-events: none; z-index: 4; transition: transform .1s; }
.pet-brush.on { transform: translate(-50%, -85%) rotate(10deg) scale(.95); }
.pet-brush svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 3px rgb(0 0 0 / .25)); }
.pet-tuft { position: absolute; width: 12px; height: 9px; margin: -4px 0 0 -6px; border-radius: 50%; background: radial-gradient(#b9c1ce, #8f99aa 70%, transparent 72%); pointer-events: none; z-index: 3; animation: tuft 1.2s ease-out forwards; font-size: 14px; line-height: 1; }
.pet-tuft.cream { background: radial-gradient(#fffaf4, #efe6dc 70%, transparent 72%); }
.pet-tuft.shine { background: none; width: auto; height: auto; }
@keyframes tuft { to { transform: translate(var(--dx, 0), -60px) rotate(120deg); opacity: 0; } }
.home-view.night { background: linear-gradient(#0f1636, #2a2f5c); }
.pet-looks { display: grid; grid-template-columns: auto repeat(3, 78px); justify-content: start; align-items: start; }
.pet-looks .look.empty, .pet-looks .look-art { min-height: 0; margin: 0; }
@media (max-width: 420px) { .pet-looks { grid-template-columns: repeat(3, 78px); } .pet-looks > span { grid-column: 1 / -1; } }

/* fishing */
.pm-card.fg { max-width: 560px; }
.fg-pond { position: relative; height: 300px; border-radius: 16px; overflow: hidden; background: linear-gradient(#bfe9ff 0 14%, #4fb3e8 14%, #2479b8 100%); }
.fg-pond::before { content: ""; position: absolute; inset: 14% 0 auto; height: 6px; background: repeating-linear-gradient(90deg, #fff6 0 18px, transparent 18px 36px); }
.fg-cat { position: absolute; bottom: -2%; inset-inline-start: 50%; width: 130px; transform: translateX(-50%); pointer-events: none; z-index: 2; }
[dir="rtl"] .fg-cat { transform: translateX(50%); }
.fg-fish { position: absolute; left: 0; width: 138px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.fg-fish svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fg-fish span { position: relative; font-weight: 800; font-size: .92rem; color: #1f2440; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-fish.caught { animation: fg-up .9s ease-in forwards; }
.fg-fish.wrong { opacity: .45; }
.fg-fish.hint svg path { stroke: #fff; stroke-width: 5; }
@keyframes fg-up { to { top: 70% !important; opacity: 0; } }

/* real room photo behind the real cat */
.pet-stage, :root[data-theme="dark"] .pet-stage { background: #d9cdbd url(../media/pet/rooms/living.webp) center 62% / cover no-repeat; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pet-stage { background: #d9cdbd url(../media/pet/rooms/living.webp) center 62% / cover no-repeat; } }
.pet-stage .pet-window, .pet-stage .pet-shelf, .pet-stage .pet-rug { display: none; }
.pet-actor:has(.photo-cat) { width: clamp(250px, 42vw, 400px); bottom: 0; }
.photo-cat image { image-rendering: auto; }
.pc-zzz text { animation: pc-z 2.4s ease-in-out infinite; }
.pc-zzz text:nth-child(2) { animation-delay: .4s; } .pc-zzz text:nth-child(3) { animation-delay: .8s; }
@keyframes pc-z { 50% { opacity: .3; } }

/* Polly beside the lesson questions (js/pet/buddy.js): the real cat, standing on the page */
.buddy-host { position: relative; }
.buddy { --b: 84px; --look: 0; position: absolute; top: 44px; inset-inline-end: 0; width: var(--b); height: var(--b); z-index: 3; }
.lesson:has(> .buddy:not(.off)) > :is(.eyebrow, .q, .teach-head) { padding-inline-end: calc(var(--b) + 12px); }
.lesson:has(> .buddy:not(.off)) :is(.teach-cat, .fb-cat) { display: none; }
/* games and review cards: a smaller Polly in the free space of the header row */
:is(section.play, section.review) > .buddy { --b: 58px; top: -10px; inset-inline-end: 84px; }
:is(section.play, section.review) > .buddy .buddy-say { font-size: .78rem; }
.buddy-move { position: absolute; inset: 0; transform-origin: 50% 100%; will-change: transform; }
.buddy-shadow { position: absolute; left: 22%; right: 22%; bottom: 2%; height: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgb(25 28 40 / .32), rgb(25 28 40 / .12) 60%, transparent); transition: left .25s, right .25s; }
.buddy.walking .buddy-shadow { left: 14%; right: 14%; }
.buddy-win { position: relative; width: 100%; height: 100%; cursor: pointer; transform: rotate(calc(var(--look) * 3deg)); transform-origin: 50% 95%; transition: transform .5s ease; }
.buddy-body { --face: 1; position: absolute; inset: 0; transform: scaleX(var(--face)); }
.buddy-body > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 2px 3px rgb(20 24 40 / .18)); }
.buddy-pose, .buddy-walk, .buddy-walk-clip { opacity: 0; }
.buddy-pose { transform-origin: 50% 96%; animation: bd-breathe 2.6s ease-in-out infinite; }
.buddy-walk { top: 4%; }
.buddy.pose .buddy-pose, .buddy.walking :is(.buddy-walk, .buddy-walk-clip) { opacity: 1; }
.buddy:is(.pose, .walking) .buddy-idle, .buddy.walking .buddy-pose { opacity: 0; }
/* a phone scrolled down to the answer: Polly walks in along the bottom of the screen */
.buddy-host .buddy.float { position: fixed; top: auto; bottom: calc(10px + var(--lift, 0px)); inset-inline-start: 12px; inset-inline-end: auto; --b: 88px; }
.buddy.float .buddy-say { inset-inline-end: auto; inset-inline-start: calc(100% + 6px); }
.buddy.float .buddy-say::after { inset-inline-start: auto; inset-inline-end: 100%; border-inline-start-color: transparent; border-inline-end-color: #fff; }
.buddy.float .buddy-x { display: none; }
.buddy-win.bump { animation: bd-bump .35s ease; }
.buddy[data-fx="hop"] .buddy-pose { animation: bd-hop .55s ease-out 2, bd-breathe 2.6s ease-in-out 1.1s infinite; }
.buddy[data-fx="jump"] .buddy-pose { animation: bd-jump .8s cubic-bezier(.3, 1.4, .5, 1), bd-breathe 2.6s ease-in-out .8s infinite; }
.buddy[data-fx="nod"] .buddy-pose { animation: bd-nod 1.4s ease-in-out; }
.buddy[data-fx="paw"] .buddy-pose { animation: bd-paw .8s ease-in-out 2; }
.buddy[data-fx="sway"] .buddy-pose { animation: bd-sway 1.6s ease-in-out 2; }
.buddy[data-fx="wave"] .buddy-pose { animation: bd-paw .45s ease-in-out 4; }
.buddy[data-fx="perk"] .buddy-pose { animation: bd-perk .4s ease-in-out 3; }
.buddy[data-fx="peek"] .buddy-pose { animation: bd-sway .9s ease-in-out; }
.buddy[data-fx="breathe"] .buddy-pose { animation: bd-breathe 3.4s ease-in-out infinite; }
.buddy[data-fx="talk"] .buddy-pose { animation: bd-talk 2.8s ease-in-out infinite; }
@keyframes bd-breathe { 50% { transform: scale(1.012, 1.03); } }
@keyframes bd-bump { 40% { transform: scale(1.05); } }
@keyframes bd-hop { 40% { transform: translateY(-11%) scale(1, 1.03); } 70% { transform: translateY(0) scale(1.05, .95); } }
@keyframes bd-jump { 45% { transform: translateY(-22%) rotate(-5deg); } 80% { transform: translateY(0) scale(1.08, .92); } }
@keyframes bd-nod { 25% { transform: rotate(-7deg); } 55% { transform: rotate(4deg); } 80% { transform: rotate(-2deg); } }
@keyframes bd-paw { 50% { transform: rotate(-5deg) translateY(-2%); } }
@keyframes bd-sway { 30% { transform: rotate(-6deg); } 70% { transform: rotate(5deg); } }
@keyframes bd-perk { 50% { transform: scale(1.04, 1.06) translateY(-2%); } }
@keyframes bd-talk { 0%, 100% { transform: none; } 18% { transform: rotate(-2deg) scale(1.01, 1.025); } 36% { transform: rotate(1deg); } 60% { transform: rotate(-1deg) scale(1.01, 1.02); } 80% { transform: rotate(1.5deg); } }
.buddy-fx { position: absolute; inset: 0; pointer-events: none; }
.bf { position: absolute; left: 50%; top: 18%; font-size: calc(16px * var(--s)); line-height: 1; opacity: 0; animation: bd-fly 1.6s ease-out var(--d) forwards; }
.bf-heart { color: #ff4f87; } .bf-star { color: #ffb627; } .bf-note { color: #5b6bd6; } .bf-z { color: #5b6bd6; font-weight: 800; }
@keyframes bd-fly { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), -70px) scale(1.1); } }
.buddy-say { --t: 2.2s; position: absolute; top: 50%; inset-inline-end: calc(100% + 6px); transform: translateY(-50%) scale(.6); width: max-content; max-width: 46vw; margin: 0; padding: .45em .8em; border-radius: 14px; background: #fff; color: #1f2440; font-weight: 700; font-size: .86rem; line-height: 1.35; box-shadow: 0 6px 18px rgb(22 29 46 / .16); opacity: 0; pointer-events: none; }
.buddy-say::after { content: ''; position: absolute; top: 50%; inset-inline-start: 100%; margin-top: -6px; border: 6px solid transparent; border-inline-start-color: #fff; }
.buddy-say.on { animation: bd-say var(--t) ease forwards; }
@keyframes bd-say { 0% { opacity: 0; transform: translateY(-50%) scale(.6); } 5% { opacity: 1; transform: translateY(-50%) scale(1.04); } 9%, 92% { opacity: 1; transform: translateY(-50%) scale(1); } 100% { opacity: 0; transform: translateY(-50%) scale(.95); } }
.buddy-streak { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%) scale(0); padding: 1px 8px; border-radius: 999px; background: #ff7a1f; color: #fff; font-weight: 800; font-size: .78rem; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.buddy-streak.on { transform: translateX(-50%) scale(1); }
.buddy-x { position: absolute; top: -4px; inset-inline-start: -4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--surface, #fff); color: var(--muted, #667); box-shadow: var(--shadow); font-size: 14px; line-height: 24px; padding: 0; cursor: pointer; opacity: 0; transition: opacity .2s; }
.buddy:hover .buddy-x, .buddy-x:focus-visible, .buddy.off .buddy-x { opacity: 1; }
.buddy.off { width: 30px; height: 30px; }
.buddy.off > :not(.buddy-x) { display: none; }
.buddy.off .buddy-x { position: static; width: 30px; height: 30px; line-height: 30px; font-size: 16px; }
@media (hover: none) { .buddy-x { opacity: .85; } }
@media (min-width: 1180px) {
  .buddy { --b: 170px; top: 64px; inset-inline-end: calc(-1 * (var(--b) + 36px)); }
  .lesson:has(> .buddy:not(.off)) > :is(.eyebrow, .q, .teach-head) { padding-inline-end: 0; }
  :is(section.play, section.review) > .buddy { --b: 170px; top: 64px; inset-inline-end: calc(-1 * (var(--b) + 36px)); }
  .buddy-say { top: auto; bottom: calc(100% + 4px); inset-inline: auto; left: 50%; transform: translateX(-50%) scale(.6); max-width: 230px; font-size: .95rem; }
  .buddy-say::after { top: 100%; inset-inline: auto; left: 50%; margin: 0 0 0 -6px; border-color: transparent; border-top-color: #fff; }
  @keyframes bd-say-up { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 5% { opacity: 1; transform: translateX(-50%) scale(1.04); } 9%, 92% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(.95); } }
  .buddy-say.on { animation-name: bd-say-up; }
  .bf { font-size: calc(24px * var(--s)); }
}
/* phones: in games and review cards Polly stands in the header row, between the title and the timer, so she never covers it */
.buddy.inrow { position: relative; top: auto; inset-inline-end: auto; flex: none; --b: 52px; margin-block: -10px; }
.buddy.inrow .buddy-say { top: calc(100% + 6px); bottom: auto; inset-inline-start: auto; inset-inline-end: 0; transform: scale(.6); transform-origin: top right; max-width: min(240px, 70vw); font-size: .8rem; z-index: 5; }
[dir="rtl"] .buddy.inrow .buddy-say { transform-origin: top left; }
.buddy.inrow .buddy-say::after { top: auto; bottom: 100%; inset-inline-start: auto; inset-inline-end: 18px; margin: 0; border-color: transparent; border-bottom-color: #fff; }
@keyframes bd-say-down { 0% { opacity: 0; transform: scale(.6); } 5% { opacity: 1; transform: scale(1.04); } 9%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.95); } }
.buddy.inrow .buddy-say.on { animation-name: bd-say-down; }
.review-head > .buddy.inrow { align-self: center; margin-inline-start: auto; }
@media (prefers-reduced-motion: reduce) { .buddy-pose, .buddy-win { animation: none !important; } }

/* Polly's house (js/pet/house.js): real rooms, the real Polly */
.house { display: grid; gap: 12px; padding-block: 16px; }
.hs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hs-head h1 { margin: 0; }
.hs-money { display: inline-flex; gap: 14px; font-weight: 800; font-size: 1.05rem; }
.hs-money > span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; background: var(--surface, #fff); box-shadow: var(--shadow); }
.hs-rooms { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.hs-room { position: relative; flex: 0 0 auto; width: 112px; height: 64px; border-radius: 12px; border: 2px solid transparent; background: #ccc center / cover; color: #fff; font-weight: 700; font-size: .82rem; cursor: pointer; overflow: hidden; padding: 0; text-shadow: 0 1px 3px rgb(0 0 0 / .7); }
.hs-room::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgb(0 0 0 / .55)); }
.hs-room span, .hs-room small { position: absolute; inset-inline: 6px; z-index: 1; }
.hs-room span { bottom: 5px; }
.hs-room small { top: 5px; font-size: .72rem; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.hs-room.on { border-color: var(--accent, #4f46e5); box-shadow: 0 0 0 2px var(--accent, #4f46e5); }
.hs-room.locked { filter: grayscale(.7) brightness(.8); }
.hs-stage { position: relative; width: 100%; max-width: calc(66vh * 16 / 9); margin-inline: auto; overflow: hidden; border-radius: 18px; box-shadow: 0 10px 30px rgb(20 24 40 / .22); background: #ddd; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.hs-stage.pano { touch-action: pan-y; }
.hs-world.pano { cursor: grab; }
.hs-world.pano:active { cursor: grabbing; }
.hs-world.door .hs-gl { transition: opacity .25s; opacity: 0; }
.hs-door { position: absolute; z-index: 3000; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .6); background: rgb(20 24 40 / .55); color: #fff; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgb(0 0 0 / .25); white-space: nowrap; }
.hs-door:hover { background: rgb(35 70 196 / .85); }
.hs-door.locked { background: rgb(20 24 40 / .4); color: #e8e8f0; }
.hs-door[hidden] { display: none; }
.hs-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .5s; pointer-events: none; }
.hs-world.gl { background-image: none !important; background-color: #222; }
.hs-world.gl .hs-gl { opacity: 1; }
.hs-world { position: absolute; top: 0; left: 0; right: auto; background: center / 100% 100% no-repeat; cursor: pointer; will-change: transform; }
.hs-things { position: absolute; inset: 0; }
.hs-thing { position: absolute; transform: translate(-50%, -96%); width: auto; max-width: none; pointer-events: auto; filter: saturate(.95) contrast(.97); }
.hs-thing:hover { filter: brightness(1.06) drop-shadow(0 0 6px rgb(255 255 255 / .8)); }
.hs-cat { position: absolute; transform: translate(calc(-1 * var(--fx, 50%)), calc(-100% + var(--base, 1.5%))); pointer-events: auto; cursor: grab; }
.hs-cat img { display: block; height: 100%; width: auto; max-width: none; transform: scaleX(var(--face, 1)); transform-origin: var(--fx, 50%) 100%; filter: contrast(1.02) saturate(.96); }
.hs-shadow { position: absolute; left: 50%; bottom: 0; width: 70%; height: 10%; transform: translate(-50%, 45%); border-radius: 50%; background: radial-gradient(closest-side, rgb(20 16 10 / .35), transparent); }
.hs-cat[data-clip="walk"] .hs-shadow { width: 80%; }
.hs-cat[data-clip="idle"] .hs-shadow, .hs-cat[data-clip="ask"] .hs-shadow, .hs-cat[data-clip="purr"] .hs-shadow { width: 62%; }
.hs-say { position: absolute; z-index: 2000; transform: translate(-50%, -100%); margin: 0; margin-top: -10px; padding: .5em .85em; max-width: min(320px, 80vw); width: max-content; border-radius: 16px; background: #fff; color: #1f2440; box-shadow: 0 8px 24px rgb(20 24 40 / .25); display: grid; gap: 2px; text-align: center; pointer-events: none; }
.hs-say strong { font-size: 1.05rem; }
.hs-say span { font-size: .85rem; color: #5a607a; }
.hs-say::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.hs-say.on { animation: hs-pop .35s cubic-bezier(.3, 1.5, .5, 1); }
.hs-say[hidden] { display: none; }
@keyframes hs-pop { from { transform: translate(-50%, -100%) scale(.6); opacity: 0; } }
.hs-heart { position: absolute; z-index: 2001; color: #ff4f87; font-size: 22px; pointer-events: none; opacity: 0; animation: hs-heart 2s ease-out forwards; }
@keyframes hs-heart { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-90px) scale(1.2); } }
.hs-tour { position: relative; width: 100%; max-width: calc(64vh * 16 / 9); margin-inline: auto; border-radius: 18px; overflow: hidden; background: #111; box-shadow: var(--shadow); }
.hs-tour video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hs-dream { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; justify-self: start; font: inherit; color: inherit; }
.hs-dream img { width: 84px; height: auto; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .25)); }
.hs-dream-say { position: relative; display: grid; gap: 2px; background: var(--surface, #fff); border: 1px solid var(--rule); border-radius: 14px; padding: 8px 12px; font-weight: 700; box-shadow: var(--shadow); text-align: start; }
.hs-dream-say small { font-weight: 400; color: var(--muted); }
.hs-gallery figure { margin: 0; }
.hs-gallery figcaption { font-size: .85rem; }
.hs-goal { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 10px; }
.hs-goal:empty { display: none; }
.hs-goal > img { width: 92px; height: 56px; object-fit: cover; border-radius: 10px; }
.hs-goal-txt { display: grid; gap: 5px; min-width: 0; }
.hs-goal-txt p { margin: 0; }
.hs-goal-bar { position: relative; height: 18px; border-radius: 99px; background: linear-gradient(90deg, #f2b632 var(--v, 0%), rgb(0 0 0 / .08) var(--v, 0%)); }
.hs-goal-bar i { display: none; }
.hs-goal-bar span { position: absolute; inset: 0; display: flex; gap: 3px; align-items: center; justify-content: center; font-size: .74rem; font-weight: 700; }
.hs-goal-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hs-how { grid-column: 1 / -1; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.hs-how p { margin: 2px 0; }
@media (max-width: 640px) { .hs-goal { grid-template-columns: 64px 1fr; } .hs-goal > img { width: 64px; height: 44px; } .hs-goal-acts { grid-column: 1 / -1; justify-content: flex-start; } }
.hs-needs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hs-need { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; }
.hs-need i { display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #3fbf7f var(--v), rgb(0 0 0 / .08) var(--v)); }
.hs-need.low i { background: linear-gradient(90deg, #f0623f var(--v), rgb(0 0 0 / .08) var(--v)); }
.hs-need.low span { color: #d9482b; }
.hs-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-row { display: flex; flex-wrap: wrap; gap: 10px; }
.hs-card { display: grid; justify-items: center; gap: 4px; width: 118px; padding: 8px; border-radius: 14px; background: var(--surface, #fff); box-shadow: var(--shadow); border: 2px solid transparent; font: inherit; font-size: .8rem; text-align: center; cursor: pointer; color: inherit; }
.hs-card img { height: 64px; width: auto; max-width: 100%; object-fit: contain; }
.hs-card.wide { width: 170px; }
.hs-card.wide img { height: 80px; width: 100%; object-fit: cover; border-radius: 8px; }
.hs-card small { display: block; color: var(--muted, #667); }
.hs-card.sel { border-color: var(--accent, #4f46e5); }
.hs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hs-shop { padding: 12px; border-radius: 16px; background: rgb(0 0 0 / .03); }
.hs-food { margin-top: 6px; }
@media (max-width: 640px) { .hs-needs { grid-template-columns: repeat(5, 1fr); gap: 5px; } .hs-need { font-size: .7rem; } .hs-card { width: 100px; } }
@media (prefers-reduced-motion: reduce) { .hs-say.on, .hs-heart { animation: none; } }
.hs-dances[hidden] { display: none; }
.hs-dances { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hs-dances .hs-en { font-weight: 700; }

/* ---------- the sea behind Polly's pages (js/pet/seascape.js) ---------- */
.sea-bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; display: block; }
.sea-bg[hidden] { display: none; }
body.sea-on::before { display: none; }
body.sea-on #view {
  --glass: color-mix(in srgb, var(--surface) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 42%, transparent); border-radius: 28px;
  padding-inline: clamp(10px, 2vw, 26px); margin-block: 10px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgb(8 30 60 / .18);
}
body.sea-on[data-sea="night"] #view { background: color-mix(in srgb, var(--bg) 66%, transparent); }
body.sea-on :is(.pet-card, .pet-shop, .hs-goal, .meme-main, .meme-side, .meme-arch) {
  background: var(--glass); border: 1px solid rgb(255 255 255 / .5); box-shadow: 0 10px 30px rgb(10 40 70 / .12);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.sea-on :is(.pet-card, .pet-shop, .hs-goal, .meme-main, .meme-side, .meme-arch) { border-color: rgb(255 255 255 / .08); } }
:root[data-theme="dark"] body.sea-on :is(.pet-card, .pet-shop, .hs-goal, .meme-main, .meme-side, .meme-arch) { border-color: rgb(255 255 255 / .08); }
body.sea-on .pet-stage, body.sea-on .hs-stage { box-shadow: 0 18px 50px rgb(8 30 60 / .3); }
.sea-ctl { position: fixed; z-index: 45; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: start; gap: 8px; direction: rtl; }
.sea-ctl[hidden] { display: none; }
.sea-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .6); font-size: 1.35rem; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 20px rgb(8 30 60 / .25); }
.sea-menu { order: -1; display: grid; gap: 4px; padding: 8px; border-radius: 18px; min-width: 150px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgb(8 30 60 / .25); }
.sea-menu[hidden] { display: none; }
.sea-menu button { font: 500 .92rem var(--font-body); color: var(--ink); background: none; border: 0; border-radius: 12px; padding: .5em .8em; text-align: start; cursor: pointer; }
.sea-menu button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sea-menu button.on { background: color-mix(in srgb, var(--accent) 20%, transparent); font-weight: 700; }
@keyframes sea-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  body.sea-on :is(.pet-card, .pet-shop, .hs-goal, .meme-main, .meme-side) { animation: sea-rise .55s cubic-bezier(.2, .8, .2, 1) both; transition: transform .25s ease, box-shadow .25s ease; }
  body.sea-on :is(.pet-card, .pet-shop):nth-of-type(2) { animation-delay: .06s; }
  body.sea-on :is(.pet-card, .pet-shop):nth-of-type(3) { animation-delay: .12s; }
  body.sea-on :is(.pet-card, .pet-shop):nth-of-type(n+4) { animation-delay: .18s; }
  body.sea-on .pet-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgb(10 40 70 / .18); }
  .sea-btn { transition: transform .2s ease; } .sea-btn:hover { transform: rotate(-12deg) scale(1.06); }
}
/* Mila (Polly's partner, a Ragdoll): her speech bubble */
.hs-say.mila-say { background: #fff7f0; }
.hs-say.mila-say::after { border-top-color: #fff7f0; }
.hs-say.mila-say strong { color: #8a4b2a; }

/* ---------- walk mode: the apartment in first person (js/pet/walk3d.js) ---------- */
html.pw-on, html.pw-on body { overflow: hidden; overscroll-behavior: none; }
.pw { position: fixed; inset: 0; z-index: 9000; background: #0d1018; color: #fff; user-select: none; -webkit-user-select: none; touch-action: none; font-family: inherit; }
.pw-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: crosshair; touch-action: none; }
.pw-cat { position: absolute; left: 0; top: 0; height: 10px; pointer-events: none; transform-origin: 50% 100%; filter: drop-shadow(0 6px 5px rgba(0,0,0,.35)); will-change: left, top, height; }
.pw-turn { position: absolute; left: 0; top: 0; pointer-events: none; background-repeat: no-repeat; filter: drop-shadow(0 6px 5px rgba(0,0,0,.35)); will-change: left, top, height; }
.pw-cat[hidden], .pw-turn[hidden], .pw-word[hidden], .pw-load[hidden], .pw-help[hidden] { display: none; }
.pw-top { position: absolute; z-index: 6; top: max(10px, env(safe-area-inset-top)); inset-inline: 12px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.pw-x { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(12,16,28,.55); color: #fff; font-size: 20px; cursor: pointer; backdrop-filter: blur(6px); }
.pw-x:hover { background: rgba(12,16,28,.8); }
.pw-room { padding: 8px 16px; border-radius: 999px; background: rgba(12,16,28,.55); backdrop-filter: blur(6px); font-size: 15px; opacity: 0; transform: translateY(-8px); }
.pw-room b { font-size: 17px; color: #ffd36a; }
.pw-room.on { animation: pw-room 4.2s ease forwards; }
@keyframes pw-room { 0% { opacity: 0; transform: translateY(-8px); } 10%, 75% { opacity: 1; transform: none; } 100% { opacity: .55; transform: none; } }
.pw-cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 2px rgba(0,0,0,.35); pointer-events: none; }
.pw-word { position: absolute; z-index: 4; left: 50%; top: calc(50% + 22px); transform: translateX(-50%); padding: 7px 14px; border-radius: 12px; border: 0; background: rgba(12,16,28,.62); color: #fff; font: inherit; font-size: 15px; white-space: nowrap; cursor: pointer; backdrop-filter: blur(6px); }
.pw-word b { font-size: 19px; color: #ffd36a; margin-inline: 4px; }
.pw-word span { opacity: .85; }
.pw-load { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; background: radial-gradient(circle at 50% 40%, #26314d, #0d1018); }
.pw-help { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; text-align: center; background: rgba(8,10,18,.55); backdrop-filter: blur(3px); }
.pw-help p { max-width: 520px; margin: 0; font-size: 17px; line-height: 1.6; padding: 14px 18px; border-radius: 14px; background: rgba(12,16,28,.7); }
.pw-help .btn { font-size: 18px; padding: 12px 28px; }
.pw-joy { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); left: 90px; bottom: 60px; top: auto; opacity: .45; pointer-events: none; transition: opacity .2s; }
.pw-joy.on { opacity: .9; bottom: auto; }
.pw-joy span { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pw-run { position: absolute; right: 22px; bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(12,16,28,.5); font-size: 28px; cursor: pointer; }
.pw-run.on { background: rgba(255,170,40,.75); border-color: #ffd36a; }
.pw-help-acts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pw-help-acts .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(12,16,28,.4); }
.pw-esc { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 13px; padding: 4px 12px; border-radius: 999px; background: rgba(12,16,28,.45); opacity: .8; pointer-events: none; }
.pw-esc[hidden] { display: none; }

.pw-sofa { position: absolute; right: 22px; bottom: max(118px, calc(env(safe-area-inset-bottom) + 102px)); width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(12,16,28,.5); font-size: 24px; cursor: pointer; }
@media (pointer: fine) { .pw-sofa { bottom: 22px; right: 22px; } }
.pw-dance { position: absolute; right: 22px; bottom: max(182px, calc(env(safe-area-inset-bottom) + 166px)); width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(12,16,28,.5); font-size: 24px; cursor: pointer; }
@media (pointer: fine) { .pw-dance { bottom: 86px; } }
.pw-run, .pw-sofa, .pw-dance, .pw-joy, .pw-cross, .pw-esc { z-index: 4; }
