/* The signed-in part of maralnetbot.com: login.html and account.html.

   A shared file rather than inline <style> like the landing page, because these two pages share
   almost all of it and the account page is long. nginx serves /assets/ as immutable for 30 days,
   so a change to this file ships under a new name (next: app.v3.css) and both pages are edited to point
   at it. Editing it in place would leave returning visitors on the old copy for a month. */

@font-face{font-family:Vazirmatn;src:url(/assets/fonts/vazirmatn-33.0.3.woff2) format("woff2");font-weight:100 900;font-style:normal;font-display:swap}

:root{
  --brand:#0d9dcf; --brand-lt:#25b2d9; --brand-dp:#075a86; --navy:#01123e;
  --ink:#0a1a33; --ink-2:#173a63; --muted:#5b6e85; --faint:#8a9bad;
  --bg:#ffffff; --soft:#f4f8fc; --line:#e4ecf4;
  --ok:#12a670; --ok-bg:rgba(18,166,112,.10); --ok-ink:#0a6b49;
  --warn:#d98324; --warn-bg:rgba(217,131,36,.12); --warn-ink:#8a4f0c;
  --bad:#d64550; --bad-bg:rgba(214,69,80,.09); --bad-ink:#9c2b34;
  --r:18px;
  --logo:url(/assets/logo-192.png);
  --shadow:0 1px 2px rgba(10,26,51,.04), 0 12px 32px -12px rgba(10,26,51,.10);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--soft); color:var(--ink);
  font-family:Vazirmatn,system-ui,"Segoe UI",Tahoma,sans-serif;
  line-height:1.85; -webkit-font-smoothing:antialiased; font-size:15px;
}
a{color:var(--brand-dp); text-decoration:none} a:hover{color:var(--brand)}
button,input,select{font:inherit; color:inherit}
[hidden]{display:none !important}
.ltr{direction:ltr; unicode-bidi:isolate}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

.mk{background:var(--logo) center/contain no-repeat; width:36px; height:36px; display:block; flex:none}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:17px; color:var(--ink)}
.brand:hover{color:var(--ink)}

.card{background:#fff; border:1px solid var(--line); border-radius:var(--r);
      padding:clamp(18px,4vw,28px); box-shadow:var(--shadow)}
.card + .card{margin-top:16px}
h1{font-size:clamp(21px,3.6vw,27px); font-weight:800; margin:0 0 6px; line-height:1.45}
h2{font-size:18px; font-weight:700; margin:0 0 4px; line-height:1.5}
h3{font-size:16px; font-weight:700; margin:0; line-height:1.5}
.sub{color:var(--muted); margin:0 0 18px}
.note{color:var(--faint); font-size:13.5px; line-height:1.9; margin:14px 0 0}
.muted{color:var(--muted)}

/* ---------- buttons ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px;
     padding:0 22px; border-radius:999px; font-size:15px; font-weight:600; border:1px solid transparent;
     cursor:pointer; transition:background .15s, border-color .15s, color .15s; text-align:center;
     white-space:nowrap; background:none; color:var(--ink)}
.btn.primary{background:var(--brand-dp); color:#fff}
.btn.primary:hover{background:var(--navy); color:#fff}
.btn.ghost{border-color:var(--line); background:#fff}
.btn.ghost:hover{border-color:var(--brand); color:var(--brand-dp)}
.btn.danger{color:var(--bad-ink); border-color:rgba(214,69,80,.3); background:#fff}
.btn.danger:hover{background:var(--bad-bg)}
.btn.sm{min-height:40px; padding:0 16px; font-size:14px}
.btn.block{width:100%}
.btn:disabled{opacity:.5; cursor:default}
.btn:focus-visible,.tab:focus-visible,.opt:focus-visible{outline:3px solid rgba(13,157,207,.35); outline-offset:2px}
.btns{display:flex; flex-wrap:wrap; gap:10px; margin-top:16px}
.btns .btn{flex:1 1 180px}

/* ---------- status lines ---------- */
.state{display:flex; align-items:center; gap:11px; padding:13px 15px; border-radius:12px;
       background:var(--soft); color:var(--ink-2); margin-top:16px; font-size:14.5px}
.state.good{background:var(--ok-bg); color:var(--ok-ink)}
.state.bad{background:var(--bad-bg); color:var(--bad-ink)}
.state.warn{background:var(--warn-bg); color:var(--warn-ink)}
.spin{width:16px; height:16px; border-radius:50%; flex:none;
      border:2px solid rgba(13,157,207,.25); border-top-color:var(--brand); animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){ .spin{animation:none} }

.badge{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600;
       padding:2px 10px; border-radius:999px; background:var(--soft); color:var(--muted); white-space:nowrap}
.badge::before{content:""; width:7px; height:7px; border-radius:50%; background:currentColor}
.badge.active{background:var(--ok-bg); color:var(--ok-ink)}
.badge.limited{background:var(--warn-bg); color:var(--warn-ink)}
.badge.expired,.badge.disabled{background:var(--bad-bg); color:var(--bad-ink)}
.badge.plain::before{display:none}

.box{background:var(--soft); border:1px solid var(--line); border-radius:12px; padding:12px 14px;
     font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:13.5px;
     direction:ltr; text-align:left; word-break:break-all; line-height:1.7}
.qr{display:block; width:184px; height:184px; background:#fff; border:1px solid var(--line);
    border-radius:14px; padding:8px; margin:14px auto 0}
.copied{color:var(--ok); font-size:13px; text-align:center; margin-top:6px}

/* ---------- login ---------- */
.narrow{max-width:520px; margin:0 auto; padding:clamp(22px,6vw,56px) 16px 40px}
.narrow > .brand{justify-content:center; margin-bottom:clamp(18px,4vw,28px)}
.match{display:flex; align-items:center; gap:16px; background:var(--soft); border:1px solid var(--line);
       border-radius:16px; padding:14px 16px; margin:4px 0 16px}
.match .num{font-size:44px; font-weight:800; color:var(--brand-dp); line-height:1; min-width:78px;
            text-align:center; font-variant-numeric:tabular-nums}
.match p{margin:0; color:var(--ink-2); font-size:14.5px}
.steps{margin:18px 0 0; padding:0; list-style:none; counter-reset:s}
.steps li{counter-increment:s; display:flex; gap:10px; align-items:flex-start; color:var(--muted); font-size:14px; margin-top:8px}
.steps li::before{content:counter(s, persian); flex:none; width:24px; height:24px; border-radius:50%;
                  background:var(--soft); border:1px solid var(--line); color:var(--brand-dp);
                  font-size:12.5px; font-weight:700; display:grid; place-items:center; margin-top:2px}
.desk{display:none}
@media(hover:hover) and (pointer:fine) and (min-width:720px){ .desk{display:block} }

/* ---------- account shell ---------- */
.top{position:sticky; top:0; z-index:20; background:rgba(255,255,255,.9);
     backdrop-filter:saturate(180%) blur(14px); border-bottom:1px solid var(--line)}
.top .in{max-width:1040px; margin:0 auto; padding:0 16px; height:62px; display:flex; align-items:center; gap:12px}
.top .who{margin-inline-start:auto; display:flex; align-items:center; gap:10px; min-width:0}
.top .who span{color:var(--muted); font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:30vw}
.shell{max-width:1040px; margin:0 auto; padding:18px 16px 96px; display:grid; gap:18px;
       grid-template-columns:220px minmax(0,1fr); align-items:start}
.side{position:sticky; top:80px; display:flex; flex-direction:column; gap:2px}
.tab{display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:12px; color:var(--muted);
     font-weight:600; font-size:14.5px; border:0; background:none; cursor:pointer; text-align:start; width:100%; min-height:44px}
.tab svg{width:20px; height:20px; flex:none; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
.tab:hover{background:#fff; color:var(--ink)}
.tab[aria-current="page"]{background:#fff; color:var(--brand-dp); box-shadow:var(--shadow)}
@media(max-width:820px){
  .shell{grid-template-columns:minmax(0,1fr); padding-bottom:92px}
  .side{position:fixed; inset:auto 0 0 0; top:auto; z-index:25; flex-direction:row; justify-content:space-around;
        background:rgba(255,255,255,.96); backdrop-filter:blur(14px); border-top:1px solid var(--line);
        padding:6px 4px calc(6px + env(safe-area-inset-bottom)); gap:0}
  .side .tab{flex-direction:column; gap:2px; font-size:11px; padding:6px 2px; min-height:52px; justify-content:center; text-align:center}
  .side .tab[aria-current="page"]{box-shadow:none; background:none}
  .side .tab.more-only{display:none}
  .top .who span{display:none}
}

.head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px}
.head h1{margin:0}
.grid{display:grid; gap:14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:820px){ .g3{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:560px){ .g2,.g3{grid-template-columns:minmax(0,1fr)} }

.stat{background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px 16px}
.stat .k{color:var(--muted); font-size:13px}
.stat .v{font-size:22px; font-weight:800; margin-top:2px; line-height:1.4; font-variant-numeric:tabular-nums}
.stat .v small{font-size:13px; font-weight:500; color:var(--muted)}

.row{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 0;
     border-bottom:1px solid var(--line); font-size:14.5px}
.row:last-child{border-bottom:0}
.row .k{color:var(--muted)}
.row .v{font-weight:600; text-align:left}

.svc{background:#fff; border:1px solid var(--line); border-radius:16px; padding:16px}
.svc .hd{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.svc .meta{display:flex; flex-wrap:wrap; gap:6px 16px; color:var(--muted); font-size:13.5px; margin-top:6px}
.bar{height:8px; border-radius:99px; background:var(--soft); overflow:hidden; margin-top:12px}
.bar i{display:block; height:100%; background:linear-gradient(90deg,var(--brand-lt),var(--brand-dp)); border-radius:99px}
.svc .acts{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px}
.svc .acts .btn{flex:1 1 120px}

.opts{display:grid; gap:10px; grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.opt{position:relative; text-align:start; background:#fff; border:1.5px solid var(--line); border-radius:16px;
     padding:14px 16px; cursor:pointer; transition:border-color .15s, box-shadow .15s; width:100%}
.opt:hover{border-color:var(--brand-lt)}
.opt[aria-pressed="true"]{border-color:var(--brand-dp); box-shadow:0 0 0 3px rgba(13,157,207,.15)}
.opt .t{font-weight:700; font-size:15px}
.opt .p{font-weight:800; font-size:18px; margin-top:6px; font-variant-numeric:tabular-nums}
.opt .p small{font-weight:500; font-size:13px; color:var(--muted)}
.opt .s{color:var(--muted); font-size:13px}
.opt .gift{position:absolute; inset-block-start:10px; inset-inline-end:10px; font-size:11.5px; font-weight:700;
           background:var(--brand-dp); color:#fff; padding:1px 9px; border-radius:99px}
.opt:disabled{opacity:.5; cursor:not-allowed}
.coins{grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}
.coins .opt{text-align:center; text-transform:uppercase; font-weight:700; padding:12px 8px}

.seg{display:inline-flex; background:#fff; border:1px solid var(--line); border-radius:999px; padding:4px; gap:2px; flex-wrap:wrap}
.seg button{border:0; background:none; border-radius:999px; padding:7px 16px; font-weight:600; font-size:14px; color:var(--muted); cursor:pointer; min-height:38px}
.seg button[aria-pressed="true"]{background:var(--brand-dp); color:#fff}

.step{margin-top:22px}
.step > .lbl{font-weight:700; font-size:15px; margin:0 0 10px; display:flex; align-items:center; gap:8px}
.step > .lbl b{width:24px; height:24px; border-radius:50%; background:var(--brand-dp); color:#fff; font-size:12.5px; display:grid; place-items:center}
.sum{position:sticky; bottom:12px; margin-top:22px; background:var(--navy); color:#fff; border-radius:18px; padding:14px 16px;
     display:flex; align-items:center; gap:14px; flex-wrap:wrap; box-shadow:0 18px 40px -18px rgba(1,18,62,.6)}
.sum .txt{flex:1 1 200px; min-width:0}
.sum .txt small{display:block; color:rgba(255,255,255,.7); font-size:12.5px}
.sum .txt b{font-size:18px}
.sum .btn.primary{background:#fff; color:var(--navy)}
.sum .btn.primary:hover{background:#e8f6fc}
@media(max-width:820px){ .sum{bottom:84px} }

table.list{width:100%; border-collapse:collapse; font-size:14px}
table.list th{color:var(--faint); font-weight:600; font-size:12.5px; text-align:start; padding:8px 10px; border-bottom:1px solid var(--line)}
table.list td{padding:11px 10px; border-bottom:1px solid var(--line); vertical-align:middle}
table.list tr:last-child td{border-bottom:0}
table.list .num{font-variant-numeric:tabular-nums; white-space:nowrap}
.plus{color:var(--ok-ink)} .minus{color:var(--bad-ink)}
@media(max-width:560px){
  table.list thead{display:none}
  table.list tr{display:grid; grid-template-columns:1fr auto; gap:2px 10px; padding:10px 0; border-bottom:1px solid var(--line)}
  table.list td{border:0; padding:0}
  table.list td.opt-col{display:none}
}

.empty{text-align:center; color:var(--muted); padding:28px 12px}
.empty .btn{margin-top:12px}

.toast{position:fixed; inset-inline:16px; bottom:22px; margin:0 auto; max-width:420px; z-index:60;
       background:var(--navy); color:#fff; border-radius:14px; padding:12px 16px; font-size:14px;
       box-shadow:0 18px 40px -18px rgba(1,18,62,.6)}
@media(max-width:820px){ .toast{bottom:86px} }

dialog{border:0; border-radius:20px; padding:0; width:min(440px,calc(100vw - 32px)); box-shadow:0 30px 80px -20px rgba(1,18,62,.45)}
dialog::backdrop{background:rgba(1,18,62,.45)}
dialog .in{padding:20px}
dialog .x{float:left; border:0; background:var(--soft); width:36px; height:36px; border-radius:50%; cursor:pointer; font-size:18px; line-height:1}

.skel{background:linear-gradient(90deg,#eef3f8,#f7fafc,#eef3f8); background-size:200% 100%; animation:sk 1.3s linear infinite; border-radius:12px; min-height:84px}
@keyframes sk{to{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){ .skel{animation:none} }

.tab.mob-only{display:none}
@media(max-width:820px){ .side .tab.mob-only{display:flex} }
.links-list{display:grid; gap:8px}
.links-list a{display:flex; align-items:center; justify-content:space-between; background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 16px; color:var(--ink); font-weight:600}
.links-list a::after{content:"‹"; color:var(--faint); font-size:20px; line-height:1}
.pill-row{display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.callout{display:flex; gap:12px; align-items:flex-start; border-radius:16px; padding:14px 16px; background:var(--warn-bg); color:var(--warn-ink); margin-bottom:14px}
.callout .btn{margin-inline-start:auto}
.callout.info{background:rgba(13,157,207,.08); color:var(--ink-2)}
@media(max-width:560px){ .callout{flex-wrap:wrap} .callout .btn{margin-inline-start:0; width:100%} }

/* phones: the stat row is three small numbers, not three full-width cards; the pay bar is one line */
.stats{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:560px){
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats .stat:first-child{grid-column:1 / -1}
  .stat{padding:12px 14px} .stat .v{font-size:19px}
  .sum{padding:10px 12px; gap:10px; flex-wrap:nowrap; border-radius:16px}
  .sum .txt{flex:1 1 auto} .sum .txt b{font-size:16px}
  .sum .btn{min-height:42px; padding:0 14px; font-size:14px}
  .callout > span:first-child{display:none}
}

/* ---------- v2: dice, tutorials, rich text ---------- */
.dice-stage{display:flex; gap:18px; justify-content:center; padding:18px 0 4px}
.dice-stage.dim{opacity:.45}
.die{width:84px; height:84px; filter:drop-shadow(0 10px 16px rgba(1,18,62,.18))}
.die svg{width:100%; height:100%; display:block}
.die-body{fill:#fff; stroke:var(--line); stroke-width:3}
.die-pip{fill:var(--navy)}
.die-pip.six{fill:var(--brand-dp)}
.die.rolling{animation:tumble .45s linear infinite}
.die.landed{animation:land .45s ease-out}
@keyframes tumble{0%{transform:rotate(0) translateY(0)}25%{transform:rotate(90deg) translateY(-10px)}50%{transform:rotate(180deg) translateY(0)}75%{transform:rotate(270deg) translateY(-6px)}100%{transform:rotate(360deg) translateY(0)}}
@keyframes land{0%{transform:scale(1.18)}60%{transform:scale(.95)}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){ .die.rolling,.die.landed{animation:none} }

.rich{white-space:pre-line; line-height:2}
.rich code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; background:var(--soft); padding:1px 6px; border-radius:6px; direction:ltr; unicode-bidi:isolate}
.guides{display:grid; gap:10px; margin-top:14px}
.guide{background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden}
.guide-head,.guide-link{display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:54px;
  padding:12px 16px; background:#fff; border:0; font:inherit; font-weight:700; color:var(--ink); cursor:pointer; text-align:start}
.guide-link{border:1px solid var(--line); border-radius:16px}
.guide-head[aria-expanded="true"] span:last-child{transform:rotate(180deg)}
.guide-body{padding:4px 16px 16px; display:grid; gap:12px}
.guide-photo{margin:0}
.guide-photo img{display:block; width:100%; max-width:420px; margin:0 auto; border-radius:12px; border:1px solid var(--line); background:var(--soft)}
.guide-photo figcaption{color:var(--muted); font-size:13.5px; margin-top:6px; text-align:center; white-space:pre-line}
.guide-file{display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--soft); border-radius:12px; padding:10px 12px}
