@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --bg: #0d0f1d;
  --bg-2: #14172a;
  --card: rgba(255, 255, 255, 0.065);
  --card-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7f3ea;
  --muted: #a9a6bd;
  --soft: #d8d3e6;
  --accent: #ffcf6e;
  --accent-2: #ff8a5b;
  --mint: #8de3c0;
  --violet: #b99cff;
  --danger: #ff6b81;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
  --radius: 22px;
  --radius-sm: 14px;
  --nav-h: 76px;
  font-family: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 500px at 10% -10%, rgba(185, 156, 255, .18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 138, 91, .16), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(141, 227, 192, .09), transparent 60%),
    linear-gradient(180deg, #0d0f1d 0%, #101226 45%, #0b0d18 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(rgba(255,255,255,.32) .6px, transparent .6px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, black, transparent 70%);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: none; }
a { color: var(--accent); }
::selection { background: rgba(255, 207, 110, .3); }

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}
.boot-pet { font-size: 74px; animation: float 2.4s ease-in-out infinite; }
.boot-title { font-weight: 900; font-size: 28px; letter-spacing: .3px; }
.boot-sub { color: var(--muted); font-weight: 700; }

.app-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(var(--nav-h) + 28px);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; font-size: 23px;
  background: linear-gradient(145deg, rgba(255,207,110,.25), rgba(255,138,91,.12));
  border: 1px solid rgba(255,207,110,.3);
  box-shadow: 0 8px 24px rgba(255,138,91,.12);
}
.brand-text { min-width: 0; }
.brand-title { font-size: 16px; font-weight: 900; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.coin-pill, .room-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 11px; border-radius: 999px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  font-weight: 900; font-size: 12px; white-space: nowrap;
}
.coin-pill span { color: var(--accent); }
.avatar-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, #2b2550, #1a1830);
  border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 20px;
}

.screen { animation: screenIn .35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes pop { 0% { transform: scale(.92); opacity: .2; } 60% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }

.card {
  background: linear-gradient(160deg, rgba(255,255,255,.085), rgba(255,255,255,.045));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-title { font-size: 13px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
.big { font-size: 24px; font-weight: 900; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hidden { display: none !important; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(600px 220px at 50% -30%, rgba(255,207,110,.22), transparent 65%),
    linear-gradient(165deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
}
.hero::after {
  content: "";
  position: absolute; inset: auto -20% -60% -20%; height: 240px;
  background: radial-gradient(closest-side, rgba(185,156,255,.24), transparent);
  pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.hero-room { font-size: 12px; font-weight: 900; color: var(--accent); letter-spacing: .3px; }
.hero-name { font-size: 27px; font-weight: 900; line-height: 1.05; margin-top: 2px; }
.hero-stage { font-size: 11px; color: var(--muted); font-weight: 800; margin-top: 5px; }
.level-badge {
  padding: 9px 12px; border-radius: 16px; text-align: center;
  background: rgba(255,207,110,.12); border: 1px solid rgba(255,207,110,.28);
  min-width: 72px;
}
.level-badge b { display: block; font-size: 20px; line-height: 1; color: var(--accent); }
.level-badge span { font-size: 9px; text-transform: uppercase; font-weight: 900; color: var(--muted); letter-spacing: .6px; }

.pet-stage {
  position: relative;
  display: grid; place-items: center;
  height: 176px; margin: 4px 0 2px;
  z-index: 1;
}
.pet-emoji {
  font-size: 108px; line-height: 1;
  filter: drop-shadow(0 20px 28px rgba(0,0,0,.35));
  animation: float 3.2s ease-in-out infinite;
  user-select: none;
}
.pet-shadow {
  position: absolute; bottom: 24px; width: 120px; height: 22px;
  border-radius: 50%; background: rgba(0,0,0,.32); filter: blur(8px);
  animation: shadowPulse 3.2s ease-in-out infinite;
}
@keyframes shadowPulse { 0%,100% { transform: scale(1); opacity: .55; } 50% { transform: scale(.86); opacity: .35; } }
.pet-stage[data-stage="2"] .pet-emoji::after,
.pet-stage[data-stage="3"] .pet-emoji::after,
.pet-stage[data-stage="4"] .pet-emoji::after {
  content: "✨";
  position: absolute; font-size: 28px; margin: -62px 0 0 80px;
  animation: pulse 1.8s ease-in-out infinite;
}
.pet-stage[data-stage="3"] .pet-emoji::before,
.pet-stage[data-stage="4"] .pet-emoji::before {
  content: "👑";
  position: absolute; font-size: 26px; margin: -96px 0 0 0;
  transform: rotate(-12deg);
}
.pet-stage[data-stage="4"] { height: 190px; }
.pet-stage[data-stage="4"] .pet-emoji { font-size: 122px; }

.xp-line { position: relative; z-index: 1; margin-top: 4px; }
.xp-meta { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; color: var(--muted); margin-bottom: 5px; }
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
.bar.mint > i { background: linear-gradient(90deg, #7fd8b6, #8de3c0); }
.bar.violet > i { background: linear-gradient(90deg, #9a7dff, #d3c2ff); }
.bar.rose > i { background: linear-gradient(90deg, #ff8a9a, #ff6b81); }

.care-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; position: relative; z-index: 1; }
.care-item { background: rgba(0,0,0,.16); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 9px; }
.care-item .lab { display: flex; justify-content: space-between; font-size: 10px; font-weight: 900; color: var(--muted); margin-bottom: 6px; }
.care-item .lab b { color: var(--text); }
.care-item .bar { height: 6px; }

.stat-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat-chip {
  padding: 9px 10px; border-radius: 14px; background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.07); text-align: center;
}
.stat-chip b { display: block; font-size: 16px; color: var(--text); }
.stat-chip span { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 900; }

.actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 12px; }
.action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 16px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  color: var(--text); font-weight: 900; font-size: 13px;
  transition: transform .12s ease, background .2s ease;
}
.action-btn:active { transform: scale(.97); }
.action-btn .ico { font-size: 22px; }
.action-btn small { display: block; font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 1px; }
.action-btn:disabled { opacity: .4; }
.action-btn.primary { background: linear-gradient(145deg, rgba(255,207,110,.2), rgba(255,138,91,.12)); border-color: rgba(255,207,110,.28); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 15px;
  font-weight: 900; font-size: 13px; color: var(--text);
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  transition: transform .12s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #241608; border: none; box-shadow: 0 12px 30px rgba(255,138,91,.22); }
.btn.mint { background: linear-gradient(135deg, #7fd8b6, #8de3c0); color: #0c2a20; border: none; }
.btn.violet { background: linear-gradient(135deg, #9a7dff, #c7b4ff); color: #1c1433; border: none; }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255,107,129,.14); border-color: rgba(255,107,129,.3); color: #ffb3bf; }
.btn.wide { width: 100%; }
.btn.sm { padding: 9px 12px; font-size: 12px; border-radius: 12px; }
.btn:disabled { opacity: .45; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-size: 10px; font-weight: 900; color: var(--muted); }
.pill.gold { color: var(--accent); border-color: rgba(255,207,110,.25); background: rgba(255,207,110,.1); }
.pill.mint { color: var(--mint); border-color: rgba(141,227,192,.24); background: rgba(141,227,192,.09); }
.pill.danger { color: #ffb3bf; border-color: rgba(255,107,129,.25); background: rgba(255,107,129,.1); }

.list { display: grid; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 16px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07);
  color: var(--text); text-align: left; width: 100%;
}
.list-item:active { background: rgba(255,255,255,.08); }
.list-item .emoji { font-size: 26px; width: 36px; text-align: center; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .name { font-weight: 900; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.list-item .right { text-align: right; flex-shrink: 0; }
.rank {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 900; font-size: 12px; background: rgba(255,255,255,.07); color: var(--muted);
  flex-shrink: 0;
}
.rank.gold { background: linear-gradient(145deg, #ffcf6e, #ffab4d); color: #2b1a04; }
.rank.silver { background: linear-gradient(145deg, #d7dbe8, #a7adc2); color: #232536; }
.rank.bronze { background: linear-gradient(145deg, #d79b6b, #b87345); color: #2a1608; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 9px; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 900; }
.section-head .link { background: none; color: var(--accent); font-size: 11px; font-weight: 900; padding: 6px; }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 9px 10px; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 900; font-size: 11px; }
.tabs button.active { background: rgba(255,255,255,.1); color: var(--text); }

.floor-chips { display: flex; gap: 6px; margin: 10px 0; }
.floor-chips button { padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted); font-weight: 900; font-size: 11px; }
.floor-chips button.active { background: rgba(255,207,110,.14); color: var(--accent); border-color: rgba(255,207,110,.28); }

.empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.empty .big-emoji { font-size: 36px; display: block; margin-bottom: 8px; }

.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(255,207,110,.1); }
.feed-text { font-size: 12px; line-height: 1.4; color: var(--soft); font-weight: 700; }
.feed-time { font-size: 10px; color: var(--muted); margin-top: 2px; }

.pet-card-mini { display: flex; align-items: center; gap: 12px; }
.pet-card-mini .emoji { font-size: 40px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.pet-card-mini .name { font-weight: 900; font-size: 15px; }
.pet-card-mini .sub { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 2px; }

.room-hero { text-align: center; padding: 18px 16px 14px; }
.room-hero .emoji { font-size: 86px; animation: float 3s ease-in-out infinite; display: inline-block; }
.room-hero .name { font-size: 24px; font-weight: 900; margin-top: 4px; }
.room-hero .sub { font-size: 12px; color: var(--muted); font-weight: 800; margin-top: 3px; }
.room-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 12px; }
.room-actions .btn { flex-direction: column; gap: 2px; line-height: 1.25; min-height: 64px; text-align: center; }

.duel-slot { position: relative; overflow: hidden; }
.duel-slot::after { content: "⚔️"; position: absolute; right: -6px; bottom: -18px; font-size: 90px; opacity: .08; transform: rotate(-12deg); }
.slot-time { font-size: 32px; font-weight: 900; letter-spacing: .5px; }
.slot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; color: var(--accent); margin-top: 4px; }
.countdown { font-variant-numeric: tabular-nums; }
.duel-card {
  background: linear-gradient(145deg, rgba(255,138,91,.12), rgba(185,156,255,.1));
  border: 1px solid rgba(255,207,110,.2);
}
.duel-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.duel-vs .emoji { font-size: 42px; }
.duel-vs .vs { font-size: 20px; font-weight: 900; color: var(--accent); }
.duel-vs .room { font-size: 12px; font-weight: 900; margin-top: 2px; }
.duel-vs .score { font-size: 24px; font-weight: 900; color: var(--accent); }

.quest-card { padding: 12px 13px; }
.quest-card + .quest-card { margin-top: 8px; }
.quest-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.quest-title { font-size: 13px; font-weight: 900; line-height: 1.25; }
.quest-reward { font-size: 10px; color: var(--accent); font-weight: 900; white-space: nowrap; }
.quest-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.quest-progress .bar { flex: 1; height: 6px; }
.quest-progress span { font-size: 10px; color: var(--muted); font-weight: 900; font-variant-numeric: tabular-nums; }
.quest-card.done { border-color: rgba(141,227,192,.24); }
.quest-card.claimed { opacity: .55; }

.profile-head { text-align: center; padding: 10px 0 16px; }
.profile-avatar { width: 76px; height: 76px; border-radius: 28px; margin: 0 auto 10px; display: grid; place-items: center; font-size: 38px; background: linear-gradient(145deg, rgba(255,207,110,.2), rgba(185,156,255,.16)); border: 1px solid rgba(255,255,255,.14); }
.profile-name { font-size: 22px; font-weight: 900; }
.profile-sub { font-size: 12px; color: var(--muted); font-weight: 800; margin-top: 3px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.settings-row:last-child { border-bottom: none; }
.settings-row .title { font-size: 13px; font-weight: 900; }
.settings-row .sub { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.switch { width: 48px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--soft); transition: transform .2s; }
.switch.on { background: rgba(141,227,192,.3); border-color: rgba(141,227,192,.4); }
.switch.on::after { transform: translateX(20px); background: var(--mint); }

.bottom-nav {
  position: fixed; z-index: 40; left: 50%; bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 540px);
  height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(18, 20, 38, .88);
  border: 1px solid rgba(255,255,255,.11);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 17px; background: transparent; color: var(--muted); font-weight: 900; font-size: 8.5px; }
.nav-btn .ico { font-size: 21px; line-height: 1; filter: grayscale(.35); transition: transform .15s, filter .15s; }
.nav-btn.active { background: rgba(255,255,255,.07); color: var(--text); }
.nav-btn.active .ico { filter: none; transform: translateY(-1px) scale(1.06); }
.nav-btn .badge { position: absolute; margin: -24px 0 0 20px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,207,110,.15); }

.toast-root { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--nav-h) + 26px); transform: translateX(-50%); width: min(calc(100% - 32px), 500px); display: grid; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto;
  padding: 12px 15px; border-radius: 15px;
  background: rgba(24, 27, 48, .96); border: 1px solid rgba(255,255,255,.13);
  color: var(--text); font-size: 12px; font-weight: 800; box-shadow: 0 14px 40px rgba(0,0,0,.4);
  animation: toastIn .25s ease both;
}
.toast.err { border-color: rgba(255,107,129,.35); color: #ffc3cc; }
.toast.ok { border-color: rgba(141,227,192,.35); color: #bdf5df; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-root { position: fixed; inset: 0; z-index: 80; display: none; }
.modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 12, .68); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); max-height: 92dvh; overflow: auto;
  background: linear-gradient(180deg, #191c32, #111321);
  border: 1px solid rgba(255,255,255,.13); border-bottom: none;
  border-radius: 28px 28px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -30px 80px rgba(0,0,0,.5);
  animation: sheetUp .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sheetUp { from { transform: translate(-50%, 30px); opacity: .2; } to { transform: translate(-50%, 0); opacity: 1; } }
.modal-grab { width: 42px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.18); margin: 0 auto 14px; }
.modal-title { font-size: 18px; font-weight: 900; margin: 0 0 4px; }
.modal-sub { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 14px; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; font-weight: 900; color: var(--muted); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 13px 14px; border-radius: 15px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  color: var(--text); outline: none; font-weight: 800; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(255,207,110,.45); box-shadow: 0 0 0 3px rgba(255,207,110,.1); }
.textarea { min-height: 100px; resize: vertical; }
.select { appearance: none; }
.checkline { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.checkline input { width: 18px; height: 18px; accent-color: var(--accent); }
.checkline span { font-size: 12px; font-weight: 800; color: var(--soft); }
.hint { font-size: 11px; line-height: 1.45; color: var(--muted); font-weight: 700; }
.error { color: #ffb3bf; font-size: 12px; font-weight: 800; min-height: 16px; margin-top: 8px; }

.species-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.species-card { padding: 12px 8px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text); text-align: center; }
.species-card .emoji { font-size: 34px; display: block; }
.species-card .name { font-size: 10px; font-weight: 900; margin-top: 4px; color: var(--muted); }
.species-card.active { border-color: rgba(255,207,110,.5); background: rgba(255,207,110,.12); }
.species-card.active .name { color: var(--accent); }

.auth-wrap { min-height: 100dvh; display: grid; align-content: center; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .emoji { font-size: 76px; animation: float 3s ease-in-out infinite; display: inline-block; }
.auth-logo h1 { font-size: 30px; font-weight: 900; margin: 4px 0 2px; letter-spacing: .2px; }
.auth-logo p { color: var(--muted); font-size: 12px; font-weight: 800; margin: 0; }
.auth-card { max-width: 420px; width: 100%; margin: 0 auto; }
.step-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); font-weight: 900; }
.step-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

.mini-game {
  position: fixed; inset: 0; z-index: 120; display: none;
  background:
    radial-gradient(700px 420px at 50% 0%, rgba(255,207,110,.16), transparent 60%),
    linear-gradient(180deg, #0c0e1a, #15142a 60%, #0b0c16);
  padding: max(18px, env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.mini-game.open { display: block; animation: fadeIn .2s ease; }
.mg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mg-title { font-size: 13px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.mg-timer { font-size: 26px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.mg-score { font-size: 48px; font-weight: 900; text-align: center; margin-top: 30px; line-height: 1; }
.mg-score-label { text-align: center; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; margin-top: 4px; }
.mg-pet { text-align: center; font-size: 96px; margin: 26px 0 8px; animation: float 2s ease-in-out infinite; }
.mg-event { min-height: 26px; text-align: center; color: var(--accent); font-weight: 900; font-size: 14px; }
.mg-tap {
  width: min(74vw, 290px); height: min(74vw, 290px); border-radius: 50%;
  margin: 18px auto 0; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffdf9c, #ff9b61 58%, #d9613f);
  box-shadow: 0 20px 50px rgba(255,138,91,.28), inset 0 -10px 26px rgba(120,40,20,.28);
  color: #2b1608; font-weight: 900; font-size: 22px; text-align: center;
  border: 6px solid rgba(255,255,255,.18);
  transition: transform .06s ease;
  user-select: none;
}
.mg-tap:active { transform: scale(.94); }
.mg-bottom { position: absolute; left: 18px; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); }
.mg-result { text-align: center; padding-top: 12vh; }
.mg-result .emoji { font-size: 84px; animation: pop .4s ease both; }
.mg-result h2 { font-size: 28px; margin: 8px 0; }
.mg-result p { color: var(--muted); font-weight: 800; }

.rules { font-size: 12px; line-height: 1.55; color: var(--soft); font-weight: 700; }
.rules h3 { font-size: 13px; color: var(--text); margin: 16px 0 6px; }
.rules p { margin: 0 0 8px; }
.rules ol, .rules ul { margin: 0 0 10px; padding-left: 18px; }

@media (max-width: 380px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .hero-name { font-size: 24px; }
  .pet-emoji { font-size: 94px; }
  .care-grid { gap: 6px; }
  .care-item { padding: 7px; }
  .action-btn { padding: 11px; font-size: 12px; }
}
