/* Tiaotiaodao pet games — shared game CSS.
   Bright, restrained, mobile-first. No Google fonts, no external assets.
   Original design for this project; not copied from any petting simulator. */
:root {
  --bg: #fff8ef;
  --surface: #ffffff;
  --ink: #26221d;
  --muted: #6f6a61;
  --line: #eadfce;
  --accent: #ff8a3d;
  --accent-soft: #ffe7d2;
  --green: #3d9e6a;
  --pink: #ff7fa5;
  --blue: #5b8def;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(90, 60, 20, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1a16;
    --surface: #2a251f;
    --ink: #f3ede3;
    --muted: #b3a99a;
    --line: #453d33;
    --accent-soft: #4a2f1d;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
a { color: var(--accent); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.nav { margin-left: auto; display: flex; gap: 14px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
h1 { font-size: 26px; line-height: 1.25; margin: 22px 0 6px; }
h2 { font-size: 20px; margin: 28px 0 8px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
p { margin: 8px 0; }
.lede { color: var(--muted); font-size: 15px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 14px 0; }
.btn { display: inline-block; border: 0; cursor: pointer; border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 700; background: var(--accent); color: #fff; text-decoration: none; }
.btn.ghost { background: var(--accent-soft); color: var(--ink); }
.btn.small { padding: 7px 13px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 13px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* --- game stage --- */
.stage { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(180deg, #bfe6ff 0%, #e9f7ff 55%, #ffe9c9 100%); touch-action: none; user-select: none; -webkit-user-select: none; }
.stage.night { background: linear-gradient(180deg, #1c2440 0%, #2c3a63 55%, #4a3358 100%); }
.stage-inner { position: relative; aspect-ratio: 4 / 3.4; }
.stage svg.pet { position: absolute; inset: 0; width: 100%; height: 100%; }
.hand { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .15s; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.hand.on { opacity: 1; }
.heart { position: absolute; font-size: 22px; pointer-events: none; z-index: 6; animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { from { transform: translateY(0) scale(.8); opacity: 1; } to { transform: translateY(-70px) scale(1.25); opacity: 0; } }
.meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), var(--accent)); transition: width .3s; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.food-btn { font-size: 26px; line-height: 1; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.food-btn:active { transform: scale(.92); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.game-tile .emoji { font-size: 40px; line-height: 1; }
.game-tile h3 { margin: 8px 0 4px; }
.game-tile p { margin: 0; color: var(--muted); font-size: 13px; }
.ad-unit { border: 1px dashed var(--line); border-radius: 14px; padding: 12px; margin: 16px 0; text-align: center; color: var(--muted); font-size: 13px; }
.ad-label { font-size: 10px; letter-spacing: .14em; color: var(--muted); }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 15px; margin: 4px 0 12px; font-family: inherit; }
label { font-size: 13px; font-weight: 700; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop img { max-width: 100%; border-radius: 14px; display: block; margin: 0 auto; }
.pet-card { text-align: center; }
.pet-card img { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; border: 5px solid var(--accent-soft); }
footer { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); }
@media (max-width: 420px) { h1 { font-size: 23px; } .game-grid { grid-template-columns: 1fr 1fr; } }
