/* ===== Kickwise profile and trade pages (profile.html, trade.html; assets/profile.js, trade.js, social.js) ===== */
.social-page main { padding-bottom: 88px; min-height: 60vh; }
.loading, .none { color: var(--muted); }
.none { margin: 0; font-size: 14.5px; }
.muted { color: var(--muted); }
.tr-err { margin: 10px 0; color: var(--bad); }
.tr-err:empty { display: none; }
.tr-ok { padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(79, 227, 138, .1); color: var(--ok); border: 1px solid rgba(79, 227, 138, .3); }
.acc-dot.static { position: static; display: inline-grid; box-shadow: none; margin-left: 4px; }
.empty-page { max-width: 560px; padding: 72px 0; }
.empty-page h1 { font-size: clamp(48px, 7vw, 80px); }
.empty-page p { color: var(--muted); font-size: 17px; margin: 12px 0 22px; }

/* small cards in rows (offers, spares, rooms) */
.mini-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-card .pcard { width: 84px; border-radius: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.user-chip .avatar { width: 40px; height: 40px; }
.user-chip > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-chip b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.user-chip small .flag { border-radius: 2px; }
.user-chip:hover b { color: var(--accent); }

/* ---------------------------------------------------------------- profile */
.prof-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center; padding: 36px 0 12px; }
.ph-card .pcard.lg { width: 230px; }
.ph-empty { width: 230px; aspect-ratio: 5 / 7; border-radius: 22px; display: grid; place-items: center; background: var(--surface); border: 1.5px dashed var(--line-strong);
  font-family: var(--display); font-weight: 900; font-size: 80px; color: var(--muted); }
.ph-info h1 { font-size: clamp(46px, 6vw, 84px); overflow-wrap: anywhere; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }
.ph-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ph-meta img { border-radius: 2px; }
.ph-meta .kw-ico { width: 17px; height: 17px; }
.ph-bio { margin: 12px 0 0; max-width: 60ch; font-size: 16.5px; }
.ph-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; max-width: 680px; }
.ph-stats > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.ph-stats dt { font-size: 12px; color: var(--muted); }
.ph-stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--muted); }
.ph-stats dd b { font-size: 26px; color: var(--text); text-transform: uppercase; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.ph-actions .kw-ico, .ps-head .kw-ico { width: 17px; height: 17px; }
.prof-sec { padding-top: 44px; }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ps-head h2 { font-size: clamp(30px, 3.6vw, 44px); }
.showcase { display: grid; grid-template-columns: repeat(6, minmax(0, 160px)); gap: 14px; }
.sc-slot .pcard { width: 100%; }
.sc-slot.empty { display: grid; place-items: center; aspect-ratio: 5 / 7; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; }
.sc-slot.empty:hover { border-color: var(--accent); color: var(--accent); }
.sc-slot.empty .kw-ico { width: 28px; height: 28px; }
.prof-two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.sport-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.sbar { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.sbar .kw-ico { width: 22px; height: 22px; color: var(--muted); flex: none; }
.sbar span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sbar b { font-size: 14.5px; }
.sbar i { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line-strong) var(--p)); }
.sbar em { font-style: normal; font-size: 13px; color: var(--muted); }
.sbar[aria-pressed="true"] { border-color: var(--accent); }
.sbar[aria-pressed="true"] .kw-ico { color: var(--accent); }

.edit-dlg { width: min(520px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface); color: var(--text); }
.edit-dlg::backdrop { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(4px); }
.edit-box { display: flex; flex-direction: column; gap: 14px; padding: 24px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.edit-box h2 { font-size: 40px; }
.edit-box textarea { height: auto; padding: 12px 14px; resize: vertical; }
.edit-box select { color-scheme: dark; }
.acc-field small { font-weight: 400; color: var(--muted); }
.edit-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-avatar { display: flex; align-items: center; gap: 14px; }
.edit-face { width: 56px !important; height: 56px !important; font-size: 20px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------------------------------------------------------- trade */
.tr-head { padding: 32px 0 6px; }
.in-room .tr-head { padding-top: 16px; } .in-room .tr-head h1 { font-size: 44px; } .in-room .tr-lead { display: none; } .in-room .tr-tabs { margin: 12px 0 16px; }
.tr-head h1 { font-size: clamp(52px, 7vw, 96px); }
.tr-lead { margin: 8px 0 0; color: var(--muted); font-size: 17px; }
.tr-tabs { display: flex; gap: 6px; margin: 18px 0 22px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; }
.tr-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.tr-tabs a .kw-ico { width: 18px; height: 18px; }
.tr-tabs a[aria-current="page"] { background: var(--text); color: var(--bg); }

.tr-guest { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tr-guest h2 { font-size: clamp(34px, 4vw, 50px); }
.tr-guest p { color: var(--muted); max-width: 52ch; margin: 10px 0 18px; }
.tg-art { display: flex; }
.tg-art .pcard { width: 120px; }
.tg-art .pcard:nth-child(1) { transform: rotate(-9deg) translateX(18px); }
.tg-art .pcard:nth-child(2) { z-index: 1; transform: translateY(-10px); }
.tg-art .pcard:nth-child(3) { transform: rotate(9deg) translateX(-18px); }

.swap-home { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.sw-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.sw-tile h2 { font-size: 32px; }
.sw-tile p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.sw-tile .btn { margin-top: auto; }
.sw-main { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 60%); }
.sw-ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--accent); }
.sw-ico .kw-ico { width: 28px; height: 28px; }
.code-form { display: flex; gap: 8px; margin-top: auto; width: 100%; }
.code-form input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .2em; font-family: var(--display); font-weight: 800; font-size: 22px; }
.code-form .btn { margin-top: 0; height: 48px; }

/* the live room: a trading screen, phone first */
.room { position: relative; display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin: 0 auto; }
.room-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.room-code { font-size: 14px; color: var(--muted); }
.room-code b { font-family: var(--display); font-size: 24px; letter-spacing: .12em; color: var(--text); margin-left: 6px; }
.room-status { margin: 0; font-weight: 600; }
.room.done .room-status { color: var(--ok); }
.room.cancelled .room-status { color: var(--bad); }
.room-qr { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.room-qr .qr { width: 200px; aspect-ratio: 1; border-radius: 12px; background: #fff; padding: 6px; }
.room-qr .qr svg { width: 100%; height: 100%; }
.room-qr p { margin: 0 0 12px; color: var(--muted); }
.room-qr .btn { margin: 0 6px 6px 0; }
.room-side { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.room-side.ok { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok), 0 0 30px -12px var(--ok); }
.room-side.them { background: color-mix(in srgb, #ff5fa8 5%, var(--surface)); }
.room-side.bump { animation: side-bump .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes side-bump { 40% { transform: scale(1.015); } }
.rs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rs-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; font-size: 15px; }
.rs-label .tabular { padding: 1px 8px; border-radius: 999px; background: var(--bg-2); font-size: 13px; }
.rs-ok { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--ok); font-weight: 700; font-size: 14px; }
.rs-ok .kw-ico { width: 18px; height: 18px; }
.room-side .btn { margin-top: 12px; }
.room-side .kw-ico, .room-bar .kw-ico { width: 18px; height: 18px; }
.room-bar { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 5; display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 10px; align-items: center;
  padding: 10px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line-strong); }
@media (min-width: 721px) { .room-bar { bottom: 16px; } }
.room-bar .btn { height: 52px; font-size: 16px; }
.room-no { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.plus-btn { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 0; cursor: pointer; background: #ff5fa8; color: #fff;
  box-shadow: 0 6px 20px -6px #ff5fa8; transition: transform .1s; touch-action: manipulation; }
.plus-btn .kw-ico { width: 26px !important; height: 26px !important; }
.plus-btn:active { transform: scale(.88); }
.plus-btn.bump { animation: side-bump .3s cubic-bezier(.2, 1.6, .4, 1); }
.plus-btn[disabled] { opacity: .35; cursor: not-allowed; box-shadow: none; }
.plus-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 6; }
.plus-layer i { position: absolute; font-style: normal; font-family: var(--display); font-weight: 900; font-size: 34px; color: var(--h); line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .4); animation: plus-up 1.2s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes plus-up { 0% { transform: translate(-50%, 0) scale(.3) rotate(0); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -20px) scale(var(--s)) rotate(var(--rot)); }
  100% { transform: translate(calc(-50% + var(--dx)), -170px) scale(calc(var(--s) * .8)) rotate(var(--rot)); opacity: 0; } }

.scan-dlg { width: min(440px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 22px; background: #000; color: #fff; overflow: hidden; }
.scan-dlg::backdrop { background: rgba(0, 0, 0, .7); }
.scan-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 18px; }
.scan-box video { width: 100%; aspect-ratio: 1; object-fit: cover; background: #111; }
.scan-frame { position: absolute; top: 15%; left: 15%; width: 70%; aspect-ratio: 1; border-radius: 18px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(0, 0, 0, .35); }
.scan-box p { margin: 0; padding: 0 16px; text-align: center; }
.scan-box .btn { color: #fff; }

.people { display: flex; flex-direction: column; gap: 8px; }
.search.big { height: 52px; width: 100%; max-width: 560px; }
.search.big input { width: 100%; font-size: 16px; }
.pp-sec { padding-top: 24px; }
.pp-sec h2 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 12px; }
.people-list, .match-list, .offer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.people-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.people-list .seen { margin-left: 8px; font-size: 12.5px; color: var(--muted); align-self: center; }
.match-list li, .offer { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.match-list li > .btn { align-self: flex-start; }
.mt-cols, .of-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mt-cols small, .of-cols small { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.mt-cols .pcard, .of-cols .pcard { width: 70px; }
.of-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.of-status { font-size: 13.5px; color: var(--muted); }
.offer.accepted .of-status { color: var(--ok); }
.offer.declined .of-status, .offer.failed .of-status { color: var(--bad); }
.offer:not(.open) { opacity: .75; }
.of-msg { margin: 0; font-style: italic; color: var(--muted); }
.of-actions { display: flex; gap: 8px; justify-content: flex-end; }
.of-actions .kw-ico { width: 16px; height: 16px; }

.builder { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bd-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.bd-col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-height: 220px; }
.bd-col h2 { font-size: 30px; }
.bd-col .kw-ico { width: 16px; height: 16px; }
.bd-swap { align-self: center; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--accent); }
.bd-swap .kw-ico { width: 22px; height: 22px; }
.bd-hint { margin: 0; color: var(--muted); font-size: 14.5px; }
.bd-actions { display: flex; gap: 8px; justify-content: flex-end; }
.bd-actions .kw-ico { width: 17px; height: 17px; }

/* the card picker */
.picker { width: min(980px, 100vw); max-width: none; height: min(860px, 100dvh); max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--bg); color: var(--text); }
.picker::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.pk-box { display: flex; flex-direction: column; height: 100%; }
.pk-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.pk-head h2 { font-size: 30px; margin-right: auto; }
.pk-count { color: var(--muted); font-weight: 600; }
.pk-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.pk-tools .search input { width: 180px; }
.pk-sports { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-sports .chip { height: 34px; }
.pk-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; padding: 14px 18px 24px; align-content: start; }
.pk-card { position: relative; padding: 0; border: 0; background: none; border-radius: 12px; cursor: pointer; transition: transform .15s; }
.pk-card .pcard { width: 100%; }
.pk-card.on { transform: translateY(-4px); }
.pk-card.on::after { content: ""; position: absolute; inset: -4px; border-radius: 16px; box-shadow: 0 0 0 3px var(--accent); }
.pk-card.last .pcard { opacity: .55; }
.pk-card .pcard.missing { opacity: .75; }
.pk-card.on .pcard.missing { opacity: 1; }

/* ---------------------------------------------------------------- tablets and phones */
@media (max-width: 960px) {
  .swap-home { grid-template-columns: 1fr 1fr; } .sw-main { grid-column: 1 / -1; }
  .ph-stats { grid-template-columns: repeat(3, 1fr); }
  .showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sport-bars { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .prof-head { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; padding-top: 22px; }
  .ph-card .pcard.lg, .ph-empty { width: 190px; }
  .ph-meta, .ph-actions { justify-content: center; }
  .ph-stats { margin-inline: auto; }
  .ph-stats dd b { font-size: 22px; }
  .prof-two { grid-template-columns: 1fr; gap: 0; }
  .prof-two > div + div { padding-top: 32px; }
  .mini-card .pcard { width: 74px; }
  .swap-home { grid-template-columns: 1fr; }
  .tr-guest { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tg-art .pcard { width: 92px; }
  .room-qr { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .room-qr .qr { width: min(240px, 70vw); }
  .room-bar { grid-template-columns: auto 1fr 1.3fr; }
  .bd-cols { grid-template-columns: 1fr; }
  .bd-swap { transform: rotate(90deg); justify-self: center; }
  .mt-cols, .of-cols { grid-template-columns: 1fr; }
  .picker { border-radius: 0; height: 100dvh; border: 0; }
  .pk-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; padding: 12px; }
  .pk-tools .search { flex: 1 1 100%; } .pk-tools .search input { width: 100%; }
  .edit-two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .room-side.bump, .plus-btn.bump { animation: none; } .plus-layer { display: none; } }
