/* NutriGame — giao diện game (kính mờ tối, mobile-first). Mọi class có tiền tố g- hoặc pet-. */
.g-root {
  --g-bg: #0b1220; --g-bg2: #111b31; --g-card: rgba(255,255,255,.07); --g-card2: rgba(255,255,255,.12);
  --g-line: rgba(255,255,255,.14); --g-text: #eef3ff; --g-dim: #9fb0d0; --g-accent: #34e0a1; --g-accent2: #5aa9ff;
  --g-good: #34e0a1; --g-bad: #ff6b81; --g-warn: #ffc857; --g-gold: #f2b632;
  position: relative; color: var(--g-text); font-family: 'Plus Jakarta Sans', 'Noto Sans Myanmar', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2f5a 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #20466a55 0%, transparent 55%), linear-gradient(180deg, var(--g-bg2), var(--g-bg));
  border-radius: 28px; padding: 14px; overflow: hidden; isolation: isolate; min-height: 560px;
}
.g-root *, .g-root *::before, .g-root *::after { box-sizing: border-box; }
:where(.g-root) button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.g-root button:focus-visible, .g-root [tabindex]:focus-visible { outline: 3px solid var(--g-accent2); outline-offset: 2px; border-radius: 12px; }
.g-root button { min-height: 44px; touch-action: manipulation; }
.g-root button[disabled] { cursor: not-allowed; }
.g-btn[href]{text-decoration:none;min-height:48px;box-sizing:border-box}
.g-primary-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-bottom:12px}
.g-primary-actions>*{min-width:0;white-space:normal;line-height:1.5;text-align:center;padding:10px;font-size:14px}
.g-flow{font-size:13px;line-height:1.6;margin:8px 0;color:var(--g-dim)}
.g-options{margin-bottom:12px;border:1px solid var(--g-line);border-radius:14px;padding:8px 12px}
.g-options summary{min-height:36px;cursor:pointer;font-size:14px;font-weight:700}
.g-options[open] summary{margin-bottom:12px}
@media(max-width:639px){
  .g-root{padding:10px;border-radius:18px}
  .g-tabs{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:4px;overflow:visible!important}
  .g-tabs button{min-width:0;padding:8px 2px!important;font-size:12px!important;white-space:normal!important;line-height:1.5;overflow-wrap:anywhere;flex-direction:column;gap:2px}
  .g-stage{min-height:250px!important}.g-petwrap{max-width:260px}
  .g-mode{font-size:13px}.g-card{padding:12px!important}
}
.g-mode { display: grid; gap: 8px; margin-bottom: 12px; color: var(--g-dim); font-size: 13px; line-height: 1.6; }
.g-profile { display: grid; gap: 4px; color: var(--g-text); font-weight: 700; }
.g-form-error { color: #ff9aa8; font-size: 14px; }
.g-search[aria-invalid="true"] { border-color: var(--g-bad); }
.g-water { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.g-run { position: relative; width: min(100%, 960px); margin: 0 auto; line-height: 1.6; user-select: none; -webkit-user-select: none; }
.g-run [hidden] { display: none !important; }
.g-run-intro { padding: 16px; margin-bottom: 12px; text-align: center; border-radius: 20px; background: var(--g-card); }
.g-run-intro h2 { margin-top: 0; font-size: 22px; }
.g-run-intro p { font-size: 16px; }
.g-run-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; margin-bottom: 10px; font-size: 16px; font-weight: 800; }
.g-run-controls { display: flex; gap: 12px; margin-top: 16px; }
.g-run-controls button { flex: 1; min-height: 48px; font-size: 16px; }
.g-run-caption { font-size: 14px; overflow-wrap: anywhere; min-height: 24px; }

/* ---------- Thanh trạng thái trên ---------- */
.g-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.g-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--g-card); border: 1px solid var(--g-line); font-weight: 700; font-size: 13px; backdrop-filter: blur(10px); white-space: nowrap; }
.g-chip b { font-variant-numeric: tabular-nums; }
.g-lvl { flex: 1 1 160px; min-width: 150px; display: flex; flex-direction: column; gap: 4px; }
.g-lvl-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--g-dim); }
.g-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.g-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--g-accent), var(--g-accent2)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.g-lang { margin-left: auto; display: flex; gap: 4px; }
.g-lang button { padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 800; background: var(--g-card); border: 1px solid var(--g-line); color: var(--g-dim); }
.g-lang button[aria-pressed="true"] { background: var(--g-accent); color: #04281c; border-color: transparent; }

/* ---------- Bố cục ---------- */
.g-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.g-layout > * { min-width: 0; }
@media (min-width: 880px) { .g-layout { grid-template-columns: minmax(340px, 5fr) minmax(0, 6fr); } }
.g-card { background: var(--g-card); border: 1px solid var(--g-line); border-radius: 24px; padding: 14px; backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.g-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.g-dim { color: var(--g-dim); font-size: 12.5px; }

/* ---------- Sân khấu linh vật ---------- */
.g-stage { position: relative; border-radius: 22px; overflow: hidden; min-height: 330px; display: flex; flex-direction: column; align-items: center; padding: 10px 10px 0; --sky1: #7cc7ff; --sky2: #d8f1ff; --hill1: #5fcf8a; --hill2: #3aa86a; --pag: #e8b94a; transition: background .6s; background: linear-gradient(180deg, var(--sky1), var(--sky2)); }
.g-stage[data-bg="bg_meadow"] { --sky1: #6ec0ff; --sky2: #e4f6ff; }
.g-stage[data-bg="bg_temple"] { --sky1: #ffb36b; --sky2: #ffe9c7; --hill1: #7bb661; --hill2: #4f9150; --pag: #f2b632; }
.g-stage[data-bg="bg_night"] { --sky1: #0f1b4d; --sky2: #3b3f8f; --hill1: #2f5d63; --hill2: #1f4147; --pag: #f2d58a; }
.g-stage[data-bg="bg_beach"] { --sky1: #4fd1e8; --sky2: #fff4d6; --hill1: #f3d89a; --hill2: #e6c27a; --pag: #e8b94a; }
.g-scene { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.g-scene .hill1 { fill: var(--hill1); } .g-scene .hill2 { fill: var(--hill2); } .g-scene .pag { fill: var(--pag); }
.g-scene .cloud { fill: #fff; opacity: .85; animation: g-drift 38s linear infinite; }
.g-scene .cloud.c2 { animation-duration: 55s; animation-delay: -20s; opacity: .6; }
.g-scene .sun { fill: #fff6c2; opacity: .9; }
.g-stage[data-bg="bg_night"] .sun { fill: #fff; } .g-stage[data-bg="bg_night"] .cloud { opacity: .2; }
@keyframes g-drift { from { transform: translateX(-60px); } to { transform: translateX(380px); } }
.g-petwrap { position: relative; width: min(100%, 360px); z-index: 2; order: 3; margin-top: auto; }
.g-speech { position: relative; z-index: 3; width: 100%; order: 1; padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: rgba(255,255,255,.95); color: #1b2740; font-weight: 700; font-size: 14px; line-height: 1.6; box-shadow: 0 6px 18px rgba(0,0,0,.18); animation: g-pop .5s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes g-pop { from { transform: scale(.6) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.g-stage-badges { position: relative; z-index: 3; order: 2; display: flex; flex-wrap: wrap; gap: 6px; align-self: stretch; justify-content: flex-end; margin-top: 8px; }
.g-pill { padding: 5px 10px; border-radius: 99px; background: rgba(8,16,36,.7); color: #fff; font-size: 12px; font-weight: 800; backdrop-filter: blur(8px); display: inline-flex; gap: 6px; align-items: center; }
.g-meter { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.g-meter .g-bar { flex: 1; height: 10px; }
.g-meter label { font-size: 12px; font-weight: 800; color: var(--g-dim); min-width: 74px; }
.g-meter b { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.g-bar.body { background: linear-gradient(90deg, #ff8a6b, #34e0a1 38%, #34e0a1 62%, #ffc857); position: relative; overflow: visible; }
.g-bar.body i { position: absolute; top: -4px; bottom: -4px; width: 6px; border-radius: 6px; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.35); transition: left .9s cubic-bezier(.2,.8,.2,1); background-image: none; }
.g-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.g-hint { padding: 5px 10px; border-radius: 10px; background: rgba(255,200,87,.14); border: 1px solid rgba(255,200,87,.35); color: #ffe3a1; font-size: 12px; font-weight: 700; }

/* ---------- Nút ---------- */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 16px; font-weight: 800; font-size: 14px; background: linear-gradient(180deg, #43efb1, #20c88a); color: #04281c; box-shadow: 0 6px 0 #129067, 0 12px 22px rgba(0,0,0,.28); transition: transform .12s, box-shadow .12s, filter .2s; }
.g-btn:hover { filter: brightness(1.06); } .g-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #129067, 0 6px 14px rgba(0,0,0,.28); }
.g-btn.alt { background: linear-gradient(180deg, #6db8ff, #3d8be0); color: #04163a; box-shadow: 0 6px 0 #2563b0, 0 12px 22px rgba(0,0,0,.28); }
.g-btn.ghost { background: var(--g-card2); color: var(--g-text); box-shadow: none; border: 1px solid var(--g-line); }
.g-btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.g-btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 12px; box-shadow: none; }

/* ---------- Tab dưới ---------- */
.g-tabs { display: flex; gap: 6px; padding: 6px; border-radius: 20px; background: rgba(0,0,0,.28); border: 1px solid var(--g-line); margin-bottom: 12px; overflow-x: auto; scrollbar-width: thin; }
.g-tabs button { flex: 1 0 auto; padding: 10px 14px; border-radius: 14px; font-weight: 800; font-size: 13px; color: var(--g-dim); display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; transition: background .2s, color .2s; }
.g-tabs button[aria-selected="true"] { background: linear-gradient(180deg, var(--g-accent), #1fbf86); color: #04281c; }

/* ---------- Ghi bữa ăn ---------- */
.g-meals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.g-meals button { padding: 9px 4px; border-radius: 14px; background: var(--g-card); border: 1px solid var(--g-line); font-weight: 800; font-size: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.g-meals button[aria-pressed="true"] { background: var(--g-card2); border-color: var(--g-accent); box-shadow: 0 0 0 2px rgba(52,224,161,.25) inset; }
.g-meals small { color: var(--g-dim); font-weight: 700; }
.g-search { width: 100%; min-width: 0; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid var(--g-line); color: var(--g-text); font: inherit; font-size: 16px; }
.g-search option { background: #111b31; color: #eef3ff; }
.g-search::placeholder { color: var(--g-dim); }
.g-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.g-chips button { flex: 0 0 auto; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: var(--g-card); border: 1px solid var(--g-line); color: var(--g-dim); }
.g-chips button[aria-pressed="true"] { background: var(--g-accent2); color: #04163a; border-color: transparent; }
.g-foodlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.g-food { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px; border-radius: 16px; background: var(--g-card); border: 1px solid var(--g-line); transition: transform .15s, border-color .15s, background .15s; }
.g-food:hover { transform: translateY(-2px); border-color: var(--g-accent); background: var(--g-card2); }
.g-food .em { font-size: 28px; line-height: 1; } .g-food .nm { font-weight: 800; font-size: 13px; line-height: 1.25; } .g-food .mt { color: var(--g-dim); font-size: 11.5px; }
.g-tag { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.g-tag.good { background: var(--g-good); } .g-tag.ok { background: var(--g-warn); } .g-tag.limit { background: var(--g-bad); }
.g-today { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 200px; overflow-y: auto; }
.g-entry { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(0,0,0,.22); font-size: 13px; }
.g-entry .em { font-size: 20px; } .g-entry .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; } .g-entry .k { color: var(--g-dim); font-variant-numeric: tabular-nums; }
.g-entry button { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 9px; background: var(--g-card2); font-weight: 800; }
.g-empty { padding: 18px; text-align: center; color: var(--g-dim); font-size: 13px; }
.g-note { padding: 10px 12px; border-radius: 14px; background: rgba(90,169,255,.12); border: 1px solid rgba(90,169,255,.3); color: #cfe3ff; font-size: 12.5px; line-height: 1.4; margin-top: 10px; }

/* ---------- Thư viện game ---------- */
.g-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.g-gamecard { position: relative; text-align: left; padding: 16px; border-radius: 22px; min-height: 150px; color: #fff; overflow: hidden; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--g-line); transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s; background: linear-gradient(145deg, var(--c1, #2b4a8c), var(--c2, #1a2a52)); box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.g-gamecard:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 16px 34px rgba(0,0,0,.4); }
.g-gamecard .ic { font-size: 40px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); } .g-gamecard .tt { font-weight: 800; font-size: 16px; } .g-gamecard .ds { font-size: 12.5px; opacity: .85; line-height: 1.35; }
.g-gamecard .bs { margin-top: auto; font-size: 12px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.g-gamecard::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.g-gamecard[data-locked="1"] { filter: grayscale(.6) brightness(.75); }
.g-tickets { display: inline-flex; gap: 4px; }
.g-ticket { width: 16px; height: 22px; border-radius: 5px; background: var(--g-gold); box-shadow: 0 2px 0 #b8860b; } .g-ticket.used { background: rgba(255,255,255,.18); box-shadow: none; }

/* ---------- Màn chơi (overlay) ---------- */
.g-play { position: fixed; inset: 0; height: 100vh; height: 100dvh; z-index: 100; background: linear-gradient(180deg, #0c1530, #0a1124); display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
@keyframes g-fade { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.g-playbar { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--g-line); }
.g-playbar .t { font-size: 14px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; font-weight: 800; flex: 1; display: flex; gap: 8px; align-items: center; }
.g-playbar button { min-width: 44px; flex-shrink: 0; }
.g-playbody { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
.g-playbody > * { max-width: 100%; }
.g-result, .g-pause { position: absolute; inset: 0; z-index: 5; display: flex; align-items: safe center; justify-content: center; overflow-y: auto; padding: 16px; background: rgba(5,10,24,.94); backdrop-filter: blur(8px); }
.g-pause { inset: 64px 0 0; }
.g-resultcard { flex-shrink: 0; }
.g-resultcard { width: min(92%, 380px); padding: 22px; border-radius: 28px; background: linear-gradient(180deg, #1b2c57, #121d3a); border: 1px solid var(--g-line); text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.g-stars { display: flex; justify-content: center; gap: 8px; font-size: 44px; margin: 6px 0 4px; }
.g-stars span { filter: grayscale(1) brightness(.5); transform: scale(.6); opacity: .6; }
.g-stars span.on { filter: none; animation: g-star .6s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay: var(--d, 0s); opacity: 1; }
@keyframes g-star { 0% { transform: scale(.2) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
.g-big { font-size: 40px; font-weight: 900; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.g-rewards { display: flex; justify-content: center; gap: 10px; margin: 10px 0 16px; flex-wrap: wrap; }
.g-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Nhiệm vụ / huy hiệu / cửa hàng ---------- */
.g-list { display: flex; flex-direction: column; gap: 8px; }
.g-mission { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px; border-radius: 16px; background: var(--g-card); border: 1px solid var(--g-line); align-items: center; }
.g-mission .nm { font-weight: 800; font-size: 13.5px; } .g-mission .g-bar { grid-column: 1 / -1; }
.g-mission.done { border-color: rgba(52,224,161,.5); background: rgba(52,224,161,.08); }
.g-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.g-badge { padding: 14px 10px; border-radius: 18px; text-align: center; background: var(--g-card); border: 1px solid var(--g-line); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.g-badge .ic { font-size: 34px; } .g-badge .nm { font-weight: 800; font-size: 12.5px; } .g-badge .ds { color: var(--g-dim); font-size: 11px; line-height: 1.3; }
.g-badge.lock { filter: grayscale(1); opacity: .5; }
.g-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.g-item { padding: 12px; border-radius: 18px; text-align: center; background: var(--g-card); border: 1px solid var(--g-line); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.g-item .ic { font-size: 34px; } .g-item.eq { border-color: var(--g-accent); box-shadow: 0 0 0 2px rgba(52,224,161,.25) inset; }

/* ---------- Toast + confetti ---------- */
.g-toasts { position: fixed; z-index: 120; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92%, 380px); }
.g-toast { padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.96); color: #14203b; font-weight: 800; font-size: 13.5px; box-shadow: 0 10px 28px rgba(0,0,0,.35); animation: g-toast 3.2s both; display: flex; gap: 8px; align-items: center; }
@keyframes g-toast { 0% { transform: translateY(-20px) scale(.8); opacity: 0; } 8% { transform: none; opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
.g-confetti { position: absolute; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.g-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: g-fall var(--t, 2.4s) cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes g-fall { to { transform: translate(var(--x, 0), 110vh) rotate(var(--r, 540deg)); opacity: .9; } }

/* =================== LINH VẬT =================== */
.pet { --bw: 1; --bh: 1; --belly: .12; --ribs: 0; --chin: 0; --droop: 0; --hollow: 0; --sweat: 0; --sat: 1; --glowo: 0; width: 100%; filter: saturate(var(--sat)) drop-shadow(0 10px 14px rgba(0,0,0,.25)); }
.pet-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pet-all { transform-origin: 160px 238px; animation: pet-breathe 3.6s ease-in-out infinite; }
.pet-body { transform-origin: 160px 238px; scale: var(--bw) var(--bh); transition: scale 1.5s cubic-bezier(.34,1.45,.5,1); }
.pet-head { translate: calc((var(--bw) - 1) * 92px) calc((var(--bh) - 1) * -92px); transition: translate 1.5s cubic-bezier(.34,1.45,.5,1); }
.pet-belly { opacity: var(--belly); transition: opacity 1s; } .pet-ribs { opacity: var(--ribs); transition: opacity 1s; }
.pet-chin { opacity: var(--chin); transition: opacity 1s; } .pet-hollow { opacity: calc(var(--hollow) * .45); transition: opacity 1s; }
.pet-cheek { opacity: calc(.55 - var(--hollow) * .45); }
.pet-sweat { opacity: var(--sweat); } .pet-sweat path { animation: pet-drip 1.8s ease-in infinite; transform-box: fill-box; transform-origin: center top; }
.pet-ear { transform-origin: 214px 92px; rotate: calc(var(--droop) * 26deg); animation: pet-ear 3.1s ease-in-out infinite; transition: rotate 1s; }
.pet-trunk { transform-origin: 252px 142px; animation: pet-trunk 4.2s ease-in-out infinite; }
.pet-tail { transform-origin: 70px 136px; animation: pet-tail 2.4s ease-in-out infinite; }
.pet-glow { opacity: var(--glowo); transition: opacity 1s; transform-origin: 160px 130px; animation: pet-glow 3.4s ease-in-out infinite; }
.pet .eyes, .pet .mouth, .pet .brows path { opacity: 0; transition: opacity .35s; }
.pet .eyes-open { transform-origin: 248px 112px; animation: pet-blink 5.2s infinite; }
.pet[data-mood="happy"] .eyes-open, .pet[data-mood="meh"] .eyes-open { opacity: 1; }
.pet[data-mood="glow"] .eyes-happy, .pet[data-mood="celebrate"] .eyes-happy { opacity: 1; }
.pet[data-mood="tired"] .eyes-tired { opacity: 1; } .pet[data-mood="sleepy"] .eyes-sleep { opacity: 1; } .pet[data-mood="hungry"] .eyes-hungry { opacity: 1; }
.pet[data-mood="meh"] .brow-meh, .pet[data-mood="tired"] .brow-tired { opacity: 1; }
.pet[data-mood="happy"] .mouth-smile, .pet[data-mood="glow"] .mouth-big, .pet[data-mood="celebrate"] .mouth-big, .pet[data-mood="meh"] .mouth-flat, .pet[data-mood="sleepy"] .mouth-flat, .pet[data-mood="tired"] .mouth-wavy, .pet[data-mood="hungry"] .mouth-o { opacity: 1; }
.pet-sparkles, .pet-zzz, .pet-rumble { opacity: 0; transition: opacity .5s; }
.pet[data-mood="glow"] .pet-sparkles, .pet[data-mood="celebrate"] .pet-sparkles { opacity: 1; } .pet[data-mood="sleepy"] .pet-zzz { opacity: 1; } .pet[data-mood="hungry"] .pet-rumble { opacity: 1; animation: pet-shake .5s linear infinite; }
.pet .sp { transform-box: fill-box; transform-origin: center; animation: pet-twinkle 1.8s ease-in-out infinite; } .pet .sp2 { animation-delay: .4s; } .pet .sp3 { animation-delay: .9s; } .pet .sp4 { animation-delay: 1.3s; }
.pet .z { animation: pet-z 2.4s ease-in-out infinite; } .pet .z2 { animation-delay: .5s; } .pet .z3 { animation-delay: 1s; }
.pet-eating .mouths { transform-origin: 256px 144px; animation: pet-chew .28s ease-in-out 6; } .pet-eating .pet-trunk { animation: pet-trunk-eat .9s ease-in-out 2; }
.pet-celebrate .pet-all { animation: pet-hop .62s cubic-bezier(.3,.7,.4,1) 2; }
@keyframes pet-breathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.012,1.022); } }
@keyframes pet-ear { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-9deg); } }
@keyframes pet-trunk { 0%,100% { transform: rotate(0); } 50% { transform: rotate(5deg); } }
@keyframes pet-trunk-eat { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-18deg) translateY(-14px); } }
@keyframes pet-tail { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
@keyframes pet-blink { 0%,94%,100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes pet-glow { 0%,100% { transform: scale(.94); } 50% { transform: scale(1.06); } }
@keyframes pet-twinkle { 0%,100% { transform: scale(.3) rotate(0); opacity: .2; } 50% { transform: scale(1.1) rotate(25deg); opacity: 1; } }
@keyframes pet-z { 0% { transform: translate(0,6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translate(8px,-14px); opacity: 0; } }
@keyframes pet-chew { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.45); } }
@keyframes pet-hop { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-34px) scale(.97,1.04); } 70% { transform: translateY(0) scale(1.05,.94); } }
@keyframes pet-drip { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
@keyframes pet-shake { 0%,100% { transform: translateX(-1px); } 50% { transform: translateX(1px); } }

@media (prefers-reduced-motion: reduce) {
  .g-root *, .pet *, .pet { animation: none !important; transition: none !important; }
}
@media (max-width: 520px) {
  .g-root { padding: 10px; border-radius: 22px; }
  .g-games { grid-template-columns: minmax(0, 1fr); }
  .g-foodlist, .g-today { max-height: none; }
  .g-meter { flex-wrap: wrap; }
  .g-meter .g-bar { min-width: 60px; }
}
