:root {
    --gold:   #c9a84c;
    --gold-l: #e2c97a;
    --gold-d: #9b7b2c;

    --frame:   #1e2d42;
    --frame-l: #26384f;
    --frame-d: #0d1826;

    --bg:    #09131f;
    --panel: rgba(9, 17, 30, 0.96);
    --slot:  rgba(7, 13, 24, 0.95);
    --slot-border: #182438;

    --text:   #b8c8d8;
    --text-l: #ccdaeb;
    --dim:    rgba(180, 200, 220, 0.75);

    --green: #c9a84c;
    --red:   #c0392b;

    --section-bg: rgba(201, 168, 76, 0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
}

h4 {
    margin: 0;
}

/* ===== WINDOW ===== */
.l2-window {
    width: 100%;
    max-width: 65rem;
    margin: 6rem auto auto auto;
    padding: 0;
    position: relative;
    border: 0.125rem solid var(--frame-l);
    background: var(--panel);
    overflow-x: hidden;
    box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.4),
    inset 0 0 0 0.0625rem rgba(90, 77, 58, 0.1),
    0 0.5rem 3rem rgba(0, 0, 0, 0.6),
    0 0 2.5rem rgba(201, 168, 76, 0.05);
    overflow: hidden;
}

.l2-window::before {
    content: '';
    display: block;
    height: 0.1875rem;
    background: linear-gradient(90deg,
    transparent 0%,
    var(--gold-d) 20%,
    var(--gold) 50%,
    var(--gold-d) 80%,
    transparent 100%);
    opacity: 0.27;
}

.l2-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 44rem) {
    .l2-body {
        grid-template-columns: 1fr;
    }
}

.l2-col {
    padding: 1.5rem 1.375rem;
}

.l2-col:first-child {
    background: linear-gradient(160deg, rgba(30, 50, 80, 0.18) 0%, transparent 60%);
}


.l2-col:last-child {
    background: linear-gradient(160deg, rgba(5, 10, 20, 0.35) 0%, rgba(9, 17, 30, 0.1) 100%);
}

.l2-col + .l2-col {
    border-left: 0.0625rem solid var(--frame);
}

@media (max-width: 44rem) {
    .l2-col + .l2-col {
        border-left: none;
        border-top: 0.0625rem solid var(--frame);
    }

    .l2-window {
        margin: 1rem 0.5rem;
        width: calc(100% - 1rem);
    }

    .slot-grid {
        flex-wrap: wrap;
    }

    .slot {
        flex: 1 1 calc(33.333% - 0.3rem);
        min-width: calc(33.333% - 0.3rem);
    }
}

.l2-section {
    font-family: 'MedievalSharp', serif;
    font-size: 1.3rem;
    color: var(--gold-d);
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    padding: 0 0 0.375rem 0;
    margin-bottom: 0.5rem;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.l2-section::before {
    content: '';
    width: 0.1875rem;
    height: 0.9rem;
    background: linear-gradient(180deg, var(--gold), var(--gold-d));
    flex-shrink: 0;
    box-shadow: 0 0 0.4rem rgba(201, 168, 76, 0.3);
}

.l2-section::after {
    content: '';
    flex: 1;
    height: 0.0625rem;
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.2), transparent);
}

/* ===== INPUT ===== */
.l2-field {
    margin-bottom: 0.875rem;
    position: relative;
}


.l2-label {
    font-size: 0.7rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.l2-input {
    width: 100%;
    box-sizing: border-box;
    height: 3rem;
    padding: 0.625rem 0.875rem;
    background: rgba(5, 10, 20, 0.85);
    border: 0.0625rem solid rgba(30, 50, 80, 0.7);
    border-radius: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    color: var(--text-l);
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.l2-input:focus {
    border-color: rgba(201, 168, 76, 0.35);
    background: rgba(7, 13, 26, 0.95);
    box-shadow: 0 0 0.75rem rgba(201, 168, 76, 0.06);
}

.l2-input::placeholder {
    color: rgba(200, 191, 168, 0.3);
    font-style: italic;
    font-size: 0.875rem;
}

.l2-input.error1 {
    border-left-color: var(--red);
    box-shadow: inset 0.25rem 0 0.5rem rgba(192, 57, 43, 0.08);
}

.l2-input:-webkit-autofill,
.l2-input:-webkit-autofill:hover,
.l2-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-l);
    -webkit-box-shadow: 0 0 0 62.5rem rgba(5, 10, 20, 0.95) inset;
    box-shadow: 0 0 0 62.5rem rgba(5, 10, 20, 0.95) inset;
    border-color: rgba(201, 168, 76, 0.2);
    caret-color: var(--text-l);
    transition: background-color 5000s ease-in-out 0s;
}

.field-error1 {
    font-size: 0.75rem;
    color: var(--red);
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.field-error1.show {
    display: block;
}

/* ===== COIN SLOT ===== */
.coin-slot {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    margin: 0.75rem 0;
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.06) 0%, rgba(7, 13, 24, 0.95) 100%);
    border: 0.0625rem solid rgba(30, 50, 80, 0.6);
    border-left: 0.1875rem solid var(--gold-d);
    box-shadow: inset 0 0 1.5rem rgba(9, 20, 40, 0.3);
}



.coin-amount {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--gold-l);
    text-shadow: 0 0 0.75rem rgba(201, 168, 76, 0.15);
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: 7rem;
    padding: 0;
    -moz-appearance: textfield;
    cursor: text;
}

.coin-amount::-webkit-inner-spin-button,
.coin-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.coin-amount:focus {
    color: var(--gold);
    text-shadow: 0 0 1rem rgba(201, 168, 76, 0.3);
}

.coin-price {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--dim);
    text-align: right;
}

.coin-price b {
    color: var(--gold);
    font-size: 0.95rem;
    display: block;
}

/* ===== PRESET SLOTS ===== */
.slot-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    margin: 0.625rem 0;
}

.slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    color: var(--text);
    cursor: pointer;
    transition: all .3s;
    position: relative;
    overflow: hidden;
    padding: 0.3rem 0.4rem;
    flex: 1;
    min-width: 0;
    gap: 0.25rem;
}

.slot-val {
    font-family: 'Cinzel', serif;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.slot-usd {
    font-family: 'Raleway', sans-serif;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--gold-d);
    padding: 0.1rem 0.25rem;
    background: rgba(201, 168, 76, 0.07);
    border: 0.0625rem solid rgba(201, 168, 76, 0.18);
    letter-spacing: 0.01em;
    transition: color .3s, background .3s, border-color .3s;
    white-space: nowrap;
}

/* corner ornaments via gradients */
.slot::before, .slot::after {
    content: '';
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    transition: all .3s;
    opacity: 0.3;
}

.slot::before {
    top: 0;
    left: 0;
    border-top: 0.0625rem solid var(--gold-d);
    border-left: 0.0625rem solid var(--gold-d);
}

.slot::after {
    bottom: 0;
    right: 0;
    border-bottom: 0.0625rem solid var(--gold-d);
    border-right: 0.0625rem solid var(--gold-d);
}

.slot:hover, .slot.on {
    border-color: var(--gold-d);
    color: var(--gold-l);
    background: linear-gradient(180deg, rgba(201, 168, 76, 0.1) 0%, rgba(201, 168, 76, 0.02) 100%);
    box-shadow: 0 0 0.75rem rgba(201, 168, 76, 0.08), inset 0 0 1rem rgba(201, 168, 76, 0.03);
}

.slot:hover::before, .slot.on::before,
.slot:hover::after, .slot.on::after {
    opacity: 0.8;
    width: 0.75rem;
    height: 0.75rem;
}

.slot:hover .slot-usd, .slot.on .slot-usd {
    color: var(--gold-l);
    background: rgba(201, 168, 76, 0.13);
    border-color: rgba(201, 168, 76, 0.4);
}

.slot:active {
    transform: scale(0.96);
}

/* ===== SLIDER ===== */
.bar-wrap {
    margin: 0.75rem 0 0;
}

.bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--dim);
    margin-bottom: 0.25rem;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 0.5rem;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.375rem;
    background: linear-gradient(180deg, var(--gold-l), var(--gold-d));
    border: 0.0625rem solid var(--gold-d);
    cursor: pointer;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 1.125rem;
    height: 1.375rem;
    border-radius: 0;
    background: linear-gradient(180deg, var(--gold-l), var(--gold-d));
    border: 0.0625rem solid var(--gold-d);
    cursor: pointer;
}

/* ===== TIERS ===== */
.tier {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.3125rem;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    transition: all .25s;
}

.tier:hover {
    border-color: var(--frame-l);
}

.tier.active {
    border-color: var(--gold-d);
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.07), var(--slot));
    box-shadow: 0 0 0.75rem rgba(201, 168, 76, 0.03);
}

.tier.completed {
    opacity: 0.65;
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.05), var(--slot));
}

.tier.completed .t-info h4 {
    color: var(--dim);
}

.tier.completed .t-info .t-bar-fill {
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.35), rgba(201, 168, 76, 0.55));
}

.tier .t-icon {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border: 0.0625rem solid var(--gold-d);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.tier .t-info {
    flex: 1;
    min-width: 0;
}

.tier .t-info h4 {
    font-family: 'MedievalSharp', serif;
    font-size: 1rem;
    color: var(--gold-l);
}

.tier .t-info .t-rng {
    font-size: 0.8125rem;
    color: var(--dim);
}

.tier .t-info .t-bar {
    margin-top: 0.25rem;
    height: 0.1875rem;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.tier .t-info .t-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-d), var(--gold-l));
    transition: width .4s;
}

.tier .t-pct {
    font-family: 'Cinzel', serif;
    font-size: 1.0625rem;
    font-weight: 900;
    color: var(--gold);
    min-width: 2.5rem;
    text-align: right;
}

.tier {
    cursor: pointer;
}

.tier .t-check {
    width: 2rem;
    height: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tier .t-check .t-seal {
    width: 1.5rem;
    height: 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hexagon seal shape via clip-path */
.tier .t-check .t-seal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,168,76,0.22), rgba(120,95,30,0.35));
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    border: none;
}

.tier .t-check .t-seal::after {
    content: '';
    position: absolute;
    inset: 0.125rem;
    background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(60,45,10,0.4));
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.tier .t-check .t-seal svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 0.2rem rgba(201,168,76,0.6));
}

@keyframes sealPulse {
    0%, 100% { filter: drop-shadow(0 0 0.15rem rgba(201,168,76,0.4)); }
    50%       { filter: drop-shadow(0 0 0.35rem rgba(201,168,76,0.75)); }
}

.tier.completed .t-check .t-seal {
    animation: sealPulse 2.5s ease-in-out infinite;
}

@keyframes tierUnlock {
    0%   { box-shadow: none; border-color: var(--slot-border); }
    20%  { box-shadow: 0 0 0.75rem rgba(201,168,76,0.35); border-color: rgba(201,168,76,0.55); }
    100% { box-shadow: none; border-color: var(--slot-border); }
}

@keyframes tierShine {
    0%   { left: -100%; }
    100% { left: 150%; }
}

.tier.unlocking {
    animation: tierUnlock 1.1s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.tier.unlocking::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.18), transparent);
    animation: tierShine 0.65s ease-out forwards;
    pointer-events: none;
    z-index: 2;
}

/* ===== STAT SHEET ===== */
.stat-sheet {
    margin-top: 0.5rem;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    padding: 0.0625rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-bottom: 0.0625rem solid rgba(42, 35, 24, 0.4);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.022);
}

.stat-row .s-l {
    font-size: 0.6875rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    font-weight: 600;
}

.stat-row .s-r {
    font-family: 'Cinzel', serif;
    font-size: 0.9375rem;
    font-weight: 700;
}

.stat-row.s-total {
    background: rgba(201, 168, 76, 0.04);
}

.stat-row.s-total .s-r {
    font-family: 'MedievalSharp', serif;
    font-size: 1.3125rem;
    color: var(--gold-l);
    text-shadow: 0 0 0.5rem rgba(201, 168, 76, 0.12);
}

.stat-cur-group {
    border-left: 0.1875rem solid rgba(201, 168, 76, 0.35);
    background: rgba(201, 168, 76, 0.03);
}

.stat-cur-group .stat-row--cur .s-l {
    font-family: 'Cinzel', serif;
    color: var(--gold-d);
    letter-spacing: 0.1em;
}

.stat-cur-group .stat-row--cur .s-r {
    font-size: 0.875rem;
    color: var(--text-l);
}

.s-bonus {
    color: var(--green);
}

/* ===== L2 BUTTON ===== */
.l2-btn {
    width: 100%;
    margin-top: 0.875rem;
    padding: 0.875rem;
    background: linear-gradient(180deg,
    rgba(40, 55, 80, 0.55) 0%,
    rgba(15, 25, 45, 0.65) 50%,
    rgba(8, 15, 30, 0.7) 100%);
    border: 0.0625rem solid rgba(220, 225, 235, 0.25);
    border-bottom-color: rgba(220, 225, 235, 0.1);
    color: rgba(220, 225, 235, 0.9);
    font-family: 'MedievalSharp', serif;
    font-size: 1.125rem;
    letter-spacing: 0.25rem;
    cursor: pointer;
    transition: all .25s;
    text-shadow: 0 0 0.75rem rgba(201, 168, 76, 0.15);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
}

.l2-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity .25s;
}

.l2-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
    rgba(201, 168, 76, 0.03) 0%,
    transparent 100%);
    pointer-events: none;
}

.l2-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 20%; right: 20%;
    height: 0.0625rem;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.25), transparent);
}

.l2-btn:hover {
    background: linear-gradient(180deg,
    rgba(50, 70, 105, 0.65) 0%,
    rgba(25, 40, 70, 0.7) 50%,
    rgba(12, 22, 45, 0.75) 100%);
    border-color: rgba(220, 225, 235, 0.45);
    color: #ffffff;
    box-shadow: 0 0 1.5rem rgba(201, 168, 76, 0.07),
    inset 0 0 1rem rgba(201, 168, 76, 0.04);
    text-shadow: 0 0 0.75rem rgba(255, 255, 255, 0.15);
}

.l2-btn:hover svg {
    opacity: 1;
}

.l2-btn:active {
    transform: scale(0.99);
    box-shadow: none;
}

.l2-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== FOOTER ===== */
.l2-footer {
    background: linear-gradient(180deg, rgba(9, 15, 28, 0.5), rgba(7, 12, 22, 0.8));
    border-top: 0.0625rem solid var(--frame);
    padding: 0.625rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--dim);
    letter-spacing: 0.125rem;
    text-transform: uppercase;
}

.l2-footer a {
    color: var(--gold-d);
    text-decoration: none;
}

/* ===== TOP DONORS (OLD — commented out) =====
.top-list { display:flex; flex-direction:column; gap:0.25rem; }
.top-item { display:flex; align-items:center; gap:0.625rem; padding:0.5rem 0.75rem;
    background:rgba(14,12,8,0.7); border-left:0.125rem solid rgba(201,168,76,0.12); }
... (see git history)
===== END OLD ===== */

/* ===== HOW IT WORKS ===== */
.howto-list {
    display: flex;
    flex-direction: column;
}

.howto-step {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4rem 0.75rem;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    transition: border-color .25s;
}

.howto-step:hover {
    border-color: var(--frame-l);
}

.howto-icon {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(201,168,76,0.1), rgba(30,50,80,0.5));
    border: 0.0625rem solid rgba(201,168,76,0.18);
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    color: var(--gold-d);
    transition: color .25s;
}

.howto-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

.howto-step:hover .howto-icon {
    color: var(--gold-l);
}

.howto-content {
    flex: 1;
    min-width: 0;
}

.howto-title {
    font-family: 'MedievalSharp', serif;
    font-size: 0.9375rem;
    color: var(--text-l);
}

.howto-desc {
    display: none;
}

.howto-num {
    font-family: 'Cinzel', serif;
    font-size: 0.9375rem;
    font-weight: 900;
    color: rgba(201,168,76,0.1);
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
    transition: color .25s;
}

.howto-step:hover .howto-num {
    color: rgba(201,168,76,0.2);
}

.howto-connector {
    width: 0.0625rem;
    height: 0.375rem;
    margin-left: calc(0.75rem + 0.875rem);
    background: linear-gradient(180deg, rgba(201,168,76,0.2), transparent);
}

/* ===== TOP DONORS (NEW) ===== */
.donor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.donor-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    position: relative;
    overflow: hidden;
    transition: border-color .25s, background .25s;
}

.donor-card:hover {
    border-color: var(--frame-l);
    background: rgba(12, 20, 36, 0.98);
}

/* rank glow strip on left */
.donor-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0.1875rem;
}

.donor-card.rank-1::before { background: linear-gradient(180deg, #f5e49a, #c9a84c); box-shadow: 0 0 0.5rem rgba(201,168,76,0.5); }
.donor-card.rank-2::before { background: linear-gradient(180deg, #d8d8d8, #9a9a9a); box-shadow: 0 0 0.4rem rgba(180,180,180,0.3); }
.donor-card.rank-3::before { background: linear-gradient(180deg, #e8a07a, #a0522d); box-shadow: 0 0 0.4rem rgba(160,82,45,0.3); }
.donor-card:not(.rank-1):not(.rank-2):not(.rank-3)::before { background: rgba(201,168,76,0.12); }

/* subtle bg gradient for rank-1 */
.donor-card.rank-1 {
    background: linear-gradient(105deg, rgba(201,168,76,0.07) 0%, var(--slot) 45%);
    border-color: rgba(201,168,76,0.2);
}

/* rank badge */
.donor-badge {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 900;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    background: rgba(30, 45, 70, 0.9);
}

.donor-card.rank-1 .donor-badge { background: linear-gradient(135deg, rgba(201,168,76,0.35), rgba(120,95,30,0.5)); color: #f5e49a; }
.donor-card.rank-2 .donor-badge { background: linear-gradient(135deg, rgba(180,180,180,0.25), rgba(100,100,100,0.4)); color: #d8d8d8; }
.donor-card.rank-3 .donor-badge { background: linear-gradient(135deg, rgba(200,130,90,0.25), rgba(120,60,30,0.4)); color: #e8a07a; }
.donor-card:not(.rank-1):not(.rank-2):not(.rank-3) .donor-badge { color: var(--dim); }

.donor-info {
    flex: 1;
    min-width: 0;
}

.donor-name {
    font-family: 'MedievalSharp', serif;
    font-size: 0.875rem;
    color: var(--text-l);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.donor-card.rank-1 .donor-name { color: var(--gold-l); }

.donor-sub {
    font-size: 0.5625rem;
    color: var(--dim);
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}

.donor-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    flex-shrink: 0;
}

.donor-coins {
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gold-d);
    white-space: nowrap;
}

.donor-card.rank-1 .donor-coins { color: var(--gold); }

.donor-label {
    font-size: 0.5rem;
    color: var(--dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ===== PAY MODAL ===== */
.pay-modal { min-width: 0; max-width: 56rem; width: min(92vw, 56rem); }

.pay-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'MedievalSharp', serif;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.08em;
}

.pay-modal-title svg { color: var(--gold-d); }

.pay-section-label {
    font-size: 0.5625rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 0.5rem;
}

.pay-cur-tabs {
    display: flex;
    gap: 0.375rem;
}

.cur-tab-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity .2s;
}

.cur-tab-wrap:hover { opacity: 0.85; }

.cur-tab-wrap.active { opacity: 1; }

.tab-code {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--gold-d);
    text-transform: uppercase;
}

.cur-tab-wrap.active .tab-code { color: var(--gold-l); }

.pay-cur-tab {
    width: 100%;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0.0625rem solid transparent;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.cur-tab-wrap.active .pay-cur-tab { border-color: transparent; }


.pay-cur-tab::after {
    content: '';
    position: absolute;
    bottom: 0; left: 15%; right: 15%;
    height: 0.125rem;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.cur-tab-wrap.active .pay-cur-tab::after { opacity: 1; }

.pay-cur-tab img {
    width: 100%;
}

.pay-cur-tab .tab-fallback {
    display: none;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gold-d);
    letter-spacing: 0.08em;
    gap: 0.25rem;
    align-items: center;
}

.pay-cur-tab .tab-fallback span { font-size: 0.55rem; color: var(--dim); }

/* ===== METHOD POPOVER ===== */
.m-popover {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(0.25rem);
    transition: opacity .18s, transform .18s;
    max-width: 18rem;
}

.m-popover.show {
    opacity: 1;
    transform: translateY(0);
}

.m-popover-inner {
    background: rgba(8, 14, 26, 0.97);
    border: 0.0625rem solid rgba(201,168,76,0.25);
    padding: 0.6rem 0.875rem;
    position: relative;
    box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.6), 0 0 1rem rgba(201,168,76,0.05);
    display: flex;
    align-items: center;
    min-height: 2.5rem;
}

.m-popover-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0.1875rem;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.5), transparent);
}

.m-popover-title {
    font-family: 'MedievalSharp', serif;
    font-size: 0.75rem;
    color: var(--gold-l);
    margin-bottom: 0.375rem;
    letter-spacing: 0.03em;
}

.m-popover-body {
    font-size: 0.6875rem;
    color: var(--dim);
    line-height: 1.55;
}

.m-popover-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.m-popover-tag {
    font-size: 0.5rem;
    color: var(--gold-d);
    border: 0.0625rem solid rgba(201,168,76,0.2);
    padding: 0.1rem 0.35rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(201,168,76,0.04);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.l2-modal {
    background: var(--panel);
    border: 0.125rem solid var(--frame);
    box-shadow: 0 0.5rem 2.5rem rgba(0, 0, 0, 0.6);
    animation: pop .3s ease-out both;
    max-width: 35rem;
    width: calc(100% - 2rem);
    margin: 1rem;
}

@keyframes pop {
    from {
        transform: scale(.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.l2-modal-header {
    background: linear-gradient(180deg, rgba(20, 32, 52, 0.98), rgba(12, 20, 38, 0.98));
    border-bottom: 0.0625rem solid var(--frame);
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.l2-modal-header h3 {
    font-family: 'MedievalSharp', serif;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.1rem;
    margin: 0;
}

.l2-modal-close {
    width: 1.5rem;
    height: 1.5rem;
    border: 0.0625rem solid var(--frame-l);
    background: var(--frame-d);
    color: var(--dim);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
}

.l2-modal-close:hover {
    background: var(--red);
    color: #fff;
}

.l2-modal-body {
    padding: 1rem;
}

.currency-grid {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.currency-btn {
    padding: 0.625rem 0.875rem;
    background: var(--slot);
    border: 0.0625rem solid var(--slot-border);
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
    overflow: hidden;
    text-align: left;
}

.currency-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0.1875rem;
    background: linear-gradient(180deg, var(--gold), var(--gold-d));
    opacity: 0;
    transition: opacity .2s;
}

.currency-btn:hover::before,
.currency-btn.active::before {
    opacity: 1;
}

.currency-btn:hover,
.currency-btn.active {
    border-color: rgba(201,168,76,0.3);
    background: linear-gradient(90deg, rgba(201,168,76,0.07), var(--slot));
}

.currency-btn.active {
    border-color: rgba(201,168,76,0.45);
}

.cur-icon-wrap {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(20,35,60,0.7));
    border: 0.0625rem solid rgba(201,168,76,0.18);
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.currency-btn .cur-symbol {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--gold-l);
    line-height: 1;
}

.cur-info {
    flex: 1;
    min-width: 0;
}

.currency-btn .cur-name {
    font-family: 'MedievalSharp', serif;
    font-size: 0.8125rem;
    color: var(--text-l);
    letter-spacing: 0.03em;
}

.cur-code {
    font-size: 0.5625rem;
    color: var(--dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.1rem;
}

.currency-btn .cur-amount {
    font-family: 'Cinzel', serif;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gold-d);
    white-space: nowrap;
    background: rgba(201,168,76,0.06);
    border: 0.0625rem solid rgba(201,168,76,0.15);
    padding: 0.2rem 0.5rem;
    transition: color .2s, border-color .2s;
}

.currency-btn:hover .cur-amount,
.currency-btn.active .cur-amount {
    color: var(--gold);
    border-color: rgba(201,168,76,0.3);
}

.methods-back {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    color: var(--gold-d);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.75rem;
    font-family: inherit;
    transition: color .2s;
}

.methods-back:hover {
    color: var(--gold-l);
}

.methods-back svg {
    width: 0.75rem;
    height: 0.75rem;
    fill: currentColor;
}

.method-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.method-btn {
    flex: 1 1 calc(33.333% - 0.375rem);
    min-width: 8rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: none;
    border: 0.0625rem solid transparent;
    cursor: pointer;
    transition: border-color .2s, opacity .2s;
    position: relative;
    overflow: hidden;
    padding: 0;
    opacity: 0.5;
}

.method-btn:hover {
    border-color: transparent;
    opacity: 1;
}

.method-btn.selected {
    border-color: transparent;
    opacity: 1;
}

.method-btn .m-img-wrap {
    width: 100%;
    height: 4rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
}

.method-btn .m-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .2s;
}

.method-btn.selected .m-img-wrap img { transform: scale(1.03); }

.pay-confirm-wrap {
    margin-top: 1rem;
    display: none;
}

.pay-confirm-wrap.show { display: block; }

.pay-confirm-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(180deg, rgba(40,55,80,0.55), rgba(8,15,30,0.7));
    border: 0.0625rem solid rgba(220,225,235,0.25);
    border-bottom-color: rgba(220,225,235,0.1);
    color: rgba(220,225,235,0.9);
    font-family: 'MedievalSharp', serif;
    font-size: 1rem;
    letter-spacing: 0.2rem;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pay-confirm-btn:hover {
    border-color: rgba(220,225,235,0.45);
    color: #fff;
    background: linear-gradient(180deg, rgba(50,70,105,0.65), rgba(12,22,45,0.75));
}

.method-btn .m-img-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--gold-d);
    font-family: 'MedievalSharp', serif;
    font-size: 0.6rem;
    text-align: center;
    padding: 0.5rem;
}

.method-btn .m-img-fallback svg { width: 1.25rem; height: 1.25rem; margin-bottom: 0.2rem; display: block; margin: 0 auto 0.2rem; }


.success-content {
    text-align: center;
    padding: 1.5rem 1rem;
}

.success-content .s-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    background: radial-gradient(circle at 35% 35%, var(--gold-l), var(--gold-d));
    border: 0.125rem solid var(--gold-d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--bg);
    box-shadow: 0 0 1.25rem rgba(201, 168, 76, 0.2);
}

.success-content h2 {
    font-family: 'MedievalSharp', serif;
    font-size: 1.375rem;
    color: var(--gold);
    margin-bottom: 0.375rem;
}

.success-content p {
    font-size: 0.9375rem;
    color: var(--dim);
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0)
    }
    20%, 60% {
        transform: translateX(-0.375rem)
    }
    40%, 80% {
        transform: translateX(0.375rem)
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* ===== MOBILE ===== */
@media (max-width: 44rem) {
    .slot-grid {
        flex-wrap: wrap;
    }
    .slot {
        flex: 1 1 calc(50% - 0.15rem);
        min-width: 0;
    }
    .toast {
        min-width: 0;
        max-width: calc(100vw - 2.5rem);
    }
    .pay-modal { width: calc(100vw - 1.5rem); }
    .pay-cur-tab { padding: 0.5rem 0.25rem; }
}

@media (max-width: 30rem) {
    .l2-modal {
        max-width: 100%;
        width: calc(100% - 1.5rem);
        margin: 0.75rem;
    }

    .l2-modal-body {
        padding: 0.75rem;
    }

    .currency-btn {
        padding: 0.75rem 0.5rem;
    }

    .currency-btn .cur-symbol {
        font-size: 1.25rem;
    }

    .method-btn {
        padding: 0.625rem 0.75rem;
        min-width: 0;
    }

    .method-btn .m-img-wrap {
        height: 3rem;
    }

    .method-btn .m-icon-wrap {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }

    .method-btn .m-name {
        font-size: 0.75rem;
    }

    .method-btn .m-amount {
        font-size: 0.7rem;
    }

    .pay-modal { width: calc(100% - 1rem); margin: 0.5rem; }

    .pay-confirm-btn { font-size: 0.875rem; letter-spacing: 0.1rem; }

    .slot-grid {
        gap: 0.25rem;
    }
}

/* ===== TOASTS ===== */
.toast-wrap {
    position: fixed;
    top: 5.5rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    min-width: 18rem;
    max-width: 26rem;
    padding: 0.75rem 1rem;
    background: rgba(14, 12, 8, 0.97);
    border-left: 0.1875rem solid var(--gold-d);
    box-shadow: 0 0.25rem 1.5rem rgba(0,0,0,0.5), 0 0 0.75rem rgba(201,168,76,0.06);
    pointer-events: auto;
    animation: toastIn .3s ease-out both;
    position: relative;
    overflow: hidden;
}

.toast.toast-error  { border-left-color: var(--red); }
.toast.toast-success { border-left-color: #c9a84c; }
.toast.toast-info   { border-left-color: #5a8fd4; }

.toast::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 0.125rem;
    background: var(--gold-d);
    animation: toastBar 4s linear forwards;
}

.toast.toast-error::after  { background: var(--red); }
.toast.toast-success::after { background: var(--gold); }
.toast.toast-info::after   { background: #5a8fd4; }

.toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-family: 'MedievalSharp', serif;
    font-size: 0.6875rem;
    color: var(--gold-d);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.1875rem;
}

.toast-error .toast-title  { color: var(--red); }
.toast-success .toast-title { color: var(--gold); }
.toast-info .toast-title   { color: #5a8fd4; }

.toast-msg {
    font-size: 0.8125rem;
    color: var(--text-l);
    line-height: 1.4;
}

.toast-close {
    font-size: 0.75rem;
    color: var(--dim);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity .2s;
    background: none;
    border: none;
    padding: 0;
}

.toast-close:hover { opacity: 1; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(1rem); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(1rem); max-height: 0; padding: 0; margin: 0; }
}

@keyframes toastBar {
    from { width: 100%; }
    to   { width: 0%; }
}