/* MusePet app. Keynote-sky stage, glossy device, glass side panels. */
:root {
  --sky-1: #9ccff0; --sky-2: #c4e4f8; --sky-3: #eef6fb;
  --ink: #13202c; --ink-2: #2a3a48; --muted: #566b7c; --faint: #8a9aa8;
  --line: rgba(19, 32, 44, .09); --line-2: rgba(19, 32, 44, .15);
  --glass: rgba(255, 255, 255, .66); --glass-2: rgba(255, 255, 255, .82); --tile: #fff; --tile-2: #f3f8fc;
  --good: #2f9e6a; --warn: #d9892b; --bad: #d64545;
  --basic: #8a97a3; --common: #6c7a86; --rare: #2f80d1; --epic: #8753d9; --legendary: #d9892b;
  --r-xl: 26px; --r-lg: 20px; --r-md: 16px; --r-sm: 12px;
  --shadow: 0 24px 60px -28px rgba(20, 60, 100, .42), 0 2px 6px -2px rgba(20, 60, 100, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Fraunces", Georgia, serif;
  --ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar: 64px; --railw: 78px; --lw: 78px; --rw: 0px; --lpw: 300px; --rpw: 440px;
}
body.l-open { --lw: calc(var(--lpw) + 16px); }
body.r-open { --rw: calc(var(--rpw) + 12px); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100svh; color: var(--ink); font: 500 14px/1.4 var(--ui); font-variant-numeric: tabular-nums;
  background: radial-gradient(120% 70% at 50% -10%, #fff 0%, rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 45%, var(--sky-3) 100%) fixed;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; left: -10vw; right: -10vw; top: -62vw; height: 80vw; border-radius: 50%;
  border-bottom: 2px solid rgba(255, 255, 255, .95); box-shadow: 0 14px 40px -8px rgba(255, 255, 255, .9); pointer-events: none; z-index: 0;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.addr { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 12px; }

/* ---- controls ---- */
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; letter-spacing: .05em; font-size: 12.5px; background: #fff; box-shadow: 0 0 0 1px var(--line-2) inset; transition: transform .12s, background .2s, box-shadow .2s; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { background: #f7fbfe; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.ink { background: var(--ink); color: #fff; box-shadow: 0 10px 22px -12px rgba(19, 32, 44, .8); }
.btn.ink:hover:not(:disabled) { background: #22384b; }
.btn.big { padding: 15px 40px; font-size: 14px; letter-spacing: .14em; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 11.5px; }
.btn.block { width: 100%; text-align: center; }
.chip { border: 0; border-radius: 999px; padding: 6px 11px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .2s, color .2s; }
.chip:hover { background: #fff; }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.chip svg.icon { width: 15px; height: 15px; flex: none; }
.iconbtn { border: 0; width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; transition: background .2s, color .2s; flex: none; }
.iconbtn:hover { background: rgba(19, 32, 44, .06); color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; }
.only-m { display: none !important; }

/* ---- header ---- */
.bar { position: relative; z-index: 20; height: var(--bar); display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 22px/1 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; filter: drop-shadow(0 3px 6px rgba(20, 60, 100, .25)); }
.bar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.iconbtn.x { color: var(--ink); }
.iconbtn.x svg { width: 17px; height: 17px; }
.coin svg { width: 16px; height: 16px; }

/* ---- shell: [pets panel][stage][panel][rail] ---- */
.app {
  position: relative; z-index: 1; height: calc(100svh - var(--bar)); padding: 0 0 14px 14px;
  display: grid; grid-template-columns: var(--lw) minmax(0, 1fr) var(--rw) var(--railw);
  transition: grid-template-columns .5s var(--ease);
}
.pane-h { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.pane-h h3 { margin: 0 auto 0 0; font: 600 20px/1 var(--display); font-variation-settings: "SOFT" 100; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px 18px; scrollbar-width: thin; scrollbar-color: rgba(19, 32, 44, .2) transparent; }
.panel-glass { background: var(--glass); backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--shadow); }

/* pets panel (left): full panel when open, avatar rail when closed */
.lp { grid-column: 1; grid-row: 1; position: relative; overflow: hidden; }
.lp-full, .lp-mini { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-xl); display: flex; flex-direction: column; transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s linear .45s; }
.lp-full { width: var(--lpw); background: var(--glass); backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--shadow); opacity: 0; transform: translateX(-24px); visibility: hidden; }
.lp-mini { width: 64px; align-items: center; gap: 9px; padding: 8px 0; opacity: 1; visibility: visible; transition-delay: 0s; }
body.l-open .lp-full { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
body.l-open .lp-mini { opacity: 0; transform: translateX(-10px); visibility: hidden; transition-delay: 0s, 0s, .45s; }
.av { width: 50px; height: 50px; border-radius: 16px; border: 0; padding: 0; overflow: hidden; background: #0c0c0e; box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .7); position: relative; transition: transform .25s var(--ease), box-shadow .25s; flex: none; }
.av:hover { transform: translateY(-2px); }
.av.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink), 0 8px 16px -10px rgba(0, 0, 0, .7); }
.av svg, .av img { width: 100%; height: 100%; display: block; }
.av.plus { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); font-size: 22px; }
.av.plus:hover { background: #fff; color: var(--ink); }
.badge-dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; border-radius: 99px; background: #e0455e; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }

/* panel (right) + rail */
.rp { grid-column: 3; grid-row: 1; position: relative; overflow: hidden; }
.rp-in { position: absolute; top: 0; bottom: 0; right: 12px; width: var(--rpw); display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--glass); backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35); border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--shadow); opacity: 0; transform: translateX(28px); visibility: hidden; transition: opacity .35s var(--ease), transform .5s var(--ease), visibility 0s linear .5s; }
body.r-open .rp-in { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.rail { grid-column: 4; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; }
.rail button { position: relative; width: 62px; border: 0; background: transparent; border-radius: 16px; padding: 9px 0 7px; display: grid; justify-items: center; gap: 3px; color: var(--ink-2); font-size: 10.5px; font-weight: 600; transition: background .2s, color .2s, transform .15s; }
.rail button svg { width: 22px; height: 22px; }
.rail button:hover { background: rgba(255, 255, 255, .7); }
.rail button.on { background: var(--ink); color: #fff; box-shadow: 0 10px 20px -10px rgba(19, 32, 44, .7); }
.rail button:active { transform: scale(.95); }
.rail .sep { width: 28px; height: 1px; background: var(--line-2); margin: 4px 0; }
.rail .badge-dot { top: 4px; right: 10px; }

/* stage */
/* Explicit columns: hidden panels (landing) must not let the stage slide into column 1. */
.stage { grid-column: 2; grid-row: 1; position: relative; min-width: 0; overflow: visible; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; }
/* The device keeps one rendered size (--dev) and is fitted with a composited scale (--fit, set by JS),
   so opening/closing panels never re-rasterises the pet's SVG filters. */
.device-wrap { --dev: min(580px, calc(100svh - var(--bar) - 262px)); position: relative; flex: none; width: var(--dev); transform: scale(var(--fit, 1)); transform-origin: 50% 0; margin-bottom: calc((var(--fit, 1) - 1) * var(--dev)); will-change: transform; filter: drop-shadow(0 30px 40px rgba(20, 60, 100, .28)); }
.device-wrap .device { cursor: pointer; }
#game { position: absolute; left: 9.3%; top: 9.3%; width: 81.4%; height: 81.4%; border-radius: 17%; touch-action: none; cursor: none; outline: none; }
.floats { position: absolute; inset: 0; pointer-events: none; }
.float { position: absolute; left: 50%; top: 36%; transform: translate(-50%, 0); font: 700 18px var(--ui); color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); animation: rise 1.4s var(--ease) forwards; white-space: nowrap; }
@keyframes rise { to { transform: translate(-50%, -64px); opacity: 0; } }
.preview-pill { position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 5px 5px 5px 14px; font-size: 12px; font-weight: 600; box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .45); white-space: nowrap; animation: pillin .35s var(--ease); }
@keyframes pillin { from { opacity: 0; transform: translate(-50%, 8px); } }
.petline { width: min(100%, 440px); display: grid; gap: 7px; }
.petname { display: flex; align-items: baseline; gap: 8px; justify-content: center; }
.petname h2 { margin: 0; font: 600 28px/1.1 var(--display); font-variation-settings: "SOFT" 100; }
.petname button { border: 0; background: none; padding: 2px; color: var(--faint); }
.petname button:hover { color: var(--ink); }
.petname button svg { width: 15px; height: 15px; }
.meta { color: var(--muted); font-size: 12.5px; text-align: center; }
.xpbar { height: 6px; border-radius: 99px; background: rgba(19, 32, 44, .08); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #7fc4ee, #3d8fd6); border-radius: inherit; transition: width .7s var(--ease); }
.care { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(100%, 400px); }
.cbtn { border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding: 0; }
.ring { position: relative; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(160deg, #fff, #e8f1f8); box-shadow: 0 12px 22px -14px rgba(20, 60, 100, .6), inset 0 -3px 0 rgba(19, 32, 44, .05); display: grid; place-items: center; transition: transform .15s var(--ease), box-shadow .2s; }
.cbtn:hover:not(:disabled) .ring { transform: translateY(-2px); }
.cbtn:active:not(:disabled) .ring { transform: scale(.94); }
.ring svg.meter { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring svg.meter circle:last-child { transition: stroke-dasharray .7s var(--ease); }
.ring svg.icon { width: 27px; height: 27px; }
.cbtn b { font-size: 12px; }
.cbtn small { color: var(--muted); font-size: 11px; margin-top: -2px; }
.cbtn.low .ring { animation: low 1.6s ease-in-out infinite; }
@keyframes low { 50% { box-shadow: 0 0 0 6px rgba(214, 69, 69, .18), 0 12px 22px -14px rgba(20, 60, 100, .6); } }
.extras { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.connect-card { display: grid; gap: 10px; justify-items: center; text-align: center; }
.namefield { display: flex; gap: 8px; }
.namefield input { border: 0; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 999px; padding: 10px 16px; width: 200px; background: #fff; }

/* landing */
.hero { display: none; text-align: center; gap: 14px; justify-items: center; }
.hero h1 { margin: 0; font: 600 clamp(38px, 7vw, 60px)/1 var(--display); font-variation-settings: "SOFT" 100; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); }
body.landing .hero { display: grid; }
body.landing .lp, body.landing .rp, body.landing .rail, body.landing .petline, body.landing .care, body.landing .extras, body.landing .bar-right > :not(.x), body.landing .preview-pill, body.landing #petsBtn { display: none !important; }
body.landing .app { grid-template-columns: 0 minmax(0, 1fr) 0 0; padding-left: 0; }
body.landing .device-wrap { --dev: min(78vw, 460px, calc(100svh - 300px)); --fit: 1; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---- accordions ---- */
.acc { border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: 0; }
.acc-h { width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 8px; padding: 13px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.acc-h small { color: var(--faint); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 12px; }
.acc-h .chev { margin-left: auto; width: 18px; height: 18px; color: var(--faint); transition: transform .38s var(--ease); }
.acc.open .acc-h .chev { transform: rotate(180deg); }
.acc-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s var(--ease); }
.acc.open .acc-b { grid-template-rows: 1fr; }
.acc-i { min-height: 0; overflow: hidden; }
.acc-i > .pad { padding: 2px 1px 16px; opacity: 0; transform: translateY(-6px); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.acc.open .acc-i > .pad { opacity: 1; transform: none; }

/* ---- panel content ---- */
.seg { display: flex; gap: 5px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; align-items: center; }
.filters select, .filters input { border: 0; box-shadow: inset 0 0 0 1px var(--line-2); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; }
.filters input { min-width: 0; flex: 1 1 110px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 9px; }
.card { position: relative; border: 0; text-align: left; background: var(--tile); border-radius: var(--r-md); padding: 7px; display: grid; gap: 5px; box-shadow: 0 0 0 1px var(--line), 0 8px 18px -16px rgba(20, 60, 100, .5); transition: transform .2s var(--ease), box-shadow .2s; content-visibility: auto; contain-intrinsic-size: auto 150px; }
.card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), 0 16px 26px -16px rgba(20, 60, 100, .55); }
.card.sel { box-shadow: 0 0 0 2px var(--ink), 0 16px 26px -16px rgba(20, 60, 100, .55); }
.card .th { aspect-ratio: 1 / .86; border-radius: 11px; background: radial-gradient(90% 80% at 50% 35%, #fff, var(--tile-2)); display: grid; place-items: center; overflow: hidden; }
.card .th svg, .card .th img { width: 100%; height: 100%; display: block; object-fit: contain; }
.th.dark { background: radial-gradient(90% 80% at 50% 35%, #26272c, #0a0a0c) !important; }
.card .nm { font-weight: 600; font-size: 12.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); padding: 0 2px 1px; }
.card .price { color: var(--ink); font-weight: 700; }
.card .badge { position: absolute; top: 11px; left: 11px; font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 3px 7px; border-radius: 99px; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .2); }
.card .corner { position: absolute; top: 9px; right: 9px; opacity: 0; transition: opacity .2s; }
.card:hover .corner, .card:focus-within .corner { opacity: 1; }
.card.worn { box-shadow: 0 0 0 2px var(--good), 0 16px 26px -16px rgba(20, 60, 100, .55); }
.card.locked .th { filter: grayscale(.4) opacity(.65); }
.card.soldout .th { filter: grayscale(.7); }
.card.none .th { color: var(--faint); font-size: 12px; font-weight: 600; }
.rar { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.rar.basic { color: var(--basic); } .rar.common { color: var(--common); } .rar.rare { color: var(--rare); } .rar.epic { color: var(--epic); } .rar.legendary { color: var(--legendary); }
.rar.mythic { background: linear-gradient(90deg, #b48a22, #6f8a3a, #d8b44a, #b48a22); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 4s linear infinite; }
.card.mythic { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #d8b44a, #6f8a3a, #f1dc93, #b48a22) border-box; border: 2px solid transparent; }
.card.legendary .th { background: radial-gradient(90% 80% at 50% 35%, #fff, #fbf1e1); }
.card.epic .th { background: radial-gradient(90% 80% at 50% 35%, #fff, #f3edfc); }
@keyframes shimmer { to { background-position: 300% 0; } }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; }
.facts b { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions input { border: 0; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 999px; padding: 9px 14px; width: 160px; background: #fff; }
.steps { display: flex; gap: 6px; font-size: 12px; color: var(--muted); }
.steps span.on { color: var(--ink); font-weight: 700; }
.kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.kvs > div { background: rgba(255, 255, 255, .72); border-radius: 12px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.kvs span { display: block; font-size: 11px; color: var(--muted); }
.kvs b { font-size: 13px; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.mult { display: grid; gap: 5px; font-size: 12.5px; background: rgba(255, 255, 255, .72); border-radius: 12px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.mult div { display: flex; justify-content: space-between; color: var(--muted); }
.mult div b { color: var(--ink); }
.mult div:last-child { border-top: 1px solid var(--line); padding-top: 6px; color: var(--ink); font-weight: 700; }
.petrows { display: grid; gap: 6px; }
.petrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 0; text-align: left; background: rgba(255, 255, 255, .72); border-radius: 14px; padding: 6px 12px 6px 6px; box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, box-shadow .2s; }
.petrow:hover { background: #fff; }
.petrow.on { background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.petrow .avatar, .rowi .avatar { width: 44px; height: 44px; border-radius: 12px; background: #0c0c0e; display: block; }
.petrow b { display: block; font-size: 13.5px; }
.petrow small { color: var(--muted); font-size: 11.5px; }
.pip { width: 9px; height: 9px; border-radius: 50%; }
.bag { display: grid; gap: 6px; }
.bag > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(255, 255, 255, .72); border-radius: 12px; padding: 7px 7px 7px 12px; box-shadow: inset 0 0 0 1px var(--line); min-height: 44px; }
.bag > div span { font-weight: 600; }
.bag > div small { color: var(--muted); font-weight: 500; }

/* detail drawer inside the panel */
.drawer { position: sticky; bottom: -18px; margin: 16px -16px -18px; padding: 16px; background: #fff; border-top: 1px solid var(--line); display: grid; gap: 10px; box-shadow: 0 -18px 30px -26px rgba(20, 60, 100, .6); animation: drawin .4s var(--ease); border-radius: 18px 18px 0 0; z-index: 2; }
@keyframes drawin { from { transform: translateY(24px); opacity: 0; } }
.drawer .top { display: flex; gap: 12px; align-items: center; }
.drawer .top .th { width: 76px; height: 66px; flex: none; border-radius: 12px; background: var(--tile-2); display: grid; place-items: center; overflow: hidden; }
.drawer .top .th svg, .drawer .top .th img { width: 100%; height: 100%; object-fit: contain; }
.drawer h4 { margin: 0 0 3px; font: 600 19px/1.15 var(--display); font-variation-settings: "SOFT" 100; }

/* lists */
.rows { display: grid; gap: 6px; }
.rowi { display: grid; grid-template-columns: 26px 44px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 0; text-align: left; background: rgba(255, 255, 255, .72); border-radius: 14px; padding: 6px 12px 6px 8px; box-shadow: inset 0 0 0 1px var(--line); transition: background .2s; }
.rowi:hover { background: #fff; }
.rowi .rk { font-weight: 700; color: var(--muted); text-align: center; }
.rowi .who { min-width: 0; }
.rowi .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .who small { color: var(--muted); }
.rowi .val { font-weight: 700; text-align: right; }
.feed { display: grid; gap: 4px; font-size: 12.5px; }
.feed div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .6); }
.feed time { color: var(--faint); flex: none; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.totals div { background: rgba(255, 255, 255, .72); border-radius: 12px; padding: 9px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.totals b { display: block; font: 600 20px/1.1 var(--display); font-variation-settings: "SOFT" 100; }
.totals span { font-size: 11px; color: var(--muted); }

/* modal + toasts */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(12, 22, 32, .42); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(420px, 100%); max-height: 88svh; overflow: auto; background: #fff; border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 14px; animation: sheetin .4s var(--ease); }
@keyframes sheetin { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.sheet h3 { margin: 0; font: 600 24px/1.1 var(--display); font-variation-settings: "SOFT" 100; }
.sheet .wl { display: grid; gap: 8px; }
.sheet .wl button { display: flex; gap: 12px; align-items: center; border: 0; background: var(--tile-2); border-radius: 14px; padding: 12px 14px; font-weight: 600; text-align: left; }
.sheet .wl img, .sheet .wl .wi { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.sheet .wl button { transition: background .2s, box-shadow .2s; }
.sheet .wl button:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.sheet .wl .wi { display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.sheet .wl .wi svg { width: 18px; height: 18px; }
.sheet .wl .wi.wc svg { width: 20px; height: auto; }
.sheet .wl small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }
.sheet .wl-h { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: -6px; }
.sheet .wl-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet .wl-apps .chip { padding: 9px 13px; font-size: 13px; text-decoration: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.reveal { display: grid; justify-items: center; gap: 8px; text-align: center; }
.reveal .th { width: 200px; height: 180px; border-radius: 20px; background: radial-gradient(90% 80% at 50% 35%, #fff, var(--tile-2)); display: grid; place-items: center; overflow: hidden; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.reveal .th svg, .reveal .th img { width: 100%; height: 100%; object-fit: contain; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 600; box-shadow: var(--shadow); animation: tin .3s var(--ease); pointer-events: auto; }
.toast.err { background: #7a1f24; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.scrim { display: none; }

@media (max-width: 1240px) { :root { --rpw: 400px; --lpw: 280px; } }

/* ---- mobile: pets drawer from the left, panel as a bottom sheet, rail as a tab bar ---- */
@media (max-width: 900px) {
  :root { --bar: 58px; }
  .only-m { display: inline-grid !important; }
  .bar { padding: 0 12px; gap: 8px; }
  .brand span, .coin .bal { display: none; }
  .bar-right .btn { padding: 9px 13px; }
  #petsBtn { width: 40px; height: 40px; border-radius: 13px; overflow: hidden; background: #0c0c0e; padding: 0; position: relative; }
  #petsBtn .avatar { width: 100%; height: 100%; display: block; }
  /* no stacking context on .app here, so the drawer/sheet/scrim/tab bar layer against the header */
  .app { display: block; height: auto; min-height: calc(100svh - var(--bar)); padding: 0 0 96px; z-index: auto; }
  .stage { min-height: calc(100svh - var(--bar) - 96px); padding: 0 16px; z-index: 1; }
  .device-wrap { --dev: max(250px, min(420px, calc(100vw - 32px), calc(100svh - var(--bar) - 336px))); }
  .lp { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); overflow: visible; transform: translateX(-104%); transition: transform .45s var(--ease); }
  body.l-open .lp { transform: none; }
  .lp-full { inset: 10px; width: auto; opacity: 1; transform: none; visibility: visible; background: rgba(255, 255, 255, .94); }
  .lp-mini { display: none; }
  .rp { position: fixed; z-index: 44; left: 0; right: 0; bottom: 0; height: min(74svh, 660px); overflow: visible; transform: translateY(105%); transition: transform .5s var(--ease); }
  body.r-open .rp { transform: none; }
  .rp-in { inset: 0 8px calc(80px + env(safe-area-inset-bottom)) 8px; width: auto; opacity: 1; transform: none; visibility: visible; border-radius: 24px; background: rgba(250, 252, 254, .985); }
  .rp .pane-h .iconbtn { transform: rotate(90deg); }
  .lp-full { background: rgba(250, 252, 254, .985); }
  .rail { position: fixed; z-index: 50; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); flex-direction: row; gap: 2px; padding: 5px; border-radius: 22px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 14px 34px -14px rgba(20, 60, 100, .5), inset 0 0 0 1px rgba(255, 255, 255, .9); }
  .rail button { width: 68px; padding: 7px 0 6px; }
  .rail .sep, .rail .desk { display: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 42; background: rgba(12, 22, 32, .32); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
  body.l-open .scrim, body.r-open .scrim { opacity: 1; pointer-events: auto; }
  body.landing .app { display: grid; min-height: calc(100svh - var(--bar)); padding-bottom: 0; }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .ring { width: 60px; height: 60px; }
  .card .corner { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
