/* «Питомец чата»: яркий фиолетово-розовый стиль, как на иконке, белые карточки. */
:root {
  --bg: #8a5cf0;
  --surface: #ffffff;
  --surface2: #f2edfb;
  --text: #2d2a32;
  --muted: #8a8296;
  --line: #2d2a3212;
  --accent: #7b5cff;
  --accent-text: #fff;
  --me-bg: #7b5cff17;
  --tabbar-bg: #ffffffeb;
  --shadow: 0 8px 24px #3b1d8a26;
  --orange: #ffb347;
  --pink: #ff7eb3;
  color-scheme: light;
}
body { background: linear-gradient(165deg, #7b5cff 0%, #b46ae0 45%, #ff8fbf 100%) fixed, #8a5cf0; }
.section-title.light { color: #ffffffd9; }
.btn.white { background: #fff; color: var(--accent); }

/* Hero (главная и выбор питомца) */
.hero { text-align: center; color: #fff; padding: 30px 8px 6px; }
.hero h1 { font-size: 26px; font-weight: 900; margin: 6px 0 6px; }
.hero p { margin: 0 auto; max-width: 380px; opacity: .92; }
.hero-pet { position: relative; display: inline-block; font-size: 84px; line-height: 1;
  animation: idle 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 10px #0003); }
.hero-bubble { position: absolute; right: -30px; top: -10px; font-size: 24px; background: #fff; border-radius: 50%;
  width: 44px; height: 44px; display: grid; place-items: center; box-shadow: 0 4px 10px #0002; }
.egg-wobble { animation: wobble 1.6s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }

.steps { padding: 6px 14px 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.step + .step { border-top: 1px solid var(--line); }
.step .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 900; }
.steps .btn { margin-top: 8px; }
.dev-hint { color: #ffffffb0; }

/* Выбор вида */
.species { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.species button { border: 2px solid transparent; border-radius: 16px; background: var(--surface2); color: var(--text);
  padding: 10px 2px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.species button span { font-size: 36px; }
.species button.active { border-color: var(--accent); background: #7b5cff14; }
input { width: 100%; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 14px; margin: 12px 0;
  border: 2px solid var(--surface2); background: var(--surface); color: var(--text); outline: none; }
input:focus { border-color: var(--accent); }

/* Шапка питомца */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #fff; margin: 2px 0 8px; }
.top-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-title b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-pill { flex: none; background: #ffffff2e; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.icon-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #ffffff2e; color: #fff;
  font: inherit; font-weight: 900; cursor: pointer; }

/* Комната питомца */
.room { position: relative; text-align: center; padding-top: 16px;
  background: radial-gradient(90% 60% at 50% 38%, #fff6e8 0, #fff 70%); }
.bubble { position: relative; display: inline-block; max-width: 92%; background: var(--surface2); border-radius: 16px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; min-height: 36px; transition: .2s; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--surface2); border-bottom: 0; }
.bubble.pop { animation: pop .3s; }
.bubble.alert { background: #ffe1e6; } .bubble.alert::after { border-top-color: #ffe1e6; }
.stage { position: relative; height: 170px; display: grid; place-items: center; cursor: pointer; user-select: none; }
.pet { font-size: 112px; line-height: 1; animation: idle 2.4s ease-in-out infinite; z-index: 1; }
.pet.hungry { filter: saturate(.5); animation: sad 3s ease-in-out infinite; }
.pet.bounce { animation: bounce .5s; }
.acc { position: absolute; top: 2px; font-size: 38px; letter-spacing: 6px; z-index: 2; }
.floor-shadow { position: absolute; bottom: 10px; width: 120px; height: 16px; border-radius: 50%; background: #0000001a; }
@keyframes idle { 50% { transform: translateY(-7px) scale(1.02); } }
@keyframes sad { 50% { transform: translateY(2px) rotate(-3deg); } }
@keyframes bounce { 30% { transform: scale(1.2) rotate(-7deg); } 60% { transform: scale(.94) rotate(4deg); } }
@keyframes pop { 50% { transform: scale(1.06); } }
.float { position: absolute; z-index: 3; font-weight: 900; font-size: 18px; color: var(--accent);
  animation: float 1.1s forwards; pointer-events: none; }
@keyframes float { to { transform: translateY(-70px); opacity: 0; } }

.pet-name { font-size: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.lvl { background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.evo { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.meter { text-align: left; margin-top: 10px; }
.meter-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.meter-head span:last-child { color: var(--muted); font-weight: 600; }
.bar { height: 12px; background: var(--surface2); border-radius: 8px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 8px; transition: width .5s; }
.xp { background: linear-gradient(90deg, #7b5cff, #b46ae0); }
.full { background: linear-gradient(90deg, #ffb347, #ff8a3d); }
.full.low { background: linear-gradient(90deg, #ff5f6d, #ff2e4d); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .55; } }

/* Большие кнопки действий */
.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.action { position: relative; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow);
  padding: 14px 4px 12px; font: inherit; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .1s; }
.action:active { transform: scale(.94); }
.action:disabled { opacity: .5; }
.action .a-ic { font-size: 34px; line-height: 1; }
.action .a-l { font-size: 13px; font-weight: 800; }
.action.feed { background: linear-gradient(160deg, #fff, #fff1df); }
.action.treat { background: linear-gradient(160deg, #fff, #ffe6f0); }
.badge { position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.badge.zero { background: #cfc8dc; }
.extras { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.extras .pill-btn { background: #ffffff33; color: #fff; }

/* Чат и рейтинг */
.invite-card { display: flex; align-items: center; gap: 12px; color: #fff;
  background: linear-gradient(135deg, #ff7eb3, #7b5cff); }
.other-chat { display: flex; align-items: center; gap: 12px; }
.other-chat .big { font-size: 32px; }
.other-chat .grow, .invite-card .grow { flex: 1; }
.xp-tag { font-weight: 800; color: var(--accent); }
.chat-row { cursor: pointer; }
.pet-ava { width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center;
  font-size: 22px; flex: none; }
.row-item .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

/* Магазин */
.balance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bal { margin: 0; display: flex; flex-direction: column; align-items: center; padding: 10px 4px; font-size: 22px; }
.bal b { font-size: 20px; }
.shop-note { color: #fff; opacity: .9; line-height: 1.6; margin: 14px 4px; }
.shop-item.owned .price { background: #cfc8dc; }

/* Чипы поколения и огонька в углах комнаты */
.room-chips { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between;
  pointer-events: none; z-index: 4; }
.rchip { background: var(--surface2); border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; }
.rchip:empty { visibility: hidden; }
.rchip.fire { background: #fff0e0; color: #e56b00; }
.room .bubble { margin-top: 22px; }

/* Аура: серебро → золото → фиолет → радуга */
.aura { position: absolute; width: 200px; height: 200px; border-radius: 50%; opacity: 0; z-index: 0; }
.aura.a1, .aura.a2, .aura.a3, .aura.a4 { opacity: 1; animation: aura 3s ease-in-out infinite; }
.aura.a1 { background: radial-gradient(circle, #b0bec5 0, #cfd8dcaa 45%, transparent 70%); }
.aura.a2 { background: radial-gradient(circle, #ffca28 0, #ffd54faa 45%, transparent 70%); }
.aura.a3 { background: radial-gradient(circle, #ba68c8 0, #ab47bcaa 45%, transparent 70%); }
.aura.a4 { background: conic-gradient(#ff5f6d, #ffc371, #7bed9f, #70a1ff, #b46ae0, #ff5f6d);
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 72%); mask: radial-gradient(circle, #000 35%, transparent 72%); opacity: .75;
  animation: aura 3s ease-in-out infinite, spin 8s linear infinite; }
@keyframes aura { 50% { transform: scale(1.12); } }
@keyframes spin { to { rotate: 360deg; } }

.pet-title { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 2px; font-weight: 800;
  color: var(--accent); font-size: 14px; }
.rarity { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; color: #fff; }
.rarity.common { background: #9e9aa8; } .rarity.rare { background: #42a5f5; }
.rarity.epic { background: #ab47bc; } .rarity.legendary { background: linear-gradient(90deg, #ffb300, #ff7043); }

/* Путешествие */
.travel-card { display: flex; align-items: center; gap: 12px; color: #fff; margin-top: 14px;
  background: linear-gradient(135deg, #ffb300, #ff7043); }
.travel-card .big { font-size: 34px; } .travel-card .grow { flex: 1; }

/* Задания дня */
.quests { margin-top: 14px; }
.quests-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.quest { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.quest + .quest { border-top: 1px solid var(--line); }
.quest .q-ic { font-size: 22px; width: 30px; text-align: center; }
.quest .q-body { flex: 1; min-width: 0; }
.quest .q-title { font-size: 14px; font-weight: 700; }
.quest .q-bar { height: 7px; background: var(--surface2); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.quest .q-bar div { height: 100%; background: linear-gradient(90deg, #7b5cff, #ff7eb3); border-radius: 4px; transition: width .4s; }
.quest .q-num { font-size: 12px; font-weight: 800; color: var(--muted); min-width: 38px; text-align: right; }
.quest.done .q-title { color: var(--muted); text-decoration: line-through; }
.quest.done .q-bar div { background: #4caf50; }
.quests-foot { margin-top: 6px; line-height: 1.5; }

/* Коллекция и Зал славы */
.collection { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-bottom: 10px; }
.coll { border-radius: 14px; background: var(--surface2); padding: 8px 2px 6px; text-align: center; border: 2px solid transparent; }
.coll .e { font-size: 30px; line-height: 1.2; }
.coll .n { font-size: 10px; font-weight: 700; }
.coll.locked .e { filter: brightness(0) opacity(.18); }
.coll.locked .n { color: var(--muted); }
.coll.rare { border-color: #42a5f5; } .coll.epic { border-color: #ab47bc; } .coll.legendary { border-color: #ffb300; }
.coll.locked { border-color: transparent; }

.segmented.on-color { background: #ffffff33; }
.segmented.on-color button { color: #fff; }
.segmented.on-color button.active { background: #fff; color: var(--accent); }
.league-note { color: #ffffffd0; margin: 6px 0; }

/* Открытие нового вида из яйца */
.reveal { text-align: center; padding: 6px 0 4px; }
.reveal .r-emoji { font-size: 80px; line-height: 1.1; animation: hatch .8s ease-out; }
.reveal .r-name { font-size: 20px; font-weight: 900; margin-top: 4px; }
@keyframes hatch { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 70% { transform: scale(1.15) rotate(6deg); } 100% { transform: none; } }

.ad-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.ad-card .btn { flex: 1 1 100%; }
.ad-card .big { font-size: 30px; }
.ad-card .grow { flex: 1; }
