/* =====================================================================
   Главный экран: шапка, вкладки, нижнее меню, шторка
   ===================================================================== */
.screen.shell { justify-content: flex-start; align-items: stretch; padding: 0; }
.shell > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
input, textarea { user-select: text; -webkit-user-select: text; }
/* Подсказки появляются над нижним меню */
.toast { bottom: max(92px, calc(env(safe-area-inset-bottom) + 80px)); }

/* Иконки валют */
.ico-coin, .ico-gem { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ico-coin {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #f2c66a 40%, #c48a2c 85%);
  box-shadow: inset 0 0 0 2px rgba(150, 100, 20, .55), 0 1px 0 #8e6420;
}
.ico-gem {
  background: linear-gradient(160deg, #f1fbff 0%, #8fd3f7 35%, #3d8fd6 75%, #2a5fa8 100%);
  clip-path: polygon(22% 8%, 78% 8%, 100% 38%, 50% 96%, 0 38%);
}
.amt { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; white-space: nowrap; }
.fly-coin { position: fixed; z-index: 60; margin: -9px 0 0 -9px; pointer-events: none; }

.appbar {
  display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px 10px;
}
.me-btn { position: relative; flex: none; }
.me-btn .avatar { width: 48px; height: 48px; }
.lvl-star {
  position: absolute; right: -8px; bottom: -6px;
  min-width: 24px; height: 24px; padding: 0 4px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #1b1406;
  background: linear-gradient(180deg, #f6d48a, #d9a03c);
  clip-path: polygon(50% 0, 62% 32%, 98% 36%, 70% 58%, 80% 96%, 50% 76%, 20% 96%, 30% 58%, 2% 36%, 38% 32%);
}
.me-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-meta b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.me-meta { text-align: left; align-items: flex-start; }
.me-btn:active, button.me-meta:active { transform: scale(.97); }

/* ---------- Профиль ---------- */
.pf-card { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.pf-photo { position: relative; flex: none; }
.pf-photo .avatar.xl { width: 92px; height: 92px; font-size: 34px; }
.pf-photo .lvl-star { right: -10px; bottom: -8px; min-width: 30px; height: 30px; font-size: 12px; }
.pf-pencil {
  position: absolute; top: -6px; right: -8px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: #1b1406;
  background: linear-gradient(180deg, #f2c66a, #d9a03c); box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(185, 138, 46, .45);
  transition: transform .15s;
}
.pf-pencil svg { width: 16px; height: 16px; stroke-width: 2.2; }
.pf-pencil:active { transform: scale(.9); }
.pf-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pf-info b { font-size: 19px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-info b .online { margin: 0; width: 10px; height: 10px; flex: none; }
.pf-info small { color: var(--muted); font-weight: 700; font-size: 13px; }
.pf-club { display: flex; align-items: center; gap: 6px; }
.pf-club svg { width: 16px; height: 16px; color: var(--gold); }
.pf-stats { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.pf-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; font-size: 15px; }
.pf-row:nth-child(odd) { background: #f6f8fb; }
.pf-row span { font-weight: 700; color: #4a4d56; }
.pf-row b { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold); }
.rrow[data-sa] { cursor: pointer; transition: transform .15s; }
.rrow[data-sa]:active { transform: scale(.98); }

/* ---------- Выбор аватара ---------- */
.pick-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 18px; background: #f6f8fb; border: 1px solid var(--line); }
.pick-preview small { font-weight: 800; color: var(--muted); }
.av-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.av-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px;
  border-radius: 16px; background: #fff; border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .2s, transform .15s;
}
.av-card .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.av-card span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.av-card.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 179, 79, .25), var(--shadow); }
.av-card.on span { color: var(--gold); }
.av-card:active { transform: scale(.95); }
.me-meta small { color: var(--muted); font-size: 12px; }
.me-meta small span { color: var(--gold); font-weight: 800; }
.wallet { display: flex; flex-direction: column; gap: 6px; }
.purse {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; min-width: 112px;
  border-radius: 99px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.purse b { flex: 1; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.purse .plus {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #f2c66a, #d9a03c); color: #1b1406; font-weight: 800; line-height: 1;
}

/* Аватары-заготовки */
.avatar.av { background: #fff; overflow: hidden; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(230, 179, 79, .8), 0 4px 12px rgba(30, 45, 90, .18); }
.avatar.av svg { width: 100%; height: 100%; stroke: none; display: block; }
.avatar.av img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.avatar.xl { width: 72px; height: 72px; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }

.tabs { flex: 1; position: relative; min-height: 0; }
.tab-panel {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 16px 24px; display: none;
  scrollbar-width: thin; scrollbar-color: rgba(20, 30, 60, .15) transparent;
}
.tab-panel.active { display: block; }
.panel-title { font-family: var(--font-display); font-size: 22px; margin: 6px 0 14px; }

.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px max(8px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(30, 45, 90, .06);
}
.tabbar button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 4px; font-size: 11px; font-weight: 700; color: var(--muted);
  transition: color .2s;
}
.tabbar button svg { width: 24px; height: 24px; transition: transform .25s var(--ease); }
.tabbar button.on { color: var(--gold); }
.tabbar button.on svg { transform: translateY(-2px) scale(1.1); }
.tabbar button.on::before {
  content: ""; position: absolute; top: -7px; left: 50%; width: 30px; height: 3px; margin-left: -15px;
  border-radius: 0 0 3px 3px; background: var(--gold); box-shadow: 0 0 12px rgba(230, 179, 79, .7);
}
.tabbar .dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; display: none; }
.tabbar .has-dot .dot { display: block; }

/* ---------- Главная ---------- */
#tab-home.active { display: flex; flex-direction: column; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 12px;
  border-radius: 18px; background: var(--surface); border: 1px solid rgba(230, 179, 79, .3); box-shadow: var(--shadow);
  transition: transform .18s var(--ease), border-color .2s;
}
.tile:hover { border-color: rgba(230, 179, 79, .5); }
.tile:active { transform: scale(.96); }
.tile svg { width: 34px; height: 34px; color: var(--gold); stroke-width: 1.6; filter: drop-shadow(0 4px 10px rgba(230, 179, 79, .35)); }
.tile b { font-size: 13px; }
.tile small { font-size: 11px; color: var(--muted); font-weight: 700; }
#tab-home .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; margin: 18px 0; }
#tab-home .logo-mark { transform: scale(.85); margin-bottom: 8px; }
.play { display: flex; flex-direction: column; gap: 12px; }
.play-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.play .btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.play .btn small { font-size: 11px; font-weight: 700; opacity: .7; }
.play .btn b { white-space: nowrap; }
.play-row .btn { padding: 0 10px; gap: 8px; font-size: 15px; }
.btn-big { min-height: 68px; font-size: 18px; }
.btn-big svg { width: 28px; height: 28px; }

/* ---------- Карточки, задания ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.quest, .daily, .club-row, .create-club, .my-place { display: flex; align-items: center; gap: 12px; }
.q-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.q-text b { font-size: 14px; line-height: 1.3; }
.q-text small { color: var(--muted); font-size: 12px; font-weight: 600; }
.bar { height: 8px; border-radius: 8px; background: #e8ecf2; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d9a03c, #f2c66a); transition: width .6s var(--ease); }
.q-reward { padding: 8px 12px; border-radius: 12px; background: #f2f4f8; display: flex; gap: 8px; }
.q-reward-inline { display: flex; gap: 8px; }
.q-done { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.q-done svg { width: 16px; height: 16px; color: #1f9d57; }
.quest.ready, .daily.ready { border-color: rgba(230, 179, 79, .55); background: rgba(230, 179, 79, .07); }
.quest.claimed { opacity: .5; }
.daily-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(230, 179, 79, .15); flex: none; }
.daily-ico svg { width: 28px; height: 28px; color: var(--gold); }
.daily.ready .daily-ico { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-5deg); } }

/* ---------- Клубы ---------- */
.emblem { width: 48px; height: 52px; flex: none; filter: drop-shadow(0 3px 6px rgba(30, 45, 90, .25)); }
.emblem svg { width: 100%; height: 100%; display: block; stroke: none; fill: none; }
.emblem.big { width: 62px; height: 68px; }
.emblem.huge { width: 92px; height: 100px; }
.emblem-add {
  width: 48px; height: 52px; flex: none; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: var(--gold);
  background: rgba(230, 179, 79, .18); clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%);
}
.create-club { width: 100%; text-align: left; border-color: rgba(230, 179, 79, .35); }
.search { position: relative; margin: 6px 0 12px; }
.search svg { position: absolute; left: 12px; top: 50%; margin-top: -10px; width: 20px; height: 20px; color: var(--muted); }
.search .input { padding-left: 40px; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; font: inherit; font-weight: 600; color: var(--text);
  background: #f2f4f8; border: 1px solid var(--line); outline: none; transition: border-color .2s;
}
.input:focus { border-color: rgba(230, 179, 79, .6); }
.club-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.club-head h2 { margin: 0; font-size: 20px; }
.club-head small { color: var(--muted); font-weight: 600; }
.segmented.wide { display: flex; margin-bottom: 12px; }
.segmented.wide button { flex: 1; }
.segmented.small button { padding: 7px 10px; font-size: 13px; }

.chat { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; }
.msg.me { align-self: flex-end; }
.msg.system { align-self: center; max-width: 100%; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #e9edf3; }
.bubble { padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.msg.me .bubble { border-radius: 16px 16px 4px 16px; background: linear-gradient(180deg, #f2c66a, #d9a03c); color: #1b1406; }
.bubble b { font-size: 12px; color: var(--gold); }
.bubble span { font-size: 14px; font-weight: 600; word-break: break-word; }
.bubble time { font-size: 10px; opacity: .55; align-self: flex-end; }
.chat-input { position: sticky; bottom: -24px; display: flex; gap: 8px; padding: 10px 0 14px; background: linear-gradient(180deg, transparent, var(--bg-bottom) 30%); }
.chat-input .btn { min-height: 46px; padding: 0 14px; }
.online { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #22b363; vertical-align: middle; }
.danger { color: var(--danger); margin-top: 6px; width: 100%; }

/* ---------- Рейтинг ---------- */
.my-place { border-color: rgba(230, 179, 79, .5); background: rgba(230, 179, 79, .08); }
.my-place .q-text b { font-size: 24px; color: var(--gold); }
.my-score { text-align: right; display: flex; flex-direction: column; }
.my-score b { font-size: 18px; }
.my-score small { color: var(--muted); font-size: 11px; font-weight: 700; }
.sub-h { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.rank-list, .member-list { display: flex; flex-direction: column; gap: 6px; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.rrow .avatar { width: 36px; height: 36px; font-size: 14px; }
.rrow .place { width: 28px; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.rrow .score { font-variant-numeric: tabular-nums; }
.rrow.me { background: rgba(230, 179, 79, .14); box-shadow: inset 0 0 0 1px rgba(230, 179, 79, .5); }
.rrow.top1 .place, .rrow.top2 .place, .rrow.top3 .place {
  height: 28px; border-radius: 50%; display: grid; place-items: center; color: #1b1406;
}
.rrow.top1 .place { background: linear-gradient(180deg, #ffe39a, #d9a03c); }
.rrow.top2 .place { background: linear-gradient(180deg, #f1f1f1, #a9adb5); }
.rrow.top3 .place { background: linear-gradient(180deg, #f0b98a, #a8642f); }

/* ---------- Настройки ---------- */
.set h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.set .btn { width: 100%; }
.set .btn + .btn { margin-top: 8px; }
.small { font-size: 13px; }
.set p.small { margin: 0 0 10px; }
.name-row { display: flex; gap: 8px; margin-bottom: 8px; }
.name-row .btn { width: auto; flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--muted); font-weight: 600; }
.kv b { text-align: right; }
.set .kv { margin-bottom: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-weight: 700; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 99px; background: linear-gradient(180deg, #f2c66a, #d9a03c); transition: background .25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 25px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); transition: left .25s var(--ease); }
.switch.off { background: #d9dee6; }
.switch.off::after { left: 3px; }
.yandex { gap: 12px; }
.ya { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fc3f1d; color: #fff; font-weight: 800; font-size: 15px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.av-pick { border-radius: 50%; padding: 3px; transition: transform .15s; }
.av-pick .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.av-pick.on { box-shadow: 0 0 0 2px var(--gold); }
.av-pick:active { transform: scale(.92); }
.version-line { text-align: center; color: rgba(155, 151, 142, .55); font-size: 12px; margin: 12px 0 0; }
.center { text-align: center; }

/* ---------- Нижняя шторка ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 26; display: flex; align-items: flex-end; justify-content: center; /* выше экрана итогов партии (25): предложение новой партии, вызов друга */
  background: rgba(20, 25, 40, .35); opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sheet.show { opacity: 1; pointer-events: auto; }
.sheet-card {
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 8px 18px max(20px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--surface-strong); border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -10px 40px rgba(20, 30, 60, .15);
  transform: translateY(100%); transition: transform .4s var(--ease);
}
.sheet.show .sheet-card { transform: none; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: rgba(20, 30, 60, .15); margin: 4px auto 12px; }
.sheet-title { font-family: var(--font-display); font-size: 20px; margin: 0 0 14px; text-align: center; }
.sheet-body { display: flex; flex-direction: column; gap: 10px; }
.sheet-body .btn[disabled] { opacity: .55; cursor: default; }
.sheet-hero { display: grid; place-items: center; height: 90px; }
.sheet-hero svg { width: 64px; height: 64px; color: var(--gold); stroke-width: 1.4; filter: drop-shadow(0 8px 20px rgba(230, 179, 79, .45)); }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.perks svg { width: 20px; height: 20px; color: var(--gold); }
.pack { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; padding: 12px; border-radius: 16px; background: #f2f4f8; font-size: 18px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.shop-item .btn { min-height: 34px; width: 100%; font-size: 13px; }
.invite { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 16px; background: #f2f4f8; }
.invite small { color: var(--muted); font-weight: 700; }
.invite b { font-family: var(--font-display); font-size: 28px; letter-spacing: .12em; color: var(--gold); }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 14px; }
.field > span { color: var(--muted); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(160deg, hsl(var(--h) 55% 58%), hsl(var(--h) 55% 28%)); }
.swatch.on { box-shadow: 0 0 0 3px var(--surface-strong), 0 0 0 5px var(--gold); }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head > div:last-child { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.profile-head b { font-size: 18px; }
.profile-head small { color: var(--muted); font-weight: 600; }

/* Юридические документы */
.sheet.doc .sheet-card { max-height: 94vh; }
.sheet.doc .sheet-title { font-size: 17px; }
.doc-date { margin: -6px 0 4px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.doc-body { font-size: 14px; line-height: 1.6; color: #3b3e46; user-select: text; -webkit-user-select: text; }
.doc-body h4 { margin: 18px 0 6px; font-size: 15px; color: var(--text); }
.doc-body p { margin: 0 0 10px; }
.doc-body ul { margin: 0 0 10px; padding-left: 20px; }
.doc-body li { margin-bottom: 4px; }
.doc-body h5 { margin: 12px 0 4px; font-size: 14px; color: var(--text); }
.doc-body b { color: var(--text); }
.doc-body .doc-h1 { margin-top: 4px; text-align: center; color: var(--gold); letter-spacing: .02em; }
.doc-body mark { background: rgba(255, 107, 74, .14); color: #c2412b; padding: 0 3px; border-radius: 4px; }

/* Первый запуск: принятие соглашения */
.consent {
  position: fixed; inset: 0; z-index: 21; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(130% 90% at 50% 0%, var(--bg-top), var(--bg-bottom) 70%);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.consent.show { opacity: 1; pointer-events: auto; }
.need-auth .consent.auth { opacity: 1; pointer-events: auto; transition: none; } /* не вошли — вход сразу, без проявления */
#consent.show { z-index: 22; } /* соглашение — поверх входа: сначала принять, потом войти */
.consent-card { width: min(400px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.consent-card .logo-mark { transform: scale(.75); margin: 0 auto -6px; }
.consent-card h2 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.consent-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.consent-links { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.consent-links .btn { justify-content: space-between; min-height: 50px; font-size: 15px; }
.consent-links .btn svg { width: 18px; height: 18px; color: var(--muted); }
.consent-note { display: flex; gap: 10px; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.45; }
.consent-note svg { width: 20px; height: 20px; flex: none; color: var(--gold); }
.consent-legal { font-size: 12px !important; }

/* ---------- Друзья ---------- */
#tab-friends.active { display: flex; flex-direction: column; padding-bottom: 0; }
#fr-body { flex: 1; }
.fr-top { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.fr-top .segmented { flex: 1; margin: 0; }
.fr-top .icon-btn { flex: none; box-shadow: var(--shadow); }
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.fr-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 8px 10px; min-width: 0;
  border-radius: 18px; background: #fff; border: 1px solid rgba(230, 179, 79, .3); box-shadow: var(--shadow);
}
.fr-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.fr-head small { font-size: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.fr-head small.on { color: #1f9d57; }
.fr-head .online { margin: 0; width: 7px; height: 7px; }
.fr-x { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #b4b8c2; }
.fr-x:hover { background: #f2f4f8; color: var(--danger); }
.fr-x svg { width: 14px; height: 14px; stroke-width: 2.4; }
.fr-ava { position: relative; margin: 4px 0 2px; }
.fr-ava .avatar { width: 64px; height: 64px; font-size: 26px; }
.fr-ava .lvl-star { right: -10px; bottom: -6px; min-width: 28px; height: 28px; font-size: 11px; }
.fr-ava.sm .avatar { width: 46px; height: 46px; font-size: 18px; }
.fr-ava.sm .lvl-star { right: -8px; bottom: -6px; min-width: 22px; height: 22px; font-size: 9px; }
.fr-name { max-width: 100%; font-size: 13px; color: #b0423a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-rec { width: 100%; padding: 6px 4px; border-radius: 10px; background: #f6f8fb; text-align: center; font-size: 11px; font-weight: 700; color: #4a4d56; }
.fr-card .btn { width: 100%; min-height: 36px; font-size: 14px; }
.fr-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 18px; grid-column: 1 / -1; }
.fr-empty svg { width: 42px; height: 42px; color: var(--gold); }
.fr-empty small { color: var(--muted); font-weight: 600; line-height: 1.45; }
.fr-none { grid-column: 1 / -1; }
.fr-log { display: flex; flex-direction: column; gap: 0; }
.fr-log-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 8px; }
.fr-log-row .fr-ava { margin: 0; flex: none; }
.fr-log-row .q-text span { font-size: 14px; font-weight: 600; line-height: 1.3; }
.fr-log-row .q-text b { color: #b0423a; }
.fr-log-row .btn { flex: none; min-height: 38px; }
.fr-footer {
  position: sticky; bottom: 0; margin: 12px -16px 0; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, rgba(237, 241, 247, 0), var(--bg-bottom) 22%);
}
.fr-bonus { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: #4a4d56; text-align: center; }
.fr-bonus .amt { color: var(--gold); }
.fr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fr-actions .btn { min-height: 52px; padding: 0 10px; font-size: 13px; gap: 8px; line-height: 1.2; }
.fr-actions .btn svg { width: 20px; height: 20px; }
.fr-footer .btn-ghost { box-shadow: none; border: 0; min-height: 34px; color: var(--muted); }

/* ---------- Итог партии: табличка «вы VS соперник» ---------- */
.result-inner { width: min(420px, 100%); }
.vs-board {
  position: relative; display: grid; grid-template-columns: 1fr 34px 1fr; align-items: start; gap: 6px;
  padding: 18px 12px 16px; border-radius: 24px; background: #fff; border: 1px solid rgba(230, 179, 79, .35);
  box-shadow: 0 20px 50px rgba(30, 45, 90, .14);
}
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.vs-label { min-height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.vs-label.winner {
  font-family: var(--font-display); font-size: clamp(12px, 3.6vw, 15px); letter-spacing: 0; text-transform: uppercase; white-space: nowrap;
  color: #1f9d57; animation: winner-pop .6s cubic-bezier(.2, 1.5, .4, 1) both .3s;
}
@keyframes winner-pop { from { transform: scale(.4); opacity: 0; } }
.vs-card {
  position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 8px 12px; border-radius: 18px; background: #f6f8fb; border: 1px solid var(--line);
  overflow: hidden;
}
.vs-side.is-winner .vs-card { background: #fffaf0; border-color: rgba(230, 179, 79, .6); }
/* Лучи за победителем */
.vs-side.is-winner .vs-card::before {
  content: ""; position: absolute; left: 50%; top: 52px; width: 340px; height: 340px; margin: -170px 0 0 -170px;
  background: repeating-conic-gradient(from 0deg, rgba(230, 179, 79, .2) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%);
  animation: spin 18s linear infinite; pointer-events: none;
}
.vs-ava { position: relative; z-index: 1; margin-bottom: 4px; }
.vs-ava .avatar { width: 84px; height: 84px; font-size: 32px; }
.vs-ava .lvl-star { right: -12px; bottom: -8px; min-width: 32px; height: 32px; font-size: 12px; }
.disc-ava { background: #e9edf3; display: grid; place-items: center; }
.disc-ava .disc { width: 68%; height: 68%; border-radius: 50%; }
.vs-name { position: relative; z-index: 1; max-width: 100%; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-rating { position: relative; z-index: 1; color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.vs-rating b { color: var(--text); font-variant-numeric: tabular-nums; }
.vs-rating .rr-delta { font-size: 11px; padding: 1px 6px; }
.vs-coins {
  position: relative; z-index: 1; margin-top: 6px; display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 17px; font-weight: 800;
}
.vs-coins[hidden] { display: none; }
.vs-coins .ico-coin { width: 22px; height: 22px; }
.vs-mid { align-self: center; margin-top: 40px; font-family: var(--font-display); font-size: 20px; color: #c3c8d2; text-align: center; }
.vs-friend { width: 100%; min-height: 40px; font-size: 14px; gap: 6px; background: linear-gradient(180deg, #f2c66a, #d9a03c); color: #1b1406; border-color: transparent; }
.vs-friend svg { width: 18px; height: 18px; }
.vs-friend.added { background: #eef1f6; color: var(--muted); }
.vs-friend[hidden] { display: none; }
.vs-note { min-height: 0; margin: 10px 0 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; }
.vs-note:empty { display: none; }
.vs-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 16px auto 18px; width: min(300px, 100%); }
.vs-progress[hidden] { display: none; }
.vs-progress small { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.vs-bar-row { position: relative; width: 100%; display: flex; align-items: center; }
.vs-bar-row .lvl-star { position: relative; right: auto; bottom: auto; z-index: 1; min-width: 34px; height: 34px; font-size: 12px; margin-right: -10px; flex: none; }
.vs-bar-row .bar { flex: 1; height: 12px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(230, 179, 79, .45); }
.vs-progress > b { font-size: 14px; font-variant-numeric: tabular-nums; }
.result.show .vs-board { animation: rise .5s var(--ease) both .1s; }
.result.show .vs-progress, .result.show .vs-note { animation: rise .5s var(--ease) both .45s; }

/* Награда за партию на экране итогов */
.result-reward { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: -6px 0 16px; font-weight: 800; }
.result-reward:empty { display: none; }
.result-reward span { display: inline-flex; align-items: center; gap: 5px; }
.result-reward .xp { color: #2f7fd0; }
.result-reward .lvl-up { color: var(--gold); width: 100%; justify-content: center; }
.result.show .result-reward { animation: rise .5s var(--ease) both .6s; }

/* ---------- Клубы: мой клуб, форма ---------- */
.club-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 22px 16px; }
.club-empty b { font-size: 17px; }
.club-empty small { color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.club-empty .btn { width: 100%; }
.club-head { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; }
.club-name { font-size: 18px !important; }
.club-desc { margin: 0 0 10px; padding: 0 4px; color: #4a4d56; font-size: 14px; line-height: 1.5; }
.club-actions { display: flex; gap: 10px; margin: 12px 0 4px; }
.club-actions .btn { flex: 1; min-height: 50px; }
.q-text small.leader { color: var(--gold); font-weight: 800; }
.rrow .elo { display: flex; flex-direction: column; align-items: flex-end; }
.rrow .elo small { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
textarea.input { resize: none; line-height: 1.45; font-family: inherit; }
.club-form { display: flex; flex-direction: column; gap: 12px; }
.emblem-editor { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 8px; border-radius: 16px; background: #f6f8fb; border: 1px solid var(--line); }
.ee-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ee-col small { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stepper { display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 14px; background: #1d1e22; color: #fff; }
.stepper button {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(180deg, #f2c66a, #d9a03c); color: #1b1406; transition: transform .12s;
}
.stepper button:active { transform: scale(.9); }
.stepper button svg { width: 18px; height: 18px; stroke-width: 2.6; }
.step-val { flex: 1; text-align: center; font-weight: 800; font-size: 15px; min-width: 0; display: grid; place-items: center; }
.stepper.mini { background: transparent; padding: 0; gap: 4px; color: var(--text); }
.stepper.mini button { width: 30px; height: 30px; border-radius: 9px; }
.stepper.mini .step-val { width: 30px; height: 34px; }
.stepper.mini .step-val svg { width: 26px; height: 26px; stroke: none; }
.swatch-shield { display: block; width: 24px; height: 28px; clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%); }

/* ---------- Магазин ---------- */
.shop-h { margin: 6px 0 2px; text-align: center; font-family: var(--font-display); font-size: 17px; }
.shop-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { position: relative; gap: 4px; padding: 12px 6px 8px; background: linear-gradient(180deg, #fff, #f7f4ec); border-color: rgba(230, 179, 79, .3); box-shadow: var(--shadow); }
.shop-n { display: flex; flex-direction: column; align-items: center; font-size: 15px; line-height: 1.1; }
.shop-n small { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.shop-art { width: 100%; aspect-ratio: 5 / 4; }
.shop-art svg { width: 100%; height: 100%; display: block; stroke: none; fill: none; }
.shop-item .btn { min-height: 36px; font-size: 13px; padding: 0 6px; }
.shop-item .btn .amt { gap: 3px; }
.shop-item .badge.soon { position: absolute; top: 6px; left: 6px; font-size: 8px; padding: 2px 5px; }
.ribbon {
  position: absolute; left: -4px; right: -4px; top: 50%; z-index: 1; padding: 3px 0; text-align: center;
  font-size: 10px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: .04em;
  background: linear-gradient(180deg, #e2574c, #a8322a); border-radius: 4px; box-shadow: 0 2px 6px rgba(168, 50, 42, .35);
}
.sheet-hero.art { height: 120px; }
.sheet-hero.art svg { width: 150px; height: 120px; stroke: none; fill: none; filter: none; }
.exch { font-size: 17px; font-weight: 700; margin: 0; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }

