/* Levels, XP and badges: the pieces the pages share (drawn by /js/levels.js). The Crest badge, the tier colours, the
   XP bar, the tier pill, the level-up dialog and the Dashboard's "Your level" row. The dialog and the row use the
   colours and buttons of /css/txlist.css (.ycp). The public profile loads this file under a Content-Security-Policy
   that allows no inline style, so tier colours are classes here and never style attributes. */

.lv-badge { display: block; width: 100%; height: auto; overflow: visible; }

/* Each tier's metal: --tc mid, --tc2 light, --tc3 dark */
.lv-t1 { --tc: #C7804B; --tc2: #F6C9A0; --tc3: #6E3B1C; }
.lv-t2 { --tc: #B4BFD0; --tc2: #F7F9FC; --tc3: #5D6A80; }
.lv-t3 { --tc: #EDB532; --tc2: #FFE9A3; --tc3: #8C5E08; }
.lv-t4 { --tc: #86D6CE; --tc2: #E3FFFA; --tc3: #2F7A76; }
.lv-t5 { --tc: #8AB4FF; --tc2: #E6F2FF; --tc3: #4B55CF; }
.lv-t6 { --tc: #C084FC; --tc2: #FFD9F1; --tc3: #5B21B6; }

/* The XP bar: a metal bar with a shine and a tick every tenth */
.lv-bar { position: relative; height: 14px; border-radius: 8px; background: #0E1118; box-shadow: inset 0 0 0 1px #2A3142, inset 0 2px 4px rgba(0,0,0,.5); overflow: hidden; }
.lv-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0) 55%), linear-gradient(90deg, var(--tc3), var(--tc) 55%, var(--tc2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.lv-bar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,0,.35) calc(10% - 1px) 10%); }

/* "Silver · Level 14" */
.lv-pill { display: inline-flex; align-items: center; height: 30px; padding: 0 13px 0 11px; border-radius: 99px; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: #E9ECF3; background: color-mix(in srgb, var(--tc) 13%, rgba(255,255,255,.03)); border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); }
.lv-pill i { flex: none; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.lv-pill b { color: var(--tc); font-weight: 600; }

/* ---------- Level-up dialog ---------- */
body.lv-dlg-open { overflow: hidden; }
.lv-scrim { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 7, 11, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.lv-dlg { position: relative; width: 100%; max-width: 400px; max-height: calc(100vh - 32px); overflow: auto; padding: 30px 28px 24px; text-align: center; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lv-dlg:focus, .ycp .lv-dlg:focus-visible { outline: none; }
.lv-dlg::before { content: ""; position: absolute; left: 50%; top: -140px; width: 420px; height: 320px; margin-left: -210px; background: radial-gradient(closest-side, color-mix(in srgb, var(--tc) 30%, transparent), transparent); pointer-events: none; }
.lv-dlg .lv-big { position: relative; width: 150px; margin: 0 auto 8px; }
.lv-dlg .lv-kicker { position: relative; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tc); }
.lv-dlg h2 { position: relative; margin: 6px 0; font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--text); }
.lv-dlg p { position: relative; margin: 0 auto; max-width: 300px; font-size: 14px; color: var(--text-2); line-height: 1.55; }
.lv-dlg .lv-pay { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: 16px 0 4px; padding: 10px 16px; border-radius: 14px; background: rgba(61, 214, 140, .1); border: 1px solid rgba(61, 214, 140, .3); font-size: 14px; color: var(--text-2); }
.lv-dlg .lv-pay b { font-size: 20px; color: var(--in); white-space: nowrap; }
.lv-dlg .lv-btns { position: relative; display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.lv-dlg .lv-btns .btn { flex: 1; }
.lv-confetti { position: absolute; inset: 0; pointer-events: none; }
.lv-confetti i { position: absolute; width: 6px; height: 10px; border-radius: 2px; opacity: .85; }

/* ---------- Dashboard: "Your level" in the balances card ---------- */
.lv-dash { display: flex; flex-direction: column; }
.lv-dash[hidden] { display: none; }
.lv-dash-head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
.lv-dash-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px 0 4px; color: #ECEEF4; text-decoration: none; }
.lv-dash-row:hover b { text-decoration: underline; text-underline-offset: 3px; }
.lv-dash-row .lv-badge { width: 44px; }
.lv-dash-row b { display: block; font-size: 15px; font-weight: 600; color: #ECEEF4; }
.lv-dash-row b span { color: var(--tc); font-weight: 500; margin-left: 6px; }
.lv-dash-row .lv-bar { max-width: 460px; margin-top: 8px; }
.lv-dash-row small { display: block; margin-top: 6px; font-size: 12.5px; color: #8A92A5; }
.lv-dash-r { text-align: right; font-size: 12.5px; color: #8A92A5; }
.lv-dash-r b { font-size: 15px; color: #3DD68C; white-space: nowrap; }

@media (max-width: 750px) {
  .lv-dlg { padding: 26px 20px 20px; }
  .lv-dash-row { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .lv-dash-row .lv-badge { width: 40px; }
  .lv-dash-r { grid-column: 2; text-align: left; }
  .lv-dash-r b { display: inline; margin-left: 4px; font-size: 13px; }
}
