/* سیستم طراحی مینی‌اپ کوله — تم تیره و روشن */
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 100 449; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 450 649; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 650 749; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-ExtraBold.woff2") format("woff2"); font-weight: 750 849; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-Black.woff2") format("woff2"); font-weight: 850 1000; font-style: normal; font-display: swap; }
button, input, select, textarea { font-family: inherit; }
:root, [data-theme="dark"] {
  --bg: #0f1220; --bg2: #151a2e; --card: #1a2038; --card2: #212844; --line: #2b3354;
  --text: #eef1fb; --muted: #97a0bf; --accent: #7c5cff; --accent2: #22c3ee; --ok: #2fd47d; --bad: #ff5d73;
  --gold: #ffc94a; --shadow: 0 10px 30px rgba(0,0,0,.35); --glass: rgba(255,255,255,.04);
}
[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #ffffff; --card: #ffffff; --card2: #f1f3fa; --line: #e3e7f2;
  --text: #171b2e; --muted: #6b7393; --accent: #6a4dff; --accent2: #0fb2d8; --ok: #18b566; --bad: #e8435b;
  --gold: #e8a800; --shadow: 0 10px 30px rgba(40,52,100,.10); --glass: rgba(0,0,0,.02);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%;
  font-family: Vazirmatn, "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif; font-size: 15px; }
body { background: radial-gradient(1200px 500px at 100% -10%, rgba(124,92,255,.18), transparent 60%),
                   radial-gradient(900px 400px at -10% 0%, rgba(34,195,238,.12), transparent 60%), var(--bg);
       background-attachment: fixed; }
.hidden { display: none !important; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { font-weight: 900; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--card2);
        color: var(--muted); border: 1px solid var(--line); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
            color: var(--text); font-size: 18px; cursor: pointer; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.title { font-weight: 800; font-size: 16px; }
.muted { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer;
       padding: 12px 16px; border-radius: 14px; font: inherit; font-weight: 800; color: #fff; text-decoration: none;
       background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 6px 18px rgba(124,92,255,.35);
       transition: transform .08s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--card2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.bad { background: linear-gradient(135deg, #ff5d73, #ff8a5b); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
         background: #111527; color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow);
         transition: all .25s; max-width: 92vw; text-align: center; z-index: 99; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
input.field { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
              background: var(--card2); color: var(--text); font: inherit; outline: none; }
input.field:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; }
.spacer { height: 12px; }

/* ---------- بازی‌ها ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 14px 14px 40px; }
.avatar { width: 56px; height: 56px; border-radius: 18px; flex: none; display: flex; align-items: center; justify-content: center;
          font-weight: 900; font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2));
          background-size: cover; background-position: center; box-shadow: 0 6px 18px rgba(124,92,255,.35); }
.avatar.sm { width: 40px; height: 40px; border-radius: 13px; font-size: 17px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small { font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 4px 10px;
        border-radius: 99px; background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.chip.copy { cursor: pointer; direction: ltr; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card { position: relative; border-radius: 22px; padding: 16px 14px; cursor: pointer; overflow: hidden; color: #fff;
             min-height: 168px; display: flex; flex-direction: column; justify-content: space-between;
             box-shadow: var(--shadow); transition: transform .12s; border: 1px solid rgba(255,255,255,.08); }
.game-card:active { transform: scale(.97); }
.game-card .gicon { font-size: 46px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.game-card .gname { font-weight: 900; font-size: 19px; margin-top: 10px; }
.game-card .gsub { font-size: 12px; opacity: .85; margin-top: 2px; }
.game-card .gfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; font-weight: 800; }
.game-card .badge { background: rgba(0,0,0,.25); padding: 4px 9px; border-radius: 99px; backdrop-filter: blur(4px); }
.game-card::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; left: -40px; top: -50px;
                    background: rgba(255,255,255,.12); }
.g-chess { background: linear-gradient(150deg, #3b2f8f, #6a4dff 55%, #22c3ee); }
.g-hokm { background: linear-gradient(150deg, #8f1d3b, #e8435b 55%, #ffb547); }
.game-card.soon { filter: grayscale(.4); opacity: .8; }
.section-title { font-weight: 900; font-size: 15px; margin: 22px 4px 10px; display: flex; align-items: center; justify-content: space-between; }
.progress { height: 8px; border-radius: 8px; background: var(--card2); overflow: hidden; direction: ltr; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.stats .s { background: var(--card2); border-radius: 14px; padding: 10px 4px; }
.stats .v { font-weight: 900; font-size: 18px; }
.stats .k { font-size: 11px; color: var(--muted); margin-top: 2px; }
.modes { display: grid; gap: 10px; }
.mode { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--card);
        border: 1px solid var(--line); cursor: pointer; transition: transform .1s, border-color .2s; color: var(--text); text-align: right; font: inherit; width: 100%; }
.mode:active { transform: scale(.98); }
.mode:hover { border-color: var(--accent); }
.mode .mi { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--card2); flex: none; }
.mode .mt { font-weight: 900; }
.mode .ms { font-size: 12px; color: var(--muted); margin-top: 2px; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.levels button { padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); color: var(--text);
                 font: inherit; font-weight: 800; cursor: pointer; }
.levels button small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; margin-top: 2px; }
.tabs { display: flex; gap: 6px; background: var(--card2); padding: 4px; border-radius: 14px; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; padding: 9px; border-radius: 11px; cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-row .rk { width: 28px; text-align: center; font-weight: 900; color: var(--muted); }
.lb-row.me { background: rgba(124,92,255,.10); border-radius: 12px; }
.league-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.league-list .lg { text-align: center; padding: 10px 2px; border-radius: 14px; background: var(--card2); font-size: 11px; color: var(--muted); }
.league-list .lg b { display: block; font-size: 22px; }
.league-list .lg.cur { outline: 2px solid var(--accent); color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 6px; }
.link-btn.back, button.back { height: 40px; padding: 0 14px 0 12px; border-radius: 14px; background: var(--card); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--text) !important; font: inherit; font-weight: 900; font-size: 14px; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.18); text-decoration: none; }
.link-btn.back:active, button.back:active { transform: scale(.96); }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.modal { position: fixed; inset: 0; background: rgba(5,8,20,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; backdrop-filter: blur(3px); }
.modal .card { width: 100%; max-width: 380px; text-align: center; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.delta-up { color: var(--ok); font-weight: 900; }
.delta-down { color: var(--bad); font-weight: 900; }

/* ================= پوسته‌ها ================= */
/* نئون آرکید */
html[data-skin="neon"][data-theme="dark"] {
  --bg: #07050f; --bg2: #0d0920; --card: rgba(255,255,255,.05); --card2: rgba(255,255,255,.09); --line: rgba(170,140,255,.24);
  --text: #f4f0ff; --muted: #a69bc9; --accent: #ff2e96; --accent2: #00e5ff; --ok: #b6ff3c; --bad: #ff4d6d;
  --shadow: 0 0 0 1px rgba(170,140,255,.22), 0 0 26px rgba(124,60,255,.22);
}
html[data-skin="neon"][data-theme="light"] {
  --bg: #f6f3ff; --bg2: #ffffff; --card: #ffffff; --card2: #f1ecff; --line: #e2d7ff;
  --text: #1b1235; --muted: #6c5f92; --accent: #e0127a; --accent2: #0099b8; --ok: #2e9e00; --bad: #e0244a;
  --shadow: 0 0 0 1px rgba(224,18,122,.14), 0 8px 26px rgba(124,60,255,.14);
}
html[data-skin="neon"] body { background: radial-gradient(520px 340px at 90% -5%, rgba(255,46,150,.22), transparent 65%),
  radial-gradient(520px 360px at -10% 25%, rgba(0,229,255,.16), transparent 65%), var(--bg); background-attachment: fixed; }
html[data-skin="neon"] .card { backdrop-filter: blur(8px); }
html[data-skin="neon"] .btn { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent); }
html[data-skin="neon"] .avatar { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent); }
/* پاستیلی بازیگوش */
html[data-skin="pastel"][data-theme="light"] {
  --bg: #f7f2ea; --bg2: #ffffff; --card: #ffffff; --card2: #f3ede4; --line: #eadfce;
  --text: #2a2340; --muted: #7a7290; --accent: #ff7a59; --accent2: #5b8cff; --ok: #2fc48d; --bad: #ef5a5a;
  --shadow: 0 6px 0 #e7dccb, 0 14px 24px rgba(120,90,50,.10);
}
html[data-skin="pastel"][data-theme="dark"] {
  --bg: #1d1a26; --bg2: #26212f; --card: #2a2536; --card2: #342d42; --line: #3e3651;
  --text: #f6efe6; --muted: #b6abc6; --accent: #ff8a6b; --accent2: #7aa2ff; --ok: #4fd6a2; --bad: #ff7a7a;
  --shadow: 0 6px 0 #120f18, 0 14px 24px rgba(0,0,0,.25);
}
html[data-skin="pastel"] body { background: radial-gradient(420px 260px at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
  radial-gradient(380px 260px at 0% 35%, color-mix(in srgb, var(--ok) 14%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
html[data-skin="pastel"] .card { border-radius: 24px; }
html[data-skin="pastel"] .btn { background: var(--accent); box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 70%, #000); border-radius: 16px; }
html[data-skin="pastel"] .btn:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 70%, #000); }
html[data-skin="pastel"] .btn.ghost { background: var(--card2); box-shadow: 0 4px 0 var(--line); }
html[data-skin="pastel"] .icon-btn { border-radius: 14px; box-shadow: 0 3px 0 var(--line); }
html[data-skin="pastel"] .avatar { border-radius: 22px; box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 60%, #000); }
