/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at top right, var(--card-glow-color, transparent), transparent 70%);
    opacity: 0.4;
}

.stat-card--wins {
    --card-glow-color: rgba(212, 175, 55, 0.5);
}

.stat-card--games {
    --card-glow-color: rgba(168, 85, 247, 0.5);
}

.stat-card--winrate {
    --card-glow-color: rgba(45, 212, 191, 0.5);
}

.stat-card--streak {
    --card-glow-color: rgba(216, 48, 48, 0.5);
}

.stat-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-card-value {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   GENERIC CARD
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    transition: all var(--transition-normal);
}

.card:hover {
    background: var(--bg-card-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   BALANCE CARD (premium look)
   ============================================ */
.balance-card {
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.08) 0%,
        rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.balance-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.balance-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.balance-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.5));
}

.balance-info {
    flex: 1;
}

.balance-amount {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.balance-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-divider {
    width: 1px;
    height: 40px;
    background: var(--border-default);
}

/* ============================================
   CHART
   ============================================ */
.chart-container {
    position: relative;
    height: 200px;
    padding: 8px 0;
}

/* ============================================
   INVENTORY
   ============================================ */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.inventory-item--empty {
    opacity: 0.4;
}

.inventory-item-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.inventory-item-info {
    flex: 1;
    min-width: 0;
}

.inventory-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-item-count {
    font-size: 11px;
    color: var(--accent-gold);
    font-weight: 700;
    margin-top: 2px;
}

.inventory-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    grid-column: 1 / -1;
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */
.achievements-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.1) 0%,
        rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.achievements-progress-circle {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg, .circle-progress {
    fill: none;
    stroke-width: 8;
}

.circle-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.circle-progress {
    stroke: url(#circleGradient);
    stroke-linecap: round;
    stroke-dasharray: 276.46;
    stroke-dashoffset: 276.46;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.circle-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.circle-text-value {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
}

.circle-text-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.achievements-summary-text {
    flex: 1;
}

.achievements-summary-text h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.achievements-summary-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.achievement-item--unlocked {
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.1) 0%,
        var(--bg-card) 100%);
    border-color: rgba(212, 175, 55, 0.3);
}

.achievement-item--locked {
    opacity: 0.6;
}

.achievement-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.achievement-item--unlocked .achievement-icon {
    background: linear-gradient(135deg, var(--accent-gold), #8a7820);
    box-shadow: var(--shadow-glow-gold);
}

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

.achievement-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.achievement-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.achievement-status {
    flex-shrink: 0;
}

.achievement-item--unlocked .achievement-status {
    color: var(--accent-gold);
    font-size: 20px;
}

.achievement-item--locked .achievement-status {
    color: var(--text-muted);
    font-size: 20px;
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-header {
    margin-bottom: 16px;
}

.leaderboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.leaderboard-item--first {
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.15) 0%,
        var(--bg-card) 100%);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.2);
}

.leaderboard-item--second {
    background: linear-gradient(135deg,
        rgba(192, 192, 192, 0.1) 0%,
        var(--bg-card) 100%);
    border-color: rgba(192, 192, 192, 0.3);
}

.leaderboard-item--third {
    background: linear-gradient(135deg,
        rgba(205, 127, 50, 0.1) 0%,
        var(--bg-card) 100%);
    border-color: rgba(205, 127, 50, 0.3);
}

.leaderboard-rank {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 32px;
    text-align: center;
}

.leaderboard-item--first .leaderboard-rank {
    font-size: 24px;
}

.leaderboard-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-mmr {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-gold);
}

/* ============================================
   ROLES
   ============================================ */
.roles-header {
    margin-bottom: 16px;
}

.role-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-top: 12px;
    padding-bottom: 4px;
}

.filter-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn.active {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

.filter-btn:active {
    transform: scale(0.95);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.role-card:active {
    transform: scale(0.97);
}

.role-card--mafia {
    border-color: rgba(216, 48, 48, 0.3);
}

.role-card--mafia::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(216, 48, 48, 0.15), transparent 60%);
    pointer-events: none;
}

.role-card--town {
    border-color: rgba(45, 212, 191, 0.3);
}

.role-card--town::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(45, 212, 191, 0.15), transparent 60%);
    pointer-events: none;
}

.role-card--neutral {
    border-color: rgba(212, 175, 55, 0.3);
}

.role-card--neutral::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.15), transparent 60%);
    pointer-events: none;
}

.role-icon {
    font-size: 40px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.role-name {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.role-team {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.role-card--mafia .role-team {
    color: var(--accent-blood);
}

.role-card--town .role-team {
    color: var(--accent-emerald);
}

.role-card--neutral .role-team {
    color: var(--accent-gold);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 200ms ease-out;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    text-align: center;
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.modal-name {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-team {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 16px;
}

.modal-team--mafia {
    background: rgba(216, 48, 48, 0.2);
    color: var(--accent-blood);
}

.modal-team--town {
    background: rgba(45, 212, 191, 0.2);
    color: var(--accent-emerald);
}

.modal-team--neutral {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-gold);
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
    font-size: 14px;
}
