@font-face { font-family: "Fredoka"; src: url("/petworld/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
:root {
  --ink: #3b2f55; --ink2: #6b5f8a; --pink: #ff6f91; --pink-d: #d9436b; --blue: #5fc4ff; --blue-d: #2f8fd0;
  --mint: #7fdba6; --mint-d: #3fae73; --sun: #ffd34d; --sun-d: #d9a520; --grape: #a78bfa; --grape-d: #7458e0;
  --cream: #fffaf0; --card: #ffffff; --shadow: 0 6px 0 rgba(59,47,85,.18), 0 10px 24px rgba(59,47,85,.18);
  --dockH: 150px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: "Fredoka", "Trebuchet MS", system-ui, sans-serif; color: var(--ink); background: #8fd3ff; overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; -webkit-user-select: text; user-select: text; }
svg.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; }

/* ---------- Sky backdrop ---------- */
.sky { position: fixed; inset: 0; z-index: 0; background: linear-gradient(#6fc0ff 0%, #a9ddff 55%, #d8f1ff 100%); overflow: hidden; }
.cloud { position: absolute; width: 180px; height: 56px; background: #fff; border-radius: 40px; opacity: .9; animation: drift 80s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; left: 26px; top: -40px; }
.cloud::after { width: 60px; height: 60px; left: 90px; top: -26px; }
.c1 { top: 12%; left: -200px; } .c2 { top: 30%; left: -200px; transform: scale(.7); animation-duration: 110s; animation-delay: -50s; } .c3 { top: 6%; left: -200px; transform: scale(1.2); animation-duration: 140s; animation-delay: -100s; }
@keyframes drift { to { left: 110%; } }
.hill { position: absolute; border-radius: 50%; }
.h1 { width: 140vw; height: 60vh; left: -30vw; bottom: -38vh; background: radial-gradient(circle at 50% 30%, #9be38f, #5fbf5f); }
.h2 { width: 110vw; height: 50vh; right: -40vw; bottom: -32vh; background: radial-gradient(circle at 50% 30%, #b5ef9f, #78cf6c); }

#app { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: linear-gradient(#ffffffee, #fff6fbdd); border-bottom: 4px solid #ffc6d8; box-shadow: 0 4px 14px rgba(59,47,85,.12); flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--pink-d); font-weight: 700; font-size: 24px; letter-spacing: .3px; text-shadow: 0 2px 0 #fff, 0 3px 0 #ffc6d8; white-space: nowrap; }
.logo em { font-style: normal; color: var(--blue-d); }
.logo-paw { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffb0c8, var(--pink)); color: #fff; font-size: 20px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 2px 0 var(--pink-d); }
.coin-pill { display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; background: linear-gradient(#fff8d6, #ffe58a); border: 3px solid var(--sun-d); border-radius: 999px; font-weight: 700; font-size: 18px; color: #8a5a00; box-shadow: inset 0 2px 0 #fff; transition: transform .15s; }
.coin-pill svg { width: 26px; height: 26px; }
.coin-pill.bump { transform: scale(1.18); }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 6px; border: 0; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; color: #fff; background: linear-gradient(#8fd8ff, var(--blue)); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 var(--blue-d); text-shadow: 0 1px 0 rgba(0,0,0,.2); transition: transform .1s; }
.nav-btn:nth-child(2) { background: linear-gradient(#ffb0c8, var(--pink)); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 var(--pink-d); }
.nav-btn:nth-child(3) { background: linear-gradient(#ffe58a, #ffbf2e); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 #c48500; color: #6a4300; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.nav-btn:nth-child(4) { background: linear-gradient(#c9b8ff, var(--grape)); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 var(--grape-d); }
.nav-btn:nth-child(5) { background: linear-gradient(#b6f0d2, var(--mint)); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 var(--mint-d); color: #1d5a3a; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.nav-btn:active { transform: translateY(2px); }
.nav-btn.active { outline: 3px solid #fff; outline-offset: 1px; }
.nav-btn .ni svg { width: 18px; height: 18px; }
.nav-btn .dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.3); } }
.top-tools { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #e3dcf5; background: #fff; color: var(--ink2); display: grid; place-items: center; font-size: 20px; box-shadow: 0 2px 0 #d5cde9; }
.icon-btn:active { transform: translateY(2px); }

/* ---------- Stage / room ---------- */
.stage { flex: 1; min-height: 0; position: relative; }
.room-view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.room-wrap { position: relative; overflow: hidden; border-radius: 26px; box-shadow: 0 10px 0 rgba(59,47,85,.12), 0 20px 40px rgba(59,47,85,.2); background: linear-gradient(#fdf3ff, #eaf6ff); border: 5px solid #fff; }
.room { position: absolute; left: 0; top: 0; width: 1000px; height: 700px; transform-origin: 0 0; }
.room-bg { position: absolute; inset: 0; width: 1000px; height: 700px; }
.room-layer { position: absolute; inset: 0; }
.fitem { position: absolute; touch-action: none; cursor: pointer; transition: filter .15s; }
.fitem svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fitem.flip svg { transform: scaleX(-1); }
.fitem:hover { filter: brightness(1.06) drop-shadow(0 0 6px #fff); }
.decorating .fitem { cursor: grab; }
.decorating .fitem::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -4%; height: 16%; border: 3px dashed rgba(255,111,145,.0); border-radius: 50%; }
.decorating .fitem.sel::after { border-color: var(--pink); }
.decorating .fitem.sel { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 8px rgba(255,111,145,.9)); }
.decorating .fitem.dragging { cursor: grabbing; filter: drop-shadow(0 14px 8px rgba(0,0,0,.25)) brightness(1.05); }
.decorating .pet { pointer-events: none; opacity: .85; }
.decorating .room-bg { filter: saturate(1.05); }
.floor-grid { opacity: 0; transition: opacity .2s; pointer-events: none; }
.decorating .floor-grid { opacity: .55; }
.flame { animation: flick .4s infinite alternate; transform-origin: 60px 112px; }
@keyframes flick { to { transform: scaleY(.85) scaleX(1.06); } }
.spray { animation: flick .6s infinite alternate; transform-origin: 60px 44px; }

.pet { position: absolute; width: 150px; height: 188px; touch-action: manipulation; cursor: pointer; }
.pet .pet-body { position: absolute; inset: 0; transform-origin: 50% 100%; }
.pet .pet-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.pet .shadow { position: absolute; left: 22%; right: 22%; bottom: -6px; height: 16px; background: radial-gradient(rgba(59,47,85,.35), transparent 70%); border-radius: 50%; }
.pet.walk .pet-body { animation: waddle .42s ease-in-out infinite; }
.pet.idle .pet-body { animation: breathe 2.6s ease-in-out infinite; }
.pet.sleep .pet-body { animation: breathe 3.6s ease-in-out infinite; }
.pet.hop .pet-body { animation: hop .5s ease-out 2; }
.pet.dance .pet-body { animation: dance .5s ease-in-out infinite; }
.pet.facing-left .pet-svg { transform: scaleX(-1); }
@keyframes waddle { 0%,100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-6px); } }
@keyframes breathe { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
@keyframes hop { 0% { transform: translateY(0) scale(1.1,.9); } 40% { transform: translateY(-40px) scale(.95,1.05); } 100% { transform: translateY(0); } }
@keyframes dance { 0%,100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(10deg) translateY(-14px); } }
.bubble { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -6px) scale(0); transform-origin: 50% 100%; background: #fff; border: 3px solid var(--ink); color: var(--ink); border-radius: 18px; padding: 8px 14px; font-size: 22px; font-weight: 600; white-space: nowrap; transition: transform .25s cubic-bezier(.3,1.6,.5,1); pointer-events: none; box-shadow: 0 4px 0 rgba(59,47,85,.15); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -12px; margin-left: -9px; border: 9px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.bubble.show { transform: translate(-50%, -6px) scale(1); }
.fx { position: absolute; pointer-events: none; z-index: 9999; animation: floatUp 1.3s ease-out forwards; color: var(--pink); font-size: 34px; }
.fx svg { width: 1em; height: 1em; }
.fx.z { color: #7a8ad0; font-size: 30px; }
.fx.txt { font-weight: 700; color: #fff; text-shadow: 0 2px 0 var(--pink-d), 0 0 6px var(--pink); font-size: 30px; }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; transform: translateY(-10px) scale(1.1); } 100% { opacity: 0; transform: translateY(-110px) translateX(var(--dx, 0px)) scale(1); } }
.held { position: absolute; width: 70px; height: 70px; left: 50%; top: 38%; margin-left: -35px; animation: nomnom .32s ease-in-out infinite alternate; pointer-events: none; }
@keyframes nomnom { to { transform: translateY(6px) rotate(-8deg) scale(.92); } }
.toyfx { position: absolute; width: 60px; height: 60px; pointer-events: none; animation: toyBounce .6s ease-in-out infinite alternate; }
@keyframes toyBounce { from { transform: translateY(0) rotate(0); } to { transform: translateY(-46px) rotate(140deg); } }

/* ---------- HUD ---------- */
.hud { position: absolute; left: 18px; top: 16px; width: 236px; padding: 12px 14px; background: rgba(255,255,255,.92); border-radius: 22px; border: 4px solid #ffd6e4; box-shadow: var(--shadow); z-index: 5; }
.hud-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hud-portrait { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #ffe6f0); border: 3px solid #ffc6d8; overflow: hidden; flex: none; }
.hud-portrait svg { width: 100%; height: 100%; transform: translateY(4px) scale(1.25); }
.hud-name { font-weight: 700; font-size: 20px; line-height: 1.1; }
.hud-species { font-size: 13px; color: var(--ink2); }
.bar { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.bar-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; flex: none; }
.bar[data-stat=hunger] .bar-ico { background: #ff9a3c; } .bar[data-stat=happy] .bar-ico { background: var(--pink); } .bar[data-stat=energy] .bar-ico { background: #4fb2ee; }
.bar-track { flex: 1; height: 16px; border-radius: 99px; background: #efeaf8; box-shadow: inset 0 2px 3px rgba(0,0,0,.12); overflow: hidden; }
.bar-fill { height: 100%; width: 50%; border-radius: 99px; transition: width .6s; background: linear-gradient(#ffd08a, #ff9a3c); box-shadow: inset 0 3px 0 rgba(255,255,255,.45); }
.bar[data-stat=happy] .bar-fill { background: linear-gradient(#ffb0c8, var(--pink)); } .bar[data-stat=energy] .bar-fill { background: linear-gradient(#a8e4ff, #4fb2ee); }
.bar.low .bar-fill { animation: lowblink 1s infinite; }
@keyframes lowblink { 50% { opacity: .55; } }
.bar-lbl { width: 54px; font-size: 12px; color: var(--ink2); text-align: right; }
.care { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }

/* ---------- Pills ---------- */
.pill { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 17px; color: #fff; background: linear-gradient(#ffb0c8, var(--pink)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 var(--pink-d); text-shadow: 0 1px 0 rgba(0,0,0,.18); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .08s, filter .15s; white-space: nowrap; }
.pill:hover { filter: brightness(1.05); }
.pill:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 1px 0 var(--pink-d); }
.pill.small { padding: 7px 12px; font-size: 14px; }
.pill.go { background: linear-gradient(#b6f0d2, #4fcf88); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 var(--mint-d); }
.pill.blue { background: linear-gradient(#a8e4ff, var(--blue)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 var(--blue-d); }
.pill.sun { background: linear-gradient(#fff0a8, #ffc42e); color: #6a4300; text-shadow: 0 1px 0 rgba(255,255,255,.6); box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 4px 0 #c48500; }
.pill.grape { background: linear-gradient(#d2c4ff, var(--grape)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 var(--grape-d); }
.pill.ghost { background: #fff; color: var(--ink2); text-shadow: none; box-shadow: inset 0 0 0 3px #e3dcf5, 0 4px 0 #d5cde9; }
.pill:disabled { filter: grayscale(.8) opacity(.6); cursor: not-allowed; }
.pill [data-ico] svg, .pill svg.ico { width: 16px; height: 16px; }
.care .pill { width: 100%; }
#feedBtn { background: linear-gradient(#ffd08a, #ff9a3c); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 #c4630e; }
#napBtn { background: linear-gradient(#a8e4ff, #4fb2ee); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 var(--blue-d); }
#decoBtn { background: linear-gradient(#d2c4ff, var(--grape)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 4px 0 var(--grape-d); }

/* ---------- Decor bar ---------- */
.decor-bar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.95); padding: 8px 10px 8px 16px; border-radius: 999px; box-shadow: var(--shadow); z-index: 6; border: 3px solid #d2c4ff; }
.decor-bar[hidden] { display: none; }
.decor-title { font-weight: 700; color: var(--grape-d); font-size: 15px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Dock ---------- */
.dock { position: relative; z-index: 3; height: var(--dockH); background: linear-gradient(#fff, #fdf1f6); border-top: 4px solid #ffc6d8; box-shadow: 0 -4px 16px rgba(59,47,85,.12); display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.dock-tabs { display: flex; gap: 4px; padding: 0 12px; transform: translateY(-4px); overflow-x: auto; scrollbar-width: none; flex: none; }
.dock-tabs::-webkit-scrollbar { display: none; }
.dock-tab { border: 3px solid #ffc6d8; border-top: 0; border-radius: 0 0 14px 14px; background: #ffe6ef; padding: 5px 14px 6px; font-weight: 600; font-size: 14px; color: var(--pink-d); white-space: nowrap; }
.dock-tab.active { background: #fff; color: var(--ink); border-color: #ffc6d8; box-shadow: 0 3px 0 #ffc6d8; }
.dock-tab b { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; }
.dock-tray { flex: 1; display: flex; gap: 10px; align-items: center; padding: 4px 14px 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
.dock-tray::-webkit-scrollbar { height: 8px; } .dock-tray::-webkit-scrollbar-thumb { background: #ffc6d8; border-radius: 9px; }
.slot { position: relative; flex: none; width: 84px; height: 88px; border-radius: 18px; border: 3px solid #ece4fb; background: radial-gradient(circle at 50% 35%, #fff, #f6f1ff); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; scroll-snap-align: start; transition: transform .12s, border-color .12s; }
.slot:hover { transform: translateY(-3px); border-color: #ffc6d8; }
.slot:active { transform: scale(.95); }
.slot .item-svg, .slot .pet-svg { width: 54px; height: 54px; }
.slot small { font-size: 11px; line-height: 1.1; text-align: center; color: var(--ink2); max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .cnt { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; border: 2px solid #fff; }
.slot.on { border-color: var(--mint); background: radial-gradient(circle at 50% 35%, #fff, #dcf8e6); }
.slot.on::before { content: "On"; position: absolute; top: -8px; left: -6px; background: var(--mint-d); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 2px solid #fff; }
.slot.add { border-style: dashed; color: var(--mint-d); font-weight: 700; font-size: 13px; }
.slot.add .plus { font-size: 34px; line-height: 1; }
.tray-empty { color: var(--ink2); font-size: 15px; padding: 0 6px; display: flex; gap: 10px; align-items: center; white-space: nowrap; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(59,47,85,.45); backdrop-filter: blur(3px); animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { position: relative; width: min(920px, 100%); max-height: 100%; overflow: auto; background: var(--cream); border-radius: 28px; border: 5px solid #fff; box-shadow: 0 12px 0 rgba(59,47,85,.2), 0 30px 60px rgba(0,0,0,.3); padding: 22px; animation: popIn .32s cubic-bezier(.3,1.5,.5,1); }
@keyframes popIn { from { transform: scale(.85); opacity: 0; } }
.sheet h2 { margin: 0 0 4px; font-size: 30px; color: var(--pink-d); text-shadow: 0 2px 0 #fff, 0 3px 0 #ffc6d8; }
.sheet .sub { margin: 0 0 16px; color: var(--ink2); }
.sheet .x { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 3px solid #ffc6d8; background: #fff; color: var(--pink-d); display: grid; place-items: center; font-size: 18px; z-index: 3; }
.sheet.full { width: min(1100px, 100%); height: 100%; display: flex; flex-direction: column; }

/* Adoption */
.adopt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.adopt-card { border: 4px solid #ece4fb; background: #fff; border-radius: 22px; padding: 10px 10px 12px; text-align: center; transition: transform .15s, border-color .15s; }
.adopt-card:hover { transform: translateY(-4px) rotate(-1deg); border-color: #ffc6d8; }
.adopt-card.sel { border-color: var(--pink); box-shadow: 0 0 0 4px #ffd6e4; }
.adopt-card .pet-svg { width: 120px; height: 140px; }
.adopt-card b { display: block; font-size: 18px; }
.adopt-card small { display: block; color: var(--ink2); font-size: 13px; min-height: 32px; }
.adopt-name { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.adopt-name input { flex: 1; min-width: 180px; max-width: 320px; padding: 12px 16px; border-radius: 999px; border: 4px solid #ffc6d8; font-size: 18px; outline: none; color: var(--ink); background: #fff; }
.adopt-name input:focus { border-color: var(--pink); }

/* Certificate */
.cert { position: relative; background: #fffdf3; border-radius: 10px; padding: 26px 30px; text-align: center; border: 10px double #e6b94c; outline: 3px solid #fff; box-shadow: inset 0 0 0 4px #fff3c4, inset 0 0 60px rgba(230,185,76,.25); }
.cert h3 { margin: 0; font-size: 15px; letter-spacing: 4px; text-transform: uppercase; color: #a17a18; }
.cert h2 { font-size: 38px; margin: 2px 0 6px; }
.cert .cert-pet { width: 170px; height: 190px; margin: 0 auto; }
.cert .cert-pet svg { width: 100%; height: 100%; }
.cert p { margin: 6px 0; font-size: 17px; line-height: 1.45; }
.cert .seal { position: absolute; right: 24px; bottom: 20px; width: 86px; height: 86px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff9fb8, var(--pink-d)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; line-height: 1.05; transform: rotate(-12deg); box-shadow: 0 3px 0 #a01f43; border: 3px dashed #ffd6e4; }
.cert .code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; color: var(--ink2); font-size: 14px; }
.cert .gifts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cert .gifts span { background: #fff; border: 2px solid #f3e3b0; border-radius: 99px; padding: 4px 12px; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.cert .gifts svg { width: 20px; height: 20px; }
.cert .sig { font-style: italic; color: #a17a18; margin-top: 10px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* Shop */
.shop-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.shop-keeper { width: 70px; height: 80px; flex: none; }
.shop-keeper svg { width: 100%; height: 100%; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { border: 3px solid #ffc6d8; background: #fff; color: var(--pink-d); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 15px; }
.tab.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-card { background: #fff; border-radius: 20px; border: 3px solid #ece4fb; padding: 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shop-card .item-svg { width: 92px; height: 92px; }
.shop-card b { font-size: 15px; }
.shop-card .meta { font-size: 12px; color: var(--ink2); min-height: 16px; }
.shop-card .price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #8a5a00; }
.shop-card .price svg { width: 18px; height: 18px; }
.shop-card .own { font-size: 12px; color: var(--mint-d); font-weight: 600; min-height: 15px; }
.shop-card.just { animation: buyPop .5s; }
@keyframes buyPop { 40% { transform: scale(1.06); border-color: var(--mint); } }

/* Wheel */
.wheel-wrap { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.wheel-box { position: relative; width: min(440px, 78vw); aspect-ratio: 1; margin: 0 auto; }
.wheel-box canvas { width: 100%; height: 100%; display: block; }
.wheel-pointer { position: absolute; left: 50%; top: -10px; width: 44px; height: 56px; margin-left: -22px; z-index: 2; filter: drop-shadow(0 3px 0 rgba(0,0,0,.2)); transform-origin: 50% 20%; }
.wheel-pointer.tick { animation: ptick .08s; }
@keyframes ptick { 50% { transform: rotate(-14deg); } }
.wheel-side { text-align: center; }
.wheel-side .big { font-size: 34px; font-weight: 700; color: var(--pink-d); margin: 4px 0 10px; min-height: 42px; }
.wheel-side .prize-art { width: 120px; height: 120px; margin: 0 auto; }
.wheel-side .prize-art svg { width: 100%; height: 100%; }
.next-spin { color: var(--ink2); font-size: 15px; margin-top: 10px; }

/* Arcade */
.arcade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.game-card { border: 0; padding: 0; border-radius: 24px; overflow: hidden; background: #fff; box-shadow: var(--shadow); text-align: left; transition: transform .15s; display: flex; flex-direction: column; }
.game-card:hover { transform: translateY(-5px) rotate(-.5deg); }
.game-card .gc-art { height: 150px; display: grid; place-items: center; }
.game-card .gc-art svg { width: 100%; height: 100%; }
.game-card .gc-body { padding: 12px 14px 16px; }
.game-card b { font-size: 20px; display: block; }
.game-card small { color: var(--ink2); font-size: 14px; display: block; margin: 4px 0 8px; min-height: 36px; }
.game-card .best { font-size: 13px; color: #8a5a00; font-weight: 600; }

.game-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.game-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-right: 50px; flex-wrap: wrap; }
.game-top h2 { margin: 0; font-size: 26px; }
.gstat { background: #fff; border-radius: 999px; border: 3px solid #ece4fb; padding: 4px 14px; font-weight: 700; font-size: 16px; display: inline-flex; gap: 6px; align-items: center; }
.gstat svg { width: 18px; height: 18px; }
.game-area { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.game-area canvas { display: block; border-radius: 20px; touch-action: none; box-shadow: 0 6px 0 rgba(59,47,85,.15); }
.game-over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,250,240,.86); border-radius: 20px; z-index: 4; animation: fadeIn .25s; }
.game-over .card { text-align: center; background: #fff; border-radius: 24px; padding: 24px 30px; border: 4px solid #ffd6e4; box-shadow: var(--shadow); max-width: 92%; }
.game-over h3 { font-size: 30px; margin: 0 0 6px; color: var(--pink-d); }
.game-over .earn { font-size: 26px; font-weight: 700; color: #8a5a00; display: inline-flex; align-items: center; gap: 8px; margin: 8px 0; }
.game-over .earn svg { width: 30px; height: 30px; }
.intro { text-align: center; max-width: 520px; margin: 0 auto; }
.intro p { font-size: 17px; line-height: 1.5; }
.combo-pop { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 44px; font-weight: 700; color: #fff; text-shadow: 0 3px 0 var(--pink-d), 0 0 14px var(--pink); pointer-events: none; animation: comboPop .9s ease-out forwards; z-index: 3; white-space: nowrap; }
@keyframes comboPop { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -110%) scale(1); opacity: 0; } }

/* Quiz */
.quiz { width: min(640px, 100%); margin: 0 auto; }
.quiz-host { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.quiz-host .owl-svg { width: 90px; height: 90px; flex: none; }
.quiz-q { position: relative; flex: 1; background: #fff; border: 4px solid #d2c4ff; border-radius: 22px; padding: 14px 18px; font-size: 21px; font-weight: 600; min-height: 84px; display: flex; align-items: center; }
.quiz-q::before { content: ""; position: absolute; left: -16px; bottom: 18px; border: 10px solid transparent; border-right-color: #d2c4ff; border-left: 0; }
.quiz-timer { height: 12px; border-radius: 99px; background: #efeaf8; overflow: hidden; margin: 6px 0 14px; }
.quiz-timer div { height: 100%; background: linear-gradient(90deg, var(--mint), var(--sun), var(--pink)); background-size: 300% 100%; width: 100%; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-opt { border: 4px solid #ece4fb; background: #fff; border-radius: 18px; padding: 14px 12px; font-size: 18px; font-weight: 600; color: var(--ink); text-align: left; display: flex; gap: 10px; align-items: center; transition: transform .1s; }
.quiz-opt:hover { border-color: #d2c4ff; transform: translateY(-2px); }
.quiz-opt i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.quiz-opt:nth-child(1) i { background: var(--pink); } .quiz-opt:nth-child(2) i { background: var(--blue); } .quiz-opt:nth-child(3) i { background: #ffb43a; } .quiz-opt:nth-child(4) i { background: var(--mint-d); }
.quiz-opt.right { border-color: var(--mint-d); background: #dcf8e6; animation: buyPop .4s; }
.quiz-opt.wrong { border-color: var(--pink); background: #ffe6ef; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.quiz-foot { display: flex; justify-content: space-between; margin-top: 12px; color: var(--ink2); font-weight: 600; }

/* Settings */
.save-code { width: 100%; min-height: 90px; border-radius: 14px; border: 3px solid #e3dcf5; padding: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; resize: vertical; color: var(--ink); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--dockH) + 24px); transform: translate(-50%, 30px); opacity: 0; z-index: 80; background: #fff; color: var(--ink); border: 4px solid var(--sun); border-radius: 999px; padding: 10px 20px; font-weight: 600; font-size: 16px; box-shadow: var(--shadow); transition: all .3s cubic-bezier(.3,1.5,.5,1); pointer-events: none; display: flex; gap: 8px; align-items: center; max-width: 92vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 22px; height: 22px; }
.coin-fly { position: fixed; z-index: 90; width: 28px; height: 28px; pointer-events: none; transition: transform .75s cubic-bezier(.5,-.3,.7,1), opacity .75s; }
.coin-fly svg { width: 100%; height: 100%; }

/* bug button sits above the dock */
.req-fab.req-fab { bottom: calc(var(--dockH) + 14px) !important; }
body.modal-open .req-fab.req-fab { display: none !important; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --dockH: 138px; }
  .topbar { padding: 6px 8px; gap: 6px; }
  .logo { font-size: 19px; } .logo-paw { width: 30px; height: 30px; font-size: 17px; }
  .coin-pill { font-size: 16px; padding: 2px 10px 2px 4px; margin-left: auto; } .coin-pill svg { width: 22px; height: 22px; }
  .top-tools .icon-btn { width: 36px; height: 36px; font-size: 18px; }
  .nav { order: 5; width: 100%; margin: 0; justify-content: space-between; gap: 4px; }
  .nav-btn { flex: 1; flex-direction: column; gap: 1px; padding: 5px 2px 4px; font-size: 10.5px; border-radius: 14px; }
  .nav-btn .ni svg { width: 20px; height: 20px; }
  .room-view { flex-direction: column; justify-content: center; padding: 6px 0; gap: 10px; }
  .bubble { font-size: 36px; padding: 10px 20px; border-width: 4px; }
  .fx { font-size: 48px; }
  .room-wrap { border-radius: 18px; border-width: 3px; }
  .hud { position: relative; left: auto; top: auto; width: calc(100% - 16px); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 8px 12px; border-radius: 18px; }
  .hud-head { grid-row: span 3; flex-direction: column; margin: 0; gap: 2px; text-align: center; width: 76px; }
  .hud-name { font-size: 15px; } .hud-species { font-size: 11px; }
  .bar { margin: 1px 0; } .bar-lbl { display: none; } .bar-ico { width: 22px; height: 22px; font-size: 13px; }
  .care { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); margin-top: 6px; }
  .care .pill { padding: 7px 4px; font-size: 13px; }
  .decor-bar { top: auto; bottom: 8px; padding: 5px 6px 5px 10px; gap: 5px; max-width: calc(100% - 12px); }
  .decor-bar .pill.small { padding: 6px 9px; font-size: 12.5px; }
  .decor-title { max-width: 80px; font-size: 13px; }
  .slot { width: 74px; height: 80px; } .slot .item-svg, .slot .pet-svg { width: 46px; height: 46px; }
  .sheet { padding: 16px 14px; border-radius: 22px; }
  .sheet h2 { font-size: 24px; padding-right: 44px; }
  .adopt-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .adopt-card .pet-svg { width: 96px; height: 110px; }
  .arcade-grid { grid-template-columns: 1fr; }
  .game-card { flex-direction: row; } .game-card .gc-art { width: 120px; height: auto; flex: none; }
  .wheel-wrap { grid-template-columns: 1fr; gap: 10px; }
  .quiz-q { font-size: 17px; min-height: 70px; } .quiz-host .owl-svg { width: 64px; height: 64px; }
  .quiz-opts { grid-template-columns: 1fr; } .quiz-opt { padding: 10px 12px; font-size: 16px; }
  .cert { padding: 18px 12px 70px; border-width: 8px; } .cert h2 { font-size: 28px; } .cert .seal { width: 70px; height: 70px; font-size: 11px; right: 12px; bottom: 10px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .toast { font-size: 14px; bottom: calc(var(--dockH) + 76px); }
}
@media (prefers-reduced-motion: reduce) { .cloud, .pet .pet-body { animation: none !important; } }
