/* ===== House Pet — candy-colored game UI ===== */
:root {
  --ink: #3b2440; --muted: #8b7793; --line: #efe6f6; --card: #ffffff;
  --pink: #ff5d8f; --purple: #8b5cf6; --green: #22c55e; --gold: #f59e0b; --sky: #3fa9ff;
  --radius: 26px; --shadow: 0 10px 30px rgba(88, 48, 120, .13), 0 2px 6px rgba(88, 48, 120, .06);
  --pop: cubic-bezier(.3, 1.6, .5, 1);
  --display: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  font-family: 'Nunito', ui-rounded, system-ui, -apple-system, sans-serif;
  color: var(--ink); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: linear-gradient(160deg, #ffe3f1 0%, #ece6ff 45%, #dcfbef 100%) fixed; }
html.night { background: linear-gradient(160deg, #2b2462 0%, #3d2f7a 50%, #1f4a66 100%) fixed; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; display: flow-root; padding: env(safe-area-inset-top) 0 calc(110px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0 0 .5em; line-height: 1.15; }
h2 { font-size: 1.35rem; display: flex; align-items: center; gap: .4em; flex-wrap: wrap; }
h3 { font-size: 1.1rem; margin-top: 1.3em; display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.muted { color: var(--muted); } .tiny { font-size: .82rem; color: var(--muted); margin: .5em 0 0; } .center { text-align: center; justify-content: center; }

/* Floating background blobs */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(60px); opacity: .45; animation: drift 26s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(1) { background: #ffb3d1; left: -12vmax; top: -10vmax; }
.bg-blobs i:nth-child(2) { background: #b9c8ff; right: -14vmax; top: 20vh; animation-delay: -8s; }
.bg-blobs i:nth-child(3) { background: #b4f5d8; left: 20vw; bottom: -20vmax; animation-delay: -16s; }
html.night .bg-blobs i { opacity: .2; }

/* ===== Header ===== */
#top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; max-width: 1240px; margin: 0 auto; }
#top:empty { display: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: grid; place-items: center; width: 46px; height: 46px; font-size: 26px; background: #fff; border-radius: 15px; box-shadow: 0 4px 0 rgba(59, 36, 64, .12), var(--shadow); transform: rotate(-6deg); }
.title { font-family: var(--display); font-weight: 700; font-size: 1.7rem; letter-spacing: -.5px; }
.title span, .setup-hero h1 span { background: linear-gradient(90deg, var(--pink), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.night .title { color: #fff; }
.meters { display: flex; gap: 8px; flex-wrap: wrap; }
.meter { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .85); padding: 6px 12px; border-radius: 99px; box-shadow: var(--shadow); font-family: var(--display); font-weight: 600; font-size: .9rem; }
.meter .bar { width: 90px; }
.bar { height: 10px; background: #f1e8f7; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd166, var(--gold)); transition: width .8s var(--pop); }
.bar i.harm { background: linear-gradient(90deg, #4ade80, #22d3ee); }

main { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; position: relative; }
.card[style*="--c"] { border-top: 6px solid var(--c); }

/* ===== Buttons ===== */
.btn { min-height: 46px; padding: 8px 16px; border-radius: 15px; background: #fff; font-family: var(--display); font-weight: 600; font-size: 1rem; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(59, 36, 64, .16), 0 1px 0 rgba(59, 36, 64, .08) inset; border: 2px solid var(--line); transition: transform .1s, box-shadow .1s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 36, 64, .16); }
.btn.primary { background: linear-gradient(#4ade80, #22c55e); color: #fff; border-color: #16a34a; box-shadow: 0 4px 0 #15803d; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.btn.primary:active { box-shadow: 0 1px 0 #15803d; }
.btn.love, .btn.help { background: linear-gradient(#ff8fb3, #ff5d8f); color: #fff; border-color: #f43f7a; box-shadow: 0 4px 0 #be185d; }
.btn.claim { background: var(--c); color: #fff; border-color: rgba(0, 0, 0, .1); box-shadow: 0 4px 0 rgba(0, 0, 0, .22); padding-left: 8px; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 0 #1d1020; }
.btn.danger { background: #ffe4e1; color: #c0392b; border-color: #ffc9c2; }
.btn.big { font-size: 1.25rem; padding: 14px 30px; min-height: 60px; border-radius: 20px; }
.btn.sm { min-height: 38px; padding: 4px 14px; font-size: .95rem; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.nope { animation: nope .4s; }
.icon-btn { min-width: 46px; min-height: 46px; border-radius: 14px; font-size: 1.25rem; background: #f6f0fa; box-shadow: 0 3px 0 rgba(59, 36, 64, .12); }
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.icon-btn.on { background: #ffd6e5; box-shadow: 0 3px 0 #ff9fbf; }
.link { color: var(--pink); font-weight: 800; padding: 0; text-decoration: underline; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 99px; font-family: var(--display); font-weight: 600; background: #fff7dc; color: #8a5a00; }
.pill.heart { background: #ffe4ee; color: #c2185b; } .pill.fire { background: #ffe8d6; color: #c2410c; } .pill.fire.off { filter: grayscale(1); opacity: .6; }
.pill.bump, .bump { animation: bump .45s var(--pop); }
.badge { font-family: var(--display); font-size: .8rem; font-weight: 600; background: var(--pink); color: #fff; border-radius: 99px; padding: 3px 10px; }
.badge.ok { background: var(--green); }
.lvl { font-family: var(--display); font-size: .8rem; font-weight: 600; background: var(--c, var(--purple)); color: #fff; border-radius: 99px; padding: 2px 10px; }
.dot { position: absolute; top: -6px; right: -14px; background: var(--pink); color: #fff; font-style: normal; font-size: .68rem; font-family: var(--display); border-radius: 99px; padding: 1px 6px; border: 2px solid #fff; }

/* ===== Quests ===== */
.quests { background: linear-gradient(135deg, #fff 0%, #fff8e6 100%); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 18px; }
.q-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.q-head h2 { margin: 0; }
.chest { margin-left: auto; font-family: var(--display); font-weight: 600; font-size: .9rem; background: #fff1c7; color: #92400e; padding: 4px 12px; border-radius: 99px; }
.chest.open { background: #dcfce7; color: #166534; }
.q-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quest { display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 10px 12px; transition: .3s; }
.quest.ready { border-color: #ffd166; box-shadow: 0 0 0 4px rgba(255, 209, 102, .35); animation: glow 1.6s ease-in-out infinite; }
.quest.claimed { opacity: .6; }
.q-e { font-size: 1.8rem; }
.q-body { flex: 1; min-width: 0; }
.q-body b { display: block; font-size: .92rem; line-height: 1.2; margin-bottom: 4px; }
.q-bar { position: relative; height: 16px; background: #f1e8f7; border-radius: 99px; overflow: hidden; }
.q-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #4ade80, #22c55e); border-radius: inherit; transition: width .6s var(--pop); }
.q-bar span { position: relative; display: block; text-align: center; font: 600 .7rem/16px var(--display); }
.q-done { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; }

/* ===== Players ===== */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.player { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; position: relative; overflow: hidden; }
.player::before { content: ""; position: absolute; inset: 0 0 auto; height: 7px; background: var(--c); }
.phead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 2px 10px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.3rem; }
.wallet { display: flex; gap: 6px; flex-wrap: wrap; }
.focus-bar { display: none; }

/* Room scene */
.room { position: relative; height: 310px; border-radius: 22px; overflow: hidden; isolation: isolate;
  background: radial-gradient(rgba(255, 255, 255, .55) 2px, transparent 2.6px) 0 0 / 24px 24px, linear-gradient(var(--wall), var(--wall2)); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .04); }
.room .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 3px, transparent 3px 64px), var(--floor); border-top: 5px solid rgba(0, 0, 0, .08); }
.room .rug { position: absolute; left: 50%; bottom: 7%; width: 58%; height: 15%; transform: translateX(-50%); border-radius: 50%; background: var(--c); opacity: .3; }
.room.dark .nameplate { background: rgba(30, 20, 60, .7); color: #fff; }
.window { position: absolute; top: 9%; left: 6%; width: 27%; aspect-ratio: 1.15; border: 7px solid #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 10px rgba(0, 0, 0, .08); background: linear-gradient(#60c6ff, #c7ecff); }
.window::before, .window::after { content: ""; position: absolute; background: #fff; z-index: 2; }
.window::before { left: 50%; top: 0; bottom: 0; width: 5px; transform: translateX(-50%); }
.window::after { top: 50%; left: 0; right: 0; height: 5px; transform: translateY(-50%); }
.tod-morning .window { background: linear-gradient(#ffd6a5, #bde0fe); }
.tod-evening .window { background: linear-gradient(#ff9a5a, #c084fc); }
.tod-night .window { background: linear-gradient(#1e1b4b, #4338ca); }
.sky-obj { position: absolute; top: 12%; right: 10%; font-size: 1.7rem; animation: bob 4s ease-in-out infinite; }
.tod-evening .sky-obj { top: 48%; }
.cloud { position: absolute; top: 46%; left: -30%; font-size: 1.4rem; animation: cloud 16s linear infinite; }
.stars { position: absolute; top: 50%; left: 14%; font-size: 1rem; animation: twinkle 2s ease-in-out infinite; }
.tod-night::after { content: ""; position: absolute; inset: 0; background: rgba(30, 20, 90, .3); pointer-events: none; z-index: 1; }
.decor { position: absolute; font-size: 2rem; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .12)); }
.decor.d0 { left: 5%; bottom: 20%; font-size: 2.4rem; } .decor.d1 { left: 60%; top: 10%; } .decor.d2 { right: 6%; bottom: 14%; }
.decor.d3 { left: 78%; top: 9%; } .decor.d4 { left: 22%; bottom: 22%; font-size: 2.3rem; } .decor.d5 { right: 21%; bottom: 22%; }
.decor.d6 { left: 40%; top: 6%; font-size: 1.7rem; } .decor.d7 { left: 50%; top: -4px; transform: translateX(-50%); animation: spin 6s linear infinite; }
.decor.d8 { right: 2%; bottom: 34%; } .decor.d9 { left: 2%; bottom: 4%; font-size: 1.7rem; }
.pet-btn { position: absolute; left: 50%; bottom: 4%; width: 230px; z-index: 3; transform: translateX(-50%) scale(var(--s, 1)); transform-origin: 50% 100%; }
.pet-btn svg { display: block; width: 100%; overflow: visible; }
.pet-btn.squish .rig { animation: squish .45s var(--pop) !important; }
.speech { position: absolute; top: 5%; left: 50%; z-index: 5; max-width: 72%; transform: translateX(-50%) scale(0); transform-origin: 50% 100%;
  background: #fff; color: var(--ink); border-radius: 18px; padding: 8px 14px; font: 600 .95rem/1.25 var(--display); text-align: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); transition: transform .3s var(--pop); pointer-events: none; }
.speech::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 9px solid transparent; border-top-color: #fff; border-bottom: 0; }
.speech.show { transform: translateX(-50%) scale(1); }
.sos { position: absolute; left: 14px; top: 46%; z-index: 4; font-size: 2rem; animation: pulse 1s ease-in-out infinite; }
.room-actions { position: absolute; top: 12px; right: 12px; z-index: 4; display: flex; flex-direction: column; gap: 8px; }
.room-btn { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; font-size: 1.9rem; background: #fff; box-shadow: 0 4px 0 rgba(59, 36, 64, .15), 0 6px 14px rgba(0, 0, 0, .1); }
.room-btn i { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font: 700 .68rem var(--display); font-style: normal; background: var(--pink); color: #fff; border-radius: 99px; padding: 1px 7px; white-space: nowrap; border: 2px solid #fff; }
.room-btn.gift { animation: wobble 2.2s ease-in-out infinite; }
.room-btn.spin.ready { animation: wobble 2.2s ease-in-out infinite .5s; } .room-btn.spin.ready i { background: var(--green); }
.room-btn.locked { opacity: .7; } .room-btn.locked i { background: #a1a1aa; }
.room-btn.ghost { visibility: hidden; height: 0; }
.nameplate { position: absolute; left: 12px; bottom: 10px; z-index: 4; background: rgba(255, 255, 255, .92); border-radius: 14px; padding: 4px 12px; display: flex; flex-direction: column; box-shadow: 0 3px 8px rgba(0, 0, 0, .08); }
.nameplate b { font-family: var(--display); font-size: 1.1rem; } .nameplate span { font-size: .8rem; font-weight: 700; color: var(--muted); }

/* Pet animation */
.pet-svg .rig { transform-box: fill-box; transform-origin: 50% 100%; animation: idle 2.6s ease-in-out infinite; }
.exp-happy .rig { animation: hop 1.3s ease-in-out infinite; }
.exp-sad .rig { animation: sway 3.4s ease-in-out infinite; }
.exp-sick .rig { animation: shiver .5s linear infinite; filter: saturate(.65); }
.exp-sleep .rig { animation: breathe 3.6s ease-in-out infinite; }
.exp-joy .rig, .exp-love .rig, .exp-wow .rig { animation: jump .6s var(--pop) 2; }
.exp-eat .rig { animation: munch .3s ease-in-out infinite alternate; }
.pet-svg .blink { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.pet-svg .chomp { transform-box: fill-box; transform-origin: center; animation: chomp .25s ease-in-out infinite alternate; }
.pet-svg .zzz text { animation: zzz 2.4s ease-in-out infinite; opacity: 0; }
.pet-svg .zzz text:nth-child(2) { animation-delay: .5s; } .pet-svg .zzz text:nth-child(3) { animation-delay: 1s; }
.pet-svg .halo { animation: bob 2s ease-in-out infinite; }
.mini-pet { display: inline-block; width: 30px; height: 30px; vertical-align: middle; }
.mini-pet svg { width: 100%; height: 100%; } .mini-pet .rig { animation: none; }

/* XP + stat rings */
.xpbar { position: relative; height: 24px; margin: 12px 0 10px; background: #f1e8f7; border-radius: 99px; overflow: hidden; }
.xpbar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width .8s var(--pop);
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .25) 0 8px, transparent 8px 16px), linear-gradient(90deg, var(--c, var(--purple)), #ffd166); background-size: 22px 22px, 100% 100%; animation: stripes 1s linear infinite; }
.xpbar.house i { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .25) 0 8px, transparent 8px 16px), linear-gradient(90deg, #f59e0b, #fde047); background-size: 22px 22px, 100% 100%; }
.xpbar span { position: relative; display: block; text-align: center; font: 600 .8rem/24px var(--display); }
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ring { position: relative; display: flex; flex-direction: column; align-items: center; }
.ring svg { width: 60px; height: 60px; transform: rotate(-90deg); }
.ring .track { fill: #fff; stroke: #f1e8f7; stroke-width: 6; }
.ring .val { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s var(--pop); }
.ring > span { position: absolute; top: 15px; font-size: 1.4rem; }
.ring small { font: 600 .75rem var(--display); color: var(--muted); }
.ring.low svg { animation: pulse 1s ease-in-out infinite; } .ring.low small { color: #ef4444; }

/* Help + capacity */
.help-panel { margin-top: 14px; border-radius: 20px; padding: 12px; border: 3px dashed var(--pink); background: repeating-linear-gradient(45deg, #fff5f9 0 14px, #ffecf3 14px 28px); }
.help-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.help-h b { font-family: var(--display); font-size: 1.1rem; } .help-h small { display: block; color: var(--muted); font-weight: 700; }
.envelope { font-size: 2.2rem; animation: wobble 1.4s ease-in-out infinite; }
.cap { margin-top: 14px; padding: 12px 14px; background: #f8f4fc; border-radius: 20px; }
.cap-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.cap-lbl { font-family: var(--display); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; margin: 16px 0; border-radius: 99px; outline: none;
  background: linear-gradient(90deg, #ff6b6b, #ffd166 45%, #4ade80); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .12); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 5px solid var(--c, var(--purple)); box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 5px solid var(--c, var(--purple)); }
.pill-btn { width: 100%; min-height: 48px; border-radius: 16px; background: #fff; font-family: var(--display); font-weight: 600; box-shadow: 0 4px 0 rgba(59, 36, 64, .12); border: 2px solid var(--line); }
.pill-btn:active { transform: translateY(3px); box-shadow: none; }
.pill-btn.on { background: linear-gradient(#ff8fb3, #ff5d8f); border-color: #f43f7a; color: #fff; box-shadow: 0 4px 0 #be185d; animation: pulse 1.8s ease-in-out infinite; }

/* Chores */
.chores, .inbox, .log, .manage { list-style: none; margin: 0; padding: 0; }
.chore, .inbox li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 9px; background: #fff; border: 3px solid var(--line); border-radius: 18px; transition: transform .3s var(--pop), opacity .3s; }
.cat-badge { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; font-size: 1.6rem; background: #f6f0fa; background: color-mix(in srgb, var(--cc) 22%, white); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--cc) 30%, transparent); }
.ct { flex: 1; min-width: 0; }
.ct b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.08rem; overflow-wrap: anywhere; }
.ct small { color: var(--muted); font-weight: 700; } .ct em { color: var(--pink); font-style: normal; } .ct .early { color: #0891b2; }
.chore.k-over { border-color: #ffb4a8; background: #fff7f5; } .chore.k-over small { color: #e0533f; }
.chore.k-today { border-color: #ffe08a; }
.chore.k-done { opacity: .55; } .chore.k-done b { text-decoration: line-through; text-decoration-thickness: 2px; }
.check { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--cc); background: #fff; color: transparent; font-size: 1.6rem; font-weight: 900; transition: .2s var(--pop); box-shadow: 0 3px 0 color-mix(in srgb, var(--cc) 40%, transparent); }
.check:active { transform: scale(.9); }
.check.done { background: var(--green); border-color: var(--green); color: #fff; box-shadow: none; width: 40px; height: 40px; font-size: 1.2rem; }
.chore.checking { transform: scale(1.03); }
.chore.checking .check, .inbox li.checking .btn { background: var(--cc, var(--green)); color: #fff; transform: scale(1.18) rotate(-8deg); }
.empty { justify-content: center; color: var(--muted); padding: 22px; border-style: dashed !important; }

/* Inbox */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.row input:not([type]), .row select, .fields input, .manage input, .manage select { min-height: 48px; border-radius: 14px; border: 3px solid var(--line); padding: 6px 12px; background: #fff; font-weight: 700; outline-color: var(--purple); }
.row input[name=task] { flex: 1 1 220px; }
.chk { display: flex; align-items: center; gap: 6px; min-height: 46px; font-weight: 700; }
.chk input { width: 22px; height: 22px; accent-color: var(--pink); }
.inbox li { flex-wrap: wrap; border-left: 8px solid var(--c, var(--line)); }
.inbox li.urgent { background: #fff7f5; border-color: #ffc4b8; border-left-color: var(--c, #ff8a65); }
.inbox .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.inbox .mini-pet { width: 26px; height: 26px; }

/* Chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 16px 4px 8px; border-radius: 99px; background: #fff; border: 3px solid var(--c); font-family: var(--display); font-weight: 600; box-shadow: 0 3px 0 rgba(0, 0, 0, .08); }
.chip.on { background: var(--c); color: #fff; }

/* Shop */
.shop-top { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.shop-top > div:first-child { flex: 1 1 300px; }
.big-wallet { display: flex; gap: 8px; font-size: 1.2rem; margin: 6px 0; }
.dressing { flex: 0 0 240px; height: 210px; }
.dressing .pet-btn { width: 190px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px 12px; background: #fff; border: 3px solid var(--line); border-radius: 20px; text-align: center; transition: transform .2s var(--pop); }
.shop-item:active { transform: scale(.97); }
.shop-item .big { font-size: 2.8rem; line-height: 1.1; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .12)); }
.shop-item b { font-family: var(--display); font-weight: 600; } .shop-item small { color: var(--muted); font-weight: 700; }
.shop-item .btn { width: 100%; margin-top: auto; }
.shop-item.sel { border-color: var(--c, var(--ink)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, #000) 20%, transparent); }
.shop-item.lovely { border-color: #ffc2d6; background: linear-gradient(#fff, #fff4f8); }
.look { width: 96px; height: 96px; } .look svg { width: 100%; height: 100%; }
.shop-item.locked .look svg { filter: brightness(0) opacity(.22); } .shop-item.locked .look .rig { animation: none; }
.swatch { display: grid; place-items: center; width: 84px; height: 64px; border-radius: 14px; font-size: 1.8rem; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }

/* Album & trophies */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.sticker { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 20px; font-size: 2.4rem; background: #fff; border: 4px solid #eadff3; box-shadow: 0 4px 0 rgba(59, 36, 64, .08); }
.sticker span { transform: rotate(-6deg); filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 3px 3px rgba(0, 0, 0, .15)); }
.sticker.r-rare { border-color: #7dd3fc; background: linear-gradient(#fff, #e8f7ff); box-shadow: 0 0 14px rgba(56, 189, 248, .45); }
.sticker.r-legendary { border-color: #fbbf24; background: linear-gradient(135deg, #fff7d6, #ffe0f0, #e0f2ff); box-shadow: 0 0 18px rgba(251, 191, 36, .6); animation: shimmer 2.4s ease-in-out infinite; }
.sticker.missing { border-style: dashed; background: #faf7fc; box-shadow: none; animation: none; } .sticker.missing span { font: 600 1.6rem var(--display); color: #d9cde4; filter: none; transform: none; }
.sticker i { position: absolute; right: 4px; bottom: 2px; font: 700 .7rem var(--display); font-style: normal; color: var(--muted); }
.house-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; text-align: center; }
.house-items div { background: #fffaf0; border-radius: 16px; padding: 8px 4px; } .house-items span { display: block; font-size: 1.8rem; }
.house-items small { font: 600 .72rem var(--display); color: var(--muted); } .house-items .locked { filter: grayscale(1); opacity: .35; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.kpis b { display: block; font: 600 1.5rem var(--display); color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-bottom: 14px; }
.cal span { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: 600 .62rem var(--display); background: #f3edf8; color: var(--muted); }
.cal span.on { background: var(--c); color: #fff; } .cal span.today { outline: 3px solid var(--gold); }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ach .a { background: linear-gradient(#fffbea, #fff3c4); border: 3px solid #ffe08a; border-radius: 18px; padding: 10px 6px; text-align: center; }
.ach .a span { font-size: 2rem; display: block; } .ach .a b { font-family: var(--display); font-weight: 600; font-size: .9rem; }
.ach .a small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; }
.ach .a.locked { filter: grayscale(1); opacity: .4; background: #fff; border-color: var(--line); }
.log li { padding: 9px 0; border-bottom: 2px dashed var(--line); font-weight: 600; } .log small { color: var(--muted); margin-right: 6px; }

/* Settings */
.fields { display: flex; flex-direction: column; gap: 12px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .9rem; }
.label { font-weight: 800; font-size: .9rem; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { display: block; width: 40px; height: 40px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.sw.on, .sw-l input:checked + .sw { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.1); }
.sw-l input, .species input { position: absolute; opacity: 0; pointer-events: none; }
.manage li { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.2fr 46px; gap: 6px; margin-bottom: 8px; }
.manage input, .manage select { min-width: 0; width: 100%; }

/* Setup & hatching */
.setup { max-width: 860px; margin: 18px auto; }
.setup-hero { text-align: center; margin-bottom: 18px; }
.setup-hero h1 { font-size: 3rem; margin: 6px 0; }
.setup-hero p { max-width: 520px; margin: 0 auto; font-weight: 700; color: var(--muted); }
.logo-big { display: inline-grid; place-items: center; width: 96px; height: 96px; font-size: 56px; background: #fff; border-radius: 30px; box-shadow: 0 6px 0 rgba(59, 36, 64, .12), var(--shadow); animation: wobble 3s ease-in-out infinite; }
.setup-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border-top: 8px solid var(--c); }
.setup form > .center { margin-top: 14px; }
.species { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.species span { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 16px; border: 3px solid transparent; cursor: pointer; transition: .2s var(--pop); }
.species svg { width: 100%; max-width: 74px; } .species .rig { animation: none; }
.species small { font: 600 .75rem var(--display); }
.species input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); transform: translateY(-4px); }
.species input:checked + span .rig { animation: hop 1s ease-in-out infinite; }
.species input:focus-visible + span { outline: 3px solid var(--purple); }
.hatch { text-align: center; padding: 30px 0; }
.hatch h1 { font-size: 2.4rem; } .hatch p { font-weight: 700; }
.eggs { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin: 24px 0; }
.egg-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 240px; padding: 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-bottom: 8px solid var(--c); }
.egg-slot b { font: 600 1.2rem var(--display); } .egg-slot small { color: var(--muted); font-weight: 700; letter-spacing: 2px; }
.egg { width: 170px; animation: wobble 1.8s ease-in-out infinite; } .egg.c2 { animation-duration: 1s; } .egg.c3 { animation-duration: .5s; }
.egg.shake { animation: eggshake .45s ease; }
.egg svg, .hatched svg { width: 100%; display: block; }
.hatched { width: 180px; animation: popin .6s var(--pop); }

/* ===== Tabs ===== */
#tabs { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; display: flex; gap: 4px; width: min(600px, calc(100% - 24px)); padding: 6px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-radius: 26px; box-shadow: 0 12px 34px rgba(88, 48, 120, .25); }
#tabs:empty { display: none; }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 58px; padding: 6px 0 4px; border-radius: 20px; font: 600 .78rem var(--display); color: var(--muted); transition: .2s; }
#tabs button span { position: relative; font-size: 1.55rem; transition: transform .3s var(--pop); }
#tabs button.on { color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple)); box-shadow: 0 4px 12px rgba(139, 92, 246, .4); }
#tabs button.on span { transform: translateY(-2px) scale(1.12); }

/* ===== Toast, modal, splash, particles ===== */
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 12px; align-items: center; width: max-content; max-width: calc(100vw - 32px);
  transform: translate(-50%, 30px) scale(.9); opacity: 0; pointer-events: none; transition: .35s var(--pop);
  background: var(--ink); color: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-weight: 700; }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
#toast small { display: block; opacity: .8; font-weight: 600; }
#toast button { color: #ffd166; font: 600 1rem var(--display); min-height: 44px; padding: 0 8px; }
.modal { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; padding: 16px; background: rgba(40, 20, 60, .5); backdrop-filter: blur(5px); }
.modal.show { display: grid; }
.modal-card { width: min(440px, 100%); background: #fff; border-radius: 30px; padding: 24px; text-align: center; box-shadow: 0 30px 60px rgba(0, 0, 0, .3); animation: popin .45s var(--pop); }
.modal-card h2 { justify-content: center; }
.giftbox { font-size: 130px; line-height: 1; margin: 10px 0; animation: wobble 1.6s ease-in-out infinite; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .15)); }
.giftbox.shake { animation: giftshake .4s ease; } .giftbox.t2 { font-size: 150px; } .giftbox.t3 { font-size: 170px; }
.reward { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; margin-bottom: 16px; border-radius: 24px; background: #fffaf0; animation: popin .5s var(--pop); }
.reward .big { font-size: 96px; line-height: 1.1; animation: hop 1.2s ease-in-out infinite; }
.reward b { font: 600 1.4rem var(--display); } .reward small { font-weight: 700; color: var(--muted); }
.rarity { text-transform: capitalize; }
.reward.r-rare { background: linear-gradient(#e8f7ff, #f3e8ff); box-shadow: 0 0 0 4px #7dd3fc; }
.reward.r-legendary { background: linear-gradient(135deg, #fff2b3, #ffd6ec, #d6ecff); box-shadow: 0 0 0 4px #fbbf24, 0 0 40px rgba(251, 191, 36, .6); animation: popin .5s var(--pop), shimmer 2s ease-in-out infinite; }
.wheel-wrap { position: relative; width: min(320px, 78vw); margin: 18px auto; }
.pointer { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 2.4rem; color: var(--pink); text-shadow: 0 3px 0 #be185d; }
.wheel { transition: transform 4.6s cubic-bezier(.15, .75, .1, 1); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .18)); }
.wheel svg { display: block; width: 100%; }
.prize { font: 600 1.3rem var(--display); }
#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -40px; font-size: 1.6rem; animation: fall 2.4s cubic-bezier(.3, .2, .6, 1) forwards; }
.confetti.paper { width: 10px; height: 16px; border-radius: 3px; }
.spark, .flyer { position: absolute; font-size: 1.5rem; will-change: transform; }
.flyer { z-index: 2; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); }
.pop-text { position: absolute; font: 700 1.6rem var(--display); white-space: nowrap; -webkit-text-stroke: 5px #fff; paint-order: stroke fill; text-shadow: 0 3px 6px rgba(0, 0, 0, .15); }
.splash { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; text-align: center; animation: splashin .5s var(--pop); width: 90vw; }
.splash::before { content: ""; position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px; z-index: -1; border-radius: 50%; opacity: .25;
  background: repeating-conic-gradient(var(--c) 0 12deg, transparent 12deg 24deg); -webkit-mask: radial-gradient(closest-side, #000 40%, transparent); mask: radial-gradient(closest-side, #000 40%, transparent); animation: spin 8s linear infinite; }
.splash.out { animation: splashout .35s ease-in forwards; }
.splash-icon { font-size: 4.5rem; animation: hop 1s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .2)); }
.splash-title { font: 700 clamp(2.4rem, 7vw, 4rem)/1 var(--display); color: #fff; -webkit-text-stroke: 10px var(--c); paint-order: stroke fill; text-shadow: 0 8px 0 rgba(0, 0, 0, .15); text-transform: uppercase; letter-spacing: 1px; }
.splash-sub { margin-top: 10px; font: 600 1.1rem var(--display); background: #fff; color: var(--ink); padding: 6px 16px; border-radius: 99px; box-shadow: var(--shadow); }

/* ===== Keyframes ===== */
@keyframes idle { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(.985, 1.025); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-12px) scale(.96, 1.05); } 55% { transform: translateY(0) scale(1.06, .94); } 70% { transform: scale(1, 1); } }
@keyframes jump { 0% { transform: scale(1, 1); } 25% { transform: translateY(0) scale(1.12, .86); } 55% { transform: translateY(-34px) scale(.92, 1.1); } 85% { transform: translateY(0) scale(1.08, .92); } 100% { transform: scale(1, 1); } }
@keyframes squish { 0% { transform: scale(1, 1); } 30% { transform: scale(1.18, .82); } 60% { transform: scale(.9, 1.12); } 100% { transform: scale(1, 1); } }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(2px); } }
@keyframes shiver { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes munch { from { transform: scale(1, 1); } to { transform: scale(1.04, .95); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes chomp { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 6px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -10px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-8deg); } 30% { transform: rotate(7deg); } 45% { transform: rotate(-4deg); } 60% { transform: rotate(0); } }
@keyframes giftshake { 0%, 100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-15deg) scale(1.1); } 40% { transform: rotate(13deg) scale(1.05); } 60% { transform: rotate(-9deg) scale(1.12); } 80% { transform: rotate(6deg); } }
@keyframes eggshake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
@keyframes nope { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 209, 102, .35); } 50% { box-shadow: 0 0 0 8px rgba(255, 209, 102, .55); } }
@keyframes shimmer { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12) saturate(1.2); } }
@keyframes stripes { to { background-position: 22px 0, 0 0; } }
@keyframes cloud { to { left: 110%; } }
@keyframes twinkle { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(6vw, 4vh) scale(1.1); } }
@keyframes popin { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fall { to { transform: translate(var(--dx), 112vh) rotate(var(--r)); } }
@keyframes splashin { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes splashout { to { transform: translate(-50%, -60%) scale(.8); opacity: 0; } }
.decor.d7 { animation: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Up for grabs (floating inbox tasks) & together tasks ===== */
.floaters { background: linear-gradient(135deg, #f0f9ff 0%, #fdf4ff 100%); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 18px; }
.floaters .q-head h2 { margin: 0; }
.float-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.floater { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #fff; border: 3px solid color-mix(in srgb, var(--cc) 45%, white); border-radius: 20px;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--cc) 25%, transparent); animation: floaty 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.floater:active, .floater:focus-within { animation-play-state: paused; }
.floater.urgent { border-color: #ffb4a8; background: #fff7f5; }
.f-top { display: flex; align-items: center; gap: 10px; }
.floater .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.floater .btn { flex: 1 1 auto; min-height: 42px; padding: 4px 10px; font-size: .92rem; }
.floater .mini-pet, .inbox .mini-pet { width: 26px; height: 26px; }
.btn.claim.together { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #6d28d9; }
.together-tag { color: var(--purple); font-weight: 800; }
.chore.from-inbox { border-style: dashed; border-color: color-mix(in srgb, var(--cc) 55%, white); background: linear-gradient(90deg, #fff, #fbf7ff); }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-6px) rotate(.4deg); } }

/* ===== 1-player mode ===== */
.mode-pick { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 0 auto 18px; max-width: 640px; }
.mode { flex: 1 1 220px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px; background: #fff; border-radius: 22px; border: 4px solid transparent;
  box-shadow: 0 4px 0 rgba(59, 36, 64, .12), var(--shadow); transition: transform .2s var(--pop); }
.mode span { font-size: 2.6rem; } .mode b { font: 600 1.25rem var(--display); } .mode small { color: var(--muted); font-weight: 700; }
.mode.on { border-color: var(--purple); background: linear-gradient(#fff, #f5f0ff); transform: translateY(-3px); }
.mode:active { transform: scale(.97); }
.duo.all.one { grid-template-columns: minmax(0, 520px); justify-content: center; }
.duo.solo { grid-template-columns: 1fr; }
.manage.solo li { grid-template-columns: 2fr 1.2fr 1.2fr 46px; }
@media (min-width: 900px) {
  .duo.solo .player { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .duo.solo .p-right h3:first-child { margin-top: 4px; }
}

/* ===== Real-life pets ===== */
.rpets { background: linear-gradient(135deg, #fff8ee 0%, #f0fbf4 100%); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 18px; }
.rpets .q-head h2 { margin: 0; }
.rp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rp-card { background: #fff; border-radius: 22px; padding: 12px; border: 3px solid color-mix(in srgb, var(--rc) 40%, white); display: flex; flex-direction: column; gap: 8px; }
.rp-scene { position: relative; height: 150px; border-radius: 16px; overflow: hidden; }
.rp-scene .floor { height: 34%; }
.rp-scene .pet-btn { width: 150px; bottom: 2%; }
.rp-scene .speech { top: 6%; font-size: .85rem; max-width: 80%; }
.polaroid { position: absolute; z-index: 2; width: 64px; height: 64px; object-fit: cover; background: #fff; padding: 4px 4px 12px; border-radius: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); transform: rotate(-6deg); }
.rp-scene .polaroid { top: 10px; left: 10px; }
.rp-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rp-name b { font: 600 1.15rem var(--display); } .rp-name small { color: var(--muted); font-weight: 700; }
.rp-meters { display: grid; gap: 5px; }
.rp-m { display: flex; align-items: center; gap: 6px; } .rp-m .bar { flex: 1; height: 9px; }
.rp-care { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.care { display: flex; flex-direction: column; align-items: center; min-height: 64px; padding: 6px 2px; border-radius: 14px; background: #f6f0fa; box-shadow: 0 3px 0 rgba(59, 36, 64, .12); transition: transform .15s var(--pop); }
.care span { font-size: 1.4rem; line-height: 1.1; } .care b { font: 600 .8rem var(--display); } .care small { font: 600 .7rem var(--display); color: var(--muted); }
.care:active { transform: translateY(2px) scale(.96); box-shadow: none; }
.care.done { background: #dcfce7; } .care.done small { color: #15803d; }
/* Pet editor (setup + settings) */
.setup-pets { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 18px; }
.mode-pick.small .mode { flex: 1 1 160px; padding: 10px; } .mode-pick.small .mode span { font-size: 1.8rem; }
.rp-editors { display: grid; gap: 12px; margin: 12px 0; }
.rp-edit { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 20px; border: 3px solid color-mix(in srgb, var(--rc) 40%, white); background: #fff; flex-wrap: wrap; }
.rp-preview { position: relative; flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; }
.rp-preview svg { width: 150px; } .rp-preview small { font-weight: 700; color: var(--muted); }
.rp-preview .polaroid { top: -4px; left: -6px; width: 56px; height: 56px; }
.rp-fields { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.rp-fields label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .9rem; }
.rp-fields input:not([type]) { min-height: 46px; border-radius: 14px; border: 3px solid var(--line); padding: 6px 12px; font-weight: 700; }
.seg { display: inline-flex; background: #f3edf8; border-radius: 14px; padding: 4px; gap: 4px; align-self: flex-start; }
.seg-b { min-height: 40px; padding: 4px 14px; border-radius: 11px; font: 600 .95rem var(--display); }
.seg-b.on { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.coats { display: flex; gap: 8px; flex-wrap: wrap; }
.coat { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.coat.on { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.1); }
.rp-actions { margin: 4px 0 0; } .rp-actions label.btn { cursor: pointer; flex-direction: row; font-size: 1rem; }
/* Who-did-it modal */
.who-pet { width: 120px; margin: -10px auto 0; }
.who-btns { display: grid; gap: 10px; margin: 14px 0; }
.who-btns .btn { width: 100%; }

/* ===== Room wallpapers & decorations ===== */
.room.wp-stone { background: linear-gradient(rgba(0, 0, 0, .22) 2px, transparent 2px) 0 0 / 100% 24px, linear-gradient(90deg, rgba(0, 0, 0, .18) 2px, transparent 2px) 0 0 / 48px 48px, linear-gradient(90deg, rgba(0, 0, 0, .18) 2px, transparent 2px) 24px 24px / 48px 48px, linear-gradient(var(--wall), var(--wall2)); }
.room.wp-damask { background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .12) 0 6px, transparent 7px) 0 0 / 34px 34px, radial-gradient(ellipse 4px 12px at 50% 50%, rgba(0, 0, 0, .25) 0 100%, transparent 101%) 17px 17px / 34px 34px, linear-gradient(var(--wall), var(--wall2)); }
.room.wp-shelves { background: linear-gradient(transparent 0 60px, rgba(0, 0, 0, .28) 60px 66px, transparent 66px) 0 0 / 100% 66px, linear-gradient(var(--wall), var(--wall2)); }
.room.wp-panes { background: linear-gradient(rgba(255, 255, 255, .35) 3px, transparent 3px) 0 0 / 100% 40px, linear-gradient(90deg, rgba(255, 255, 255, .35) 3px, transparent 3px) 0 0 / 40px 100%, linear-gradient(var(--wall), var(--wall2)); }
.room.wp-stars { background: radial-gradient(#fff 1px, transparent 1.6px) 0 0 / 46px 46px, radial-gradient(rgba(255, 255, 255, .6) 1px, transparent 1.4px) 23px 17px / 46px 46px, linear-gradient(var(--wall), var(--wall2)); }
.room.wp-arches { background: radial-gradient(ellipse 18px 30px at 50% 100%, rgba(255, 180, 220, .22) 0 98%, transparent 100%) 0 0 / 52px 64px, linear-gradient(var(--wall), var(--wall2)); }
.room.dark .floor { border-top-color: rgba(255, 255, 255, .06); }
.rdeco { position: absolute; z-index: 2; font-size: 2rem; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); }
.rdeco.r0 { left: 13%; bottom: 7%; } .rdeco.r1 { right: 14%; bottom: 7%; } .rdeco.r2 { left: 38%; top: 30%; font-size: 1.6rem; }
.rp-scene .rdeco { display: none; }
/* Shop tabs, thumbnails, gothic tags */
.shop-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; position: sticky; top: 0; z-index: 4; background: var(--card); padding: 6px 0; }
.shop-item { position: relative; }
.goth-tag { position: absolute; top: 6px; right: 8px; font-style: normal; font-size: .95rem; }
.shop-item.gothy { border-color: #c9b6e4; }
.room-thumb { position: relative; display: block; width: 100%; height: 76px !important; border-radius: 14px; overflow: hidden; }
.room-thumb .floor { height: 32% !important; }
.rt-deco { position: absolute; inset: auto 0 6px; text-align: center; font-size: 1.3rem; letter-spacing: 4px; z-index: 2; }
.rooms-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hair-colors .sw { width: 44px; height: 44px; }
.theme-btn { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .8); font-size: 1.2rem; box-shadow: var(--shadow); }
.room-coat { display: grid; place-items: center; font-size: 1rem; border-radius: 12px; }
.pet-svg .glow { animation: firefly 1.8s ease-in-out infinite; } .pet-svg .glow.g2 { animation-delay: .6s; } .pet-svg .glow.g3 { animation-delay: 1.2s; }
@keyframes firefly { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ===== Gothic theme ===== */
html.goth { --ink: #ede4f5; --muted: #a798b5; --line: #3b3046; --card: #1e1726; --pink: #d6336c; --purple: #9d4edd; --green: #2fa36b; --gold: #c9a227;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3); background: linear-gradient(160deg, #120d18 0%, #22142b 50%, #0f181d 100%) fixed; color-scheme: dark; }
html.goth .bg-blobs i:nth-child(1) { background: #5a189a; } html.goth .bg-blobs i:nth-child(2) { background: #6a0d2b; } html.goth .bg-blobs i:nth-child(3) { background: #1b4332; }
html.goth .bg-blobs i { opacity: .28; }
html.goth .title, html.goth h1, html.goth h2, html.goth .splash-title { font-family: 'Grenze Gotisch', var(--display); letter-spacing: .5px; }
html.goth .title { color: #ede4f5; font-size: 1.9rem; }
html.goth .title span, html.goth .setup-hero h1 span { background: linear-gradient(90deg, #c77dff, #ff4d6d); -webkit-background-clip: text; background-clip: text; }
html.goth .card, html.goth .player, html.goth .quests, html.goth .floaters, html.goth .rpets, html.goth .setup-card, html.goth .setup-pets, html.goth .egg-slot,
html.goth .modal-card, html.goth .shop-tabs, html.goth .mode { background: var(--card); color: var(--ink); }
html.goth .quests { background: linear-gradient(135deg, #221a2b, #2a1a26); } html.goth .floaters { background: linear-gradient(135deg, #1b1f2b, #241a2e); } html.goth .rpets { background: linear-gradient(135deg, #261d1a, #172420); }
html.goth .chore, html.goth .inbox li, html.goth .quest, html.goth .floater, html.goth .rp-card, html.goth .rp-edit, html.goth .shop-item, html.goth .sticker, html.goth .house-items div,
html.goth .ach .a, html.goth .reward, html.goth .cap, html.goth .care, html.goth .seg, html.goth .cat-badge { background: #261d30; color: var(--ink); border-color: var(--line); }
html.goth .chore.k-over, html.goth .inbox li.urgent, html.goth .floater.urgent { background: #33161f; border-color: #7a1f2b; }
html.goth .chore.k-today { border-color: #6b4f1d; }
html.goth .chore.from-inbox { background: linear-gradient(90deg, #261d30, #2c2238); }
html.goth .btn, html.goth .icon-btn, html.goth .pill-btn, html.goth .chip, html.goth .room-btn, html.goth .theme-btn, html.goth .seg-b.on, html.goth .care { background: #2e2439; color: var(--ink); border-color: var(--line); box-shadow: 0 4px 0 #0d0911; }
html.goth .btn.primary { background: linear-gradient(#3fb37f, #24855a); border-color: #1d6b48; box-shadow: 0 4px 0 #134a31; color: #fff; }
html.goth .btn.love, html.goth .btn.help, html.goth .pill-btn.on { background: linear-gradient(#d6336c, #9b1b45); border-color: #7a1235; box-shadow: 0 4px 0 #55091f; color: #fff; }
html.goth .btn.on, html.goth .chip.on { background: var(--c, #9d4edd); color: #fff; }
html.goth .btn.claim { background: var(--c); color: #fff; }
html.goth .check { background: #1a1420; }
html.goth .meter, html.goth .logo, html.goth .nameplate, html.goth .speech { background: rgba(30, 23, 38, .92); color: var(--ink); }
html.goth .speech::after { border-top-color: rgba(30, 23, 38, .92); }
html.goth #tabs { background: rgba(24, 18, 31, .96); }
html.goth #tabs button.on { background: linear-gradient(135deg, #9b1b45, #5a189a); }
html.goth .bar, html.goth .xpbar, html.goth .q-bar, html.goth .cal span { background: #2e2439; }
html.goth .ring .track { fill: #1e1726; stroke: #2e2439; }
html.goth .pill { background: #2e2439; color: var(--ink); }
html.goth .help-panel { background: repeating-linear-gradient(45deg, #2a1622 0 14px, #301a27 14px 28px); }
html.goth input:not([type=range]):not([type=checkbox]):not([type=radio]), html.goth select { background: #16111c; color: var(--ink); border-color: var(--line); }
html.goth .modal { background: rgba(8, 4, 12, .7); }
html.goth #toast { background: #2a1f35; border: 1px solid #4b3a5c; }
html.goth .badge { background: #9b1b45; } html.goth .badge.ok { background: #24855a; }
html.goth .chest { background: #3a2a14; color: #e9c46a; } html.goth .chest.open { background: #183a28; color: #8be0b0; }
html.goth .ach .a:not(.locked) { background: linear-gradient(#2e2236, #3a2340); border-color: #6b4f1d; }
html.goth .mode.on { background: linear-gradient(#2a1f35, #34204a); }
html.goth .shop-item.gothy { border-color: #6b3fa0; }
html.goth .link { color: #ff6b9a; }

/* ===== Phones ===== */
@media (max-width: 760px) {
  .duo { grid-template-columns: 1fr; }
  .focus-bar { display: block; position: sticky; top: 0; z-index: 10; padding: 8px 0 2px; }
  .duo[data-focus=a] .player[data-p=b], .duo[data-focus=b] .player[data-p=a] { display: none; }
  .q-list { grid-template-columns: 1fr; gap: 6px; }
  .quest { padding: 6px 10px; } .q-e { font-size: 1.4rem; } .q-head .tiny { display: none; }
  .room { height: 280px; } .pet-btn { width: 200px; }
  .shop-top { flex-direction: column; } .shop-top > div:first-child { flex-basis: auto; } .dressing { flex: 0 0 210px; }
  .manage li, .manage.solo li { grid-template-columns: 1fr 1fr 1fr 46px; } .manage li input { grid-column: 1 / -1; }
  .manage.solo li { grid-template-columns: 1fr 1fr 46px; }
  .kpis { grid-template-columns: repeat(5, 1fr); font-size: .68rem; }
  .title { font-size: 1.4rem; } .meter .bar { width: 60px; }
  .setup-hero h1 { font-size: 2.3rem; }
  .species { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 420px) {
  .check { width: 50px; height: 50px; }
  .meters { width: 100%; } .meter { flex: 1; }
  .rings .ring svg { width: 54px; height: 54px; } .ring > span { top: 13px; font-size: 1.2rem; }
}
html.goth .btn.claim.together { background: linear-gradient(135deg, #d6336c, #7b2cbf); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #3c096c; }
