/* «Лавка Левши» в браузере (me.html): нижние вкладки, списки, карточки — как в лавке на Android. */
html:has(body.appmode) { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.appmode { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.appmode .top .wrap { padding-top: env(safe-area-inset-top); }
.appwrap { max-width: 720px; padding-top: 6px; }
.iconbtn { border: 0; background: var(--surface2); color: var(--text); border-radius: 50%; width: 38px; height: 38px; flex: none;
  display: inline-grid; place-items: center; font: 900 20px Nunito, sans-serif; cursor: pointer; text-decoration: none; position: relative; }
.top .iconbtn { background: rgba(242, 181, 49, .14); color: var(--cream); font-size: 17px; }
.nbadge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brick); color: #fff;
  font: 900 11px/18px Nunito, sans-serif; padding: 0 4px; }
.nbadge[hidden] { display: none; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--choco-deep) 96%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(242, 181, 49, .15); }
.tabbar a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: #C9A27A; font: 800 12px Nunito, sans-serif; padding: 4px 0; }
.tabbar svg { width: 46px; height: 30px; padding: 3px 11px; border-radius: 99px; transition: background .2s; }
.tabbar a[aria-current] { color: var(--gold); }
.tabbar a[aria-current] svg { background: var(--gold); color: var(--choco); }

.vhead { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; }
.vhead h1 { font-size: clamp(26px, 6vw, 34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec { font-size: 21px; margin: 22px 0 10px; }
.pad { padding: 6px 2px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.grow b, .grow span, .grow small { overflow: hidden; text-overflow: ellipsis; }
.small, small { font-size: 13px; }
.big { font-size: 20px; }
.chev { color: var(--text2); font-size: 24px; font-weight: 900; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; align-items: center; }
.btns.center { justify-content: center; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.danger { color: var(--brick); }
.btn:disabled { opacity: .5; }
.panel { margin-bottom: 12px; }
.panel.tip { background: var(--surface2); font-size: 15px; }
.chips.sub { margin: 0 0 14px; }
.chips.sub .chip { text-decoration: none; }

.homehead { display: flex; gap: 14px; align-items: center; margin: 14px 0 6px; }
.homehead h1 { font-size: 30px; }
.homehead p { margin: 2px 0 0; color: var(--text2); }
.mascot-s { width: 72px; image-rendering: pixelated; }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.row { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.list .row:last-child { border-bottom: 0; }
.row.link, .row.card-row { cursor: pointer; }
.row.link:hover, .row.card-row:hover { background: var(--surface2); }
a.row.link:not(.list .row) { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin: 12px 0; }
.panel.row { padding: 14px; }
.row p { margin: 2px 0 0; }
.row.wrap { flex-wrap: wrap; }
.row .acts { flex-basis: 100%; display: flex; gap: 8px; padding-left: 62px; }
.row .meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text2); }
.icon.sm { width: 44px; height: 44px; border-radius: 12px; }
.nicon { width: 38px; height: 38px; border-radius: 12px; background: var(--surface2); display: grid; place-items: center; flex: none; font-size: 18px; }
.gicon { width: 46px; height: 46px; border-radius: 14px; background: var(--brick); color: #fff; display: grid; place-items: center; font: 900 22px Nunito, sans-serif; flex: none; }
.playing { color: var(--green); font-weight: 800; }
.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* аватар в рамке */
.av { --s: 44px; position: relative; flex: none; width: calc(var(--s) + 6px); height: calc(var(--s) + 6px); padding: 3px; border-radius: 28%; display: inline-block; }
.av img { width: var(--s); height: var(--s); border-radius: 22%; display: block; background: var(--surface2); object-fit: cover; }
.av .dot { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: #3FB06A; border: 2px solid var(--surface); }
.f-wood { background: linear-gradient(135deg, #8A5A35, #C47A52, #6A3424); }
.f-bronze { background: linear-gradient(135deg, #874013, #E6A060, #874013); }
.f-silver { background: linear-gradient(135deg, #9AA6C4, #F2F5FB, #6B7898); }
.f-gold { background: linear-gradient(135deg, #B87A12, #FFE08A, #C98A10); }
.f-master { background: linear-gradient(135deg, #C3271B, #F2B531, #C3271B); }
.av.big { margin: 0 auto; }
.photo { width: 140px; height: 140px; border-radius: 28%; object-fit: cover; box-shadow: var(--shadow); }
.profile h2 { margin-top: 10px; }

/* профиль: создать / войти */
.welcome { text-align: center; }
.welcome h2 { margin-top: 6px; }
.perks { text-align: left; max-width: 360px; margin: 12px auto; padding-left: 22px; }
.perks li { margin: 4px 0; }
.welcome .btns { justify-content: center; }
.field { display: block; text-align: left; margin: 10px 0; }
.field span, .lbl { display: block; font-weight: 800; font-size: 14px; color: var(--text2); margin-bottom: 4px; text-align: left; }
.field input, .field textarea, .inp, .composer textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--text); font: 600 17px Nunito, sans-serif; padding: 11px 13px; resize: vertical; }
.inp { margin-bottom: 8px; }
.avgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 6px 0 10px; }
.avpick { border: 2px solid transparent; background: var(--surface2); border-radius: 16px; padding: 6px; cursor: pointer; }
.avpick img { width: 100%; display: block; border-radius: 10px; }
.avpick[aria-pressed="true"] { border-color: var(--gold); background: rgba(242, 181, 49, .18); }

/* лента */
.composer { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.composer textarea { flex: 1 1 200px; min-height: 52px; font-size: 16px; }
.composer .btn { margin-left: auto; }
.post header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.post header .grow small { display: block; }
.post p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post footer { display: flex; gap: 12px; align-items: center; margin-top: 8px; background: none; color: inherit; }
.nm { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nm .badge { font-size: 11px; padding: 1px 8px; }
.like, .cm { display: inline-flex; gap: 6px; align-items: center; border: 0; background: var(--surface2); color: var(--text2); border-radius: 99px;
  padding: 6px 14px; font: 800 15px Nunito, sans-serif; cursor: pointer; text-decoration: none; }
.like svg { width: 18px; height: 18px; }
.like.on { background: var(--gold); color: var(--choco); animation: pop .25s; }
.rec { display: flex; gap: 12px; align-items: center; background: var(--surface2); border-radius: 14px; padding: 12px; color: var(--text); text-decoration: none; }
.rec span { display: flex; flex-direction: column; }
.rec small { color: var(--text2); }
.star { font-size: 26px; color: var(--gold-d); }
.pop { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  overflow: hidden; min-width: 200px; }
.pop button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: 700 16px Nunito, sans-serif; padding: 12px 16px; cursor: pointer; }
.pop button:hover { background: var(--surface2); }

/* группы, рекорды, статистика */
.invite { margin: 8px 0; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; }
.code.big { font-size: 22px; font-weight: 800; }
.place { width: 30px; text-align: center; font-weight: 900; color: var(--text2); }
.place.p1 { color: var(--gold-d); } .place.p2 { color: #9AA6C4; } .place.p3 { color: #C47A52; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; text-align: center; }
.stats.small div { padding: 8px; background: var(--surface2); }
.stats b { display: block; font-size: 24px; font-weight: 900; color: var(--gold-text); }
.stats span { font-size: 13px; color: var(--text2); }
.wcard { width: 100%; max-width: 420px; display: block; margin: 12px auto; border-radius: 18px; box-shadow: var(--shadow); }

/* настройки */
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch:last-of-type { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; }
.switch i { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--border); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.frame { border: 2px solid transparent; background: var(--surface); border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 700 14px Nunito, sans-serif; color: var(--text); cursor: pointer; }
.frame[aria-pressed="true"] { border-color: var(--gold); }
.frame:disabled { opacity: .55; cursor: default; }
.cropwrap { display: flex; gap: 14px; align-items: flex-end; margin: 10px 0; }
#cc { width: min(260px, 70vw); aspect-ratio: 1; border-radius: 18px; touch-action: none; cursor: grab; background: var(--surface2); }
#cp { width: 96px; height: 96px; border-radius: 18px; image-rendering: pixelated; }
input[type=range] { width: 100%; accent-color: var(--gold); }

.skel { height: 74px; border-radius: 18px; margin: 12px 0; background: linear-gradient(90deg, var(--surface2), var(--surface), var(--surface2));
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel.short { height: 40px; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sheet { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; border-radius: 22px 22px 0 0; } }

/* «Идеи и пожелания» */
.idea { display: flex; gap: 12px; align-items: flex-start; }
.idea .grow { gap: 3px; }
.idea .ititle { font-size: 18px; font-weight: 900; }
.idea.big .ititle { font-size: 22px; margin: 4px 0; }
.ibody { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.vote { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; cursor: pointer; min-width: 54px;
  background: var(--surface2); color: var(--text2); border-radius: 14px; padding: 8px 6px; font: 900 16px Nunito, sans-serif; }
.vote svg { width: 22px; height: 22px; }
.vote.on { background: var(--gold); color: var(--choco); animation: pop .25s; }
.ist { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 900; }
.ist-new { background: var(--surface2); color: var(--text2); }
.ist-working { background: var(--gold); color: var(--choco); }
.ist-done { background: #237841; color: #fff; }
.ist-rejected { background: transparent; color: var(--text2); border: 1px dashed var(--border); }
.panel.reply { border-left: 4px solid var(--gold); }
.panel.reply p { white-space: pre-wrap; margin: 6px 0; }
.panel.master { border: 2px dashed var(--gold-d); }
.donebox ul { margin: 6px 0 0; padding-left: 20px; }
.shotprev { height: 64px; border-radius: 10px; vertical-align: middle; }
.shotfull { max-width: 100%; border-radius: 12px; margin-top: 8px; }
.dupin { width: 160px; margin: 0; }
select.inp { appearance: auto; }

/* Унификация (14.10): главная «Игра недели», лист снизу вместо окошка, дорожная карта, помощь, размеры под палец */
.feat { display: block; min-height: 180px; background: var(--surface2) center / cover no-repeat; position: relative; padding: 0; overflow: hidden; text-decoration: none; }
.feat-in { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 14px;
  background: linear-gradient(transparent, rgba(20, 11, 7, .85)); color: #fff; }
.feat-in b { display: block; font-size: 20px; }
.feat .rating { color: var(--gold); }
.asheet { position: fixed; inset: 0; z-index: 60; background: rgba(10, 5, 3, 0); transition: background .2s; display: flex; align-items: flex-end; }
.asheet.on { background: rgba(10, 5, 3, .45); }
.asheet-in { width: 100%; max-width: 560px; margin: 0 auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; }
.asheet.on .asheet-in { transform: none; }
.asheet-in button { display: block; width: 100%; min-height: 52px; border: 0; background: none; color: var(--text); font: 800 17px Nunito, sans-serif;
  border-bottom: 1px solid var(--border); cursor: pointer; }
.asheet-in button.cancel { border: 0; color: var(--text2); margin-top: 4px; }
.dotst { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--text2); }
.dotst.st-now { background: var(--gold); } .dotst.st-done { background: var(--green); } .dotst.st-idea { background: transparent; border: 2px dashed var(--text2); }
details.faq { border-bottom: 1px solid var(--border); padding: 0 14px; }
details.faq:last-child { border-bottom: 0; }
details.faq summary { cursor: pointer; font-weight: 800; padding: 14px 0; list-style: none; min-height: var(--touch); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq .a { padding: 0 0 12px; } details.faq .a p { margin: 0 0 8px; }
.appmode .chip { min-height: var(--touch); display: inline-flex; align-items: center; }
.appmode .iconbtn { width: var(--touch); height: var(--touch); }
.appmode .row { min-height: 56px; }
.appmode .btn.small { min-height: var(--touch); }
.appmode .vhead h1:empty { display: none; }
#apage .app-head { padding-top: 0; }
@media (hover: none) { .card:hover { transform: none; } .row.link:hover, .row.card-row:hover { background: none; } }

[hidden] { display: none !important; }

/* окно поверх экрана: «Сохраните код», QR, «что с чем сольётся» */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(10, 5, 3, 0); display: grid; place-items: center; padding: 16px;
  transition: background .18s; overflow-y: auto; }
.modal.on { background: rgba(10, 5, 3, .55); }
.modal-in { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 20px 18px;
  text-align: center; box-shadow: var(--shadow); transform: scale(.96); opacity: 0; transition: transform .18s, opacity .18s; }
.modal.on .modal-in { transform: none; opacity: 1; }
.modal-in h2 { margin: 6px 0 8px; }
.modal-in .left, .modal-in ul.left { text-align: left; }
.modal-in .list { margin: 10px 0; }
.btns.col { flex-direction: column; align-items: stretch; }
.qrimg svg { display: block; width: min(72vw, 280px); height: auto; margin: 6px auto; border-radius: 12px; }
button.row { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
.small { font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .modal, .modal-in { transition: none; } }
.modal-in .list .lbl { padding: 10px 14px 0; margin: 0; }

/* 4.0: герой, лига, витрина, стена, сравнение */
img.hero { image-rendering: pixelated; background: var(--cream); border-radius: 10px; padding: 3px; flex: none; box-sizing: content-box; }
img.hero.big { border-radius: 16px; padding: 6px; }
.herocard { gap: 14px; align-items: center; }
.herocard .grow > * { display: block; }
.lg { font-weight: 800; color: #B5582E; }
.lg-bronze { color: #B87333; } .lg-silver { color: #8A939D; } .lg-gold { color: #C98E12; } .lg-platinum { color: #3E9E9B; } .lg-master { color: #7D69B0; }
.chips .badge.pick { cursor: pointer; border: 1.5px solid var(--border); font: inherit; font-size: 13px; }
.chips .badge.pick[aria-pressed="true"] { border: 2.5px solid var(--gold); }
.chips.showcase .badge.big { font-size: 15px; padding: 6px 12px; border: 2px solid var(--gold); }
.stats.mini { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats.mini div { padding: 8px 2px; border-radius: 12px; }
.stats.mini b { font-size: 19px; }
.stats.mini span { font-size: 11px; line-height: 1.2; display: block; }
.pre { white-space: pre-wrap; display: block; }
.nm a { color: inherit; text-decoration: none; }
.badge.ok { background: #237841; color: #fff; }
table.cmp th { overflow-wrap: anywhere; }
table.cmp { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.cmp th, table.cmp td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--border); }
table.cmp tr > th:first-child { text-align: left; font-weight: 600; color: var(--text2); }
table.cmp td.win { font-weight: 900; color: var(--green); }
