/* Leaderboard — self-contained styles, loaded only on leaderboard pages. */

:root {
    --lb-purple: #6d28d9;
    --lb-purple-soft: rgba(109, 40, 217, .08);
    --lb-green: #16a34a;
    --lb-line: var(--border, rgba(128, 128, 128, .16));
}

/* dark theme: same layout, colours tuned for a dark surface */
[data-theme="dark"] {
    --lb-purple: #a78bfa;
    --lb-purple-soft: rgba(167, 139, 250, .14);
    --lb-green: #34d399;
}
[data-theme="dark"] .lb-status-live { background: rgba(52, 211, 153, .16); color: #6ee7b7; }
[data-theme="dark"] .lbw-table thead th { background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .lb-digit,
[data-theme="dark"] .lb-winner-row,
[data-theme="dark"] .lb-rank-num { background: rgba(255, 255, 255, .06); }

.lb-card { background: var(--surface, #fff); border: 1px solid var(--lb-line);
           border-radius: 14px; padding: 22px; margin-bottom: 18px;
           box-shadow: 0 1px 2px rgba(0,0,0,.04); }

.lb-label { font-size: 14px; font-weight: 700; }
.lb-sub { font-size: 12px; opacity: .6; }
.lb-empty { text-align: center; opacity: .75; padding: 26px; }

/* ===== top grid ===== */
.lb-grid-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }

/* hero */
.lb-hero-title { display: none; text-align: center; font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.lb-hero-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.lb-trophy { font-size: 58px; line-height: 1; }
.lb-pool-block { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.lb-pool-amount { font-size: 40px; font-weight: 800; color: var(--lb-purple); line-height: 1.1; }

.lb-count-block { margin-left: auto; text-align: center; }
.lb-count-title { display: inline-block; font-size: 12px; font-weight: 700; margin-bottom: 8px;
                  padding: 5px 14px; border-radius: 999px; }
.lb-status-live { background: rgba(22, 163, 74, .12); color: #15803d; }
.lb-status-ended { background: #dc2626; color: #fff; }
.lb-count-boxes { display: flex; align-items: center; gap: 6px; }
.lb-count-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lb-digit { display: inline-block; min-width: 44px; padding: 5px 6px; border: 1px solid var(--lb-line);
            border-radius: 10px; font-size: 19px; font-weight: 800;
            font-variant-numeric: tabular-nums; background: rgba(128,128,128,.04); }
.lb-unit { font-size: 10px; font-weight: 700; opacity: .55; letter-spacing: .03em; }
.lb-colon { font-weight: 800; opacity: .5; margin-bottom: 16px; }

.lb-prize-badges { display: flex; gap: 26px; flex-wrap: wrap; margin: 20px 4px 16px; align-items: flex-end; }
/* every slot the same height and amounts pinned to the bottom, so the
   money lines up whether the rank above wears a ribbon badge or not */
.lb-prize-badge { display: flex; flex-direction: column; align-items: center;
                  justify-content: flex-end; gap: 2px; min-height: 58px; }
.lb-prize-place { line-height: 1.1; }
.lb-prize-amt { font-weight: 800; }

.lb-medal { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center;
            justify-content: center; font-size: 13px; font-weight: 800; color: #fff;
            border: 2px solid rgba(255,255,255,.7); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.lb-medal-1 { background: linear-gradient(180deg, #fbbf24, #d97706); }
.lb-medal-2 { background: linear-gradient(180deg, #cbd5e1, #64748b); }
.lb-medal-3 { background: linear-gradient(180deg, #f59e0b, #b45309); }
.lb-medal-4 { background: rgba(128,128,128,.25); color: inherit; border-color: transparent; }

.lb-strip { background: var(--lb-purple-soft); border-radius: 10px; padding: 10px 14px;
            font-size: 13px; }
.lb-foot { margin-bottom: 6px; }

/* rules */
.lb-rules-title {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 12px;
}

.lb-rules ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lb-rules li {
    position: relative;
    padding-left: 24px;
    font-size: 13.5px;
}

.lb-rules li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 1px;
    width: 16px;
    height: 16px;
    background: #2db84d;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* ===== top 10 ===== */
.lb-board-title { font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.lb-board { padding-bottom: 16px; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; font-size: 12px; font-weight: 700; opacity: .6;
               padding: 10px 12px; border-bottom: 1px solid var(--lb-line); }
.lb-table td { padding: 12px; border-bottom: 1px solid var(--lb-line); }
.lb-table tr:last-child td { border-bottom: 0; }
.lb-right { text-align: right; }
.lb-table th.lb-right, .lb-table td.lb-right { text-align: right; }

.lb-first td { background: var(--lb-purple-soft); }
.lb-first td:first-child { border-radius: 10px 0 0 10px; }
.lb-first td:last-child { border-radius: 0 10px 10px 0; }

.lb-rank-cell { width: 70px; }
.lb-rank-medal { font-size: 20px; }
.lb-rank-num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%;
               align-items: center; justify-content: center; font-weight: 800;
               background: rgba(128,128,128,.1); font-size: 13px; }

.lb-avatar { display: inline-flex; width: 34px; height: 34px; border-radius: 50%;
             align-items: center; justify-content: center; font-weight: 800; color: #fff;
             background: linear-gradient(135deg, #7c3aed, #4f46e5); margin-right: 10px;
             vertical-align: middle; font-size: 14px; }
.lb-user-name { font-weight: 600; vertical-align: middle; }
.lb-money { font-weight: 800; color: var(--lb-green); }
.lb-row-trophy { margin-left: 8px; }

.lb-me { display: flex; align-items: center; gap: 12px; margin-top: 14px;
         background: var(--lb-purple-soft); border-radius: 12px; padding: 13px 16px; flex-wrap: wrap; }
.lb-me-ico { font-size: 18px; }
.lb-me-label { font-weight: 700; }
.lb-me-rank { color: var(--lb-purple); font-weight: 800; font-size: 22px; }
.lb-me-name { font-weight: 600; }
.lb-me-money { margin-left: auto; font-weight: 800; color: var(--lb-green); font-size: 17px; }

/* ===== winners ===== */
.lb-winners-head { display: flex; align-items: center; justify-content: space-between;
                   gap: 12px; margin-bottom: 12px; }
.lb-winners-head .lb-board-title { margin-bottom: 0; }
.lb-viewall { border: 1px solid var(--lb-purple); color: var(--lb-purple); background: transparent;
              border-radius: 9px; padding: 7px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
              text-decoration: none; display: inline-block; }
[x-cloak] { display: none !important; }

.lb-winner-list { display: flex; flex-direction: column; gap: 12px; }
.lb-winner-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--lb-line);
                 border-radius: 12px; padding: 13px 14px; background: rgba(128,128,128,.03); }
.lb-winner-row:first-child { background: rgba(250, 204, 21, .08); }
.lb-avatar-md { width: 42px; height: 42px; font-size: 16px; margin: 0; }
.lb-winner-who { display: flex; flex-direction: column; gap: 2px; }
.lb-winner-name { font-weight: 700; font-size: 14px; }
.lb-winner-month { font-size: 12px; opacity: .6; }
.lb-winner-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.lb-winner-prize { font-weight: 800; color: #b45309; font-size: 17px; }
.lb-chip-paid { background: rgba(22,163,74,.14); color: var(--lb-green); font-size: 11px;
                font-weight: 800; padding: 3px 10px; border-radius: 7px; }

/* ===== mobile ===== */
@media (max-width: 860px) {
    .lb-grid-top { grid-template-columns: 1fr; }
    .lb-count-block { margin-left: 0; }
}
@media (max-width: 560px) {
    .lb-card { padding: 16px; }

    /* the prize card becomes one centered column */
    .lb-hero-title { display: block; }
    .lb-hero-head { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
    .lb-pool-block .lb-label { display: none; }   /* title already shown above the trophy */
    .lb-trophy { font-size: 78px; }
    .lb-pool-block { align-items: center; }
    .lb-pool-amount { font-size: 38px; }
    .lb-count-block { margin: 8px auto 0; }
    .lb-count-block { border-top: 1px solid var(--lb-line); padding-top: 12px; width: 100%; }
    .lb-count-boxes { justify-content: center; }
    .lb-digit { padding: 4px 5px; font-size: 17px; min-width: 40px; }
    .lb-prize-badges { justify-content: center; gap: 18px; }

    /* the TOP-10 BOARD ONLY: rows become compact cards, header row kept.
       Scoped to .lb-board so the winners tables stay real tables. */
    .lb-board .lb-table, .lb-board .lb-table tbody { display: block; }
    .lb-board .lb-table thead { display: block; }
    .lb-board .lb-table thead tr { display: flex; border: 0; background: transparent;
                         margin-bottom: 4px; padding: 0 6px; }
    .lb-board .lb-table thead th { padding: 2px 5px; font-size: 11px; border-bottom: 0; }
    .lb-board .lb-table thead th:first-child { width: 42px; flex-shrink: 0; }
    .lb-board .lb-table thead th:nth-child(2) { flex: 1; padding-left: 40px; }
    .lb-board .lb-table thead th:last-child { text-align: right; }
    .lb-board .lb-table tbody tr { display: flex; align-items: center; border: 1px solid var(--lb-line);
                   border-radius: 11px; margin-bottom: 7px; padding: 1px 6px;
                   background: rgba(128,128,128,.02); }
    .lb-board .lb-table td { border-bottom: 0; padding: 7px 5px; }
    .lb-board .lb-table td:nth-child(2) { flex: 1; min-width: 0; }
    .lb-board .lb-first td { background: transparent; }
    .lb-board tr.lb-first { background: rgba(250, 204, 21, .10); border-color: rgba(250, 204, 21, .5); }
    .lb-rank-cell { width: 42px; }
    .lb-avatar { width: 30px; height: 30px; font-size: 12px; margin-right: 7px; }
    .lb-user-name { font-size: 13.5px; }
    .lb-money { font-size: 14px; }
    .lb-row-trophy { margin-left: 5px; font-size: 14px; }
    .lb-me { gap: 8px; padding: 11px 12px; }
    .lb-me-money { font-size: 15px; }
}

/* ===== admin management page ===== */
.lb-admin-card { margin-bottom: 18px; }
.lb-h2 { font-size: 17px; font-weight: 800; margin: 0 0 14px; }
.lb-h3 { font-size: 14px; font-weight: 800; margin: 18px 0 8px; }
.lb-mt { margin-top: 12px; }
.lb-self-end { align-self: end; }
.lb-muted { opacity: .6; }

.lb-form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.lb-form-row label, .lb-ranks-grid label { display: flex; flex-direction: column; gap: 5px;
    font-size: 13px; font-weight: 600; }
.lb-form-row input, .lb-form-row select, .lb-ranks-grid input {
    padding: 9px 11px; border: 1px solid var(--lb-line); border-radius: 9px;
    background: transparent; color: inherit; font: inherit; min-width: 0; }
.lb-form-row input:focus, .lb-form-row select:focus, .lb-ranks-grid input:focus {
    outline: 2px solid var(--lb-purple); outline-offset: 0; border-color: transparent; }

.lb-ranks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px; margin-bottom: 14px; }

.lb-fold { border: 1px solid var(--lb-line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.lb-fold > summary { padding: 13px 16px; cursor: pointer; font-weight: 700; list-style: none;
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lb-fold > summary::-webkit-details-marker { display: none; }
.lb-caret { margin-left: auto; transition: transform .15s; font-size: 12px; opacity: .6; }
.lb-fold[open] > summary .lb-caret { transform: rotate(180deg); }
.lb-fold-body { padding: 14px 16px 18px; border-top: 1px solid var(--lb-line); }

.lb-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px;
    font-weight: 800; background: rgba(109,40,217,.12); color: var(--lb-purple); margin-left: 6px; }
.lb-badge-ok { background: rgba(22,163,74,.15); color: var(--lb-green); }
.lb-badge-muted { background: rgba(128,128,128,.18); color: inherit; opacity: .85; margin-left: 0; }

.lb-toggles { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.lb-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.lb-toggle input { width: 18px; height: 18px; accent-color: var(--lb-purple); }

/* ===== previous winners page ===== */
.lbw-wrap { max-width: 980px; margin: 0 auto; }
.lbw-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.lbw-trophy { font-size: 42px; line-height: 1; }
.lbw-title { font-size: 24px; font-weight: 800; line-height: 1.2; }
.lbw-sub { font-size: 13px; opacity: .6; margin-top: 4px; }

.lbw-item { border: 1px solid var(--lb-line); border-radius: 14px; margin-bottom: 14px;
    background: var(--surface, #fff); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.lbw-item > summary { list-style: none; cursor: pointer; padding: 17px 20px;
    display: flex; align-items: center; gap: 14px; }
.lbw-item > summary::-webkit-details-marker { display: none; }
.lbw-cal { font-size: 26px; }
.lbw-month { font-weight: 800; font-size: 17px; }
.lbw-range { font-size: 13px; opacity: .6; margin-top: 2px; }
.lbw-poolside { margin-left: auto; text-align: right; }
.lbw-pool-label { font-size: 12px; opacity: .6; }
.lbw-pool-amt { color: var(--lb-purple); font-weight: 800; font-size: 20px; }
.lbw-chev { font-size: 13px; opacity: .55; margin-left: 12px; transition: transform .15s; }
.lbw-item[open] .lbw-chev { transform: rotate(180deg); }

.lbw-body { padding: 4px 20px 20px; }
.lbw-inner { border: 1px solid var(--lb-line); border-radius: 12px; padding: 14px; }
.lbw-inner-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }

.lbw-strip { background: var(--lb-purple-soft); border-radius: 10px; padding: 11px 15px;
    font-size: 13px; margin-bottom: 16px; }
.lbw-strip-foot { margin: 4px 0 8px; line-height: 1.7; }

@media (max-width: 560px) {
    .lbw-item > summary { padding: 14px; gap: 10px; flex-wrap: wrap; }
    .lbw-poolside { margin-left: auto; }
    .lbw-title { font-size: 19px; }
    .lbw-body { padding: 2px 12px 14px; }
    .lbw-inner { padding: 8px; }
}

/* ===== previous winners page ===== */
.lbw-public { max-width: 980px; margin: 0 auto; padding: 28px 16px 40px;
              /* short content must not let the footer ride up mid-screen */
              min-height: calc(100vh - 240px); }
.lbw-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.lbw-trophy { font-size: 42px; line-height: 1; }
.lbw-title { font-size: 22px; font-weight: 800; margin: 0 0 2px; }
.lbw-strip { margin-bottom: 16px; }

.lbw-fold { border: 1px solid var(--lb-line); border-radius: 14px; margin-bottom: 12px;
            background: var(--surface, #fff); overflow: hidden;
            box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.lbw-fold summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
                    cursor: pointer; list-style: none; }
.lbw-fold summary::-webkit-details-marker { display: none; }
.lbw-cal { font-size: 26px; }
.lbw-when { display: flex; flex-direction: column; gap: 2px; }
.lbw-month { font-weight: 800; font-size: 16px; }
.lbw-range { font-size: 12.5px; opacity: .6; }
.lbw-pool { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lbw-pool-label { font-size: 12px; opacity: .6; }
.lbw-pool-amt { font-weight: 800; font-size: 19px; color: var(--lb-purple); }
.lbw-fold .lb-caret { margin-left: 4px; font-size: 18px; opacity: .55; flex-shrink: 0;
                      align-self: center; transition: transform .15s; }
.lbw-fold[open] .lb-caret { transform: rotate(180deg); }
.lbw-body { padding: 4px 16px 16px; }
.lbw-body-title { font-weight: 700; font-size: 14px; margin: 6px 2px 8px; }
.lbw-table { border: 1px solid var(--lb-line); border-radius: 10px; overflow: hidden; }
.lbw-table thead th { background: rgba(128,128,128,.05); }
/* "User" starts where the names start (past the avatar);
   "Prize (USD)" sits right above the amounts. */
.lbw-table thead th:nth-child(2) { padding-left: 56px; }
.lbw-table th.lb-right, .lbw-table td.lb-right { text-align: right; }
.lbw-prize { font-weight: 800; color: var(--lb-purple); }

@media (max-width: 560px) {
    .lbw-title { font-size: 17px; }

    /* summary stays one row: month left, pool right, arrow at the edge */
    .lbw-fold summary { padding: 13px 12px; gap: 8px; flex-wrap: nowrap; }
    .lbw-cal { font-size: 21px; }
    .lbw-when { flex: 1; min-width: 0; }
    .lbw-month { font-size: 14.5px; }
    .lbw-range { font-size: 11.5px; }
    .lbw-pool { flex-shrink: 0; }
    .lbw-pool-label { font-size: 10.5px; }
    .lbw-pool-amt { font-size: 16px; }
    .lbw-body { padding: 2px 8px 12px; }

    /* the winners table stays a real table: header row visible,
       three slim columns, prize on the right */
    .lbw-table { display: table; }
    .lbw-table thead { display: table-header-group; }
    .lbw-table tbody { display: table-row-group; }
    .lbw-table tr, .lbw-table tbody tr { display: table-row; border: 0; margin: 0; padding: 0;
        border-radius: 0; background: transparent; }
    .lbw-table td, .lbw-table th { display: table-cell; padding: 8px 6px; }
    .lbw-table .lb-rank-cell { width: 44px; }
    .lbw-table thead th:nth-child(2) { padding-left: 40px; }
    .lbw-table .lb-avatar { width: 28px; height: 28px; font-size: 12px; margin-right: 6px; }
    .lbw-table .lb-user-name { font-size: 13px; }
    .lbw-prize { font-size: 14px; }
}

/* ===== admin toggles ===== */
.lb-toggles { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.lb-toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; flex-wrap: wrap; }
.lb-toggle code { background: rgba(128,128,128,.1); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.lb-toggle input { width: 17px; height: 17px; accent-color: var(--lb-purple); }

/* rosette rank badges */
.lb-rosette { vertical-align: middle; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.2)); }
/* the ribbon tails hang into the row padding instead of stretching the row */
.lb-table .lb-rosette, .lbw-table .lb-rosette { margin: -6px 0 -9px; }
.lb-winner-row .lb-rank-num, .lb-prize-badge .lb-rank-num { display: inline-flex; width: 28px;
    height: 28px; border-radius: 50%; align-items: center; justify-content: center;
    font-weight: 800; background: rgba(128,128,128,.12); font-size: 13px; }

/* winners section on the leaderboard page shares the winners-page table look */
.lb-winners .lbw-table { border: 1px solid var(--lb-line); border-radius: 10px; overflow: hidden; }
.lb-winners-sub { margin: -8px 0 14px; }

/* the prize zone: every rank that pays a prize sits on a soft green,
   so members can see at a glance where they need to rank to win */
.lb-board .lb-table tr.lb-in-prize td { background: rgba(22, 163, 74, .07); }
@media (max-width: 560px) {
    .lb-board .lb-table tbody tr.lb-in-prize { background: rgba(22, 163, 74, .08);
        border-color: rgba(22, 163, 74, .38); }
    .lb-board .lb-table tbody tr.lb-in-prize td { background: transparent; }
}

/* winning-rank labels under the hero badges */
.lb-prize-place { font-size: 11px; font-weight: 700; opacity: .55; letter-spacing: .02em; }

/* ===== admin page on mobile ===== */
.lb-fold-body { overflow-x: auto; }
@media (max-width: 700px) {
    .lb-admin-card { padding: 14px; }
    .lb-h2 { font-size: 16px; }
    .lb-h3 { font-size: 13.5px; }
    .lb-form-row { flex-direction: column; gap: 10px; }
    .lb-form-row label { width: 100%; }
    .lb-form-row input, .lb-form-row select { width: 100%; box-sizing: border-box; }
    .lb-ranks-grid { grid-template-columns: 1fr 1fr; }
    .lb-ranks-grid label { min-width: 0; }
    .lb-ranks-grid input { width: 100%; box-sizing: border-box; min-width: 0; }
    .lb-fold summary { font-size: 13px; flex-wrap: wrap; padding: 11px 12px; row-gap: 2px; }
    .lb-fold-body { padding: 10px 8px 14px; }
    /* wide admin tables (distribution / standings / pinned) scroll sideways
       instead of being crushed */
    .lb-fold-body .lb-table { min-width: 540px; }
    .lb-self-end { align-self: stretch; }
    .lb-self-end .btn, .lb-form-row + .btn { width: 100%; }
    .lb-toggle { font-size: 13px; }
    .lb-toggle code { word-break: break-all; font-size: 11px; }
}

/* small prize line under the username on the top-10 board */
.lb-user-wrap { display: inline-flex; flex-direction: column; gap: 1px; vertical-align: middle; }
.lb-row-prize { font-size: 11px; font-weight: 700; color: var(--lb-purple); line-height: 1.2; }

/* ================= MODERN 3D SKIN =================
   Pure visual layer on top of everything above: depth, gloss, gradients.
   Same selectors, later in the file, so structure/layout stay untouched. */

.lb-card, .lbw-fold {
    border-radius: 18px;
    border-color: var(--lb-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55),
                0 1px 2px rgba(16, 22, 35, .05),
                0 12px 30px rgba(16, 22, 35, .09);
}
[data-theme="dark"] .lb-card, [data-theme="dark"] .lbw-fold {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05),
                0 1px 2px rgba(0, 0, 0, .35),
                0 14px 34px rgba(0, 0, 0, .45);
}

/* hero: soft purple glow behind the trophy + gradient money */
.lb-hero { position: relative; overflow: hidden; }
.lb-hero::before { content: ''; position: absolute; inset: -40% -20% auto -20%; height: 75%;
    background: radial-gradient(closest-side, rgba(124, 58, 237, .12), transparent 70%);
    pointer-events: none; }
.lb-pool-amount, .lbw-pool-amt, .lb-me-rank {
    background: linear-gradient(135deg, #8b5cf6, #4f46e5);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .lb-pool-amount, [data-theme="dark"] .lbw-pool-amt, [data-theme="dark"] .lb-me-rank {
    background: linear-gradient(135deg, #c4b5fd, #818cf8);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* countdown digits: keycap look */
.lb-digit {
    background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(238, 240, 246, .9));
    border: 1px solid var(--lb-line);
    box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--lb-line), 0 5px 10px rgba(16, 22, 35, .08);
}
[data-theme="dark"] .lb-digit {
    background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 rgba(0, 0, 0, .4), 0 5px 10px rgba(0, 0, 0, .35);
}

/* status chips: glossy pills */
.lb-count-title { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(16, 22, 35, .08); }
.lb-status-ended { background: linear-gradient(180deg, #ef4444, #dc2626);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 12px rgba(220, 38, 38, .35); }

/* board rows: floating cards with hover lift (desktop rows + mobile cards) */
.lb-board .lb-table tbody tr { transition: transform .14s ease, box-shadow .14s ease; }
@media (min-width: 561px) {
    .lb-board .lb-table tbody tr:hover td { background: rgba(124, 58, 237, .04); }
}
@media (max-width: 560px) {
    .lb-board .lb-table tbody tr {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 10px rgba(16, 22, 35, .07);
    }
    [data-theme="dark"] .lb-board .lb-table tbody tr {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 3px 10px rgba(0, 0, 0, .35);
    }
    .lb-winner-row { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 10px rgba(16, 22, 35, .07); }
    [data-theme="dark"] .lb-winner-row { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 3px 10px rgba(0, 0, 0, .35); }
}

/* green prize zone gets gentle depth too */
.lb-board .lb-table tbody tr.lb-in-prize { border-color: rgba(22, 163, 74, .4); }
.lb-board .lb-table tr.lb-in-prize td { background: linear-gradient(180deg, rgba(34, 197, 94, .1), rgba(22, 163, 74, .05)); }
@media (max-width: 560px) {
    .lb-board .lb-table tbody tr.lb-in-prize {
        background: linear-gradient(180deg, rgba(34, 197, 94, .12), rgba(22, 163, 74, .05)); }
    .lb-board .lb-table tbody tr.lb-in-prize td { background: transparent; }
}

/* avatars: ring + depth; rosettes: deeper shadow */
.lb-avatar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(79, 70, 229, .35); }
.lb-rosette { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .28)); }

/* your-rank strip + info strips: gradient panels */
.lb-me { background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(79, 70, 229, .1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(79, 70, 229, .12); }
[data-theme="dark"] .lb-me { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 16px rgba(0, 0, 0, .3); }
.lb-strip { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); border-radius: 12px; }

/* buttons and view-all: gradient + press */
.lb-viewall { background: linear-gradient(180deg, #8b5cf6, #6d28d9); color: #fff; border: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 12px rgba(109, 40, 217, .35);
    transition: transform .12s ease, box-shadow .12s ease; }
.lb-viewall:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 2px 6px rgba(109, 40, 217, .3); }

/* accordion summaries: subtle hover */
.lbw-fold summary, .lb-fold summary { transition: background .12s ease; }
.lbw-fold summary:hover, .lb-fold summary:hover { background: rgba(124, 58, 237, .05); }

/* winners tables: floating panel */
.lb-winners .lbw-table, .lbw-body .lbw-table {
    box-shadow: 0 4px 14px rgba(16, 22, 35, .06); }
[data-theme="dark"] .lb-winners .lbw-table, [data-theme="dark"] .lbw-body .lbw-table {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }

/* ================= ADMIN PAGE POLISH =================
   The member pages got the 3D treatment; the admin cards, inputs and
   folds now match it. Pure visual — nothing structural. */

.lb-admin-card {
    border-radius: 16px; padding: 24px; border: 1px solid var(--lb-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55),
                0 1px 2px rgba(16, 22, 35, .05),
                0 10px 26px rgba(16, 22, 35, .08);
}
[data-theme="dark"] .lb-admin-card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05),
                0 1px 2px rgba(0, 0, 0, .35),
                0 12px 30px rgba(0, 0, 0, .4);
}
.lb-admin-card .lb-h2 { margin-bottom: 18px; }

.lb-form-row input, .lb-form-row select, .lb-ranks-grid input {
    background: var(--surface, transparent);
    border: 1px solid var(--lb-line); border-radius: 10px; padding: 10px 12px;
    box-shadow: inset 0 1px 2px rgba(16, 22, 35, .05);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.lb-form-row input:focus, .lb-form-row select:focus, .lb-ranks-grid input:focus {
    outline: none; border-color: var(--lb-purple);
    box-shadow: inset 0 1px 2px rgba(16, 22, 35, .04), 0 0 0 3px rgba(124, 58, 237, .18);
}
.lb-form-row label, .lb-ranks-grid label { font-weight: 600; gap: 6px; }
.lb-ranks-grid { gap: 12px; }

.lb-fold {
    border-radius: 13px;
    box-shadow: 0 2px 8px rgba(16, 22, 35, .05);
    background: var(--surface, transparent);
}
[data-theme="dark"] .lb-fold { box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.lb-fold summary { font-size: 14px; }

.lb-toggles { gap: 14px; }
.lb-toggle { font-weight: 600; }

/* ================= ADMIN LAYOUT v2: switches + create modal ================= */
.lb-page-head { display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.lb-page-head .page-title { margin: 0; }
.lb-create-btn { box-shadow: 0 4px 12px rgba(59, 92, 246, .3); }

/* toggle switches */
.lb-switch { position: relative; display: inline-flex; flex-shrink: 0; }
.lb-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lb-switch-track { width: 42px; height: 23px; border-radius: 999px; background: rgba(128,128,128,.32);
    display: inline-block; position: relative; transition: background .15s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.15); }
.lb-switch-knob { position: absolute; top: 2.5px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.lb-switch input:checked + .lb-switch-track { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.lb-switch input:checked + .lb-switch-track .lb-switch-knob { transform: translateX(18px); }

/* create modal */
[x-cloak] { display: none !important; }
.lb-modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 24, .55);
    backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center;
    padding: 18px; }
.lb-modal { background: var(--surface, #fff); border-radius: 18px; width: 100%; max-width: 680px;
    max-height: 92vh; overflow-y: auto; padding: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255,255,255,.5); }
[data-theme="dark"] .lb-modal { box-shadow: 0 24px 70px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255,255,255,.05); }
.lb-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.lb-modal-head .lb-h2 { margin: 0; }
.lb-modal-x { border: 0; background: rgba(128,128,128,.12); width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; font-size: 14px; color: inherit; }
.lb-modal-x:hover { background: rgba(128,128,128,.22); }

/* rank rows inside the modal */
.lb-rank-head, .lb-rank-row { display: grid; grid-template-columns: 46px 1fr 1.3fr;
    gap: 10px; align-items: center; }
.lb-rank-head { font-size: 11px; font-weight: 700; opacity: .55; margin: 14px 0 6px; }
.lb-rank-row { margin-bottom: 8px; }
.lb-rank-row input { border: 1px solid var(--lb-line); border-radius: 10px; padding: 9px 11px;
    background: var(--surface, transparent); color: inherit; width: 100%; box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(16,22,35,.05); min-width: 0; }
.lb-rank-row input:focus { outline: none; border-color: var(--lb-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.lb-rank-row .lb-rank-num { justify-self: center; }

.lb-modal-foot { display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.lb-pool-live { font-size: 15px; }
.lb-pool-live strong { color: var(--lb-purple); font-size: 19px; }

@media (max-width: 560px) {
    .lb-modal { padding: 15px; border-radius: 14px; }
    .lb-rank-head { display: none; }
    .lb-rank-row { grid-template-columns: 34px 1fr; grid-template-areas: 'n prize' 'n member'; row-gap: 6px; }
    .lb-rank-row .lb-rank-num { grid-area: n; }
    .lb-rank-row input.lb-prize-in { grid-area: prize; }
    .lb-rank-row input[type=email] { grid-area: member; }
    .lb-modal-foot { flex-direction: column; align-items: stretch; text-align: center; }
}

/* member pages: toggles + save + create on one clean row */
.lb-member-row { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; }
.lb-member-row .lb-toggles { flex-direction: row; align-items: center; gap: 22px; flex-wrap: wrap; }
@media (max-width: 700px) {
    .lb-member-row { flex-direction: column; align-items: stretch; }
    .lb-member-row .lb-toggles { flex-direction: column; align-items: flex-start; gap: 12px; }
    .lb-member-row .lb-create-btn { width: 100%; }
}

/* modal head actions + member search dropdowns */
.lb-modal-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lb-ac { position: relative; min-width: 0; }
.lb-ac input { width: 100%; box-sizing: border-box; border: 1px solid var(--lb-line);
    border-radius: 10px; padding: 9px 11px; background: var(--surface, transparent);
    color: inherit; box-shadow: inset 0 1px 2px rgba(16,22,35,.05); min-width: 0; }
.lb-ac input:focus { outline: none; border-color: var(--lb-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.lb-ac input.lb-ac-miss { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }
.lb-ac-drop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface, #fff); border: 1px solid var(--lb-line); border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18); overflow: hidden; max-height: 210px; overflow-y: auto; }
.lb-ac-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    width: 100%; text-align: left; border: 0; background: transparent; color: inherit;
    padding: 8px 11px; cursor: pointer; }
.lb-ac-hit:hover { background: rgba(124, 58, 237, .08); }
.lb-ac-name { font-weight: 700; font-size: 13px; }
.lb-ac-mail { font-size: 11.5px; opacity: .6; }
.lb-ac-nores { display: inline-block; margin-top: 4px; font-size: 11.5px;
    color: #dc2626; font-weight: 700; background: var(--surface, #fff);
    border: 1px solid rgba(220,38,38,.4); border-radius: 8px; padding: 3px 9px; }
@media (max-width: 560px) {
    .lb-modal-actions { width: 100%; justify-content: space-between; }
    .lb-rank-row .lb-ac { grid-area: member; }
}

/* credit confirmation popup */
.lb-modal-sm { max-width: 430px; }
.lb-credit-line { font-size: 14.5px; margin: 4px 0 16px; }
.lb-credit-toggle { margin-bottom: 18px; }
.lb-credit-actions { display: flex; justify-content: flex-end; gap: 10px; }
.lb-btn-ghost { background: rgba(128,128,128,.12); color: inherit; border: 0; }
.lb-btn-ghost:hover { background: rgba(128,128,128,.2); }