/* =========================================================
   Рома & Даша — стили
   ========================================================= */

:root {
  --bg-1: #fff4f7;
  --bg-2: #ffe6ee;
  --bg-3: #f1e6ff;
  --blob-1: rgba(255, 143, 177, .45);
  --blob-2: rgba(186, 157, 255, .38);
  --blob-3: rgba(255, 209, 170, .40);

  --card: rgba(255, 255, 255, .62);
  --card-strong: rgba(255, 255, 255, .86);
  --card-border: rgba(255, 255, 255, .85);
  --line: rgba(122, 63, 104, .12);

  --text: #3a2440;
  --text-2: #6e5677;
  --muted: #a08aa8;

  --primary: #ff4f86;
  --primary-2: #ff8db0;
  --accent: #9b7bff;
  --accent-2: #c7b5ff;
  --gold: #ffb84d;
  --ok: #34c38f;

  --grad: linear-gradient(135deg, #ff5c8f 0%, #ff8fb1 45%, #b08cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 92, 143, .14), rgba(176, 140, 255, .14));
  --shadow: 0 10px 30px -12px rgba(170, 60, 110, .35), 0 2px 6px rgba(170, 60, 110, .06);
  --shadow-lg: 0 24px 60px -20px rgba(170, 60, 110, .45);
  --glow: 0 0 0 4px rgba(255, 79, 134, .14);

  --petal-1: #ffb3c9;
  --petal-2: #ff8db0;
  --petal-3: #d9c6ff;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --safe-top: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));

  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg-1: #120a1b;
  --bg-2: #1b0f2b;
  --bg-3: #0d1226;
  --blob-1: rgba(255, 79, 134, .22);
  --blob-2: rgba(130, 100, 255, .24);
  --blob-3: rgba(80, 140, 255, .14);

  --card: rgba(38, 22, 54, .58);
  --card-strong: rgba(48, 28, 68, .9);
  --card-border: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .08);

  --text: #fbeef6;
  --text-2: #d6c2dd;
  --muted: #9a86a6;

  --primary: #ff6b9a;
  --primary-2: #ff9cbc;
  --accent: #b39bff;
  --accent-2: #7b62d6;

  --grad: linear-gradient(135deg, #ff6b9a 0%, #e47bd6 50%, #9b84ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 107, 154, .16), rgba(155, 132, 255, .16));
  --shadow: 0 12px 32px -14px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --glow: 0 0 0 4px rgba(255, 107, 154, .18);

  --petal-1: rgba(255, 140, 180, .75);
  --petal-2: rgba(255, 107, 154, .6);
  --petal-3: rgba(180, 160, 255, .65);

  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }

body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg-1);
  background-image:
    radial-gradient(60vmax 50vmax at 0% 0%, var(--blob-1), transparent 60%),
    radial-gradient(55vmax 45vmax at 100% 30%, var(--blob-2), transparent 60%),
    radial-gradient(60vmax 50vmax at 30% 110%, var(--blob-3), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 50%, var(--bg-3));
  background-attachment: fixed;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .3s;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { display: block; }
[hidden] { display: none !important; }

#defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.ic-line { color: currentColor; }

#petals {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ---------------- Сплэш / доступ ---------------- */

#splash, #denied {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; gap: 14px; text-align: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
#splash.hide { opacity: 0; visibility: hidden; }
.splash-heart { display: grid; place-items: center; animation: beat 1.2s var(--ease) infinite; filter: drop-shadow(0 10px 20px rgba(255, 79, 134, .35)); }
.big-icon { display: grid; place-items: center; margin-bottom: 6px; }
.splash-text { font-weight: 700; color: var(--text-2); }
.denied-card { padding: 32px; }
.denied-card h2 { margin: 8px 0 4px; }
.denied-card p { color: var(--text-2); margin: 0; }
.big-emoji { font-size: 56px; }

/* ---------------- Каркас ---------------- */

#app {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) 18px 8px;
  gap: 12px;
}
.hello { font-weight: 900; font-size: 22px; letter-spacing: -.02em; }
.hello .wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 80%; }
.presence { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.presence .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .3s; }
.presence.on .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 195, 143, .6); animation: pulse 2s infinite; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  transition: transform .3s var(--spring);
}
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; position: absolute; transition: transform .5s var(--spring), opacity .3s; }
.icon-btn { position: relative; }
.icon-btn .i-moon { fill: var(--text); stroke: none; }
:root[data-theme="light"] .icon-btn .i-moon { opacity: 0; transform: rotate(-90deg) scale(.4); }
:root[data-theme="dark"] .icon-btn .i-sun { opacity: 0; transform: rotate(90deg) scale(.4); }

#views { position: relative; flex: 1; min-height: 0; }

.view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 6px 16px calc(var(--safe-bottom) + 110px);
  opacity: 0; visibility: hidden;
  transform: translateY(14px) scale(.985);
  transition: opacity .38s var(--ease), transform .45s var(--ease), visibility 0s .4s;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }
.view.active { opacity: 1; visibility: visible; transform: none; transition: opacity .38s var(--ease), transform .45s var(--ease), visibility 0s; }

/* ---------------- Нижняя навигация ---------------- */

.tabbar {
  position: fixed; z-index: 10;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 14px);
  width: min(440px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px;
  border-radius: 26px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--shadow-lg);
}
.tabbar button {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 6px;
  font-size: 11px; font-weight: 800; color: var(--muted);
  transition: color .3s;
}
.tabbar button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--spring); }
.tabbar button.active { color: #fff; }
.tabbar button.active svg { transform: translateY(-1px) scale(1.08); }
.tab-indicator {
  position: absolute; z-index: 0; top: 7px; bottom: 7px; left: 7px;
  width: calc((100% - 14px) / 5);
  border-radius: 20px;
  background: var(--grad);
  box-shadow: 0 8px 20px -6px rgba(255, 79, 134, .6);
  transition: transform .5s var(--spring);
}
.badge {
  position: absolute; top: 5px; right: calc(50% - 18px);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--card-strong);
  animation: pop .4s var(--spring);
}
.tabbar button.active .badge { display: none; }

/* ---------------- Карточки и общие элементы ---------------- */

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow);
  animation: rise .6s var(--ease) both;
}
.view.active .card:nth-child(2) { animation-delay: .05s; }
.view.active .card:nth-child(3) { animation-delay: .1s; }
.view.active .card:nth-child(4) { animation-delay: .15s; }
.view.active .card:nth-child(5) { animation-delay: .2s; }

.card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 900; font-size: 17px; margin: 0 0 12px; letter-spacing: -.01em;
}
.card-title .sub { font-weight: 700; font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.hand { font-family: 'Caveat', cursive; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 16px;
  font-weight: 800; font-size: 15px;
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 24px -10px rgba(255, 79, 134, .7);
  transition: transform .25s var(--spring), filter .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--grad-soft); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.small { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 12px; }

.field {
  width: 100%;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card-strong);
  padding: 13px 15px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: none;
}
.field:focus { border-color: var(--primary-2); box-shadow: var(--glow); }
.field::placeholder { color: var(--muted); }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: 16px;
  background: var(--grad-soft); border: 1px solid var(--line);
  position: relative; margin-bottom: 14px;
}
.seg button { position: relative; z-index: 1; padding: 10px 6px; font-weight: 800; font-size: 14px; color: var(--text-2); border-radius: 12px; transition: color .3s; }
.seg button.active { color: var(--text); }
.seg .seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 12px;
  background: var(--card-strong); box-shadow: var(--shadow);
  transition: transform .45s var(--spring), width .3s;
}

/* ---------------- Главная: счётчик ---------------- */

.hero {
  text-align: center;
  padding: 22px 18px 20px;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: -40% -20% auto; height: 120%;
  background: radial-gradient(closest-side, rgba(255, 79, 134, .18), transparent);
  pointer-events: none;
}
.couple { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 6px; position: relative; }
.avatar {
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; font-size: 32px;
  background: var(--card-strong); border: 3px solid var(--card-border);
  box-shadow: var(--shadow);
  position: relative;
}
.avatar small { position: absolute; bottom: -22px; font-size: 12px; font-weight: 800; color: var(--text-2); white-space: nowrap; }
.avatar .on-dot { position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--card-strong); }
.link {
  width: 92px; height: 40px; position: relative;
}
.link svg { width: 100%; height: 100%; overflow: visible; }
.link > svg path { fill: none; stroke: var(--primary-2); stroke-width: 2; stroke-dasharray: 4 6; animation: dash 1.6s linear infinite; }
.link .heart { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -62%); font-size: 26px; animation: beat 1.3s var(--ease) infinite; filter: drop-shadow(0 4px 10px rgba(255, 79, 134, .5)); }

/* Единый таймер «мы вместе» */
.timer-title { font-size: 28px; font-weight: 700; margin-top: 30px; color: var(--text-2); }
.timer {
  display: flex; align-items: stretch; justify-content: center;
  margin: 8px auto 0; padding: 12px 6px;
  border-radius: 22px;
  background: var(--card-strong);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), var(--shadow);
  position: relative;
}
.t-unit { flex: 1; min-width: 0; text-align: center; }
.t-val {
  position: relative; height: 40px; overflow: hidden;
  font-size: 34px; line-height: 40px; font-weight: 900; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.t-val span {
  display: block;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.t-val span.in { animation: rollIn .5s var(--spring) both; }
.t-val span.out { position: absolute; inset: 0; animation: rollOut .4s var(--ease) both; }
.t-lbl { font-size: 11px; font-weight: 800; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.t-sep { width: 1px; margin: 6px 0; background: var(--line); flex: none; }
.t-unit[data-u="seconds"] .t-val span { background: linear-gradient(135deg, #b08cff, #ff5c8f); -webkit-background-clip: text; background-clip: text; }
@keyframes rollIn { from { transform: translateY(70%); opacity: 0; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes rollOut { to { transform: translateY(-70%); opacity: 0; filter: blur(2px); } }
@media (max-width: 360px) { .t-val { font-size: 28px; } .t-lbl { font-size: 10px; } }

.days-num {
  font-family: 'Caveat', cursive; font-weight: 700;
  font-size: 104px; line-height: .95; letter-spacing: -.02em;
  margin-top: 26px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 79, 134, .25));
}
.days-label { font-weight: 900; font-size: 18px; margin-top: -2px; }
.since { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.ticker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 16px;
}
.tick { background: var(--grad-soft); border: 1px solid var(--line); border-radius: 14px; padding: 9px 2px 7px; }
.tick b { display: block; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tick span { font-size: 11px; color: var(--muted); font-weight: 700; }

.milestone { margin-top: 16px; text-align: left; }
.milestone-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; margin-bottom: 7px; }
.milestone-row span:last-child { color: var(--muted); }
.bar { height: 10px; border-radius: 10px; background: var(--grad-soft); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; border-radius: 10px; background: var(--grad); transition: width 1.2s var(--ease); position: relative; overflow: hidden; }
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shine 2.4s infinite; }

.celebrate {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left;
  margin-top: 14px; padding: 12px 14px; border-radius: 16px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 12px 26px -12px rgba(255, 79, 134, .8);
  animation: pop .6s var(--spring) both .3s;
}

/* ---------------- Расстояние ---------------- */

.distance { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; text-align: center; }
.city b { display: block; font-weight: 900; font-size: 15px; }
.city .time { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.city small { color: var(--muted); font-weight: 700; font-size: 12px; }
.km { position: relative; padding: 0 4px; }
.km .plane { font-size: 22px; display: block; animation: float 3s ease-in-out infinite; }
.km b { display: block; font-weight: 900; font-size: 15px; white-space: nowrap; }
.km small { font-size: 11px; color: var(--muted); font-weight: 700; }
.distance-note { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; margin-top: 12px; font-family: 'Caveat', cursive; font-size: 22px; line-height: 1.1; color: var(--text-2); }
.city b { display: inline-flex !important; align-items: center; gap: 4px; justify-content: center; }
.km .plane { display: grid !important; place-items: center; }

/* ---------------- Настроение ---------------- */

.mood-partner {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: 18px; background: var(--grad-soft); border: 1px solid var(--line);
  margin-bottom: 14px;
}
.mood-partner .m-emoji { font-size: 36px; animation: bob 3s ease-in-out infinite; }
.mood-partner .m-text { flex: 1; min-width: 0; }
.mood-partner .m-text b { display: block; font-size: 15px; }
.mood-partner .m-text p { margin: 2px 0 0; font-size: 14px; color: var(--text-2); word-wrap: break-word; }
.mood-partner .m-text small { color: var(--muted); font-weight: 700; font-size: 12px; }

.moods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 2px 8px; border-radius: 16px;
  background: var(--card-strong); border: 1.5px solid var(--line);
  font-size: 11.5px; font-weight: 800; color: var(--text-2);
  transition: transform .3s var(--spring), border-color .2s, background .2s;
}
.mood-btn .e { font-size: 28px; transition: transform .4s var(--spring); }
.mood-btn:active { transform: scale(.92); }
.mood-btn.selected { border-color: var(--primary); background: var(--grad-soft); color: var(--text); }
.mood-btn.selected .e { transform: scale(1.18) rotate(-6deg); }
.mood-note { display: flex; gap: 8px; margin-top: 10px; }
.mood-note .field { flex: 1; }
.mood-partner .m-emoji { display: grid; place-items: center; }
.mood-btn .e, .support button .e { display: grid; place-items: center; height: 38px; }
.btn.icon-only { width: 52px; padding: 0; flex: none; }
.q-status, .presence-text, #toast { display: inline-flex; align-items: center; gap: 6px; }
#toast { display: flex; justify-content: center; }
.mood-mine { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 10px; text-align: center; }

.mood-history { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 2px; margin-top: 12px; scrollbar-width: none; }
.mood-history::-webkit-scrollbar { display: none; }
.mh { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 800; color: var(--muted); }
.mh span { font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--card-strong); border: 1px solid var(--line); }
.mh.roma span { border-color: rgba(255, 184, 77, .5); }
.mh.dasha span { border-color: rgba(255, 79, 134, .45); }

.support { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.support button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 2px 9px; border-radius: 18px;
  background: var(--card-strong); border: 1.5px solid var(--line);
  font-size: 11.5px; font-weight: 800; color: var(--text-2);
  transition: transform .3s var(--spring);
}
.support button .e { font-size: 30px; }
.support button:active { transform: scale(.88) rotate(-4deg); }

/* ---------------- Вопрос дня ---------------- */

.q-card { text-align: center; padding: 26px 20px 22px; overflow: hidden; }
.q-card .q-day { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); }
.q-card .q-text { font-family: 'Caveat', cursive; font-weight: 700; font-size: 34px; line-height: 1.1; margin: 12px 0 4px; }
.q-card .q-deco { position: absolute; font-size: 54px; opacity: .14; pointer-events: none; }
.q-card .q-deco.a { top: -6px; left: 8px; transform: rotate(-14deg); }
.q-card .q-deco.b { bottom: -10px; right: 6px; transform: rotate(12deg); }
.q-preview .q-text { font-size: 26px; text-align: left; margin: 2px 0 10px; }
.q-preview .q-status { font-size: 13px; font-weight: 700; color: var(--muted); }

.answers { display: grid; gap: 12px; }
.bubble {
  padding: 14px 16px; border-radius: 22px;
  background: var(--card-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both;
}
.bubble .who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 900; color: var(--text-2); margin-bottom: 4px; }
.bubble p { margin: 0; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { border-bottom-right-radius: 8px; margin-left: 28px; background: var(--grad-soft); }
.bubble.theirs { border-bottom-left-radius: 8px; margin-right: 28px; }
.bubble.locked { position: relative; overflow: hidden; }
.bubble.locked p { filter: blur(6px); user-select: none; }
.bubble.locked .lock {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px;
  font-weight: 800; font-size: 14px; color: var(--text-2);
}
.bubble.locked .lock span { font-size: 24px; }
.bubble.waiting p { color: var(--muted); font-style: italic; }
.edit-link { font-size: 12px; font-weight: 800; color: var(--primary); margin-top: 6px; display: inline-block; }

.history-item { padding: 14px 0; border-top: 1px solid var(--line); }
.history-item:first-child { border-top: 0; padding-top: 2px; }
.history-item .h-date { font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.history-item .h-q { font-family: 'Caveat', cursive; font-size: 22px; font-weight: 700; margin: 2px 0 6px; line-height: 1.1; }
.history-item .h-a { font-size: 14px; margin: 4px 0; color: var(--text-2); }
.history-item .h-a b { color: var(--text); }

/* ---------------- Игры ---------------- */

.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 8px; }
.scoreboard .sc-who { font-size: 30px; }
.scoreboard .sc-name { font-weight: 900; font-size: 14px; }
.scoreboard .sc-num { font-size: 40px; font-weight: 900; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.scoreboard .sc-vs { font-family: 'Caveat', cursive; font-size: 26px; color: var(--muted); }

.game-tile {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; margin-bottom: 12px;
  border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  transition: transform .3s var(--spring);
  animation: rise .6s var(--ease) both;
}
.game-tile:active { transform: scale(.97); }
.game-tile .gt-icon {
  width: 58px; height: 58px; flex: none; border-radius: 18px;
  display: grid; place-items: center; font-size: 30px;
  background: var(--grad-soft); border: 1px solid var(--line);
}
.game-tile .gt-body { flex: 1; min-width: 0; }
.game-tile b { display: block; font-size: 16px; font-weight: 900; }
.game-tile small { display: block; color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 2px; }
.game-tile .gt-status { font-size: 11px; font-weight: 900; padding: 5px 9px; border-radius: 10px; background: var(--grad); color: #fff; white-space: nowrap; }
.game-tile .gt-status.idle { background: var(--grad-soft); color: var(--text-2); }
.game-tile .gt-score { font-size: 12px; font-weight: 800; color: var(--text-2); margin-top: 4px; }

.game-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.back-btn {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow);
}
.back-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.game-head h2 { margin: 0; font-size: 20px; font-weight: 900; flex: 1; }

.turn-pill {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 16px; margin-bottom: 14px;
  font-weight: 800; font-size: 15px;
  background: var(--card-strong); border: 1px solid var(--line);
  transition: background .3s;
}
.turn-pill.mine { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -12px rgba(255, 79, 134, .8); }
.turn-pill.win { background: linear-gradient(135deg, #ffd166, #ff8fb1); color: #4a2a00; border-color: transparent; }

/* Крестики-нолики */
.ttt {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  width: min(100%, 360px); margin: 0 auto 16px; aspect-ratio: 1;
}
.ttt button {
  border-radius: 22px; background: var(--card-strong); border: 1.5px solid var(--line);
  font-size: clamp(36px, 13vw, 58px); display: grid; place-items: center;
  box-shadow: var(--shadow);
  transition: transform .25s var(--spring), background .3s;
}
.ttt button:active:not(:disabled) { transform: scale(.92); }
/* Обёртка занимает всю клетку — иначе проценты у иконки не от чего считать и она схлопывается в точку */
.ttt button span { animation: pop .45s var(--spring) both; display: grid; place-items: center; width: 100%; height: 100%; }
.ttt button .ic { width: 64%; height: 64%; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18)); }
.gt-icon .ic { width: 36px; height: 36px; }
.sc-who { display: grid; place-items: center; }
.lives { align-items: center; }
.waiting-box .big-icon { animation: bob 2.4s ease-in-out infinite; }
.turn-pill .ic { flex: none; }
.ttt button.win { background: var(--grad); border-color: transparent; }
.ttt button.win span { animation: beat 1s var(--ease) infinite; }
.ttt button:disabled { cursor: default; }

/* Морской бой */
.bs-board {
  display: grid; gap: 4px;
  width: min(100%, 380px); margin: 0 auto 12px; aspect-ratio: 1;
  padding: 8px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(125, 211, 252, .28), rgba(155, 123, 255, .22));
  border: 1px solid var(--line);
}
.bs-cell {
  border-radius: 7px; background: rgba(255, 255, 255, .5);
  display: grid; place-items: center; font-size: clamp(12px, 4vw, 18px);
  transition: transform .2s var(--spring), background .2s;
  position: relative;
}
:root[data-theme="dark"] .bs-cell { background: rgba(255, 255, 255, .07); }
.bs-cell.ship { background: linear-gradient(135deg, #9b7bff, #ff8fb1); }
.bs-cell.miss::after { content: ''; width: 22%; height: 22%; border-radius: 50%; background: var(--muted); opacity: .7; }
.bs-cell.hit { background: linear-gradient(135deg, #ffb84d, #ff5c8f); animation: shake .35s; }
.bs-cell.sunk { background: linear-gradient(135deg, #5b3a6e, #a33c6b); }
.bs-cell .ic { width: 72%; height: 72%; animation: pop .35s var(--spring) both; }
.bs-cell.last { box-shadow: 0 0 0 2.5px var(--primary); }
.bs-cell.target:active { transform: scale(.85); }
.bs-info { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--text-2); margin: 0 4px 12px; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }

/* Угадай слово */
.lives { display: flex; justify-content: center; gap: 4px; font-size: 22px; margin-bottom: 14px; }
.lives span { transition: transform .4s var(--spring), opacity .4s, filter .4s; }
.lives span.lost { opacity: .25; filter: grayscale(1); transform: scale(.75); }
.word-hint { text-align: center; font-family: 'Caveat', cursive; font-size: 24px; color: var(--text-2); margin-bottom: 14px; }
.word-mask { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 18px; }
.word-mask span {
  width: 38px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 900; text-transform: uppercase;
  background: var(--card-strong); border: 1.5px solid var(--line); box-shadow: var(--shadow);
}
.word-mask span.open { animation: flip .5s var(--spring) both; border-color: var(--primary-2); }
.keyboard { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; }
.keyboard button {
  height: 44px; border-radius: 10px;
  font-weight: 900; font-size: 15px; text-transform: uppercase;
  background: var(--card-strong); border: 1px solid var(--line);
  transition: transform .2s var(--spring), opacity .2s;
}
.keyboard button:active { transform: scale(.88); }
.keyboard button.good { background: linear-gradient(135deg, #5ee0a8, #34c38f); color: #fff; border-color: transparent; }
.keyboard button.bad { opacity: .3; }
.keyboard button:disabled { pointer-events: none; }

.waiting-box { text-align: center; padding: 26px 10px; }
.waiting-box .big-emoji { animation: bob 2.4s ease-in-out infinite; margin-bottom: 8px; }
.waiting-box p { color: var(--text-2); font-weight: 700; margin: 4px 0 0; }

/* ---------------- Холст ---------------- */

.canvas-wrap {
  position: relative;
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: var(--r-xl); overflow: hidden;
  background: #fffdfb;
  background-image: radial-gradient(rgba(150, 110, 140, .18) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  touch-action: none;
  margin-bottom: 12px;
}
:root[data-theme="dark"] .canvas-wrap { background-color: #fbf6f8; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.canvas-who {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 5px 10px; border-radius: 12px; font-size: 12px; font-weight: 800;
  background: rgba(255, 255, 255, .88); color: #5a3a5f; box-shadow: 0 4px 12px rgba(0,0,0,.08);
  opacity: 0; transform: translateY(-6px); transition: .3s var(--ease);
}
.canvas-who.show { opacity: 1; transform: none; }

.tools {
  padding: 12px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.swatches { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  border: 3px solid var(--card-strong); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .3s var(--spring);
}
.swatch.active { transform: scale(1.2); box-shadow: 0 0 0 2px var(--primary), 0 4px 10px rgba(0,0,0,.2); }
.tool-row { display: flex; align-items: center; gap: 8px; }
.tool-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--primary); }
.pen-cursor {
  position: absolute; z-index: 3; left: 0; top: 0;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  pointer-events: none; opacity: 0;
  transition: opacity .35s var(--ease);
  will-change: transform;
}
.pen-cursor.show { opacity: 1; }
.pen-cursor .ring {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 2.5px solid var(--pen, #ff4f86); background: rgba(255,255,255,.55);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--pen, #ff4f86) 18%, transparent);
  animation: penPulse 1.2s ease-in-out infinite;
}
.pen-cursor .who { position: absolute; left: 24px; top: -6px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
@keyframes penPulse { 50% { transform: scale(.82); } }
.canvas-who { display: inline-flex; align-items: center; gap: 6px; }

.tool-btn {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 19px; color: var(--text);
  background: var(--card-strong); border: 1.5px solid var(--line);
  transition: transform .25s var(--spring);
}
.tool-btn:active { transform: scale(.9); }
.tool-btn.active { border-color: var(--primary); background: var(--grad-soft); }
.size-dot { width: 42px; height: 42px; display: grid; place-items: center; flex: none; }
.size-dot i { display: block; border-radius: 50%; background: var(--text); transition: width .15s, height .15s; }

/* ---------------- Факты ---------------- */

.fact {
  padding: 13px 15px; border-radius: 18px; margin-bottom: 10px;
  background: var(--card-strong); border: 1px solid var(--line);
  animation: rise .45s var(--ease) both;
}
.fact .f-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 900; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.fact .f-value { font-size: 16px; font-weight: 700; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.fact .f-value.empty { color: var(--muted); font-weight: 600; font-style: italic; }
.fact textarea.f-input { width: 100%; border: 0; background: transparent; outline: none; font-size: 16px; font-weight: 700; padding: 0; resize: none; line-height: 1.4; min-height: 24px; }
.fact input.f-label-input { border: 0; background: transparent; outline: none; font-size: 12px; font-weight: 900; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; width: 100%; padding: 0; }
.fact .f-del { font-size: 15px; opacity: .45; padding: 2px 4px; }
.fact .f-del:active { opacity: 1; }
.fact:focus-within { border-color: var(--primary-2); box-shadow: var(--glow); }
.facts-progress { font-size: 13px; font-weight: 800; color: var(--text-2); display: flex; justify-content: space-between; margin-bottom: 8px; }
.save-state { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; height: 18px; margin-top: 4px; transition: opacity .3s; }

/* ---------------- Тосты, эффекты ---------------- */

#toast {
  position: fixed; z-index: 60; left: 50%;
  top: calc(var(--safe-top) + 12px);
  transform: translate(-50%, -140%);
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 18px;
  background: var(--card-strong); border: 1px solid var(--card-border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  font-weight: 800; font-size: 15px; text-align: center;
  transition: transform .5s var(--spring);
}
#toast.show { transform: translate(-50%, 0); }

#conn-banner {
  position: fixed; z-index: 55; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 96px);
  padding: 8px 14px; border-radius: 14px; font-size: 13px; font-weight: 800;
  background: var(--card-strong); box-shadow: var(--shadow); color: var(--text-2);
}

#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx-emoji {
  position: absolute; transform: translate(-50%, -50%); line-height: 0;
  animation: fly 1.5s var(--ease) forwards;
  will-change: transform, opacity;
}
.fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 69; }

.hug-overlay {
  position: fixed; inset: 0; z-index: 65;
  display: grid; place-content: center; text-align: center; gap: 6px;
  background: radial-gradient(circle, rgba(255, 79, 134, .25), transparent 70%);
  animation: fadeInOut 2.6s var(--ease) forwards;
  pointer-events: none;
}
.hug-overlay .e { display: grid; place-items: center; animation: hugPop 2.6s var(--spring) forwards; filter: drop-shadow(0 16px 30px rgba(255, 79, 134, .45)); }
.hug-overlay b { font-size: 22px; font-weight: 900; text-shadow: 0 2px 12px var(--bg-1); }

/* ---------------- Анимации ---------------- */

@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
.link .heart { animation-name: beatC; }
@keyframes beatC { 0%, 100% { transform: translate(-50%, -62%) scale(1); } 15% { transform: translate(-50%, -62%) scale(1.2); } 30% { transform: translate(-50%, -62%) scale(1); } 45% { transform: translate(-50%, -62%) scale(1.12); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 195, 143, .55); } 70% { box-shadow: 0 0 0 8px rgba(52, 195, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 195, 143, 0); } }
@keyframes dash { to { stroke-dashoffset: -20; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: none; } }
@keyframes fly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(calc(var(--s, 1) * 1.1)) rotate(var(--rot)); }
}
@keyframes fadeInOut { 0% { opacity: 0; } 12%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hugPop { 0% { transform: scale(.2) rotate(-20deg); } 20% { transform: scale(1.15) rotate(6deg); } 30% { transform: scale(1); } 85% { transform: scale(1); } 100% { transform: scale(1.4); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (min-width: 640px) {
  .view { padding-left: calc(50% - 300px); padding-right: calc(50% - 300px); }
}

/* Иконки-значки людей в разных местах */
.sc-who .ic { width: 42px; height: 42px; }
.gt-score .ic, .bubble .who .ic, .h-a .ic, .seg button .ic { vertical-align: -3px; }
.lives .ic { transition: inherit; }
.btn .ic-line { width: 20px; height: 20px; }
.hello .wave .ic { vertical-align: -4px; animation: sway 3s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.hello .wave { animation: none; }
.f-del { display: grid; place-items: center; color: var(--text-2); }
.q-card .q-deco { line-height: 0; }
.mood-mine .ic { vertical-align: -3px; }
.avatar .ic { filter: drop-shadow(0 2px 4px rgba(0,0,0,.08)); }
.link .heart { line-height: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }

/* =========================================================
   Погода
   ========================================================= */

.wx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wx-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 172px; padding: 12px;
  border-radius: 20px; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 10px 24px -14px rgba(60, 30, 90, .6);
}
.wx-tile > * { position: relative; }
.wx-tile::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.wx-clear { background: linear-gradient(160deg, #ffc56b, #ff8fa3); }
.wx-partly { background: linear-gradient(160deg, #8fc8ff, #b49cff); }
.wx-cloudy { background: linear-gradient(160deg, #a9b3d6, #8a83c2); }
.wx-fog { background: linear-gradient(160deg, #c2bfd8, #9a97b9); }
.wx-drizzle, .wx-rain { background: linear-gradient(160deg, #7d9bd0, #5767a8); }
.wx-snow { background: linear-gradient(160deg, #a9d4ff, #8aa6e8); }
.wx-storm { background: linear-gradient(160deg, #5d4a8a, #2c2652); }
.wx-tile.night::before { background: linear-gradient(160deg, rgba(24, 16, 70, .5), rgba(10, 8, 40, .68)); }
.wx-tile.night.wx-clear { background: linear-gradient(160deg, #423e9a, #1c1a4d); }
.wx-tile.night.wx-clear::before { display: none; }
.wx-city { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 900; text-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.wx-main { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 4px; }
.wx-ic { line-height: 0; }
.wx-ic .ic { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }
.wx-temp { font-size: 30px; font-weight: 900; letter-spacing: -.03em; text-shadow: 0 2px 10px rgba(0, 0, 0, .15); font-variant-numeric: tabular-nums; }
.wx-text { font-size: 13.5px; font-weight: 800; margin-top: 2px; }
.wx-meta { display: flex; flex-direction: column; gap: 1px; margin-top: auto; padding-top: 6px; font-size: 11.5px; font-weight: 700; opacity: .92; }
.wx-empty { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 800; }
.weather-card .distance-note { margin-top: 12px; }
@media (max-width: 360px) {
  .wx-ic .ic { width: 46px; height: 46px; }
  .wx-temp { font-size: 28px; }
}

/* Анимации внутри иконок погоды */
.wx .wx-rays { transform-box: fill-box; transform-origin: center; animation: spin 16s linear infinite; }
.wx .wx-float { animation: wxDrift 6s ease-in-out infinite; }
.wx .wx-float2 { animation: wxDrift 7s ease-in-out infinite reverse; }
.wx .wx-drop { animation: wxDrop 1s linear infinite; }
.wx .wx-flake { animation: wxFlake 2.4s linear infinite; }
.wx .wx-bolt { animation: wxBolt 3.2s ease-in-out infinite; }
.wx .wx-tw { transform-box: fill-box; transform-origin: center; animation: wxTw 2.6s ease-in-out infinite; }
.wx .wx-fog { animation: wxFog 3s ease-in-out infinite; }
@keyframes wxDrift { 50% { transform: translateX(2px); } }
@keyframes wxDrop { 0% { transform: translateY(-3px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(7px); opacity: 0; } }
@keyframes wxFlake { 0% { transform: translate(0, -3px); opacity: 0; } 20% { opacity: 1; } 50% { transform: translate(1.5px, 3px); } 100% { transform: translate(-1px, 9px); opacity: 0; } }
@keyframes wxBolt { 0%, 40%, 100% { opacity: 0; } 44%, 54% { opacity: 1; } 49% { opacity: .3; } }
@keyframes wxTw { 50% { transform: scale(.5); opacity: .4; } }
@keyframes wxFog { 50% { transform: translateX(3px); opacity: .6; } }

/* =========================================================
   «Наш сад» — карточка на главной
   ========================================================= */

.garden-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 214, 120, .38), rgba(255, 92, 143, .2) 55%, rgba(176, 140, 255, .26)), var(--card);
}
.garden-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .32) 50%, transparent 65%);
  animation: shine 4.5s ease-in-out infinite;
}
.gc-ic {
  width: 66px; height: 66px; flex: none;
  display: grid; place-items: center;
  border-radius: 22px; background: rgba(255, 255, 255, .55);
  animation: gFloat 4s ease-in-out infinite;
}
:root[data-theme="dark"] .gc-ic { background: rgba(255, 255, 255, .08); }
.gc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gc-body b { font-size: 18px; font-weight: 900; }
.gc-stat { font-size: 14px; font-weight: 800; color: var(--text-2); }
.gc-stat em { font-style: normal; color: var(--primary); font-variant-numeric: tabular-nums; }
.gc-body small { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-go {
  flex: none; padding: 9px 14px; border-radius: 14px;
  background: var(--grad); color: #fff; font-size: 13px; font-weight: 900;
  box-shadow: 0 8px 18px -8px rgba(255, 79, 134, .8);
}

/* =========================================================
   «Наш сад» — экран кликера
   ========================================================= */

.tabbar { transition: transform .45s var(--ease), opacity .3s; }
body.in-garden .tabbar { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }

.view.garden { overflow: hidden; padding-bottom: 0; }
.g-wrap { display: flex; flex-direction: column; height: 100%; }
.g-head { margin-bottom: 4px; flex: none; }
.g-badge-seeds {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px 6px 8px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow);
  font-weight: 900; font-size: 14px;
}

.g-hero { position: relative; flex: none; text-align: center; padding-bottom: 2px; }
.g-bank { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.g-bank b {
  font-size: 34px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.g-bank small { font-size: 14px; font-weight: 800; color: var(--text-2); }
.g-hps { font-size: 13px; font-weight: 800; color: var(--text-2); }
.g-hps b { color: var(--text); font-variant-numeric: tabular-nums; }
.g-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 24px; margin: 6px 0 2px; }
.g-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 900; white-space: nowrap;
  animation: pop .4s var(--spring);
}
.g-chip.love { background: var(--grad); color: #fff; }
.g-chip.gold { background: linear-gradient(135deg, #ffe08a, #ffae3b); color: #5a3500; }

.g-flower-wrap { position: relative; width: 178px; height: 178px; margin: 0 auto; display: grid; place-items: center; }
.g-aura {
  position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 120, .6), rgba(255, 92, 143, .2) 55%, transparent 70%);
  animation: auraPulse 3s ease-in-out infinite;
}
.g-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(255, 92, 143, .35); animation: spin 40s linear infinite; }
.g-flower {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  display: grid; place-items: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  animation: gFloat 4s ease-in-out infinite;
}
.g-flower .ic { width: 100%; height: 100%; filter: drop-shadow(0 12px 22px rgba(255, 140, 60, .35)); }
.g-flower.press .ic { animation: gPress .22s var(--spring); }
.g-click-info { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--muted); }
.g-click-info b { color: var(--text-2); }
@keyframes gPress { 0% { transform: scale(1); } 35% { transform: scale(.88) rotate(-5deg); } 100% { transform: scale(1); } }
@keyframes gFloat { 50% { transform: translateY(-5px); } }
@keyframes auraPulse { 50% { transform: scale(1.08); opacity: .75; } }

@media (max-height: 740px) {
  .g-flower-wrap { width: 138px; height: 138px; }
  .g-flower { width: 116px; height: 116px; }
  .g-bank b { font-size: 28px; }
}

.g-tabs { display: flex; gap: 6px; flex: none; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-tabs button {
  position: relative; flex: 1 1 auto; padding: 8px 4px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--card-border);
  font-size: 12px; font-weight: 900; color: var(--text-2); white-space: nowrap;
  transition: background .25s, color .25s;
}
.g-tabs button.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(255, 79, 134, .8); }
.g-dot { position: absolute; top: 3px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--card-strong); animation: pop .4s var(--spring); }

.g-panel {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -16px; padding: 2px 16px calc(var(--safe-bottom) + 24px);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.g-panel::-webkit-scrollbar { display: none; }

/* Поле — живая ферма */
.g-field {
  position: relative; overflow: hidden; min-height: 118px;
  padding: 34px 10px 34px; border-radius: 22px;
  background: linear-gradient(180deg, #c9ecff 0%, #e6f6ff 26%, #bfeaa5 27%, #7fcd6e 100%);
  border: 1px solid var(--card-border); box-shadow: var(--shadow);
}
:root[data-theme="dark"] .g-field { background: linear-gradient(180deg, #221d55 0%, #2e2870 26%, #2f6a3d 27%, #1d4a2a 100%); }
.g-field::before {
  content: ''; position: absolute; right: 18px; top: 9px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(#fff6c2, #ffc94d); box-shadow: 0 0 18px #ffd76a;
}
:root[data-theme="dark"] .g-field::before { background: radial-gradient(#fffbe6, #e9dca8); box-shadow: 0 0 16px rgba(255, 246, 200, .6); }
.g-plants { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 0 3px; }
.g-plant { display: inline-block; line-height: 0; transform-origin: 50% 100%; animation: sway 3s ease-in-out infinite; }
.g-plant .ic { width: 30px; height: 30px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .15)); }
.g-field-cap {
  position: absolute; left: 10px; bottom: 8px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .65); color: #24572c; font-size: 12px; font-weight: 900;
}
:root[data-theme="dark"] .g-field-cap { background: rgba(0, 0, 0, .3); color: #d7f5d0; }
.g-field.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px 24px 16px; text-align: center; font-size: 13px; font-weight: 800; color: #2a5a31; }
:root[data-theme="dark"] .g-field.empty { color: #d7f5d0; }

.g-mode { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.g-mode button { padding: 7px 0; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); font-size: 13px; font-weight: 900; color: var(--text-2); }
.g-mode button.active { background: var(--text); color: var(--bg-1); border-color: transparent; }

/* Карточки покупок */
.g-list { display: flex; flex-direction: column; gap: 8px; }
.g-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: .6;
  transition: transform .2s var(--spring), opacity .25s, border-color .25s;
}
.g-item.can { opacity: 1; border-color: rgba(255, 92, 143, .45); }
.g-item:active { transform: scale(.97); }
.g-item.mystery { opacity: .55; }
.g-item.mystery .g-ic .ic { filter: brightness(0) opacity(.3); }
.g-item.shake { animation: shake .3s; }
.g-ic {
  position: relative; width: 50px; height: 50px; flex: none;
  display: grid; place-items: center;
  border-radius: 15px; background: var(--grad-soft); border: 1px solid var(--line);
}
.g-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.g-body b { font-size: 15px; font-weight: 900; }
.g-body small { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-cost { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 900; color: var(--muted); }
.g-cost em { font-style: normal; font-variant-numeric: tabular-nums; }
.g-cost i { font-style: normal; color: var(--text-2); margin-left: 3px; font-size: 12px; }
.g-item.can .g-cost { color: var(--primary); }
.g-own { min-width: 34px; text-align: right; font-size: 26px; font-weight: 900; color: var(--text-2); opacity: .6; font-variant-numeric: tabular-nums; }
.g-price { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 13px; font-weight: 900; color: var(--muted); white-space: nowrap; }
.g-item.can .g-price { color: var(--primary); }
.g-item.seed.owned { opacity: 1; background: var(--grad-soft); }
.g-item.seed.owned .g-price { color: var(--ok); }
.g-tier {
  position: absolute; right: -5px; bottom: -5px; min-width: 19px; height: 19px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 10px; font-weight: 900; font-style: normal;
  box-shadow: 0 0 0 2px var(--card-strong);
}

.g-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 14px 2px 8px;
  font-size: 12px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.g-sub:first-child { margin-top: 4px; }
.g-sub .btn { text-transform: none; letter-spacing: 0; }
.g-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); font-weight: 800; }
.g-owned { display: flex; flex-wrap: wrap; gap: 6px; }
.g-owned span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); }

/* Перерождение и «Вдвоём» */
.g-reb, .g-duo {
  margin-bottom: 10px; padding: 16px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.g-reb { background: linear-gradient(135deg, rgba(241, 194, 122, .28), rgba(176, 140, 255, .2)), var(--card); }
.g-reb-top, .g-duo-head { display: flex; align-items: center; gap: 12px; }
.g-reb-top b, .g-duo-head b { display: block; font-size: 16px; font-weight: 900; }
.g-reb-top small, .g-duo-head small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.g-reb-ic { line-height: 0; animation: bob 2.6s ease-in-out infinite; }
.g-reb-gain { margin: 14px 0 8px; font-weight: 800; color: var(--text-2); }
.g-reb-gain b { font-size: 22px; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-reb-next { display: block; margin: 6px 0 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.g-hint { margin: 10px 2px 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.g-duo .btn { margin-top: 12px; }
.g-duo .g-stats { background: none; border: 0; padding: 8px 0 0; }

.g-vs { margin-top: 12px; }
.g-vs-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 900; }
.g-vs-row span { display: inline-flex; align-items: center; gap: 4px; }
.g-vs-bar { height: 10px; margin-top: 6px; border-radius: 99px; overflow: hidden; }
.g-vs-bar.me-roma { background: linear-gradient(90deg, #ffb3cb, #ff6f9c); }
.g-vs-bar.me-dasha { background: linear-gradient(90deg, #ffd36b, #ffae00); }
.g-vs-bar i { display: block; height: 100%; border-radius: 99px; transition: width .6s var(--ease); }
.g-vs-bar.me-roma i { background: linear-gradient(90deg, #ffe07a, #ffae00); }
.g-vs-bar.me-dasha i { background: linear-gradient(90deg, #ffb3cb, #ff6f9c); }

/* Награды и статистика */
.g-ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.g-medal { aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; background: var(--card); border: 1px solid var(--card-border); }
.g-medal:not(.got) .ic { filter: grayscale(1) opacity(.28); }
.g-medal.got { background: linear-gradient(135deg, rgba(255, 214, 120, .38), rgba(255, 92, 143, .18)); border-color: rgba(255, 184, 77, .5); }
.g-stats { display: flex; flex-direction: column; padding: 4px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-border); }
.g-stat { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--text-2); }
.g-stat:first-child { border-top: 0; }
.g-stat b { color: var(--text); font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }

/* Золотой лепесток */
.g-golden {
  position: fixed; z-index: 40; width: 66px; height: 66px; margin: -33px 0 0 -33px;
  display: grid; place-items: center;
  filter: drop-shadow(0 0 14px rgba(255, 200, 70, .95));
  animation: goldFly 13s ease-in-out forwards;
}
.g-golden .ic { animation: goldWobble 2.6s ease-in-out infinite; }
.g-golden.caught { animation: goldCaught .4s var(--ease) forwards; pointer-events: none; }
@keyframes goldFly {
  0% { opacity: 0; transform: scale(.3); }
  6% { opacity: 1; transform: scale(1); }
  25% { transform: translate(20px, -16px) rotate(10deg); }
  50% { transform: translate(-16px, 12px) rotate(-8deg); }
  75% { transform: translate(14px, 18px) rotate(6deg); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate(0, -34px) scale(.6); }
}
@keyframes goldWobble { 50% { transform: rotate(14deg) scale(1.08); } }
@keyframes goldCaught { to { transform: scale(1.9); opacity: 0; } }

/* Всплывающие «+N» и частицы от клика */
.g-floats { position: fixed; inset: 0; z-index: 45; pointer-events: none; overflow: hidden; }
.g-float {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
  font-size: 20px; font-weight: 900; color: #fff;
  text-shadow: 0 2px 0 #ff4f86, 0 0 10px rgba(255, 79, 134, .6);
  animation: gFloatUp 1s var(--ease) forwards;
}
.g-float.big { font-size: 30px; color: #fff4c2; text-shadow: 0 2px 0 #e08a00, 0 0 14px rgba(255, 180, 0, .8); }
.g-part { position: absolute; line-height: 0; transform: translate(-50%, -50%); animation: gPart .9s var(--ease) forwards; }
@keyframes gFloatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}
@keyframes gPart {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.6); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(30deg); }
}

/* Окно (перерождение, офлайн-доход) */
.g-modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: rgba(30, 10, 40, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s; transition: opacity .3s;
}
.g-modal.hide { opacity: 0; }
.g-modal-card {
  width: min(360px, 100%); padding: 22px; border-radius: 26px; text-align: center;
  background: var(--card-strong); border: 1px solid var(--card-border); box-shadow: var(--shadow-lg);
  animation: pop .4s var(--spring);
}
.g-modal-card h3 { margin: 8px 0 6px; font-size: 21px; font-weight: 900; }
.g-modal-card p { margin: 0 0 8px; color: var(--text-2); font-weight: 600; line-height: 1.4; }
.g-modal-card small { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.g-modal-ic { display: grid; place-items: center; animation: bob 2.4s ease-in-out infinite; }
.g-modal-big { font-size: 36px; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.g-modal-actions .btn { flex: 1; padding: 0 12px; }
