/* Тема взята со страницы «Друзья» и применена ко всем страницам */
:root {
  --bg: #161617;
  --card: #2a2a2c;
  --card-2: #343436;
  --text: #ffffff;
  --muted: #8e8e93;
  --accent: #30d158;
  --accent-ink: #06210f;
  --link: #3e9bff;
  --star: #ffd60a;
  --line: rgba(255, 255, 255, .08);
  --avatar-bg: #48484a;
  --ico-bg: #1f3a29;
  --ico-star-bg: #3d3510;
  --shadow: none;
  --radius: 16px;
  --radius-sm: 12px;
  --gap: 12px;
  --pad: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* Светлая тема: те же роли цветов, другие значения */
:root[data-theme="light"] {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-2: #ececf1;
  --text: #111113;
  --muted: #6e6e73;
  --link: #007aff;
  --line: rgba(0, 0, 0, .08);
  --avatar-bg: #d1d1d6;
  --ico-bg: #d8f3e0;
  --ico-star-bg: #fcefbf;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

.app { display: flex; flex-direction: column; height: 100%; max-width: 520px; margin: 0 auto; }

/* Верхняя панель пользователя */
.topbar { display: flex; align-items: center; gap: 10px; margin: 6px var(--pad) 0;
  padding: 7px 8px 7px 10px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); flex: none;
  background-size: cover; background-position: center; }
.username { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--card-2);
  border-radius: 999px; font-weight: 600; font-size: 14px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--card-2); color: var(--link);
  display: grid; place-items: center; }

/* Страницы */
.pages { flex: 1; overflow-y: auto; padding: var(--pad); }
.page { display: none; flex-direction: column; gap: var(--gap); animation: fade .15s ease; }
.page.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-h1 { margin: 8px 0 0; text-align: center; font-size: 24px; font-weight: 700; }
.page-sub { margin: 0 12px 4px; text-align: center; color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Кнопки */
.btn-primary { width: 100%; padding: 16px; border-radius: var(--radius); background: var(--accent);
  color: var(--accent-ink); font-weight: 700; font-size: 18px; }
.btn-primary:active { filter: brightness(.92); }
.btn-chip { padding: 8px 12px; border-radius: 10px; background: var(--card-2); color: var(--link); font-size: 14px; font-weight: 600; }

/* Карточки */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.ref-card .ref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ref-link { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.stat-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--ico-bg); display: grid; place-items: center; font-size: 16px; }
.stat-ico.star { background: var(--ico-star-bg); }
.stat-num { font-size: 30px; font-weight: 700; }
.stat > .muted { font-size: 14px; }
.stat.sm { display: flex; flex-direction: column; gap: 4px; }
.stat.sm .stat-ico { width: 28px; height: 28px; font-size: 13px; }
.stat-num.s { font-size: 22px; }

/* Главная */
.mascot-ph { width: 160px; height: 160px; display: grid; place-items: center; font-size: 80px;
  background: var(--card); border-radius: var(--radius); }

/* Задания */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.task-title { flex: 1; font-weight: 600; }
.task-reward { color: var(--accent); font-weight: 700; font-size: 14px; }
.task-go { padding: 8px 14px; border-radius: 10px; background: var(--card-2); color: var(--link); font-weight: 600; font-size: 14px; }

.empty { margin: auto; color: var(--muted); padding: 80px 0; }

/* Нижняя навигация */
/* Нижнее меню: одна панель вместо четырёх карточек, ниже на ~20 px */
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin: 0 var(--pad) calc(8px + var(--safe-bottom)); padding: 4px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 4px 5px;
  border-radius: var(--radius-sm); color: var(--muted); }
.tab.active { background: var(--card-2); }
.tab-ico { width: 34px; height: 34px; object-fit: contain; opacity: .55; transform: scale(.9);
  transition: opacity .15s ease, transform .15s ease; }
.tab-label { font-size: 11px; }
.tab.active { color: var(--accent); }
.tab.active .tab-ico { opacity: 1; transform: scale(1.05); }

/* Реклама Telegram на вкладке заданий */
.ads { display: flex; flex-direction: column; gap: 12px; }
.ads-top { display: flex; align-items: center; gap: 12px; }
.ads-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--ico-bg); color: var(--accent);
  display: grid; place-items: center; flex: none; }
.ads-text { flex: 1; min-width: 0; }
.ads-title { font-weight: 700; font-size: 16px; }
.ads-count { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ads-count .muted { font-weight: 600; }
.bar { height: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s ease; }
.ads-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Создание задания */
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.balance-card { display: flex; flex-direction: column; gap: 8px; }
.gram-val { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gram-unit { font-size: 16px; font-weight: 600; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.field .seg { align-self: flex-start; }
.field-label { font-size: 13px; color: var(--muted); }
.form input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); font: inherit; outline: none; }
.form input:focus { border-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.select-wrap { position: relative; display: block; }
.select-wrap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.form select { width: 100%; appearance: none; -webkit-appearance: none; padding: 12px 40px 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; outline: none; cursor: pointer; }
.form select:focus { border-color: var(--accent); }
.form select option { background: var(--card); color: var(--text); }
.req { padding: 10px 12px; border-radius: 10px; border-left: 3px solid var(--accent); background: var(--card-2);
  color: var(--muted); font-size: 13px; line-height: 1.4; }
.field-error { color: #ff453a; font-size: 13px; }
.field-error:empty { display: none; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.mode { text-align: left; padding: 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  border: 2px solid transparent; display: flex; flex-direction: column; gap: 4px; }
.mode-title { font-weight: 700; }
.mode-desc { color: var(--muted); font-size: 13px; line-height: 1.35; }
.mode[aria-checked="true"] { border-color: var(--accent); background: var(--ico-bg); }
.mode:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Круги рефералов на вкладке «Друзья» */
.levels { display: flex; flex-direction: column; }
.levels-head { padding-bottom: 6px; }
.level { display: grid; grid-template-columns: 36px 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.level-num { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--ico-bg); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; }
.level-name { font-weight: 700; }
.level-desc { grid-column: 2; color: var(--muted); font-size: 13px; }
.level-pct { grid-row: span 2; grid-column: 3; font-size: 22px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.level-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.level-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.levels .example { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--card-2); line-height: 1.4; }
.calc .row { padding: 10px 0; }
.calc .row:first-child { border-top: 0; padding-top: 0; }
.calc .row:last-child { padding-bottom: 0; }
.calc .total dt { color: var(--text); font-weight: 600; }
.calc .total dd { color: var(--accent); font-size: 20px; font-weight: 800; }
/* Неактивная кнопка — серая, чтобы её не путали с активной */
.btn-primary[disabled] { background: var(--card-2); color: var(--muted); cursor: default; }
.hint { text-align: center; min-height: 1.35em; }

/* Список заданий и экран выполнения */
.task { width: 100%; text-align: left; }
.task-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--ico-bg); display: grid; place-items: center; font-size: 20px; flex: none; }
.task-main { flex: 1; min-width: 0; }
.task-main > span { display: block; }
.task-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-chev { color: var(--muted); font-size: 22px; line-height: 1; }
.task-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 20px 14px; }
.task-big-ico { width: 72px; height: 72px; border-radius: 22px; background: var(--ico-bg); display: grid; place-items: center; font-size: 36px; }
.task-hero-title { font-size: 20px; font-weight: 800; margin-top: 6px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.pill { padding: 5px 12px; border-radius: 999px; background: var(--card-2); font-size: 13px; font-weight: 600; }
.pill.green { background: var(--ico-bg); color: var(--accent); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li::marker { color: var(--accent); font-weight: 800; }
.btn-primary.ghost { background: var(--card-2); color: var(--link); }
.balance { color: var(--text); }
.wbar { margin: 10px 0 8px; }

/* Игра: колесо удачи */
.wheel-card { display: flex; flex-direction: column; gap: 14px; align-items: stretch; padding: 18px 14px; }
.wheel-stage { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 6px auto 4px; }
.wheel { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 6px var(--card-2), 0 6px 18px rgba(0, 0, 0, .25); will-change: transform; }
.wheel svg { width: 100%; height: 100%; display: block; }
.seg { stroke: var(--card); stroke-width: 2; }
.seg.a { fill: var(--ico-bg); }
.seg.b { fill: var(--card-2); }
.seg.big { fill: var(--ico-star-bg); }
.seg-label { fill: var(--text); font: 800 20px -apple-system, "Segoe UI", Roboto, sans-serif; text-anchor: middle; dominant-baseline: middle; }
.coin-i { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.22em; }
.gem { width: 20px; height: 20px; display: block; }
.wheel-pointer { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); z-index: 2; width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 26px solid var(--accent);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%); z-index: 1;
  border-radius: 50%; background: var(--card); border: 4px solid var(--accent); display: grid; place-items: center; font-size: 24px; }
.wheel-status { text-align: center; min-height: 1.35em; font-variant-numeric: tabular-nums; }
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prize { background: var(--card-2); border-radius: 10px; padding: 8px 4px; text-align: center; }
.prize b { display: block; font-size: 15px; }
.prize b { white-space: nowrap; font-size: 14px; }
/* Шанс приза: полоска, цвет от зелёного (часто) до красного (редко) */
.chance { display: block; height: 6px; margin: 6px 6px 2px; border-radius: 3px; background: var(--line); overflow: hidden; }
.chance i { display: block; height: 100%; border-radius: 3px; background: hsl(var(--h) 75% 48%); }
.chance-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chance-legend i { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, hsl(120 75% 48%), hsl(60 75% 48%), hsl(0 75% 48%)); }
[dir="rtl"] .chance-legend i { background: linear-gradient(270deg, hsl(120 75% 48%), hsl(60 75% 48%), hsl(0 75% 48%)); }
.prize.big b { color: var(--star); }

.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .55); }
.overlay[hidden] { display: none; }
.result-card { width: min(320px, 100%); background: var(--card); border-radius: 22px; padding: 22px 18px; text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center; animation: pop .3s ease; }
.result-cat { width: 120px; height: 120px; object-fit: contain; }
.result-prize { font-size: 40px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* Короткое сообщение внизу экрана */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 8px);
  width: max-content; max-width: min(420px, calc(100% - 32px)); padding: 10px 16px; border-radius: 12px; background: var(--card-2);
  color: var(--text); font-size: 14px; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Настройки */
.settings-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.settings-head .page-h1 { margin: 0; }
.settings-head .btn-chip { justify-self: start; }
.section-label { margin: 10px 4px -4px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.avatar.lg { width: 56px; height: 56px; font-size: 22px; font-weight: 700; color: var(--muted); display: grid; place-items: center; }
.acct-top { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; }
.acct-name { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows { margin: 0; }
.rows .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.rows dt { color: var(--muted); font-size: 15px; }
.rows dd { margin: 0; font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list { padding: 4px 14px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; text-align: left; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt-label { flex: 1; font-size: 16px; }
.flag { width: 36px; height: 26px; border-radius: 7px; background: var(--card-2); color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.opt[aria-checked="true"] .flag { background: var(--ico-bg); color: var(--accent); }
.check { color: var(--accent); font-weight: 800; opacity: 0; }
.opt[aria-checked="true"] .check { opacity: 1; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--card-2); border-radius: 10px; }
.seg button { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: var(--card-2); transition: background .2s ease; }
.slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s ease; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider, .seg button:focus-visible, .opt:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Общие мелочи */
.card-title { font-weight: 700; font-size: 16px; }
.btn-primary.sm { padding: 13px; font-size: 16px; }
.timer { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.pill.gold { background: var(--ico-star-bg); color: var(--star); }
.pill.x2 { padding: 2px 7px; font-size: 11px; font-weight: 800; flex: none; }
.btn-chip.back::before { content: "‹ "; }
.tg-back .btn-chip.back { visibility: hidden; }

/* Главная: награда за вход, рядом кот-жонглёр (монета летает над карточкой) */
.home-hero { display: flex; align-items: flex-end; gap: 4px; padding: 0 14px 14px 4px; margin-top: 56px; }
.home-cat { width: min(160px, 44%); aspect-ratio: 1; flex: none; margin-top: -56px; display: grid; place-items: center; }
.home-cat > img { width: 100%; height: auto; }
.home-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 0 4px; }
.first-up::first-letter { text-transform: uppercase; }
.daily-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.daily-dots i { height: 8px; border-radius: 4px; background: var(--card-2); }
.daily-dots i.done { background: var(--accent); }
.daily-dots i.today { background: var(--accent); opacity: .45; }
.daily-dots i.big { background: var(--star); opacity: .55; }
.home-side .btn-primary { padding: 12px 8px; font-size: 15px; }

/* Главная: плитки задания дня и колеса */
.tile { display: flex; flex-direction: column; gap: 8px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tile-top .pill { white-space: nowrap; font-size: 12px; padding: 4px 9px; }
.tile-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--ico-bg); display: grid; place-items: center; font-size: 20px; flex: none; }
.tile-ico img { width: 34px; height: 34px; object-fit: contain; }
.tile-title { font-weight: 700; font-size: 15px; }
.tile-reward b { color: var(--accent); font-size: 16px; }
.tile .btn-primary { padding: 10px 6px; font-size: 15px; border-radius: 12px; margin-top: auto; }

/* Главная: статистика списком */
.stats-list { display: flex; flex-direction: column; }
.stats-list .card-title { margin-bottom: 4px; }
.stats-list .li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stats-list .card-title + .li { border-top: 0; }
.stats-list .li span { color: var(--muted); }
.stats-list .li b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Объёмная монета (coin-art.js): у кота-жонглёра */
.coin3d { position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; }
.coin3d > * { position: absolute; inset: 0; }
.coin3d svg { width: 100%; height: 100%; display: block; }
.coin3d .front { transform: translateZ(calc(var(--d) / 2)); backface-visibility: hidden; }
.coin3d .back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); backface-visibility: hidden; }
.home-cat .stage { perspective: 500px; }

/* Игра: переключатель и билеты */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-seg { flex: 1; }
.game-seg button { flex: 1; }
.game-seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tickets { font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-view { display: flex; flex-direction: column; gap: var(--gap); }
.game-view[hidden] { display: none; }

/* Игра: рыбалка */
.fish-card { display: flex; flex-direction: column; gap: 12px; }
.pond { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; cursor: crosshair;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pond-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Дневная сцена: светлое небо, яркая вода; одинаково в обеих темах */
.sky-a { stop-color: #8ec9f2; } .sky-b { stop-color: #d9effc; }
.water-a { stop-color: #4fa9db; } .water-b { stop-color: #2479b2; }
.sun { fill: #ffe27a; }
.cloud { fill: rgba(255, 255, 255, .85); }
.wave { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 2; stroke-linecap: round; }
.shore { fill: #63a64a; stroke: #7cc25d; stroke-width: 3; }
.line { fill: none; stroke: rgba(40, 44, 56, .7); stroke-width: 1.1; }
/* Удочка */
.pond-front { pointer-events: none; }
.rod-blank { fill: none; stroke: #3a2f28; stroke-width: 2.2; stroke-linecap: round; }
.rod-blank.base { stroke-width: 3.4; }
.rod-guides circle { fill: none; stroke: #c9ccd6; stroke-width: .9; }
.rod-tip { stroke: #ff453a; stroke-width: 2; stroke-linecap: round; }
.rod-seat { stroke: #8d939e; stroke-width: 2.4; stroke-linecap: round; }
.reel { fill: #b9bec8; stroke: #6e7480; stroke-width: 1.2; }
.reel-hub { fill: #6e7480; }
.reel-arm { stroke: #6e7480; stroke-width: 1.4; stroke-linecap: round; }
.reel-knob { fill: #3a2f28; }
.rod-grip { stroke: #c99358; stroke-width: 6.5; stroke-linecap: round; }
.rod-butt { stroke: #3a2f28; stroke-width: 7; stroke-linecap: round; }
.rod-paw { fill: #eceaf3; stroke: #5d5368; stroke-width: 1.3; }
.rod-toes { fill: none; stroke: #5d5368; stroke-width: 1; stroke-linecap: round; }
.bob-a { fill: #fff; } .bob-b { fill: #ff453a; }
.ripple { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }
.fisher { position: absolute; left: 0; bottom: 3%; width: 31%; aspect-ratio: 1; pointer-events: none; }
.fisher > img { width: 100%; display: block; }
/* живой кот: холст 768 совпадает с картинкой cat.png при сдвиге 0,4% и размере 99% */
.fisher > .rig { position: absolute; left: .4%; top: .4%; width: 99%; height: 99%; }
.catch-fly { position: absolute; width: 46px; height: 46px; line-height: 1; transform: translate(-50%, -50%); pointer-events: none; display: none; }
.bite { position: absolute; transform: translate(-50%, -150%); width: 26px; height: 26px; border-radius: 50%; background: var(--star);
  color: #3a2d00; font-weight: 900; display: none; place-items: center; pointer-events: none; }
.glow { filter: drop-shadow(0 0 6px rgba(255, 214, 10, .8)); }
.catch-fly svg, .catch .ico svg { width: 100%; height: 100%; display: block; }
.catch-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.catch { background: var(--card-2); border-radius: 10px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.catch .ico { width: 36px; height: 36px; }
.catch b { font-size: 13px; }
.catch span { font-size: 11px; color: var(--muted); }
.r-fail { color: var(--muted); } .r-common { color: var(--text); } .r-uncommon { color: #30d158; }
.r-rare { color: #3e9bff; } .r-epic { color: #bf5af2; } .r-legendary { color: var(--star); }

/* Игра: розыгрыш недели */
.big-num { font-size: 34px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.big-num.sm { font-size: 26px; color: var(--text); }
.rf-pool-card, .rf-me { display: flex; flex-direction: column; gap: 6px; }
.rf-me .btn-primary { margin-top: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td, .table th { padding: 8px 4px; border-top: 1px solid var(--line); text-align: start; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; border-top: 0; }
.table td:last-child, .table th:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.table tr.me td { color: var(--accent); font-weight: 800; }
.demo-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px;
  background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }

/* Окно результата (колесо, рыбалка) */
.result-media { min-height: 80px; display: grid; place-items: center; }
.result-media .fish-art { width: 110px; height: 110px; display: block; }
.result-media img { width: 120px; height: 120px; object-fit: contain; }
.result-name { font-weight: 800; font-size: 18px; }
.result-name:empty { display: none; }

/* Письмо справа налево: арабский, персидский. Стрелки ‹ › браузер зеркалит сам. */
[dir="rtl"] .task, [dir="rtl"] .opt, [dir="rtl"] .mode { text-align: right; }
[dir="rtl"] .rows dd { text-align: left; }
[dir="rtl"] .req { border-left: 0; border-right: 3px solid var(--accent); }
[dir="rtl"] .select-wrap::after { right: auto; left: 16px; }
[dir="rtl"] .form select { padding: 12px 14px 12px 40px; }
[dir="rtl"] .steps { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .slider::after { left: auto; right: 2px; }
[dir="rtl"] .switch input:checked + .slider::after { transform: translateX(-20px); }
[dir="rtl"] .task-reward, [dir="rtl"] #dtask-new, [dir="rtl"] #dtask-old, [dir="rtl"] .stats-list .li b,
[dir="rtl"] #tk-reward, [dir="rtl"] .result-prize, [dir="rtl"] .prize b, [dir="rtl"] .big-num,
[dir="rtl"] .balance, [dir="rtl"] .tickets { direction: ltr; unicode-bidi: isolate; }

/* Значки (icons.js): линейные, цвета текста */
.i { width: 22px; height: 22px; display: block; }
.task-ico, .tile-ico, .stat-ico, .task-big-ico { color: var(--accent); }
.stat-ico.star { color: var(--star); }
.stat-ico .i { width: 18px; height: 18px; }
.task-big-ico .i { width: 38px; height: 38px; }
.wheel-hub svg { width: 30px; height: 30px; display: block; color: var(--accent); }
.ticket-i { width: 1.3em; height: 1.3em; vertical-align: -0.3em; }

/* Задания: карточка для заказчиков внизу */
.promo { display: flex; align-items: center; gap: 12px; }
.promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.promo-text b { font-size: 15px; }

/* Кошелёк: цель и история */
.wgoal { display: flex; flex-direction: column; gap: 8px; }
.wgoal .wbar { margin: 2px 0; }
.goal { color: var(--accent); font-weight: 600; }
.goal:empty { display: none; }
.history { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 6px; }
.hist { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.hist:first-child { border-top: 0; }
.hist-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--ico-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.hist-ico .i { width: 19px; height: 19px; }
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hist-main b { font-size: 14px; }
.hist-n { font-weight: 700; color: var(--accent); white-space: nowrap; }
.hist-n.out { color: var(--text); }
.empty { text-align: center; padding: 14px 6px; }
[dir="rtl"] .hist-n { direction: ltr; unicode-bidi: isolate; }

/* Друзья */
.fr-hero { display: flex; flex-direction: column; gap: 12px; }
.fr-hero .page-h1 { margin-top: 2px; }
.fr-hero .page-sub { margin: 0; }
.fr-hero .ref-row { background: var(--card-2); border-radius: 12px; padding: 6px 6px 6px 14px; }
.fr-hero .icon-btn { background: var(--card); flex: none; }
.fr-hero .icon-btn .i { width: 19px; height: 19px; }
.levels { display: flex; flex-direction: column; gap: 10px; }
.lv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lv { background: var(--card-2); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.lv b { font-size: 20px; color: var(--accent); }
.lv span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.lv.main { background: var(--ico-bg); }
.how summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 14px; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: " ›"; display: inline-block; transition: transform .15s; }
.how[open] summary::after { transform: rotate(90deg); }
.how p, .how ul { margin: 8px 0 0; }
.how ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.how li b { color: var(--text); font-weight: 600; }
[dir="rtl"] .how ul { padding-left: 0; padding-right: 18px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--card-2); color: var(--muted); display: grid; place-items: center; }

/* Настройки: строка языка */
.lang-row .chev { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s; }
.lang-row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.lang-row .flag { background: var(--ico-bg); color: var(--accent); }
#lang-list { border-top: 1px solid var(--line); }
.fr-hero .ref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; }
.fr-hero .ref-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn:focus:not(:focus-visible), .btn-chip:focus:not(:focus-visible) { outline: none; }

/* Прогресс до билета: 10 делений, каждое — одно задание */
.tprog { display: flex; align-items: center; gap: 12px; padding: 10px 14px; width: 100%; text-align: start; }
button.tprog { cursor: pointer; }
.tprog-ico { width: 34px; height: 34px; flex: none; }
.tprog-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tprog-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.tprog-top b { font-variant-numeric: tabular-nums; color: #ffb53d; white-space: nowrap; }
.tprog-bar { display: grid; gap: 3px; }
.tprog-bar i { height: 6px; border-radius: 3px; background: var(--card-2); }
.tprog-bar i.on { background: #ffb53d; }
[dir="rtl"] .tprog-top b { direction: ltr; unicode-bidi: isolate; }
.catch .chance { align-self: stretch; margin: 4px 8px 0; }

/* Задания: выполнено или ждёт повтора */
.task.is-done { opacity: .6; }
.task-state { color: var(--accent); display: grid; place-items: center; white-space: nowrap; }
.task-state .i { width: 20px; height: 20px; }
/* Список друзей */
.friend { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.friend:first-child { border-top: 0; }
.friend-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--ico-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.friend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* Мои задания */
.mytask { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mytask:first-child { border-top: 0; }
.mytask-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mytask .bar { margin: 2px 0; }
/* Заявки на вывод */
.wd-status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--card-2); color: var(--muted); }
.wd-status.paid { background: var(--ico-bg); color: var(--accent); }
.wd-status.rejected { color: #ff6b6b; }
/* Админка */
.adm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.adm-stat { background: var(--card); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.adm-stat b { font-size: 18px; }
.adm-stat span { font-size: 12px; color: var(--muted); }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.adm-row:first-child { border-top: 0; }
.adm-main { flex: 1; min-width: 0; line-height: 1.45; }
.adm-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.adm-addr { font-size: 12px; word-break: break-all; color: var(--text); }
.adm-gram { width: 84px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; font-size: 13px; }
.adm-search { display: flex; gap: 8px; margin-bottom: 6px; }
.adm-search input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; }
.btn-chip.danger { color: #ff6b6b; }
