/* mywebpet — styles. Mobile-first, light + dark. */
:root {
  --bg: #EEF3EA; --card: #FAFCF7; --ink: #1E2B24; --muted: #5B6B61; --line: #D3DDD0; --chip: #E4ECE0;
  --accent: #F2B32B; --accent-ink: #2A1E05; --leaf: #2E7D5B; --leaf-ink: #FFFFFF;
  --sky: #D8ECF3; --grass: #A9D18E; --shadow: rgba(40,70,40,.18); --zz: #3A5A7A;
  --good: #2E7D5B; --warn: #9A6414; --bad: #B8362F;
  --good-bg: #DDEFE3; --warn-bg: #F8EBCF; --bad-bg: #F7DEDB;
  --bar: #E1E8DD;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121915; --card: #1A231E; --ink: #E6EEE7; --muted: #9DAEA3; --line: #2C3A32; --chip: #24302A;
    --accent: #F2B32B; --accent-ink: #2A1E05; --leaf: #5DBE8E; --leaf-ink: #0D1A13;
    --sky: #22394A; --grass: #3E6B44; --shadow: rgba(0,0,0,.35); --zz: #BFD6EE;
    --good: #6CC79A; --warn: #E5B357; --bad: #F08A80;
    --good-bg: #1D3428; --warn-bg: #3A3020; --bad-bg: #3D2423;
    --bar: #2A3630;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--leaf); font-weight: 700; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
code { background: var(--chip); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; }
.eyebrow { font: 800 13px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--leaf); }
.bad-text { color: var(--bad); font-weight: 700; }

/* ---- Top bar ---- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.mark { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; color: var(--ink); text-decoration: none; letter-spacing: -.5px; white-space: nowrap; }
.mark span { color: var(--muted); font-weight: 700; }
.mark em { font-style: normal; background: var(--accent); color: var(--accent-ink); padding: 0 7px 2px; border-radius: 9px 9px 9px 2px; margin-left: 2px; }
.topnav { display: none; gap: 4px; }
.topnav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.topnav a:hover { color: var(--ink); background: var(--chip); }
.topnav a[aria-current] { color: var(--ink); background: var(--chip); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pts { font: 800 15px var(--body); background: var(--accent); color: var(--accent-ink); padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.pts small { font-weight: 700; opacity: .75; }
.lang-switch { font: 800 13px var(--body); color: var(--ink); text-decoration: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 10px; }
@media (min-width: 820px) { .topnav { display: flex; } }

/* ---- Bottom nav (phones) ---- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; color: var(--muted); text-decoration: none; font-size: 12px; }
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a[aria-current] { color: var(--leaf); }
.bottomnav a[aria-current] svg { fill: color-mix(in srgb, var(--leaf) 18%, transparent); }
body.logged-in { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 820px) { .bottomnav { display: none; } body.logged-in { padding-bottom: 0; } }

/* ---- Page ---- */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 40px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.narrow { max-width: 560px; width: 100%; margin-inline: auto; }
.page.narrow { max-width: 640px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sitefoot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1120px; width: 100%; margin: 0 auto; padding: 16px; color: var(--muted); font-size: 13px; }
.sitefoot a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.soft { background: transparent; border-style: dashed; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2, .grid3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- Forms & buttons ---- */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 600; }
label.check input { margin-top: 4px; }
input, select, textarea { font: 600 16px var(--body); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 25%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 800 15px var(--body); color: var(--ink); background: var(--chip); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--leaf); color: var(--leaf-ink); }
.btn.primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, .act:focus-visible, .food:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.flash { padding: 10px 14px; border-radius: 12px; font-weight: 700; background: var(--good-bg); color: var(--good); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.tight { padding: 6px 10px; font-size: 14px; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.chips li { font-size: 13px; font-weight: 800; background: var(--chip); padding: 3px 10px; border-radius: 999px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.badge.good { background: var(--accent); color: var(--accent-ink); }
.badge.admin { background: var(--ink); color: var(--card); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* ---- Pet art ---- */
.art svg { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--sky); }
.art.bounce svg { animation: bounce .5s ease; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
.breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.03); } }
.mood-sleepy .breathe { animation-duration: 5.5s; }
.tail { transform-box: view-box; animation: wag 1.3s ease-in-out infinite; }
@keyframes wag { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
.mood-happy .tail { animation-duration: .42s; }
.mood-sad .tail, .mood-sleepy .tail { animation: none; }
.blink { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.wingL, .wingR { transform-box: view-box; animation: flapL 2.6s ease-in-out infinite; }
.wingR { animation-name: flapR; }
@keyframes flapL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(7deg); } }
@keyframes flapR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-7deg); } }
.mood-happy .wingL, .mood-happy .wingR { animation-duration: .9s; }
.mood-sad .wingL, .mood-sad .wingR, .mood-sleepy .wingL, .mood-sleepy .wingR { animation: none; }
.tongue { animation: flick 2.4s infinite; }
@keyframes flick { 0%, 60%, 100% { opacity: 0; } 65%, 85% { opacity: 1; } }
.zz text { transform-box: fill-box; animation: rise 3s ease-out infinite; opacity: 0; }
.zz text:nth-child(2) { animation-delay: 1s; } .zz text:nth-child(3) { animation-delay: 2s; }
.puff > * { transform-box: fill-box; animation: rise 2.2s ease-out infinite; opacity: 0; }
.puff > :nth-child(2) { animation-delay: .7s; } .puff > :nth-child(3) { animation-delay: 1.4s; }
@keyframes rise { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -22px) scale(1.2); } }
.bubble { transform-box: fill-box; transform-origin: 0 100%; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } .zz text, .puff > *, .tongue { opacity: 1; } }

/* ---- Landing ---- */
.hero { display: grid; gap: 20px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 10px; max-width: 60ch; }
.hero h1 { font-size: clamp(34px, 8vw, 58px); }
.hero-pets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.landing-grid { display: grid; gap: 16px; }
.ticks { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 820px) { .hero { grid-template-columns: 1.1fr 1fr; } .landing-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Pet cards ---- */
.pet-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.pet-card { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; font-weight: 400; transition: transform .15s, box-shadow .15s; }
a.pet-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px var(--shadow); }
.pet-card-body { display: flex; flex-direction: column; gap: 10px; }
.pet-card-title { display: flex; flex-direction: column; gap: 2px; }
.mood { font-weight: 700; }
.mood-hungry, .mood-sad { color: var(--warn); }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-block: 28px; }
.empty-art { width: 200px; }

/* ---- Stats ---- */
.stats { display: flex; flex-direction: column; gap: 8px; }
.stat { display: grid; grid-template-columns: 7.5em 1fr 2.4em; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.stat-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bar { height: 12px; border-radius: 999px; background: var(--bar); overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 999px; background: var(--good); transition: width .6s ease; }
.fill.mid { background: var(--accent); }
.fill.low { background: var(--bad); }
.stats.compact { gap: 5px; }
.stats.compact .stat { grid-template-columns: 6.5em 1fr 2em; font-size: 12px; }
.stats.compact .bar { height: 8px; }

.owner-card { display: grid; gap: 16px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 700px) { .owner-card { grid-template-columns: 1fr auto auto; } }
.score-ring { --v: 0; width: 110px; height: 110px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--card) 76%, transparent 77%), conic-gradient(var(--leaf) calc(var(--v) * 1%), var(--bar) 0); }
.score-ring strong { font: 800 32px var(--display); line-height: 1; font-variant-numeric: tabular-nums; }
.score-ring span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---- Adopt ---- */
.group-title { margin-top: 8px; font-size: 18px; color: var(--muted); }
.species-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.species-opt { position: relative; cursor: pointer; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 8px; gap: 6px; text-align: center; }
.species-opt input { position: absolute; opacity: 0; pointer-events: none; }
.species-opt:has(input:checked) { border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 25%, transparent); }
.species-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.species-name { font: 800 17px var(--display); }
.adopt-preview { display: grid; gap: 16px; }
.art.big { max-width: 360px; width: 100%; }
@media (min-width: 700px) { .adopt-preview { grid-template-columns: minmax(0, 360px) 1fr; } }
.swatches { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.swatches legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; padding: 0; }
.swatch { cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); }
.swatch input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 3px var(--card) inset; }
.swatch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Pet page ---- */
.pet-page { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .pet-page { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } .pet-main { position: sticky; top: 76px; } }
.pet-main { display: flex; flex-direction: column; gap: 14px; }
.pet-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.pet-head > div { display: flex; flex-direction: column; gap: 4px; }
.stage-wrap { position: relative; }
.mood-line { position: absolute; left: 12px; top: 12px; right: 12px; width: fit-content; max-width: calc(100% - 24px); font-weight: 800; font-size: 14px; background: var(--card); padding: 5px 12px; border-radius: 999px; box-shadow: 0 1px 4px var(--shadow); }
.pet-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.act { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; font: 800 14px var(--body); color: var(--ink); background: var(--chip); border: 1.5px solid transparent; border-radius: 14px; padding: 8px 6px; cursor: pointer; text-align: center; }
.act:hover:not(:disabled) { border-color: var(--leaf); }
.act:disabled { opacity: .55; cursor: not-allowed; }
.act-cd { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.act-cd:empty { display: none; }
.foods { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.food { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 700 12px var(--body); color: var(--ink); background: transparent; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 4px; cursor: pointer; line-height: 1.2; text-align: center; }
.food:hover:not(:disabled) { border-color: var(--leaf); background: var(--chip); }
.food:disabled { opacity: .5; cursor: not-allowed; }
.food-icon { font-size: 26px; line-height: 1.1; }
.toast { position: sticky; bottom: 80px; z-index: 5; padding: 12px 16px; border-radius: 14px; font-weight: 800; box-shadow: 0 6px 18px var(--shadow); background: var(--card); border: 2px solid var(--line); }
.toast.ok { border-color: var(--good); color: var(--good); background: var(--good-bg); }
.toast.no, .toast.info { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.toast.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
@media (min-width: 820px) { .toast { bottom: 16px; } }
.diary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.diary li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.diary li:last-child { border-bottom: 0; }
.diary time { color: var(--muted); white-space: nowrap; font-size: 13px; }

/* ---- Profile ---- */
.profile-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .profile-grid { grid-template-columns: 1fr 1fr; } .profile-grid > :last-child { grid-column: 1 / -1; } }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--chip); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tile strong { font: 800 28px var(--display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; font-weight: 700; color: var(--muted); }
.reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reqs li { padding-left: 28px; position: relative; font-weight: 600; }
.reqs li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); }
.reqs li.done::before { background: var(--good); border-color: var(--good); }
.reqs li.done::after { content: ""; position: absolute; left: 6px; top: 6px; width: 5px; height: 9px; border: solid var(--card); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.invite { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 14px; background: var(--chip); }
.invite .grow { display: flex; flex-direction: column; gap: 4px; }
.invite.used, .invite.revoked, .invite.expired { opacity: .65; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { font-size: 13px; padding: 6px 10px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.me td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.table tr.banned td { opacity: .5; }
.table tbody tr:last-child td { border-bottom: 0; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-cell form { margin: 0; }
.thumb { width: 64px; }
.art.mini svg { background: transparent; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--muted); padding: 6px 14px; border-radius: 999px; background: var(--chip); }
.tabs a[aria-current] { background: var(--ink); color: var(--card); }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 2px solid var(--line); }
.tree > li > ul { margin-left: 4px; }
.tree li { padding: 2px 0 2px 8px; font-weight: 700; }
.oldest { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.oldest > div { display: flex; flex-direction: column; gap: 4px; }

/* ---- Share ---- */
.share-page { display: flex; flex-direction: column; gap: 16px; max-width: 900px; width: 100%; margin: 0 auto; }
.share-card { display: grid; gap: 18px; }
@media (min-width: 760px) { .share-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.growth { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.growth-step { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; }
.share-preview { width: 100%; max-width: 420px; border-radius: 16px; border: 1px solid var(--line); background: var(--sky); }
.share-preview.story { max-width: 300px; }

.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.checks .ok { color: var(--good); } .checks .bad { color: var(--bad); }

/* ---- Games ---- */
.play-page { display: flex; flex-direction: column; gap: 16px; max-width: 760px; width: 100%; margin: 0 auto; }
.play-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.play-head h1 { font-size: 28px; flex: 1; }
.energy-pill { font-weight: 800; font-size: 14px; background: var(--chip); padding: 5px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.game-picker { display: flex; flex-direction: column; gap: 12px; }
.game-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .15s, border-color .15s; }
.game-card:hover { transform: translateY(-2px); border-color: var(--leaf); }
.game-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.game-card-title { font: 800 21px var(--display); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.game-thumb { display: block; border-radius: 16px; overflow: hidden; }
.game-thumb svg { display: block; width: 100%; height: auto; background: var(--sky); }
.arena-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.arena { position: relative; width: min(100%, calc((100vh - 230px) * 2 / 3), 480px); aspect-ratio: 2 / 3; border-radius: 22px; overflow: hidden; box-shadow: 0 8px 24px var(--shadow); background: #CFE8F3; touch-action: none; user-select: none; -webkit-user-select: none; }
.arena canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.arena-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(20, 30, 25, .35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.ov-card { background: var(--card); color: var(--ink); border-radius: 20px; padding: 20px; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 12px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ov-actions { display: flex; flex-direction: column; gap: 8px; }
.ov-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ov-lines li { display: flex; justify-content: space-between; gap: 10px; background: var(--chip); padding: 6px 12px; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-msg { font-weight: 800; }
.deltas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.delta { font-weight: 800; font-size: 14px; padding: 4px 10px; border-radius: 999px; }
.delta.up { background: var(--good-bg); color: var(--good); }
.delta.down { background: var(--bad-bg); color: var(--bad); }
.delta.pts { background: var(--accent); color: var(--accent-ink); }
.pad { display: flex; gap: 12px; justify-content: center; width: min(100%, 480px); }
.pad:empty { display: none; }
.pad-btn { flex: 1; min-height: 64px; font: 800 18px var(--body); color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 18px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pad-btn.on, .pad-btn:active { background: var(--leaf); color: var(--leaf-ink); border-color: var(--leaf); }
.pad.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 56px); gap: 8px; width: auto; }
.pad.dpad .pad-btn { min-height: 0; font-size: 22px; }
.pad.dpad .pad-up { grid-column: 2; grid-row: 1; }
.pad.dpad .pad-left { grid-column: 1; grid-row: 2; }
.pad.dpad .pad-down { grid-column: 2; grid-row: 2; }
.pad.dpad .pad-right { grid-column: 3; grid-row: 2; }
.center { text-align: center; }
.games-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 30%, var(--card)), var(--card)); }
.games-cta p { margin: 0; }
@media (hover: hover) and (pointer: fine) { .pad { display: none; } }
.badge.plain { background: var(--chip); color: var(--muted); }
.game-card.free .game-thumb { opacity: .9; }

/* ---- Friends & petsitting (0.3.0) ---- */
.dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font: 800 11px var(--body); vertical-align: 2px; }
.bottomnav a { position: relative; }
.bottomnav .dot { position: absolute; top: 4px; left: calc(50% + 6px); }
.bottomnav { grid-template-columns: repeat(5, 1fr); }
.bottomnav a { font-size: 11px; }
.badge.sitter { background: #CDE7F7; color: #1F5577; }
@media (prefers-color-scheme: dark) { .badge.sitter { background: #1F3A4D; color: #BFE0F5; } }
.link-flash { text-decoration: none; display: block; }
.sit-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sit-banner.away { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.sit-banner.sitter { border: 2px solid #7DB8DE; background: color-mix(in srgb, #7DB8DE 14%, var(--card)); }
.sit-banner form { margin: 0; }
.sit-request { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; }
@media (max-width: 520px) { .sit-request { grid-template-columns: 1fr; } .sit-request .art { max-width: 200px; } }
.owner-note { margin: 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--chip); border-radius: 0 12px 12px 0; font-style: italic; display: flex; flex-direction: column; gap: 2px; }
.owner-note .muted { font-style: normal; }
.friends-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 860px) { .friends-grid { grid-template-columns: 360px 1fr; } }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.people li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--chip); padding: 8px 10px; border-radius: 12px; }
.people li > :first-child { flex: 1; }
.people form { margin: 0; }
.friend { display: flex; flex-direction: column; gap: 12px; }
.friend-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.friend-name { font: 800 20px var(--display); }
.friend-menu { position: relative; }
.friend-menu summary { list-style: none; cursor: pointer; font-weight: 800; font-size: 20px; padding: 0 8px; border-radius: 8px; }
.friend-menu summary::-webkit-details-marker { display: none; }
.friend-menu[open] form { position: absolute; right: 0; top: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; z-index: 5; box-shadow: 0 6px 18px var(--shadow); }
.friend-pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.friend-pet { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); text-align: center; font-weight: 800; }
.friend-pet .badge { align-self: center; }
.guide { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: 22px; padding: 20px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.guide[open] { display: flex; flex-direction: column; gap: 16px; }
.guide::backdrop { background: rgba(20, 30, 25, .55); }
.guide-head { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.guide-grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
.guide h3 { margin-bottom: 6px; }
.food-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.food-list li { padding: 6px 10px; border-radius: 10px; font-weight: 700; }
.food-list.ok li { background: var(--good-bg); color: var(--good); }
.food-list.bad li { background: var(--bad-bg); color: var(--bad); }
.trait-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trait-list li { background: var(--chip); padding: 8px 12px; border-radius: 12px; }
.guide-actions { display: flex; justify-content: flex-end; margin: 0; }
.pet-card.sat { border: 2px solid #7DB8DE; }

/* ---- Friend suggestions (0.3.1) ---- */
.combo { position: relative; min-width: 0; }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 10px 24px var(--shadow); max-height: 280px; overflow-y: auto; }
.suggest li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.suggest li[aria-selected="true"], .suggest li[role=option]:hover { background: var(--chip); }
.suggest mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sug-state { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.suggest .suggest-empty { color: var(--muted); font-weight: 600; cursor: default; }
.lb-name { font-weight: 800; color: var(--leaf); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.friend-tiles { max-width: 520px; }
.suggest li { flex-wrap: wrap; }
@media (max-width: 560px) { #friend-form .combo { flex-basis: 100%; } #friend-form > .btn { width: 100%; } }

/* ---- Notifications (0.4.0) ---- */
.notify-card { grid-column: 1 / -1; }
.notify-table td, .notify-table th { vertical-align: middle; }
.notify-table input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--leaf); }
.table .center, .center { text-align: center; }
.push-box { border-top: 1px solid var(--line); padding-top: 14px; }
.queue-tiles { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .queue-tiles { grid-template-columns: repeat(2, 1fr); } }
.mail-error { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--bad-bg); color: var(--bad); padding: 8px 12px; border-radius: 10px; word-break: break-word; }

/* ---- 0.5.0: shop, guide, touch, album, sound ---- */
.sound-toggle { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; width: 34px; height: 30px; font-size: 15px; cursor: pointer; display: grid; place-items: center; padding: 0; }
a.pts { text-decoration: none; }
a.pts:hover { filter: brightness(1.05); }
.wallet { font: 800 26px var(--display); background: var(--accent); color: var(--accent-ink); padding: 4px 16px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.shop { display: grid; gap: 16px; align-items: start; }
@media (min-width: 860px) { .shop { grid-template-columns: 340px 1fr; } .fitting { position: sticky; top: 76px; } }
.fitting { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.fitting-art { max-width: 300px; width: 100%; align-self: center; }
.fitting-name { text-align: center; }
.center-row { justify-content: center; }
.pet-tabs { justify-content: center; }
.tabs button { font: 700 14px var(--body); border: 0; cursor: pointer; color: var(--muted); padding: 6px 14px; border-radius: 999px; background: var(--chip); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--card); }
.item-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.item { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.item.on { border-color: var(--leaf); box-shadow: 0 0 0 2px color-mix(in srgb, var(--leaf) 30%, transparent); }
.item.trying { border-color: var(--accent); }
.item-thumb { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; }
.item-thumb svg { border-radius: 14px; }
.item-body { display: flex; flex-direction: column; gap: 2px; min-height: 2.6em; }
.item .btn { width: 100%; }
.pet-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.touch-hint { text-align: center; margin-top: -4px; }
.touch-hint.pulse-text { animation: hintpulse 1.2s ease 2; }
@keyframes hintpulse { 50% { color: var(--leaf); } }
.stage-wrap { position: relative; }
#pet-art { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
#pet-art:active { cursor: grabbing; }
.float-fx { position: absolute; z-index: 4; pointer-events: none; font-size: 26px; transform: translate(-50%, -50%); animation: floatup 1.2s ease-out forwards; }
.float-fx.heart { font-size: 20px; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1.15); } }
.food-ghost { position: fixed; z-index: 100; pointer-events: none; font-size: 40px; transform: translate(-50%, -50%) scale(1.15); filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.food-ghost.flying { transition: left .45s cubic-bezier(.3,.7,.4,1), top .45s cubic-bezier(.5,-0.4,.7,1), transform .45s, opacity .45s; }
.food.lifted { opacity: .4; }
.stage-wrap.drop-ok .art svg { outline: 4px dashed var(--leaf); outline-offset: -4px; }
.pulse { animation: pulsering 1.2s ease 2; border-radius: 16px; }
@keyframes pulsering { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); } }
.guide-card { display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.guide-card.finished { border-color: var(--good); }
.guide-card form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: gs; }
.guide-steps li { counter-increment: gs; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 42px; border-radius: 12px; position: relative; background: var(--card); }
.guide-steps li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.guide-steps li::before { content: counter(gs); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 13px var(--body); background: var(--chip); color: var(--muted); }
.guide-steps li.done { opacity: .7; }
.guide-steps li.done strong { text-decoration: line-through; }
.guide-steps li.done::before { content: "✓"; background: var(--good); color: #fff; }
.guide-steps li.next { box-shadow: 0 0 0 2px var(--accent) inset; }
.guide-steps li.next::before { background: var(--accent); color: var(--accent-ink); }
.guide-banner { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; border: 2px solid var(--accent); font-weight: 400; }
.progress { display: block; height: 10px; border-radius: 999px; background: var(--bar); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.photo-dialog .photo-preview { max-width: 260px; width: 100%; align-self: center; }
.album { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.memory { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.memory.photo { transform: rotate(-.6deg); }
.memory:nth-child(even).photo { transform: rotate(.6deg); }
.memory-body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.memory-title { font: 800 18px var(--display); line-height: 1.2; }
.memory-actions { margin-top: 4px; }
.memory-actions form { margin: 0; }
.wallet { white-space: nowrap; }
@media (max-width: 859px) { .fitting-art { max-width: 210px; } .fitting { padding: 12px; } }
.games-cta, .games-cta * { text-decoration: none; color: inherit; }
.art.shake svg { animation: shake .35s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-1deg); } 75% { transform: translateX(6px) rotate(1deg); } }
