/* ============================================
   GLHF Gaming — User Cabinet
   ============================================ */

.cabinet {
    padding-top: calc(var(--glhf-header-height) + 40px);
    padding-bottom: 4rem;
    min-height: 100vh;
}

.admin-bar .cabinet {
    padding-top: calc(var(--glhf-header-height) + 40px);
}

/* --- Profile Header --- */
.cabinet-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-xl);
    padding: 2.5rem 3rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.cabinet-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--glhf-accent), var(--glhf-discord), var(--glhf-accent));
}

.cabinet-avatar {
    position: relative;
    flex-shrink: 0;
}

.cabinet-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--glhf-accent);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(var(--glhf-accent-rgb), 0.3);
}

.cabinet-avatar .status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--glhf-bg-card);
}

.status-dot--online  { background: #43b581; }
.status-dot--idle    { background: #faa61a; }
.status-dot--dnd     { background: #f04747; }
.status-dot--offline { background: #747f8d; }

.cabinet-user-info h1 {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
}

.cabinet-username {
    color: var(--glhf-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.cabinet-roles {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--glhf-radius-full);
    border: 1px solid currentColor;
    opacity: 0.9;
}

.role-badge .role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.cabinet-moderation-status {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--glhf-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.cabinet-moderation-status--banned {
    background: rgba(220, 53, 69, 0.15);
    color: var(--glhf-danger, #dc3545);
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.cabinet-moderation-status--timeout {
    background: rgba(253, 126, 20, 0.15);
    color: var(--glhf-warning, #fd7e14);
    border: 1px solid rgba(253, 126, 20, 0.35);
}

.cabinet-moderation-status-icon {
    font-size: 1rem;
}

.cabinet-moderation-status-reason {
    width: 100%;
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* --- Cabinet Tabs --- */

/* Wrapper injected by cabinet.js around .cabinet-tabs. Hosts the prev/next
   nav buttons and fade-masks so desktop users with no touch/trackpad can
   still reach tabs that overflow the viewport. */
.cabinet-tabs-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 2rem;
}

.cabinet-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
    scroll-behavior: smooth;
}

/* When wrapped, reset margin-bottom because the wrap owns the gap. */
.cabinet-tabs-wrap > .cabinet-tabs {
    margin-bottom: 0;
}

.cabinet-tabs::-webkit-scrollbar {
    display: none;
}

/* Fade edges ONLY when there's overflow — indicates scrollable content. */
.cabinet-tabs-wrap[data-overflow="yes"] > .cabinet-tabs {
    -webkit-mask-image: linear-gradient(to right,
        transparent 0,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%);
    mask-image: linear-gradient(to right,
        transparent 0,
        #000 24px,
        #000 calc(100% - 24px),
        transparent 100%);
}

.cabinet-tabs-wrap[data-overflow="yes"][data-at-start] > .cabinet-tabs {
    -webkit-mask-image: linear-gradient(to right,
        #000 0,
        #000 calc(100% - 24px),
        transparent 100%);
    mask-image: linear-gradient(to right,
        #000 0,
        #000 calc(100% - 24px),
        transparent 100%);
}

.cabinet-tabs-wrap[data-overflow="yes"][data-at-end] > .cabinet-tabs {
    -webkit-mask-image: linear-gradient(to right,
        transparent 0,
        #000 24px,
        #000 100%);
    mask-image: linear-gradient(to right,
        transparent 0,
        #000 24px,
        #000 100%);
}

/* Prev/next nav buttons — shown only when tabs overflow. */
.cabinet-tabs-nav {
    flex-shrink: 0;
    align-self: stretch;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    padding: 0;
    margin: 0;
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-text-muted);
    cursor: pointer;
    transition: color var(--glhf-transition-fast),
                border-color var(--glhf-transition-fast),
                background var(--glhf-transition-fast),
                opacity var(--glhf-transition-fast);
}

.cabinet-tabs-wrap[data-overflow="yes"] .cabinet-tabs-nav {
    display: inline-flex;
}

.cabinet-tabs-nav:hover,
.cabinet-tabs-nav:focus-visible {
    color: var(--glhf-accent);
    border-color: var(--glhf-accent);
    background: var(--glhf-accent-dim);
    outline: none;
}

.cabinet-tabs-nav svg {
    display: block;
    pointer-events: none;
}

.cabinet-tabs-wrap[data-at-start] .cabinet-tabs-nav--prev,
.cabinet-tabs-wrap[data-at-end]   .cabinet-tabs-nav--next {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* On touch-only devices native swipe is enough — hide the buttons but
   keep the fade-masks as visual affordance. */
@media (hover: none) and (pointer: coarse) {
    .cabinet-tabs-wrap[data-overflow="yes"] .cabinet-tabs-nav { display: none; }
}

.cabinet-tab {
    flex-shrink: 0;
    padding: 12px 24px 12px;
    font-family: var(--glhf-font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--glhf-text-muted);
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--glhf-transition-fast);
    white-space: nowrap;
}

.cabinet-tab:hover,
button.cabinet-tab:hover {
    color: var(--glhf-text-primary);
    border-color: var(--glhf-border-bright);
    background: var(--glhf-accent-dim);
}

.cabinet-tab.active {
    color: var(--glhf-accent);
    border-color: var(--glhf-accent);
    background: var(--glhf-accent-dim);
}

.cabinet-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--glhf-danger);
    border-radius: var(--glhf-radius-full);
    vertical-align: middle;
}

/* --- Tab Content --- */
.cabinet-tab-content {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.cabinet-tab-content.active {
    display: block;
}

/* --- Widget Cards --- */
.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.cabinet-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.cabinet-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.cabinet-widget {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    padding: 1.75rem;
    transition: border-color var(--glhf-transition-fast);
}

.cabinet-widget:hover {
    border-color: var(--glhf-border-bright);
}

.cabinet-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.cabinet-widget-title {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.cabinet-widget-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--glhf-radius-sm);
    font-size: 1rem;
}

/* --- FunCoin Summary --- */
.funcoin-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.funcoin-stat-item {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    transition: border-color var(--glhf-transition-fast);
}

.funcoin-stat-item:hover {
    border-color: var(--glhf-border-bright);
}

.funcoin-stat-value {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--glhf-text-primary);
}

.funcoin-stat-item--balance {
    padding: 1rem 1rem;
}

.funcoin-balance-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.funcoin-balance-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.funcoin-stat-value--lg {
    font-size: 1.6rem;
    line-height: 1.6rem;
}

.funcoin-stat-value--lg .funcoin-symbol {
    font-size: 1rem;
    opacity: 0.6;
    margin-right: 4px;
}

.funcoin-coin-img {
    flex-shrink: 0;
    border-radius: 50%;
    filter: drop-shadow(0 2px 6px rgba(var(--glhf-funcoin-rgb), 0.4));
}

.funcoin-stat-label {
    font-size: 0.78rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- FC Stat Link wrapper --- */
.funcoin-stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* --- FC Streak – clickable --- */
.funcoin-stat-item--streak {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.funcoin-stat-item--streak::before {
    content: '';
    position: absolute; inset: -1px;
    border-radius: var(--glhf-radius-lg);
    background: linear-gradient(135deg, rgba(var(--glhf-accent-rgb), 0.2), transparent 50%);
    opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none;
}
.funcoin-stat-item--streak:hover {
    border-color: var(--glhf-accent);
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(var(--glhf-accent-rgb), 0.2);
}
.funcoin-stat-item--streak:hover::before { opacity: 1; }
.funcoin-stat-item--streak:hover .fc-rank-hint { opacity: 0.8; transform: translateX(0); }

/* --- FC Rank – clickable --- */
.funcoin-stat-item--rank {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.funcoin-stat-item--rank::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--glhf-radius-lg);
    background: linear-gradient(135deg, rgba(var(--glhf-funcoin-rgb), 0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.funcoin-stat-item--rank:hover {
    border-color: var(--glhf-funcoin);
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(var(--glhf-funcoin-rgb), 0.2);
}
.funcoin-stat-item--rank:hover::before { opacity: 1; }
.fc-rank-hint {
    position: absolute;
    right: 0.75rem;
    bottom: 0.3rem;
    font-family: var(--glhf-font-heading);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--glhf-funcoin);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.funcoin-stat-item--rank:hover .fc-rank-hint {
    opacity: 0.8;
    transform: translateX(0);
}

/* --- FC Leaderboard Modal --- */
.fc-lb-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.fc-lb-overlay.active { opacity: 1; pointer-events: auto; }
.fc-lb-modal {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    width: 90%; max-width: 520px;
    max-height: 85vh; overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.fc-lb-overlay.active .fc-lb-modal {
    transform: translateY(0) scale(1);
}
.fc-lb-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem 0.75rem;
}
.fc-lb-title {
    font-family: var(--glhf-font-heading);
    font-weight: 800; font-size: 1.15rem; margin: 0;
    color: var(--glhf-text-primary);
}
.fc-lb-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.5rem; line-height: 1;
    color: var(--glhf-text-muted);
    transition: color 0.2s, transform 0.2s;
    padding: 0 0.25rem;
}
.fc-lb-close:hover { color: var(--glhf-text-primary); transform: scale(1.15); }
.fc-lb-tabs {
    display: flex; gap: 4px;
    padding: 0 1.5rem; margin-bottom: 0.5rem;
}
.fc-lb-tab {
    flex: 1; padding: 0.6rem 0;
    font-family: var(--glhf-font-heading);
    font-weight: 600; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--glhf-text-muted);
    background: var(--glhf-bg-tertiary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}
.fc-lb-tab:hover { color: var(--glhf-text-primary); border-color: var(--glhf-border-bright); }
.fc-lb-tab.active { color: var(--glhf-funcoin); border-color: var(--glhf-funcoin); background: rgba(var(--glhf-funcoin-rgb),0.08); }
.fc-lb-body { padding: 0.5rem 1.5rem 1.5rem; }
.fc-lb-loading {
    height: 260px;
    background: var(--glhf-bg-tertiary);
    border-radius: var(--glhf-radius-sm);
    animation: fcPulse 1s ease-in-out infinite alternate;
}
.fc-lb-list { display: flex; flex-direction: column; gap: 2px; }
.fc-lb-row {
    display: grid;
    grid-template-columns: 2rem 1fr 120px auto;
    align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--glhf-radius-sm);
    transition: background 0.15s;
}
.fc-lb-row:hover { background: var(--glhf-bg-tertiary); }
.fc-lb-row--top1 { background: rgba(255,215,0,0.06); }
.fc-lb-row--top2 { background: rgba(192,192,192,0.05); }
.fc-lb-row--top3 { background: rgba(205,127,50,0.05); }
.fc-lb-medal { font-size: 1.1rem; text-align: center; }
.fc-lb-num {
    font-family: var(--glhf-font-heading);
    font-weight: 700; font-size: 0.85rem;
    color: var(--glhf-text-muted);
}
.fc-lb-name {
    font-weight: 600; font-size: 0.88rem;
    color: var(--glhf-text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-lb-bar-wrap {
    height: 6px; background: var(--glhf-bg-tertiary);
    border-radius: 3px; overflow: hidden;
}
.fc-lb-bar {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--glhf-funcoin), rgba(var(--glhf-funcoin-rgb),0.5));
    transition: width 0.6s ease;
}
.fc-lb-pts {
    font-family: var(--glhf-font-heading);
    font-weight: 700; font-size: 0.85rem;
    color: var(--glhf-funcoin);
    white-space: nowrap; text-align: right;
}

/* --- FC Share – clickable (reuse rank hover pattern) --- */
.funcoin-stat-item--share {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.funcoin-stat-item--share::before {
    content: '';
    position: absolute; inset: -1px;
    border-radius: var(--glhf-radius-lg);
    background: linear-gradient(135deg, rgba(var(--glhf-accent-rgb, 108,92,231), 0.2), transparent 50%);
    opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none;
}
.funcoin-stat-item--share:hover {
    border-color: var(--glhf-accent);
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(var(--glhf-accent-rgb, 108,92,231), 0.2);
}
.funcoin-stat-item--share:hover::before { opacity: 1; }
.funcoin-stat-item--share:hover .fc-rank-hint { opacity: 0.8; transform: translateX(0); }

/* --- FC Draw Modal --- */
.fc-draw-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
}
.fc-draw-overlay.active { opacity: 1; pointer-events: auto; }
.fc-draw-modal {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    width: 90%; max-width: 440px;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
}
.fc-draw-overlay.active .fc-draw-modal { transform: translateY(0) scale(1); }
.fc-draw-stage { padding: 0 1.5rem 1.5rem; text-align: center; min-height: 120px; }

/* Draw intro */
.fc-draw-intro { display: flex; flex-direction: column; align-items: center; }
.fc-draw-dice-wrap {
    width: 80px; height: 80px; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--glhf-accent-rgb),0.12) 0%, transparent 70%);
    animation: fcDiceFloat 3s ease-in-out infinite;
}
.fc-draw-dice { font-size: 3rem; filter: drop-shadow(0 0 12px rgba(var(--glhf-accent-rgb),0.4)); }
@keyframes fcDiceFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.fc-draw-intro-text { margin-bottom: 1rem; }
.fc-draw-intro-desc {
    font-size: 0.85rem; line-height: 1.5;
    color: var(--glhf-text-secondary); margin: 0;
}
.fc-draw-intro-desc strong { color: var(--glhf-funcoin); }
.fc-draw-intro-stats {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.5rem; width: 100%; margin-bottom: 1.25rem;
}
.fc-draw-go-btn {
    margin-top: 0.25rem;
}

/* «Ще раз»: білий текст при наведенні (узгоджено з анімацією заповнення glhf-btn) */
button#fc-draw-again:hover {
    color: #fff;
}

/* Old spin button (kept for spinner label during animation) */
.fc-draw-spin-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.9rem 2rem;
    font-family: var(--glhf-font-heading);
    font-weight: 700; font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--glhf-accent), #8b5cf6);
    border: none; border-radius: var(--glhf-radius-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(108,92,231,0.3);
}
.fc-draw-spin-btn:hover { transform: scale(1.04); box-shadow: 0 6px 30px rgba(108,92,231,0.45); }
.fc-draw-spin-btn:active { transform: scale(0.97); }
.fc-draw-spin-btn--again {
    margin-top: 1.25rem;
    font-size: 0.85rem; padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, var(--glhf-bg-tertiary), var(--glhf-bg-card));
    color: var(--glhf-text-primary);
    border: 1px solid var(--glhf-border);
    box-shadow: none;
}
.fc-draw-spin-btn--again:hover { border-color: var(--glhf-accent); color: var(--glhf-accent); box-shadow: 0 0 15px rgba(108,92,231,0.15); }

/* Spinner reel */
.fc-draw-spinner {
    width: 80px; height: 80px; margin: 1rem auto;
    overflow: hidden; border-radius: var(--glhf-radius-md);
    border: 2px solid var(--glhf-accent);
    box-shadow: 0 0 30px rgba(108,92,231,0.3);
    position: relative;
}
.fc-draw-reel { display: flex; flex-direction: column; }
.fc-draw-reel-item {
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}
.fc-draw-spinner-label {
    margin-top: 0.75rem;
    font-family: var(--glhf-font-heading);
    font-size: 0.85rem; font-weight: 600;
    color: var(--glhf-accent);
    animation: fcPulse 0.8s ease-in-out infinite alternate;
}
@keyframes fcReelSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3120px); } /* 39 items * 80px */
}

/* Result */
.fc-draw-result { position: relative; padding: 0.5rem 0; }
.fc-draw-result--reveal { animation: fcReveal 0.5s ease; }
@keyframes fcReveal {
    0% { opacity: 0; transform: scale(0.8); }
    60% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
.fc-draw-winner-icon { font-size: 3rem; margin-bottom: 0.25rem; }
.fc-draw-winner-name {
    font-family: var(--glhf-font-heading);
    font-weight: 900; font-size: 1.4rem;
    color: var(--glhf-text-primary);
    margin-bottom: 0.15rem;
}
.fc-draw-winner-fc {
    font-family: var(--glhf-font-heading);
    font-weight: 700; font-size: 1rem;
    color: var(--glhf-funcoin);
    margin-bottom: 1rem;
}
.fc-draw-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.5rem; margin-bottom: 0.5rem;
}
.fc-draw-stat {
    background: var(--glhf-bg-tertiary);
    border-radius: var(--glhf-radius-sm);
    padding: 0.5rem;
    display: flex; flex-direction: column; align-items: center;
}
.fc-draw-stat-val {
    font-family: var(--glhf-font-heading);
    font-weight: 800; font-size: 0.95rem;
    color: var(--glhf-text-primary);
}
.fc-draw-stat-lbl {
    font-size: 0.65rem; font-weight: 600;
    color: var(--glhf-text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* Confetti */
.fc-draw-confetti {
    position: absolute; inset: 0;
    pointer-events: none; overflow: hidden;
}
.fc-confetti-piece {
    position: absolute; top: -10px;
    width: 6px; height: 12px;
    border-radius: 2px;
    animation: fcConfettiFall linear forwards;
}
@keyframes fcConfettiFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(350px) rotate(720deg); opacity: 0; }
}

@media (max-width: 600px) {
    .funcoin-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    .fc-lb-row { grid-template-columns: 2rem 1fr auto; }
    .fc-lb-bar-wrap { display: none; }
    .fc-lb-modal { width: 95%; }
    .fc-draw-modal { width: 95%; }
}

/* --- FunCoin Widget (fallback) --- */
.funcoin-balance {
    font-family: var(--glhf-font-heading);
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--glhf-funcoin);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.funcoin-balance .funcoin-symbol {
    font-size: 1.5rem;
    opacity: 0.7;
    margin-right: 4px;
}

/* --- FunCoin Day-Grouped History --- */
.fc-day-list {
    display: flex;
    flex-direction: column;
}

.fc-day {
    border-bottom: 1px solid var(--glhf-border);
}

.fc-day:last-child {
    border-bottom: none;
}

.fc-day-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    cursor: pointer;
    transition: background var(--glhf-transition-fast);
    border-radius: var(--glhf-radius-sm);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.fc-day-header:hover {
    background: var(--glhf-bg-tertiary);
}

.fc-day-date {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--glhf-text-primary);
    min-width: 90px;
}

.fc-day-meta {
    font-size: 0.8rem;
    color: var(--glhf-text-muted);
    flex: 1;
}

.fc-day-total {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.fc-day-arrow {
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.fc-day--open > .fc-day-header .fc-day-arrow {
    transform: rotate(180deg);
}

.fc-day-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0.5rem;
}

.fc-day--open > .fc-day-detail {
    max-height: 600px;
    padding: 0 0.5rem 0.75rem;
}

.fc-day-loading {
    height: 24px;
    background: var(--glhf-bg-tertiary);
    border-radius: var(--glhf-radius-sm);
    animation: fcPulse 1s ease-in-out infinite alternate;
    margin: 0.5rem 0;
}

@keyframes fcPulse {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

.fc-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: fixed;
}

.fc-detail-table th:nth-child(1),
.fc-detail-table td:nth-child(1) { width: 60px; }
.fc-detail-table th:nth-child(2),
.fc-detail-table td:nth-child(2) { width: 90px; }

.fc-detail-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--glhf-text-muted);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--glhf-border);
    font-weight: 600;
}

.fc-detail-table td {
    padding: 0.4rem 0.5rem;
    color: var(--glhf-text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.fc-detail-table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 600px) {
    .fc-day-header {
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
    }
    .fc-day-meta {
        order: 3;
        flex-basis: 100%;
    }
}

/* --- Stats Widget --- */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glhf-border);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row-label {
    color: var(--glhf-text-secondary);
    font-size: 0.9rem;
}

.stat-row-value {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    color: var(--glhf-text-primary);
    font-size: 0.95rem;
}

/* --- Streak Display --- */
.streak-display-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--glhf-radius-md);
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(var(--glhf-funcoin-rgb), 0.1);
    border: 1px solid rgba(var(--glhf-funcoin-rgb), 0.2);
    border-radius: var(--glhf-radius-md);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.streak-display::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--glhf-radius-md);
    background: linear-gradient(135deg, rgba(var(--glhf-funcoin-rgb), 0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.streak-display:hover {
    border-color: var(--glhf-funcoin);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(var(--glhf-funcoin-rgb), 0.25);
}

.streak-display:hover::before {
    opacity: 1;
}

.streak-link-hint {
    position: absolute;
    right: 1rem;
    bottom: 0.35rem;
    font-family: var(--glhf-font-heading);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--glhf-funcoin);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.streak-display:hover .streak-link-hint {
    opacity: 0.8;
    transform: translateX(0);
}

.streak-fire {
    font-size: 2rem;
}

.streak-count {
    font-family: var(--glhf-font-heading);
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--glhf-funcoin);
}

.streak-label {
    font-size: 0.8rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.streak-bonus {
    margin-left: auto;
    text-align: center;
}

.streak-bonus-badge {
    font-family: var(--glhf-font-heading);
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--glhf-accent);
    line-height: 1.2;
}

.streak-bonus-label {
    font-size: 0.7rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Game Profiles --- */
.game-profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--glhf-bg-tertiary);
    border-radius: var(--glhf-radius-md);
    margin-bottom: 0.75rem;
}

.game-profile-card:last-child {
    margin-bottom: 0;
}

.game-profile-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--glhf-radius-sm);
    background: var(--glhf-bg-card);
    font-size: 1.2rem;
}

.game-profile-info {
    flex-grow: 1;
}

.game-profile-name {
    font-weight: 600;
    color: var(--glhf-text-primary);
    font-size: 0.9rem;
}

.game-profile-id {
    font-size: 0.8rem;
    color: var(--glhf-text-muted);
}

.game-profile-link {
    font-size: 0.8rem;
    color: var(--glhf-accent);
}

/* --- Steam Account Cards --- */
.steam-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.steam-card {
    background: var(--glhf-bg-tertiary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-md);
    overflow: hidden;
}

.steam-card-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.steam-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--glhf-radius-sm);
    flex-shrink: 0;
    object-fit: cover;
}

.steam-card-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glhf-bg-card);
    font-size: 1.4rem;
}

.steam-card-info {
    flex: 1;
    min-width: 0;
}

.steam-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--glhf-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.steam-card-link {
    font-size: 0.8rem;
    color: var(--glhf-accent);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.steam-card-link:hover {
    text-decoration: underline;
}

.steam-card-unlink {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0 1px;
    flex-shrink: 0;
    transition: all var(--glhf-transition-fast);
}

.steam-card-unlink:hover {
    color: var(--glhf-danger);
    border-color: var(--glhf-danger);
    background: rgba(239, 68, 68, 0.1);
}

.steam-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.steam-card-set-default {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0 2px;
    transition: all var(--glhf-transition-fast);
}

.steam-card-set-default:hover {
    color: var(--glhf-funcoin);
    border-color: var(--glhf-funcoin);
    background: rgba(255, 193, 7, 0.1);
}

.steam-default-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--glhf-funcoin);
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: var(--glhf-radius-sm);
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.steam-card--default {
    border-color: rgba(255, 193, 7, 0.2);
}

.steam-card-extra {
    margin-top: -10px;
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.steam-field-label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.steam-field-hint {
    font-size: 0.7rem;
    color: var(--glhf-accent);
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
}

.steam-field-hint:hover {
    text-decoration: underline;
}

.steam-field-row {
    display: flex;
    gap: 0.5rem;
}

.steam-field-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--glhf-text-primary);
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    outline: none;
    transition: border-color var(--glhf-transition-fast);
}

.steam-field-input:focus {
    border-color: var(--glhf-accent);
}

.steam-field-input::placeholder {
    color: var(--glhf-text-muted);
    opacity: 0.6;
}

.steam-field-save {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--glhf-text-primary);
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--glhf-transition-fast);
}

.steam-field-save:hover {
    border-color: var(--glhf-accent);
    color: var(--glhf-accent);
}

.steam-field-save.saved {
    border-color: var(--glhf-success);
    color: var(--glhf-success);
}

.steam-field-static {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.steam-field-static .steam-field-label {
    display: inline;
    margin-bottom: 0;
    flex-shrink: 0;
}

.trade-url-copy-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.trade-url-copy-btn {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.2s, transform 0.2s;
}

.trade-url-copy-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

.trade-url-copy-btn:active {
    transform: scale(0.9);
}

.trade-url-toast {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: #16a34a;
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
}

.trade-url-toast::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #16a34a;
}

.trade-url-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.steam-field-value {
    font-size: 0.9rem;
    color: var(--glhf-text-primary);
}

/* Add Steam Button */
.steam-add-wrap--has-accounts {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glhf-border);
}

.steam-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #171a21;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    transition: all var(--glhf-transition-fast);
}

.steam-add-btn:hover {
    background: #2a475e;
    border-color: #66c0f4;
}

.steam-add-btn svg {
    flex-shrink: 0;
}

/* Steam Modal */
.steam-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.steam-modal {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    max-width: 580px;
    width: 100%;
    padding: 2rem;
    position: relative;
}

.steam-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--glhf-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.steam-modal-close:hover {
    color: var(--glhf-text-primary);
}

.steam-modal-icon {
    text-align: center;
    margin-bottom: 1rem;
}

.steam-modal-title {
    text-align: center;
    font-family: var(--glhf-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--glhf-text-primary);
}

.steam-modal-body p {
    color: var(--glhf-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.steam-modal-notice {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(var(--glhf-accent-rgb, 34,197,94), 0.08);
    border: 1px solid rgba(var(--glhf-accent-rgb, 34,197,94), 0.2);
    border-radius: var(--glhf-radius-sm);
}

.steam-modal-notice-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.steam-modal-notice p {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
}

.steam-modal-notice ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: var(--glhf-text-secondary);
}

.steam-modal-notice ul li {
    margin-bottom: 0.2rem;
}

.steam-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.steam-modal-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--glhf-transition-fast);
}

.steam-modal-btn--confirm {
    background: #171a21;
    color: #66c0f4;
    border-color: #66c0f4;
}

.steam-modal-btn--confirm:hover {
    background: #2a475e;
    color: #fff;
}

.steam-modal-btn--cancel {
    background: var(--glhf-bg-tertiary);
    color: var(--glhf-text-secondary);
    border-color: var(--glhf-border);
}

.steam-modal-btn--cancel:hover {
    border-color: var(--glhf-text-muted);
}

/* --- Steam Toast --- */
.steam-toast {
    position: fixed;
    top: calc(var(--glhf-header-height, 60px) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 99999;
    padding: 0.85rem 1.5rem;
    border-radius: var(--glhf-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.steam-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.steam-toast--error {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.6);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

@media (max-width: 600px) {
    .steam-card-extra {
        padding: 0 0.75rem 0.75rem;
    }
    .steam-field-row {
        flex-direction: column;
    }
}

/* --- History Table --- */
.cabinet-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cabinet-table {
    width: 100%;
    border-collapse: collapse;
}

.cabinet-table th {
    font-family: var(--glhf-font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glhf-border);
}

.cabinet-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--glhf-text-secondary);
    border-bottom: 1px solid var(--glhf-border);
}

.cabinet-table tr:last-child td {
    border-bottom: none;
}

.cabinet-table tr:hover td {
    background: rgba(var(--glhf-accent-rgb), 0.03);
}

.result-win  { color: var(--glhf-success); font-weight: 600; }
.result-loss { color: var(--glhf-danger); font-weight: 600; }
.result-draw { color: var(--glhf-warning); font-weight: 600; }

@media (max-width: 600px) {
    .cabinet-table-wrap .cabinet-table {
        min-width: 520px;
    }
    .cabinet-table-wrap .cabinet-table th,
    .cabinet-table-wrap .cabinet-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.82rem;
    }
}

/* --- Warnings --- */
.warning-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--glhf-radius-md);
    margin-bottom: 0.75rem;
}

.warning-card:last-child {
    margin-bottom: 0;
}

.warning-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-danger);
    font-size: 1.1rem;
}

.warning-reason {
    color: var(--glhf-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.warning-meta {
    font-size: 0.8rem;
    color: var(--glhf-text-muted);
}

/* --- Widget Count Badge --- */
.cabinet-widget-count {
    font-family: var(--glhf-font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--glhf-text-muted);
    background: var(--glhf-bg-tertiary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-full);
    padding: 2px 10px;
    letter-spacing: 0.5px;
}

/* --- Pagination --- */
.cabinet-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--glhf-border);
}

.cabinet-pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--glhf-text-primary);
    background: var(--glhf-bg-tertiary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    transition: all var(--glhf-transition-fast);
}

.cabinet-pagination-btn:hover:not(:disabled) {
    border-color: var(--glhf-accent);
    color: var(--glhf-accent);
    background: var(--glhf-accent-dim);
}

.cabinet-pagination-btn:disabled,
.cabinet-pagination-btn.is-disabled {
    opacity: 0.3;
    cursor: default;
}

a.cabinet-pagination-btn {
    text-decoration: none;
}

.cabinet-pagination-info {
    font-family: var(--glhf-font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--glhf-text-secondary);
    letter-spacing: 1px;
}

/* --- Empty State --- */
.cabinet-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--glhf-text-muted);
}

.cabinet-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cabinet-empty p {
    font-size: 1rem;
}

/* --- Login Required --- */
.cabinet-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 1.5rem;
}

.cabinet-login-required h2 {
    font-size: 2rem;
}

.cabinet-login-required p {
    color: var(--glhf-text-muted);
    max-width: 400px;
}

/* --- Demo gateway missing warning --- */
.em-pay-demo-missing {
    padding: 14px 16px;
    margin: 0 0 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd5a0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.em-pay-demo-missing strong {
    display: block;
    color: #fde0b8;
    margin-bottom: 4px;
}

.em-pay-demo-missing p {
    margin: 0;
    opacity: 0.92;
}

/* --- Login-required placeholder (demo-mode guest tabs) --- */
.cabinet-login-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    padding: 48px 24px;
    margin: 20px 0;
    border-radius: 18px;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(0, 255, 100, 0.07), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(0, 255, 100, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 12px 30px rgba(0, 0, 0, 0.28);
}

.cabinet-login-placeholder__icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #00ff9c;
    background: radial-gradient(circle at 50% 40%, rgba(0, 255, 100, 0.18), rgba(0, 255, 100, 0.05) 70%);
    box-shadow: 0 0 0 1px rgba(0, 255, 100, 0.25), 0 10px 24px rgba(0, 255, 100, 0.1);
}

.cabinet-login-placeholder__title {
    margin: 4px 0 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--glhf-text, #eaffe5);
    letter-spacing: 0.01em;
}

.cabinet-login-placeholder__desc {
    margin: 0;
    max-width: 520px;
    color: var(--glhf-text-muted, #9bb39a);
    font-size: 0.98rem;
    line-height: 1.55;
}

.cabinet-login-placeholder__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    margin-top: 6px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #5865f2, #4752c4);
    box-shadow: 0 10px 22px rgba(88, 101, 242, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cabinet-login-placeholder__btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 14px 28px rgba(88, 101, 242, 0.45);
    color: #fff;
}

.cabinet-login-placeholder__btn:active {
    transform: translateY(0);
}

@media (max-width: 540px) {
    .cabinet-login-placeholder {
        padding: 36px 16px;
    }
    .cabinet-login-placeholder__title {
        font-size: 1.2rem;
    }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .cabinet-grid--3,
    .cabinet-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cabinet > .container {
        padding: 0 12px;
    }

    .cabinet-profile {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }

    .cabinet-roles {
        justify-content: center;
    }

    .cabinet-grid,
    .cabinet-grid--3,
    .cabinet-grid--4 {
        grid-template-columns: 1fr;
    }

    .cabinet-widget {
        padding: 1rem;
    }

    .cabinet-tabs {
        gap: 2px;
    }

    .cabinet-tab {
        padding: 13px 14px 9px;
        font-size: 0.75rem;
    }
}

/* --- Minigames: 2-column layout (table + Герої піску) --- */
.minigames-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .minigames-layout {
        grid-template-columns: 1fr;
    }
    .minigames-layout > .cabinet-widget {
        min-width: 0;
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .minigames-stats-table th {
        white-space: normal;
    }
    .minigames-stats-table th,
    .minigames-stats-table td {
        padding: 0.4rem 0.4rem;
        font-size: 0.82rem;
    }

    .sand-heroes-widget {
        overflow: hidden;
    }
    .sand-heroes-left {
        flex: 0 0 100px;
    }
    .sand-hero-image {
        width: 100px;
        height: 220px;
    }
    .sand-hero-health-wrap {
        width: 100px;
    }
    .sand-hero-name-level {
        font-size: 12px;
    }
    .sand-hero-health-center {
        font-size: 11px;
    }
    .sand-hero-health-bar {
        height: 16px;
    }
    .sand-heroes-body {
        gap: 0.75rem;
    }
    .sand-hero-level {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    .sand-hero-stats-list {
        font-size: 0.8rem;
        gap: 0.15rem 0.5rem;
        margin-bottom: 0.5rem;
        max-width: 100%;
    }
    .sand-hero-stats-list dt {
        white-space: normal;
    }
    .sand-hero-battle-stats {
        gap: 0.3rem 0.5rem;
    }
    .sand-hero-battle-row {
        font-size: 0.78rem;
    }
    .sand-heroes-header {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
}

.minigames-stats-table .minigames-game-icon {
    margin-right: 0.35em;
}

.minigames-game-link {
    color: var(--glhf-text-primary);
    text-decoration: none;
    transition: color var(--glhf-transition-fast);
    display: inline-flex;
    align-items: center;
}
.minigames-game-link:hover {
    color: var(--glhf-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.minigames-total-row {
    font-weight: 700;
    border-top: 2px solid var(--glhf-border);
}

.minigames-total-row td {
    padding-top: 0.75rem;
}

/* Sand Heroes (Герої піску) block */
.sand-heroes-header {
    font-family: var(--glhf-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sand-heroes-body {
    display: flex;
    gap: 1rem;
}

.sand-heroes-left {
    flex: 0 0 150px;
    text-align: center;
}

.sand-hero-name-level {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 0.1rem;
}

.sand-hero-name-level .sand-hero-name {
    color: #fff;
}

.sand-hero-name-level .sand-hero-level-num {
    color: var(--glhf-text-muted);
    font-weight: 600;
}

.sand-hero-health-wrap {
    margin-bottom: 4px;
    width: 150px;
}

.sand-hero-health-bar {
    height: 20px;
    background: var(--glhf-bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--glhf-border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Градієнт: червоний (мало HP) → жовтий → зелений (повні HP) */
.sand-hero-health-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #c0392b 0%, #d35400 25%, #f1c40f 50%, #27ae60 100%);
    border-radius: 0;
    transition: width 0.5s ease;
}

.sand-hero-health-center {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 2px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.8);
}

.sand-hero-image {
    width: 150px;
    height: 330px;
    border-radius: var(--glhf-radius-md);
    overflow: hidden;
    border: 1px solid var(--glhf-border);
    background: var(--glhf-bg-tertiary);
}

.sand-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sand-heroes-right {
    flex: 1;
    min-width: 0;
}

.sand-hero-stats-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    align-items: baseline;
    max-width: 220px;
}

.sand-hero-stats-list dt {
    margin: 0;
    font-weight: 600;
    color: var(--glhf-text-secondary);
    white-space: nowrap;
}

.sand-hero-stats-list dd {
    margin: 0;
    text-align: left;
}

.sand-hero-heal-btn {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.sand-hero-level {
    font-family: var(--glhf-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--glhf-text-muted);
    margin-bottom: 0.5rem;
}

.sand-hero-battle-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.sand-hero-battle-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.sand-hero-battle-label {
    color: var(--glhf-text-muted);
}

.sand-hero-battle-value {
    color: var(--glhf-text-primary);
}

.sand-hero-heal-note {
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
    margin: 0;
}

/* --- Moderator Bar --- */
.cabinet-mod-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    margin-top: -0.5rem;
    margin-bottom: 1.25rem;
    background: rgba(var(--glhf-accent-rgb), 0.06);
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.15);
    border-radius: var(--glhf-radius-sm);
}
.cabinet-mod-bar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--glhf-accent);
    opacity: 0.7;
}
.cabinet-mod-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem 0.4rem 0.6rem;
    background: rgba(var(--glhf-accent-rgb), 0.12);
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.25);
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--glhf-transition-fast), border-color var(--glhf-transition-fast);
}
.cabinet-mod-btn:hover {
    background: rgba(var(--glhf-accent-rgb), 0.2);
    border-color: rgba(var(--glhf-accent-rgb), 0.4);
}
.cabinet-mod-btn-icon {
    font-size: 1rem;
    line-height: 1;
}

/* --- FC Modal --- */
.fc-mod-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fcModFadeIn 0.2s ease;
}
@keyframes fcModFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fc-mod-modal {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fcModSlideIn 0.25s ease;
}
@keyframes fcModSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.fc-mod-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glhf-border);
}
.fc-mod-modal-title {
    font-family: var(--glhf-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--glhf-text-primary);
    margin: 0;
}
.fc-mod-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--glhf-transition-fast), border-color var(--glhf-transition-fast);
}
.fc-mod-modal-close:hover {
    color: var(--glhf-text-primary);
    border-color: var(--glhf-border-bright);
}
.fc-mod-modal-body {
    padding: 1.5rem;
}
.fc-mod-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.fc-mod-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--glhf-text-muted);
}
.fc-mod-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.6;
}
.fc-mod-input {
    background: var(--glhf-bg-main);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-text-primary);
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--glhf-transition-fast);
}
.fc-mod-input:focus {
    border-color: var(--glhf-accent);
}
.fc-mod-submit-btn {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.7rem;
    background: var(--glhf-accent);
    color: #0a0a0a;
    border: none;
    border-radius: var(--glhf-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--glhf-transition-fast);
}
.fc-mod-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.fc-mod-submit-btn:not(:disabled):hover {
    opacity: 0.85;
}
.fc-mod-submit-btn--loading {
    pointer-events: none;
    opacity: 0.6;
}
.fc-mod-result {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--glhf-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}
.fc-mod-result--ok {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #66bb6a;
}
.fc-mod-result--err {
    background: rgba(244, 67, 54, 0.12);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ef5350;
}

/* --- Warning Moderator Button & Modal --- */
.cabinet-mod-btn--warn {
    background: rgba(239, 152, 38, 0.12);
    border-color: rgba(239, 152, 38, 0.25);
    color: #ef9826;
}
.cabinet-mod-btn--warn:hover {
    background: rgba(239, 152, 38, 0.22);
    border-color: rgba(239, 152, 38, 0.4);
}
.warn-mod-textarea {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
    line-height: 1.5;
}
.warn-mod-submit-btn {
    background: #ef9826;
}
.warn-mod-submit-btn:not(:disabled):hover {
    background: #d98820;
}

/* Animate newly inserted warning card */
.warning-card--new {
    animation: warnCardIn 0.4s ease;
}
@keyframes warnCardIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   STREAMS TAB — Troll Order Statistics
   ============================================ */

/* Stats Grid */
.streams-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.streams-stats-grid--5 {
    grid-template-columns: repeat(5, 1fr);
}

.streams-stat-card--earnings {
    border-color: rgba(var(--glhf-funcoin-rgb), 0.3);
}

.streams-stat-card--earnings .streams-stat-value {
    color: var(--glhf-funcoin);
}

.streams-reset-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--glhf-text-muted);
    background: var(--glhf-bg-tertiary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.streams-reset-btn:hover {
    color: var(--glhf-text-primary);
    border-color: var(--glhf-accent);
    background: var(--glhf-accent-dim);
}

.streams-stat-card {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.streams-stat-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--glhf-radius-lg);
    background: linear-gradient(135deg, rgba(var(--glhf-accent-rgb), 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.streams-stat-card:hover {
    border-color: var(--glhf-border-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.streams-stat-card:hover::before {
    opacity: 1;
}

.streams-stat-card--clickable {
    cursor: pointer;
}

.streams-stat-card--clickable:hover {
    border-color: var(--glhf-accent);
    box-shadow: 0 0 20px rgba(var(--glhf-accent-rgb), 0.15);
}

.streams-stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.streams-stat-value {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--glhf-text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.streams-stat-value--sm {
    font-size: 1rem;
}

.streams-stat-unit {
    font-size: 0.85rem;
    opacity: 0.6;
}

.streams-stat-label {
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.streams-stat-hint {
    display: block;
    font-size: 0.65rem;
    color: var(--glhf-accent);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.streams-stat-card--clickable:hover .streams-stat-hint {
    opacity: 1;
}

/* Actions Modal */
.streams-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.streams-modal {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.streams-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glhf-border);
}

.streams-modal-header h3 {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
    color: var(--glhf-text-primary);
}

.streams-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--glhf-text-muted);
    transition: color 0.2s, transform 0.2s;
    padding: 0 0.25rem;
}

.streams-modal-close:hover {
    color: var(--glhf-text-primary);
    transform: scale(1.15);
}

.streams-modal-body {
    padding: 1.25rem 1.5rem;
}

/* Action frequency rows */
.streams-action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.streams-action-row:last-child {
    border-bottom: none;
}

.streams-action-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--glhf-text-primary);
    min-width: 130px;
    white-space: nowrap;
}

.streams-action-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--glhf-bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.streams-action-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--glhf-accent), rgba(var(--glhf-accent-rgb), 0.5));
    transition: width 0.6s ease;
}

.streams-action-meta {
    display: flex;
    gap: 4px;
    min-width: 70px;
    justify-content: flex-end;
}

.streams-action-count {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--glhf-text-primary);
}

.streams-action-pct {
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
}

/* Chart */
.streams-chart-wrap {
    padding: 0.5rem 0;
}

.streams-chart-wrap canvas {
    width: 100% !important;
    max-height: 200px;
}

/* Responsive */
@media (max-width: 1100px) {
    .streams-stats-grid--5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .streams-stats-grid,
    .streams-stats-grid--5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .streams-stats-grid {
        grid-template-columns: 1fr;
    }
    .streams-action-name {
        min-width: 100px;
        font-size: 0.8rem;
    }
    .streams-modal {
        width: 95%;
    }
}

/* ===========================
   Emeralds Tab — Sidebar Layout
   =========================== */

@keyframes emFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes emCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes emGlowPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(var(--glhf-accent-rgb), 0.15); }
    50%      { box-shadow: 0 0 24px rgba(var(--glhf-accent-rgb), 0.35); }
}

@keyframes emHeroGlow {
    0%, 100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 40px rgba(0, 0, 0, 0.14);
        border-color: rgba(var(--glhf-accent-rgb), 0.24);
    }
    50% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 52px rgba(0, 0, 0, 0.2), 0 0 30px rgba(255, 140, 0, 0.08);
        border-color: rgba(var(--glhf-accent-rgb), 0.34);
    }
}

@keyframes emOfferShine {
    0% {
        transform: translateX(-140%) skewX(-18deg);
        opacity: 0;
    }
    15% {
        opacity: 0.28;
    }
    45%, 100% {
        transform: translateX(220%) skewX(-18deg);
        opacity: 0;
    }
}

@keyframes emBadgePulse {
    0%, 100% {
        transform: rotate(45deg) scale(1);
    }
    50% {
        transform: rotate(45deg) scale(1.06);
    }
}

/* Layout */
.em-layout {
    display: flex;
    gap: 1.25rem;
    min-height: 400px;
}

/* Sidebar */
.em-sidebar {
    flex-shrink: 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.em-sidebar-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 14px;
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    color: var(--glhf-text-muted);
    font: inherit;
}

.em-sidebar-tab::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--glhf-radius-lg);
    background: linear-gradient(135deg, rgba(var(--glhf-accent-rgb), 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.em-sidebar-tab:hover {
    border-color: var(--glhf-border-bright);
    transform: translateY(-2px);
}

.em-sidebar-tab.active {
    border-color: var(--glhf-accent);
    background: var(--glhf-accent-dim);
    color: var(--glhf-text-primary);
}

.em-sidebar-tab.active::before {
    opacity: 1;
}

.em-sidebar-tab-icon {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(var(--glhf-accent-rgb), 0.3));
}

.em-sidebar-tab-icon-svg {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    color: var(--glhf-accent);
}

.em-sidebar-tab-info {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.em-sidebar-tab-value {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--glhf-accent);
    line-height: 1.2;
}

.em-sidebar-tab-title {
    position: relative;
    z-index: 1;
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--glhf-text-primary);
    line-height: 1.2;
}

.em-sidebar-tab-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-sidebar-tab--topup {
    align-items: center;
}

/* Topup tab special glow */
.em-sidebar-tab--topup {
    animation: emGlowPulse 3s ease-in-out infinite;
}

.em-sidebar-tab--topup:hover {
    box-shadow: 0 0 30px rgba(var(--glhf-accent-rgb), 0.3);
}

.em-sidebar-tab--topup.active {
    animation: none;
    box-shadow: 0 0 20px rgba(var(--glhf-accent-rgb), 0.25);
}

.em-sidebar-tab-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--glhf-radius-lg);
    background: radial-gradient(circle at 30% 50%, rgba(var(--glhf-accent-rgb), 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Main content area */
.em-main {
    flex: 1;
    min-width: 0;
}

.em-main .cabinet-pagination-info,
.em-panel .cabinet-empty p {
    color: rgba(255, 255, 255, 0.78);
}

.em-panel {
    display: none;
}

.em-panel.active {
    display: block;
    animation: emFadeIn 0.3s ease;
}

/* Day-grouped history */
.emerald-day-list {
    display: flex;
    flex-direction: column;
}

.emerald-day {
    border-bottom: 1px solid var(--glhf-border);
}

.emerald-day:last-child {
    border-bottom: none;
}

.emerald-day-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--glhf-transition-fast);
}

.emerald-day-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.emerald-day-date {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--glhf-text-primary);
    min-width: 90px;
}

.emerald-day-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.74);
    flex: 1;
}

.emerald-day-total {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.emerald-day-arrow {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.emerald-day--open .emerald-day-arrow {
    transform: rotate(180deg);
}

.emerald-day-detail {
    display: none;
    padding: 0 16px 12px;
}

.emerald-day--open .emerald-day-detail {
    display: block;
    animation: emFadeIn 0.25s ease;
}

/* Transaction rows inside day details */
.emerald-tx-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--glhf-radius-sm);
    transition: background var(--glhf-transition-fast);
}

.emerald-tx-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.emerald-tx-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.emerald-tx-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.emerald-tx-desc {
    font-size: 0.85rem;
    color: var(--glhf-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emerald-tx-meta {
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.74);
}

.emerald-tx-meta-id {
    color: rgb(255 255 255 / 15%);
}

@media (max-width: 576px) {
    .emerald-tx-meta-id {
        display: none;
    }
}

.emerald-tx-amount {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.emerald-tx--credit .emerald-tx-amount {
    color: var(--glhf-accent);
}

.emerald-tx--debit .emerald-tx-amount {
    color: var(--glhf-danger, #ff4d4d);
}

/* Top-up panel */
.em-packages {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.18);
    border-radius: calc(var(--glhf-radius-lg) + 4px);
    background:
        radial-gradient(circle at top left, rgba(var(--glhf-accent-rgb), 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 184, 0, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.08)),
        var(--glhf-bg-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.16);
}

.em-packages::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.035) 42%, transparent 60%);
    pointer-events: none;
}

/* Unified hero banner */
.em-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.24);
    border-radius: var(--glhf-radius-lg);
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 50%, rgba(var(--glhf-accent-rgb), 0.2), transparent 36%),
        radial-gradient(circle at 90% 50%, rgba(255, 184, 0, 0.08), transparent 30%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.02), rgba(var(--glhf-accent-rgb), 0.04)),
        var(--glhf-bg-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 40px rgba(0, 0, 0, 0.14);
    animation: emCardIn 0.4s ease both, emHeroGlow 7s ease-in-out infinite;
}

.em-hero::before {
    content: '';
    position: absolute;
    inset: -18%;
    z-index: 0;
    background:
        radial-gradient(circle at 14% 50%, rgba(var(--glhf-accent-rgb), 0.34), transparent 24%),
        radial-gradient(circle at 76% 42%, rgba(255, 158, 0, 0.18), transparent 20%),
        radial-gradient(circle at 90% 50%, rgba(255, 86, 0, 0.12), transparent 14%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(var(--glhf-accent-rgb), 0.08)),
        var(--glhf-bg-card);
    filter: blur(14px) saturate(1.12);
    transform: scale(1.04);
    opacity: 0.74;
    pointer-events: none;
}

.em-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.03) 40%, transparent 58%);
    pointer-events: none;
}

.em-hero-embers {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.em-hero-embers-canvas {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0.86;
    filter: blur(2px) saturate(1.15);
}

.em-hero-artbox {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 275px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.em-hero-artbox::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 24px;
    background: radial-gradient(circle, rgba(var(--glhf-accent-rgb), 0.22), transparent 68%);
    filter: blur(6px);
}

.em-hero-art {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.em-hero-body {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.em-hero-title {
    margin: 0.6rem 0 0.45rem;
    font-family: var(--glhf-font-heading);
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--glhf-text-primary);
    max-width: 20ch;
}

.em-hero-text {
    margin: 0;
    max-width: 55ch;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
    line-height: 1.55;
}

.em-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.em-hero-pill {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.18);
    border-radius: 999px;
    background: rgba(var(--glhf-accent-rgb), 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.em-hero-offer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.55rem 1.3rem 1.25rem;
    border: 1px solid rgba(255, 200, 88, 0.34);
    border-radius: var(--glhf-radius-lg);
    min-width: 400px;
    text-align: center;
    background:
        radial-gradient(circle at top center, rgba(var(--glhf-accent-rgb), 0.18), transparent 38%),
        linear-gradient(180deg, rgba(255, 195, 72, 0.12), rgb(12 14 12 / 20%) 32%, rgb(12 14 12 / 24%)),
        rgb(14 16 15 / 20%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    -webkit-backdrop-filter: blur(6px) saturate(1.3);
    backdrop-filter: blur(6px) saturate(1.3);
}

.em-hero-offer::before {
    content: '';
    position: absolute;
    inset: -20% auto -20% -30%;
    width: 46%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    transform: skewX(-18deg);
    opacity: 0;
    animation: emOfferShine 6.5s ease-in-out infinite;
}

.em-hero-offer .em-pkg-gem,
.em-hero-offer .em-pkg-amount,
.em-hero-offer .em-pkg-btn {
    position: relative;
    z-index: 2;
}

.em-hero-offer::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(255, 231, 170, 0.08),
        inset 0 0 60px rgba(255, 173, 59, 0.08);
    pointer-events: none;
}

.em-hero-offer .em-pkg-gem {
    width: 68px;
    height: 68px;
}

.em-hero-offer .em-pkg-amount {
    font-size: 2.2rem;
}

.em-hero-offer .em-pkg-btn {
    max-width: 220px;
    font-size: 0.95rem;
    padding: 12px 18px;
    margin-top: 0.35rem;
}

.em-packages-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.em-pkg {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    padding: 1.1rem 1rem 0.9rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.3s ease;
    animation: emCardIn 0.4s ease both;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.em-pkg::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--glhf-radius-lg);
    background: linear-gradient(135deg, rgba(var(--glhf-accent-rgb), 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.em-pkg:hover {
    border-color: var(--glhf-accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 34px rgba(var(--glhf-accent-rgb), 0.14);
}

.em-pkg:hover::before {
    opacity: 1;
}

.em-pkg:hover .em-pkg-gem {
    transform: scale(1.12) rotate(-6deg);
    filter: drop-shadow(0 0 14px rgba(0, 200, 83, 0.5));
}

.em-pkg--plus {
    border-color: rgba(var(--glhf-accent-rgb), 0.2);
    background:
        radial-gradient(circle at top center, rgba(var(--glhf-accent-rgb), 0.08), transparent 44%),
        var(--glhf-bg-card);
}

.em-pkg--premium {
    border-color: rgba(255, 184, 0, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 184, 0, 0.06), transparent 30%),
        radial-gradient(circle at top center, rgba(var(--glhf-accent-rgb), 0.1), transparent 46%),
        var(--glhf-bg-card);
    box-shadow: inset 0 1px 0 rgba(255, 225, 145, 0.08);
}

.em-pkg--premium .em-pkg-gem {
    width: 48px;
    height: 48px;
}

.em-pkg--elite {
    border-color: rgba(255, 198, 84, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 198, 84, 0.1), transparent 34%),
        radial-gradient(circle at top center, rgba(var(--glhf-accent-rgb), 0.16), transparent 42%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 198, 84, 0.03)),
        var(--glhf-bg-card);
    box-shadow:
        inset 0 1px 0 rgba(255, 231, 170, 0.12),
        0 18px 40px rgba(0, 0, 0, 0.16);
}

.em-pkg--elite::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffd677, transparent);
    opacity: 0.8;
}

.em-pkg--elite .em-pkg-gem {
    width: 56px;
    height: 56px;
}

.em-pkg--elite .em-pkg-amount {
    font-size: 1.6rem;
}

.em-pkg-rec {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 3px 12px;
    background: var(--glhf-accent-dim);
    color: var(--glhf-accent);
    font-family: var(--glhf-font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--glhf-radius-sm);
    margin-bottom: 4px;
}

.em-pkg-badge {
    position: absolute;
    top: 14px;
    right: -32px;
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    color: #000;
    font-weight: 700;
    padding: 5px 42px;
    transform: rotate(45deg);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 204, 0, 0.3);
    z-index: 2;
}

.em-hero-offer .em-pkg-badge {
    top: 18px;
    right: -42px;
    padding: 8px 56px;
    font-size: 0.9rem;
    box-shadow: 0 6px 18px rgba(255, 170, 0, 0.28);
    animation: emBadgePulse 2.8s ease-in-out infinite;
}

.em-pkg--no-bonus .em-pkg-badge {
    display: none;
}

.em-pkg-gem {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(0, 200, 83, 0.3));
}

.em-pkg-amount {
    position: relative;
    z-index: 1;
    font-family: var(--glhf-font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--glhf-accent);
    letter-spacing: 0.5px;
    line-height: 1;
}

.em-pkg-label {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: #00ff6444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1;
}

.em-pkg-btn {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: auto;
    padding: 10px 14px;
    background: transparent;
    border: 2px solid var(--glhf-accent);
    border-radius: var(--glhf-radius-lg);
    color: var(--glhf-accent);
    font-family: var(--glhf-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.em-pkg-btn:hover {
    background: var(--glhf-accent);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.25);
}

/* ----------------------------------------------------------------
   Emeralds Info Block
   ---------------------------------------------------------------- */

.em-info-block {
    margin-top: 2rem;
    padding: 1.5rem 1.8rem;
    background: radial-gradient(circle at top left, rgba(var(--glhf-accent-rgb), 0.08), transparent 50%), var(--glhf-bg-tertiary);
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.15);
    border-radius: var(--glhf-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.em-info-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(var(--glhf-accent-rgb), 0.5), transparent);
}

.em-info-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--glhf-font-heading);
    font-size: 1.3rem;
    color: var(--glhf-text-primary);
    margin: 0 0 1.25rem 0;
    font-weight: 800;
}

.em-info-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(0, 200, 83, 0.5));
}

.em-info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.em-info-col h5 {
    font-size: 0.95rem;
    color: var(--glhf-accent);
    margin: 0 0 0.85rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.em-info-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.em-info-col li {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.55;
    position: relative;
    padding-left: 1.4rem;
}

.em-info-col li::before {
    content: '▪';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--glhf-accent);
    font-size: 1.2rem;
    line-height: 1.2;
}

.em-info-col li strong {
    color: #fff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .em-info-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Responsive */

/* Intermediate: sidebar is still 220px visible, but the right column is too
   narrow for the 3-col `auto 1fr auto` hero layout (artbox 275 + body + offer
   400 + gaps). Collapse to 2 rows: [artbox | body] + [offer full-width]. */
@media (min-width: 901px) and (max-width: 1330px) {
    .em-hero {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        row-gap: 1rem;
    }
    .em-hero-artbox {
        width: 200px;
    }
    .em-hero-body {
        grid-column: 2;
    }
    .em-hero-offer {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
        min-width: 0;
        width: 100%;
        padding: 1rem 1.25rem;
    }
    .em-hero-offer .em-pkg-gem {
        width: 52px;
        height: 52px;
    }
    .em-hero-offer .em-pkg-amount {
        font-size: 1.8rem;
    }
    .em-hero-offer .em-pkg-btn {
        margin-top: 0;
        width: auto;
        min-width: 180px;
    }
    .em-hero-offer .em-pkg-badge {
        top: 10px;
        right: -42px;
        padding: 6px 48px;
        font-size: 0.78rem;
    }
}

@media (max-width: 900px) {
    .em-layout {
        flex-direction: column;
    }
    .em-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .em-sidebar-tab {
        flex: 1;
        min-width: 180px;
    }
    .em-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .em-hero-artbox {
        width: 220px;
        margin: 0 auto;
    }
    .em-hero-title {
        max-width: none;
    }
    .em-hero-pills {
        justify-content: center;
    }
    .em-hero-offer {
        width: 100%;
        min-width: 0;
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 700px) {
    .em-packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 450px) {
    .em-packages-grid {
        grid-template-columns: 1fr;
    }
    .em-hero {
        padding: 1rem;
    }
}

/* ----------------------------------------------------------------
   Payment: button loading state
   ---------------------------------------------------------------- */

.em-pkg-btn--loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.em-pkg-btn--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: em-btn-spin 0.6s linear infinite;
}

@keyframes em-btn-spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------
   Payment: toast notifications
   ---------------------------------------------------------------- */

.em-payment-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100000;
    max-width: 420px;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: auto;
}

.em-payment-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.em-payment-toast--success {
    background: rgba(16, 185, 80, 0.14);
    border: 1px solid rgba(16, 185, 80, 0.35);
    color: #6ee7a0;
}

.em-payment-toast--error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.em-payment-toast--info {
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93bbfd;
}

.em-payment-toast--loading {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #fcd34d;
}

/* ----------------------------------------------------------------
   Payment Method Selection Modal
   ---------------------------------------------------------------- */

.em-pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: emPayFadeIn 0.2s ease;
}

@keyframes emPayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.em-pay-modal {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: emPaySlideIn 0.3s ease;
}

@keyframes emPaySlideIn {
    from { transform: translateY(24px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.em-pay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glhf-border);
}

.em-pay-title {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
    color: var(--glhf-text-primary);
}

.em-pay-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    color: var(--glhf-text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.em-pay-close:hover {
    color: var(--glhf-text-primary);
    border-color: var(--glhf-border-bright);
    background: var(--glhf-bg-tertiary);
}

.em-pay-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

/* Package info */
.em-pay-package {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background:
        radial-gradient(circle at left, rgba(var(--glhf-accent-rgb), 0.08), transparent 50%),
        var(--glhf-bg-tertiary);
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.15);
    border-radius: var(--glhf-radius-md);
    margin-bottom: 1.25rem;
}

.em-pay-package-gem {
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(0, 200, 83, 0.3));
}

.em-pay-package-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.em-pay-package-amount {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--glhf-accent);
}

.em-pay-package-label {
    font-size: 0.75rem;
    color: var(--glhf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.em-pay-package-price {
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--glhf-text-primary);
    white-space: nowrap;
}

/* Methods list */
.em-pay-methods {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.em-pay-method {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: var(--glhf-bg-tertiary);
    border: 2px solid var(--glhf-border);
    border-radius: var(--glhf-radius-md);
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    transition: all 0.2s ease;
}

.em-pay-method:hover {
    border-color: var(--glhf-border-bright);
    background: rgba(255, 255, 255, 0.03);
}

.em-pay-method.selected {
    border-color: var(--glhf-accent);
    background: rgba(var(--glhf-accent-rgb), 0.06);
}

.em-pay-method-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.em-pay-method-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.em-pay-method-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--glhf-text-primary);
}

.em-pay-method-desc {
    font-size: 0.78rem;
    color: var(--glhf-text-muted);
}

.em-pay-method-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--glhf-border);
    border-radius: 50%;
    color: transparent;
    transition: all 0.2s ease;
}

.em-pay-method.selected .em-pay-method-check {
    border-color: var(--glhf-accent);
    background: var(--glhf-accent);
    color: #000;
}

/* Terms checkbox */
.em-pay-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.em-pay-terms input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.em-pay-terms-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 2px solid var(--glhf-border);
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.em-pay-terms-check::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.2s ease;
    position: absolute;
    top: 3px;
}

.em-pay-terms input:checked ~ .em-pay-terms-check {
    border-color: var(--glhf-accent);
    background: var(--glhf-accent);
}

.em-pay-terms input:checked ~ .em-pay-terms-check::after {
    transform: rotate(-45deg) scale(1);
}

.em-pay-terms-text {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--glhf-text-secondary);
}

.em-pay-terms-text a {
    color: var(--glhf-accent);
    text-decoration: none;
}

.em-pay-terms-text a:hover {
    text-decoration: underline;
}

/* Submit button */
.em-pay-submit {
    width: 100%;
    padding: 14px;
    background: var(--glhf-accent);
    color: #000;
    border: none;
    border-radius: var(--glhf-radius-md);
    font-family: var(--glhf-font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.em-pay-submit:not(:disabled):hover {
    box-shadow: 0 0 24px rgba(var(--glhf-accent-rgb), 0.35);
    transform: translateY(-1px);
}

.em-pay-submit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.em-pay-submit--loading {
    pointer-events: none;
    color: transparent !important;
}

.em-pay-submit--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: em-btn-spin 0.6s linear infinite;
}

/* Manual instructions block */
.em-pay-instructions {
    margin-top: 1.25rem;
    padding: 1rem;
    background: rgba(var(--glhf-accent-rgb), 0.05);
    border: 1px solid rgba(var(--glhf-accent-rgb), 0.18);
    border-radius: var(--glhf-radius-md);
    animation: emFadeIn 0.3s ease;
}

.em-pay-instructions-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--glhf-text-primary);
    margin-bottom: 0.75rem;
}

.em-pay-instructions-icon {
    font-size: 1.2rem;
}

.em-pay-instructions-body {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--glhf-text-secondary);
    margin-bottom: 0.75rem;
    word-break: break-word;
}

.em-pay-instructions-ref {
    font-size: 0.85rem;
    color: var(--glhf-text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.em-pay-instructions-ref code {
    display: inline-block;
    padding: 3px 10px;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-sm);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--glhf-accent);
    user-select: all;
}

.em-pay-instructions-note {
    font-size: 0.78rem;
    color: var(--glhf-text-muted);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 500px) {
    .em-pay-modal {
        max-width: 100%;
        border-radius: var(--glhf-radius-md);
    }
    .em-pay-body {
        padding: 1rem;
    }
}

/* ── Streams: Transaction Table ───────────────────── */
.streams-tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.streams-tx-table th,
.streams-tx-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--glhf-border, rgba(255,255,255,0.06));
}
.streams-tx-table th {
    color: var(--glhf-text-muted, rgba(255,255,255,0.5));
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.streams-tx-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}
.streams-tx-list {
    max-height: 400px;
    overflow-y: auto;
}
