/* Padel Club — чёрно-оранжевая тема. Одна тема, без светлой. */
:root {
  --bg: #0A0A0B; --surface: #141417; --surface-2: #1C1C20; --surface-3: #232328;
  --ink: #F4F1EC; --ink-2: #B5B0A8; --ink-3: #78746E; --line: #26262B; --line-2: #34343A;
  --court: #FF7A1A; --court-ink: #0A0A0B;          /* основной акцент: активные элементы, победители, ссылки */
  --ball: #FF8C2E; --ball-ink: #0A0A0B;            /* главные кнопки, золото, выделение */
  --orange-deep: #E8600A; --orange-soft: rgba(255,122,26,.14); --orange-glow: rgba(255,122,26,.35);
  --win: rgba(255,122,26,.10); --danger: #FF5C5C; --danger-bg: #2A1414;
  --radius: 16px; --radius-sm: 11px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%;
  padding-bottom: 78px;
  background-image:
    radial-gradient(900px 380px at 50% -200px, rgba(255,122,26,.18), transparent 60%),
    radial-gradient(rgba(255,255,255,.045) 1px, transparent 1.2px);
  background-size: auto, 22px 22px;
  background-attachment: fixed, fixed;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 10px 14px 30px; }
h1,h2,h3 { font-family: "Unbounded", "Manrope", sans-serif; margin: 0; letter-spacing: -0.02em; }
h1 { font-weight: 700; font-size: 24px; }
h2 { font-weight: 700; font-size: 19px; }
h3 { font-weight: 600; font-size: 15px; }
a { color: var(--court); }
::selection { background: var(--orange-soft); }

/* ---------- шапка: компактный знак слева, статус справа ---------- */
header.top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 12px; }
/* точки из «0» выплёскиваются в сетку фона: оранжевый ореол точек вокруг знака, гаснущий к краям */
header.top::before { content: ""; position: absolute; left: -14px; top: -10px; width: 300px; height: 96px; pointer-events: none; z-index: -1;
  background-image: radial-gradient(rgba(255,138,46,.8) 1.3px, transparent 1.7px); background-size: 22px 22px; background-position: 8px 6px;
  -webkit-mask-image: radial-gradient(150px 60px at 80px 44px, #000 0%, rgba(0,0,0,.6) 40%, transparent 72%); mask-image: radial-gradient(150px 60px at 80px 44px, #000 0%, rgba(0,0,0,.6) 40%, transparent 72%); }
header.top .brand { display: block; line-height: 0; }
header.top .brand svg.logo { height: 46px; width: auto; display: block; }
header.top .brand h1 { position: absolute; left: -9999px; }
header.top .meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
header.top .meta .who { font-size: 13px; color: var(--ink-2); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#syncStatus { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--ink-3); border: 1px solid rgba(255,255,255,.1); white-space: nowrap; }
#syncStatus[data-state="saved"] { color: var(--court); border-color: rgba(255,122,26,.35); background: var(--orange-soft); }
#syncStatus[data-state="dirty"] { color: var(--ink); }
#syncStatus[data-state="saving"] { color: var(--court); }
#logoutBtn { color: var(--ink-3); padding: 6px 6px; font-size: 15px; }
#logoutBtn:hover { color: var(--ink); }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- профиль ---------- */
.card.hero { background: linear-gradient(150deg, rgba(255,122,26,.22) 0%, rgba(255,122,26,.06) 40%, rgba(255,255,255,.02) 100%); border-color: rgba(255,122,26,.35); }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-name { font-family: "Unbounded", "Manrope", sans-serif; font-weight: 700; font-size: 22px; line-height: 1.1; }
.hero-elo { text-align: right; font-family: "Unbounded", "Manrope", sans-serif; line-height: 1; }
.hero-elo span { font-size: 32px; font-weight: 700; color: var(--court); text-shadow: 0 0 24px var(--orange-glow); }
.hero-elo small { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: .04em; margin-top: 2px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.hero-grid div { background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px -14px rgba(0,0,0,.8); border-radius: 14px; padding: 10px 6px; text-align: center; }
.hero-grid strong { display: block; font-family: "Unbounded", "Manrope", sans-serif; font-size: 16px; font-weight: 700; }
.hero-grid span { font-size: 11px; color: var(--ink-3); }

/* ---------- нижняя навигация ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(12,12,14,.82); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); gap: 4px;
}
nav.tabs button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--ink-3); font-family: inherit;
  font-size: 11px; font-weight: 700; padding: 6px 2px 4px; border-radius: 12px; cursor: pointer;
  position: relative; transition: color .15s, transform .12s;
}
nav.tabs button .ic { width: 22px; height: 22px; display: block; }
nav.tabs button .ic svg { width: 22px; height: 22px; display: block; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs button::before { content: ""; position: absolute; top: -7px; left: 50%; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--court); transform: translateX(-50%) scaleX(0); transition: transform .18s; }
nav.tabs button.active { color: var(--court); }
nav.tabs button.active::before { transform: translateX(-50%) scaleX(1); }
nav.tabs button:active { transform: scale(.94); }

/* ---------- карточки и текст ---------- */
.card {
  position: relative;
  background: linear-gradient(150deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.03) 45%, rgba(255,255,255,.015) 100%);
  border: 1px solid rgba(255,255,255,.09); border-radius: 18px;
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 14px 34px -18px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.10), inset 0 -1px 0 rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px 120px at 18% 0%, rgba(255,255,255,.10), transparent 70%); }
.card > * { position: relative; }
.card + .card { margin-top: 0; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.wrap-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.section-head h2 { font-size: 19px; }
.section-head > .btn.ghost.sm { font-size: 14px; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); }
.empty .ic { font-size: 34px; margin-bottom: 8px; }

/* ---------- формы ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=email], input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; font-family: inherit; font-size: 15.5px; color: var(--ink);
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm);
  padding: 10px 12px; appearance: none; transition: border-color .15s, box-shadow .15s; box-shadow: inset 0 2px 6px rgba(0,0,0,.35);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--court); box-shadow: 0 0 0 3px var(--orange-soft); }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
::placeholder { color: var(--ink-3); }

.seg { display: flex; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm); overflow: hidden; background: rgba(0,0,0,.35); box-shadow: inset 0 2px 6px rgba(0,0,0,.4); }
.seg button { flex: 1; background: transparent; border: none; padding: 10px 8px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--line-2); transition: background .12s, color .12s; }
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--court); color: var(--court-ink); }
.seg button:active { background: var(--surface-3); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: linear-gradient(150deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink-2); transition: transform .12s, background .12s, border-color .12s, color .12s; user-select: none; }
.chip:active { transform: scale(.96); }
.chip.active { background: var(--court); color: var(--court-ink); border-color: var(--court); box-shadow: 0 4px 14px var(--orange-glow); }
.chip.inactive { opacity: .45; }

/* ---------- кнопки ---------- */
button.btn {
  font-family: inherit; font-weight: 700; font-size: 15px; border-radius: var(--radius-sm); padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.14); background: linear-gradient(150deg, rgba(255,255,255,.10), rgba(255,255,255,.04)); color: var(--ink); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 16px -10px rgba(0,0,0,.8);
  transition: transform .12s, box-shadow .15s, background .15s, filter .15s;
}
button.btn:active { transform: translateY(1px) scale(.98); }
button.btn.primary { background: linear-gradient(160deg, #FFA24E 0%, #FF7A1A 50%, #EE5F08 100%); color: var(--ball-ink); border-color: rgba(255,200,150,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 24px -8px var(--orange-glow); }
button.btn.primary:hover { filter: brightness(1.05); }
button.btn.primary:active { box-shadow: 0 3px 10px -4px var(--orange-glow); }
button.btn.ghost { background: transparent; border-color: transparent; color: var(--court); padding: 8px 4px; }
button.btn.danger { color: var(--danger); }
button.btn.danger.primary { background: var(--danger); color: #fff; box-shadow: none; }
button.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
button.btn.block { width: 100%; }
button.btn.sm { padding: 8px 12px; font-size: 13.5px; }
.edit-pen { background: none; border: none; color: var(--ink-3); cursor: pointer; font-size: 12px; padding: 0 4px; opacity: .7; transition: color .12s, opacity .12s; }
.edit-pen:hover, .edit-pen:active { opacity: 1; color: var(--court); }
.fmt-info { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid currentColor; background: none; color: inherit; opacity: .55; font: italic 700 11px/1 Georgia, serif; padding: 0; margin-left: 2px; cursor: pointer; vertical-align: middle; }
.fmt-info:hover, .fmt-info.on { opacity: 1; color: var(--court); }
.chip.active .fmt-info { border-color: var(--court-ink); color: var(--court-ink); }

/* ---------- таблицы ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
table.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td, table.tbl th { white-space: nowrap; }
table.tbl td.pts { color: var(--ink-2); font-variant-numeric: tabular-nums; }
table.tbl td.pts span:first-child { color: var(--ink); font-weight: 600; }
table.tbl th.sortable { cursor: pointer; user-select: none; -webkit-user-select: none; }
table.tbl th.sortable .arr { margin-left: 4px; opacity: .45; font-size: 10px; }
table.tbl th.sortable.on { color: var(--court); }
table.tbl th.sortable.on .arr { opacity: 1; }
.card:has(table.tbl) { overflow-x: auto; }

.pos-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(150deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.12); font-weight: 600; font-size: 11.5px; color: var(--ink-2); font-family: "Unbounded", "Manrope", sans-serif; }
.pos-badge.gold { background: linear-gradient(160deg, #FFB05C, #FF7A1A); color: var(--ball-ink); border-color: transparent; box-shadow: 0 0 0 3px var(--orange-soft), 0 4px 12px -4px var(--orange-glow); }

/* ---------- матчи ---------- */
.match { background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px -14px rgba(0,0,0,.8); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.match .court-lbl { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.match .mrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.match .pair { font-weight: 600; font-size: 14px; line-height: 1.25; }
.match .pair.right { text-align: right; }
.match .pair small { display: block; font-weight: 400; color: var(--ink-2); font-size: 13px; }
.match .pair.winner, .match .pair.winner small { color: var(--court); }
.match .pair.winner small { font-weight: 600; }
.match .score { display: flex; align-items: center; gap: 5px; }
.match .score input { width: 56px; height: 50px; text-align: center; font-weight: 700; font-size: 19px; padding: 0; font-family: "Unbounded", "Manrope", sans-serif; background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.12); border-radius: 12px; box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
.match .score .colon { font-weight: 700; color: var(--ink-3); }
.match .score input:disabled { opacity: 1; color: var(--ink); background: transparent; border-color: transparent; -webkit-text-fill-color: var(--ink); }

/* ---------- статистика ---------- */
.hm-table { border-collapse: collapse; font-size: 11.5px; }
.hm-table th { padding: 3px; font-weight: 600; color: var(--ink-2); writing-mode: vertical-rl; text-orientation: mixed; max-width: 26px; }
.hm-table td { width: 30px; height: 30px; text-align: center; font-weight: 700; border: 1px solid var(--bg); border-radius: 6px; }
.hm-table td.self { background: var(--surface-2); color: var(--ink-3); }
.hm-table th.rowlbl { writing-mode: horizontal-tb; text-align: right; padding-right: 6px; }
svg.formchart { width: 100%; height: 180px; display: block; }
.h2h-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.h2h-stat { background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px -14px rgba(0,0,0,.8); border-radius: 14px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.h2h-stat strong { font-size: 17px; font-family: "Unbounded", "Manrope", sans-serif; }
.h2h-game { background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px -14px rgba(0,0,0,.8); border-radius: 14px; padding: 8px 10px; margin-bottom: 6px; }
.h2h-game .mrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 4px; }
.h2h-game .pair { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.h2h-game .pair.right { text-align: right; }
.h2h-game .pair small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
.h2h-game .pair.winner { color: var(--court); }
.h2h-game .sc { font-weight: 800; font-size: 17px; white-space: nowrap; font-family: "Unbounded", "Manrope", sans-serif; }

.badge-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.badge { display: flex; gap: 10px; align-items: flex-start; padding: 10px; background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 20px -14px rgba(0,0,0,.8); border-radius: 14px; }
.badge-ic { font-size: 24px; line-height: 1; width: 32px; text-align: center; flex: 0 0 auto; }
.badge-body { flex: 1; min-width: 0; }
.badge-name { font-weight: 700; font-size: 15px; }
.badge-holder { display: flex; flex-direction: column; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.badge-holder strong { font-size: 14.5px; color: var(--court); }
.badge-person { padding: 8px 0; border-bottom: 1px solid var(--line); }
.badge-person:last-child { border-bottom: none; }
.chip.badge-chip { cursor: default; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; }
.chip.badge-chip small { font-weight: 400; font-size: 11px; color: var(--ink-3); white-space: normal; }
.card.quote { border-color: rgba(255,122,26,.35); }
.card.quote::before { background: radial-gradient(400px 140px at 10% 0%, rgba(255,122,26,.25), transparent 70%); }
.quote-text { font-family: "Manrope", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.35; }
.log-row { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-row:last-child { border-bottom: none; }

/* ---------- списки ---------- */
select[multiple] { height: auto; }
.link-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; border-radius: 8px; }
.link-row:last-child { border-bottom: none; }
.link-row:active { background: rgba(255,255,255,.05); }
.link-row .arrow { color: var(--court); font-size: 20px; }

/* ---------- toast ---------- */
.toast { font-family: "Manrope", sans-serif; position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(6px); background: var(--court); color: var(--court-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 40; box-shadow: 0 10px 30px -8px var(--orange-glow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

@media (max-width: 430px) {
  table.tbl { font-size: 13px; }
  table.tbl td { padding: 8px 6px; }
  table.tbl th { padding: 6px 6px; }
  .pos-badge { width: 24px; height: 24px; font-size: 12px; }
  button.btn.sm { padding: 7px 10px; font-size: 13px; }
  table.tbl td:first-child, table.tbl th:first-child { padding-left: 2px; padding-right: 2px; }
  .lb-p { gap: 6px; }
  .lb-p .avatar { width: 26px !important; height: 26px !important; }
}

/* --- tiles & scroll rows --- */
.tile { position: relative; border-radius: 18px; padding: 14px 16px; background: linear-gradient(160deg, rgba(255,255,255,.075), rgba(255,255,255,.025) 55%, rgba(255,122,26,.05)); border: 1px solid rgba(255,255,255,.09); box-shadow: 0 10px 28px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .12s, border-color .12s; }
.tile:active { transform: scale(.985); border-color: rgba(255,122,26,.4); }
.t-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.t-tile-name { font-family: "Unbounded", "Manrope", sans-serif; font-weight: 600; font-size: 14px; line-height: 1.25; margin-bottom: 4px; }
.t-tile-side { display: flex; align-items: center; gap: 10px; flex: none; }
/* статус турнира: зелёный — завершён, оранжевый (пульс) — идёт, серый — запланирован */
.t-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .01em; padding: 6px 10px; border-radius: 999px; white-space: nowrap; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.t-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.t-status.done { color: #4ADE80; border-color: rgba(74,222,128,.3); }
.t-status.live { color: var(--court); border-color: rgba(255,122,26,.4); background: rgba(255,122,26,.12); }
.t-status.live i { animation: pulse 1.4s ease-in-out infinite; }
.t-status.planned { color: var(--ink-3); }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.75); } }
.t-tile .arrow { color: var(--court); font-size: 22px; line-height: 1; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex: none; scroll-snap-align: start; }

/* --- профиль: аватар, редактирование, компактные подвкладки --- */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; background: linear-gradient(150deg, rgba(255,122,26,.55), rgba(255,122,26,.18)); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 16px rgba(0,0,0,.4); font-family: "Unbounded", "Manrope", sans-serif; font-weight: 700; color: #fff; letter-spacing: .02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero-id .hero-name { word-break: break-word; }
.plink { cursor: pointer; }
.plink:active { color: var(--court); }
.p-row { gap: 8px; }
.p-row-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.p-row-name { font-weight: 700; }
.p-row-side { display: flex; align-items: center; gap: 6px; flex: none; }
.p-row-side .arrow { cursor: pointer; padding: 0 2px; }
.pf-edit { display: flex; gap: 14px; align-items: center; }
.pf-avatar-pick { position: relative; cursor: pointer; flex: none; }
.pf-cam { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; background: var(--court); display: flex; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.pf-fields { flex: 1; min-width: 0; }
.pf-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.sm { padding: 6px 11px; font-size: 13px; }
.section-head .back { padding-left: 8px; }

.avatar.ph { background: linear-gradient(150deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); }
.avatar.ph svg { width: 70%; height: 70%; fill: rgba(244,241,236,.55); margin-top: 8%; }
.lb-name { white-space: nowrap; }
.lb-p { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; vertical-align: middle; }
.lb-p .plink { border-bottom: none; }
.lb-p:active .plink { color: var(--court); }
.tbl td { vertical-align: middle; }
.lb-elo, table.tbl td.lb-hl { font-family: "Unbounded", "Manrope", sans-serif; font-weight: 700; font-size: 15px; color: var(--court); text-shadow: 0 0 14px rgba(255,122,26,.35); }
table.tbl td.lb-hl.pts span, table.tbl td.lb-hl strong, table.tbl td.lb-hl .plink { color: var(--court); }
table.tbl td.lb-name.lb-hl { font-size: 14px; font-family: "Manrope", sans-serif; text-shadow: none; }
table.tbl td.lb-hl.pts { font-size: 14px; }
.role-sel { padding: 7px 28px 7px 10px; font-size: 13px; font-weight: 600; border-radius: 10px; width: auto; }
.role-tag { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: var(--ink-2); }
.role-tag.owner { color: var(--court); border-color: rgba(255,122,26,.4); background: var(--orange-soft); }
.btn.ghost.danger { color: var(--danger); }
.pub-name { font-family: "Manrope", sans-serif; font-weight: 500; font-size: .72em; color: var(--ink-3); letter-spacing: 0; }
.p-row-name .pub-name { font-size: 13px; }
.match .pair .plink:active, .tbl .plink:active { color: var(--court); }

/* --- ачивки: круглые значки сеткой, раскрывающаяся карточка --- */
.bdg-head { cursor: pointer; user-select: none; }
.bdg-head .chev { font-size: 22px; color: var(--ink-3); transition: transform .15s; line-height: 1; }
.bdg-card.open .bdg-head .chev { transform: rotate(90deg); color: var(--court); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; margin-top: 14px; }
.bdg { text-align: center; min-width: 0; }
.bdg-ic { width: 66px; height: 66px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.18), transparent 55%), linear-gradient(160deg, #3a2a1c, #1a1410);
  border: 2px solid var(--court); box-shadow: 0 0 0 3px rgba(255,122,26,.18), 0 8px 18px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.15); }
.bdg-ic svg { width: 32px; height: 32px; }
.bdg-ic span { font-size: 28px; line-height: 1; }
.bdg.title .bdg-ic { border-color: #FFC94D; box-shadow: 0 0 0 3px rgba(255,201,77,.18), 0 8px 18px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.15); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.2), transparent 55%), linear-gradient(160deg, #4a3a14, #1a1508); color: #FFE08A; }
.bdg.anti .bdg-ic { border-color: #FF5C5C; box-shadow: 0 0 0 3px rgba(255,92,92,.16), 0 8px 18px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.14), transparent 55%), linear-gradient(160deg, #3a1a1a, #170c0c); color: #FFB3B3; }
.bdg.personal .bdg-ic { color: #FFD1AD; }
.bdg-name { font-family: "Unbounded", "Manrope", sans-serif; font-weight: 600; font-size: 11.5px; line-height: 1.2; }
.bdg-desc { font-size: 10.5px; color: var(--ink-3); line-height: 1.25; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-avatar { display: block; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; margin: -1px auto 0; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); transition: border-color .15s, box-shadow .15s; }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-avatar.ph { display: flex; align-items: center; justify-content: center; }
nav.tabs button .ic .nav-avatar.ph svg { width: 70%; height: 70%; fill: currentColor; stroke: none; margin-top: 10%; opacity: .85; }
nav.tabs button.active .nav-avatar { border-color: var(--court); box-shadow: 0 0 10px rgba(255,122,26,.5); }
/* кнопка «Посмотреть раунды» у прошедших турниров */
.rounds-toggle { width: 100%; margin: 4px 0 6px; padding: 14px 16px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font: 700 15px "Unbounded", sans-serif; color: var(--ink);
  background: linear-gradient(135deg, rgba(255,122,26,.2), rgba(255,122,26,.05)); border: 1px solid rgba(255,122,26,.4); box-shadow: 0 8px 20px -12px rgba(255,122,26,.5); }
.rounds-toggle .chev { font-size: 22px; color: var(--court); transition: transform .15s; }
.rounds-toggle.open .chev { transform: rotate(90deg); }
.rounds-toggle:active { transform: scale(.98); }
/* прокрутка: не «протягиваем» жест наружу (в Telegram это сворачивало приложение) */
html, body { overscroll-behavior-y: none; }
.card:has(table.tbl), .chips-scroll { overscroll-behavior: contain; touch-action: pan-x pan-y; }
