/* maxbetmarket.com — website shell around the same Market app (the Telegram Mini App at /app stays unchanged). */
html.site body { padding: 0 0 calc(96px + env(safe-area-inset-bottom)); }
html.site #app { max-width: 1180px; margin: 0 auto; padding: 14px 14px 8px; }
html.site #app[data-page="sell"], html.site #app[data-page="edit"], html.site #app[data-page="review"] { max-width: 760px; }
html.site #app[data-page="my"], html.site #app[data-page="scams"], html.site #app[data-page="resell"], html.site #app[data-page="admin"], html.site #app[data-page="wanted"], html.site #app[data-page="top"] { max-width: 980px; }
html.site .splash { min-height: 60vh; }
.grow { flex: 1; }

/* header */
#sitehead { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
#sitehead:empty { display: none; }
.shin { max-width: 1180px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; gap: 8px; }
.sbrand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); margin-right: 14px; flex: none; }
.sbrand img { width: 24px; height: 27px; object-fit: contain; }
.sbrand b { font: 700 16px var(--font-ui); letter-spacing: -.3px; }
.sbrand b span { color: var(--gold); font-weight: 500; margin-left: 2px; }
.slinks { display: none; gap: 2px; }
.slinks a { color: var(--text-2); text-decoration: none; font: 600 14px var(--font-ui); padding: 8px 12px; border-radius: 11px; transition: color .15s, background .15s; }
.slinks a:hover { color: var(--text); background: var(--raise); }
.slinks a.on { color: var(--gold); background: var(--gold-soft); }
.ssell { display: none; text-decoration: none; width: auto; }
.ssell.on { outline: 2px solid var(--gold-line); }
.sacct { display: none; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 600 14px var(--font-ui); padding: 4px 10px 4px 4px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--card); max-width: 180px; }
.sacct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sacct.on { border-color: var(--gold-line); }
.sacct .ava { width: 30px; height: 30px; border-radius: 10px; flex: none; }
#sitehead .iconbtn { text-decoration: none; display: grid; place-items: center; }
#sitehead .webauth { width: auto; margin: 0; }
#sitehead .btn.sm { padding: 9px 14px; }
.pagebar { margin: 0 0 10px; }

/* listings as a grid of cards */
.lgrid { display: block; }

/* landing hero + how it works (site browse page) */
.mh em { font-style: normal; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hsub { color: rgba(242,237,230,.62); font-size: 14px; line-height: 1.5; margin: -4px 0 16px; max-width: 640px; }
.how { margin: 28px 0 10px; }
.how h2 { margin: 0 6px 12px; }
.howg .card { position: relative; padding: 18px 18px 16px 62px; }
.howg .card b { display: block; font-size: 15px; margin-bottom: 4px; }
.howg .card p { margin: 0; line-height: 1.5; }
.hn { position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 10px; background: var(--gold-grad); color: #0d0a06; font: 700 14px/30px var(--font-ui); text-align: center; }

/* footer */
.sfoot { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0 18px; }
.sfin { max-width: 1180px; margin: 0 auto; padding: 0 18px; display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.sfin > div:first-child { grid-column: 1 / -1; }
.sfin b { display: block; font: 700 13px var(--font-ui); margin-bottom: 8px; color: var(--text); }
.sfin a { display: block; color: var(--text-2); text-decoration: none; font-size: 13.5px; padding: 4px 0; }
.sfin a:hover { color: var(--gold); }
.sfin .sbrand { margin-bottom: 8px; }
.sfin p { margin: 0; max-width: 340px; line-height: 1.5; }
.sfcopy { display: block; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }

/* login sheet */
.tglogin { text-decoration: none; display: flex; justify-content: center; align-items: center; gap: 8px; }
.tglogin[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.lqrwrap { display: none; margin: 16px auto 4px; }
.lqr { width: 168px; height: 168px; margin: 8px auto 0; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: #f6f1e8; }
.lqr svg { width: 100%; height: 100%; display: block; }
.lsteps { text-align: left; max-width: 300px; margin: 16px auto 8px; padding-left: 20px; line-height: 1.7; }
#lstate { min-height: 20px; margin-top: 6px; }
#lstate .spinner.sm { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }


@media (min-width: 640px) {
  html.site body { padding-top: 0; }
  html.site #app { max-width: 1180px; }
  html.site #nav { max-width: 560px; }
  html.site .sheet { max-width: 480px; }
  .sacct { display: flex; }
  .ssell { display: inline-flex; }
  .lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 14px; }
  .lgrid .lcard { flex-direction: column; margin: 0; padding: 10px; gap: 10px; height: 100%; transition: transform .18s var(--ease), border-color .18s; }
  .lgrid .lcard:hover { transform: translateY(-2px); border-color: var(--gold-line); }
  .lgrid .lthumb { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 14px; }
  .lgrid .lbody { padding: 0 4px 4px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .lgrid .lfoot { margin-top: auto; padding-top: 6px; }
  .howg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .howg .card { margin: 0; }
  .sfin { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .sfin > div:first-child { grid-column: auto; }
  .lqrwrap { display: block; }
  html.site .cchips { margin: 0 0 14px; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
  html.site .bquick { max-width: 720px; }
}

@media (min-width: 980px) {
  html.site body { padding-bottom: 0; }
  html.site #nav { display: none; }
  .slinks { display: flex; }
  .shin { padding: 12px 22px; }
  html.site #app { padding: 22px 22px 10px; }
  .sfin { padding: 0 22px; }
  .shero { padding: 34px 34px 30px; border-radius: 28px; margin-bottom: 16px; }
  .shero .mh { font-size: 38px; line-height: 1.1; letter-spacing: -1.4px; max-width: 760px; margin: 10px 0 12px; }
  .shero .hsub { font-size: 15.5px; margin-bottom: 22px; }
  .shero .msearch { max-width: 720px; padding: 6px 6px 6px 16px; }
  .shero .msearch input { font-size: 16px; }
  .lpage { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0 22px; align-items: start; }
  .lpage .lmain, .lpage .lside { display: block; min-width: 0; }
  .lpage .lside { position: sticky; top: 80px; }
  .lpage .gallery { margin: 0 0 8px; padding: 0; }
  .lpage .gallery img { max-height: 520px; }
  .lpage .lpbig { font-size: 32px; }
  html.site .sheet-backdrop { align-items: center; }
  html.site .sheet { border-radius: 24px; margin: auto; max-height: 88vh; }
}
@media (hover: hover) { .lgrid .lcard:active { transform: none; } }
.sback { font-weight: 600; color: var(--text-2); padding: 8px 4px; }
.sback:hover { color: var(--gold); }
@media (min-width: 980px) { html.site .sheet .grab { display: none; } }

/* Narrower side margins: half the previous left/right space at every screen size */
html.site #app { padding-left: 7px; padding-right: 7px; }
.shin { padding-left: 7px; padding-right: 7px; }
.sfin { padding-left: 9px; padding-right: 9px; }
@media (min-width: 640px) {
  html.site #app, .shin, .sfin { max-width: calc(1180px + (100vw - 1180px) / 2); }
}
@media (min-width: 980px) {
  html.site #app { padding-left: 11px; padding-right: 11px; }
  .shin, .sfin { padding-left: 11px; padding-right: 11px; }
}
