:root {
    --primary: #0066FF;
    --primary-light: #E8F0FF;
    --primary-dark: #0052CC;
    --bg: #F8F9FB;
    --white: #FFFFFF;
    --text: #1A1D21;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --ton: #0098EA;
    --ton-light: rgba(0, 152, 234, 0.1);
    --radius: 10px;
    --radius-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: visible; }

img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
}

.app { height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #0052CC);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.logo-text { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.logo-text span { color: var(--primary); }

.header-nav { display: flex; align-items: center; gap: 4px; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover { color: var(--text); background: var(--border-light); }
.nav-btn.active { color: var(--primary); background: var(--primary-light); }

.header-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    margin: 0 8px;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--border-light);
    border-radius: 8px;
}

.header-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.header-stat-icon.bank { background: rgba(0, 152, 234, 0.15); }
.header-stat-icon.timer { background: rgba(0, 102, 255, 0.1); }
.header-stat-icon.online { background: rgba(16, 185, 129, 0.15); }

.header-stat-info { display: flex; flex-direction: column; line-height: 1.2; }
.header-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.header-stat-value { font-size: 14px; font-weight: 700; color: var(--text); }

.header-right { display: flex; align-items: center; gap: 10px; }

.deposit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--success);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.deposit-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.deposit-btn:hover { background: #0DA271; }

.balance-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.balance-icon { font-size: 16px; }
.balance-value { font-size: 14px; font-weight: 700; color: var(--text); }

.user-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

/* Main */
.main {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 16px;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
    overflow: visible;
}

/* Sidebar Cards */
.sidebar-card { overflow: hidden;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.card-title { font-size: 13px; font-weight: 600; }

.card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 5px;
}

/* Players */
.players-list { flex: 1; padding: 8px; overflow-y: auto; }

.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.player-item:hover { background: var(--border-light); }

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bet { font-size: 11px; color: var(--text-secondary); }
.player-bet span { color: var(--ton); font-weight: 600; }

.player-chance { text-align: right; }
.chance-value { font-size: 13px; font-weight: 700; }
.chance-bar { width: 48px; height: 3px; background: var(--border-light); border-radius: 2px; margin-top: 3px; }
.chance-fill { height: 100%; border-radius: 2px; }

/* Empty State */
.empty-state {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-text { font-size: 13px; }

/* Game Center */
.game-center {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* Game Stats Bar */
.game-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--border-light);
    border-radius: 10px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 600; color: var(--text); }
.stat-value.highlight { color: var(--ton); }
.stat-divider { width: 1px; height: 14px; background: var(--border); }

/* Game Bank */
.game-bank {
    text-align: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #E6F4FF 0%, #CCE9FF 100%);
    border: 2px solid rgba(0, 152, 234, 0.2);
    border-radius: 14px;
    position: relative;
    overflow: visible;
}

.bank-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.bank-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bank-star {
    font-size: 36px;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.bank-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.bank-value.bump {
    animation: bankBump 0.3s ease;
}

@keyframes bankBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: var(--warning); }
    100% { transform: scale(1); }
}

.bank-currency {
    font-size: 18px;
    font-weight: 700;
    color: var(--ton);
    align-self: flex-end;
    margin-bottom: 6px;
}

.bank-players {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.bank-players span { color: var(--primary); font-weight: 700; }

/* Roulette */
.roulette-wrapper {
    position: relative;
    width: 100%;
    padding: 3px;
}

.roulette-border {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    border: 3px solid var(--success);
    pointer-events: none;
    z-index: 5;
    transition: border-color 0.3s;
}

.roulette-border.warning { border-color: var(--warning); }
.roulette-border.danger { border-color: var(--danger); }

.roulette-container {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    overflow: visible;
}

.roulette-pointer {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pointer-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid var(--primary);
    filter: drop-shadow(0 2px 4px rgba(0,102,255,0.4));
}

.roulette-window { overflow: hidden;
    height: 72px;
    overflow: visible;
    position: relative;
}

.roulette-window::before,
.roulette-window::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 5;
    pointer-events: none;
}

.roulette-window::before { left: 0; background: linear-gradient(to right, var(--white), transparent); }
.roulette-window::after { right: 0; background: linear-gradient(to left, var(--white), transparent); }

.roulette-strip {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%) translateX(-50px);
    will-change: transform;
}

.roulette-item {
    flex-shrink: 0;
    width: 60px;
    height: 56px;
    margin: 0 3px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 2px solid #ccc;
    background: #f9f9f9;
    transition: transform 0.1s, box-shadow 0.1s;
}

.roulette-item .item-avatar { font-size: 20px; line-height: 1; }
.roulette-item .item-name { font-size: 9px; font-weight: 600; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.roulette-item.winner {
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(16,185,129,0.5);
    border-color: var(--success) !important;
}

/* Game Status */
.game-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--border-light);
    border-radius: var(--radius);
}

.game-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.game-status-dot.betting { background: var(--success); animation: statusPulse 1.5s ease infinite; }
.game-status-dot.spinning { background: var(--primary); animation: statusPulse 0.5s ease infinite; }
.game-status-dot.finished { background: var(--warning); }

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.game-status-text { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.game-timer { font-size: 14px; font-weight: 700; color: var(--text); }

/* Controls */
.controls-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.bet-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
}

.bet-adj {
    width: 32px;
    height: 36px;
    background: var(--border-light);
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.bet-adj:hover { background: var(--border); color: var(--text); }

.bet-input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.bet-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.quick-bets { display: flex; gap: 4px; flex: 1; }

.quick-bet {
    flex: 1;
    padding: 8px 4px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.quick-bet:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.place-btn {
    padding: 8px 16px;
    height: 36px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.2s;
}

.place-btn:hover { background: var(--primary-dark); }
.place-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Chat */
.chat-messages { flex: 1; padding: 8px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 6px; }

.chat-msg {
    padding: 8px 10px;
    background: var(--border-light);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

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

.chat-msg.system {
    background: rgba(16,185,129,0.1);
    border-left: 2px solid var(--success);
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: var(--white);
    border: 1px solid var(--border);
}

.chat-avatar.bronze { border-color: #CD7F32; }
.chat-avatar.silver { border-color: #C0C0C0; }
.chat-avatar.gold { border-color: #FFD700; }
.chat-avatar.diamond { border-color: #B9F2FF; }

.chat-content { flex: 1; min-width: 0; overflow: visible; }
.msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.msg-user { font-size: 11px; font-weight: 600; color: var(--primary); }
.msg-time { font-size: 9px; color: var(--text-muted); }
.msg-text { font-size: 12px; color: var(--text-secondary); word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; white-space: pre-wrap; max-width: 100%; }

.chat-input-box { padding: 8px; border-top: 1px solid var(--border); display: flex; gap: 6px; }

.chat-input {
    flex: 1;
    padding: 8px 10px;
    background: var(--border-light);
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.chat-input:focus { background: var(--white); box-shadow: 0 0 0 1px var(--primary); }

.chat-send {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 360px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.toast.success .toast-icon { background: rgba(16, 185, 129, 0.15); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.15); }
.toast.warning .toast-icon { background: rgba(245, 158, 11, 0.15); }

.toast-content { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.toast-message { font-size: 12px; color: var(--text-secondary); }

.toast-close {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
}

/* Mobile */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 6px 12px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 100;
}

.mobile-nav-inner { display: flex; justify-content: space-around; }

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.mobile-nav-btn span:first-child { font-size: 18px; }
.mobile-nav-btn span:last-child { font-size: 10px; color: var(--text-muted); }
.mobile-nav-btn.active span:last-child { color: var(--primary); }

.mobile-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-panel-overlay.active { opacity: 1; visibility: visible; }

.mobile-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    background: var(--white);
    z-index: 201;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.mobile-panel.left { left: 0; transform: translateX(-100%); }
.mobile-panel.right { right: 0; transform: translateX(100%); }
.mobile-panel-overlay.active .mobile-panel { transform: translateX(0); }

.mobile-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--border-light);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: var(--danger);
    color: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    z-index: 999;
    display: none;
}

.connection-status.offline { display: block; }

/* Responsive */
@media (max-width: 1100px) {
    .main { grid-template-columns: 220px 1fr 240px; gap: 12px; padding: 12px; }
    .header-stats { display: none; }
}

@media (max-width: 900px) {
    .header-nav { display: none; }
    .main { grid-template-columns: 1fr; padding: 12px; padding-bottom: 70px; }
    .sidebar-card { overflow: hidden; display: none; }
    .mobile-nav { display: block; }
    .bank-value { font-size: 36px; }
}

@media (max-width: 500px) {
    .header-inner { padding: 0 12px; height: 48px; }
    .logo-icon { width: 28px; height: 28px; font-size: 14px; }
    .logo-text { font-size: 16px; }
    .deposit-btn { display: none; }
    .quick-bets { order: 3; width: 100%; }
    .toast-container { top: auto; bottom: 80px; right: 10px; left: 10px; }
    .toast { min-width: auto; max-width: none; }
}

/* Full width pages */
.full-page {
    grid-column: 1 / -1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.history-page,
.fairness-page {
    grid-column: 1 / -1;
}

/* Scrollable pages */
.app.scrollable {
    height: auto;
    min-height: 100vh;
}

.app.scrollable .main {
    min-height: auto;
}

/* Stats Bar Updated */
.game-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.stat-item.lucky {
    gap: 6px;
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text);
}

.stat-value.highlight {
    color: var(--success);
    font-weight: 700;
}

.stat-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.stat-wins {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.stat-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

/* TON Blue Color */
.stat-value.ton-color {
    color: #0088CC;
    font-weight: 700;
}

/* Chat login prompt */
.chat-login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--border-light);
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.chat-login-prompt:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.chat-login-prompt svg {
    width: 16px;
    height: 16px;
}

/* Profile Pages */
.profile-page {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 8px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.profile-nav-item:hover {
    background: var(--border-light);
    color: var(--text);
}

.profile-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.profile-nav-item svg {
    width: 20px;
    height: 20px;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Profile Card */
.profile-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.profile-banner {
    height: 100px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    background: var(--white);
    border: 4px solid var(--white);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: absolute;
    bottom: -40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.profile-details {
    padding: 52px 24px 24px;
    text-align: center;
}

.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}

.profile-name-row h1 {
    font-size: 24px;
    font-weight: 800;
}

.profile-level {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-level.bronze { background: #CD7F3220; color: #CD7F32; }
.profile-level.silver { background: #C0C0C020; color: #808080; }
.profile-level.gold { background: #FFD70020; color: #B8860B; }
.profile-level.diamond { background: #B9F2FF20; color: #00CED1; }

.profile-email {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.profile-joined {
    color: var(--text-muted);
    font-size: 13px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.balance { background: #0088CC15; }
.stat-icon.wins { background: #FFD70020; }
.stat-icon.won { background: #10B98120; }
.stat-icon.games { background: #8B5CF620; }

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* Profile Section */
.profile-section {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px;
}

.profile-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

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

.section-header h2 {
    margin-bottom: 0;
}

.balance-badge {
    padding: 8px 14px;
    background: var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.balance-badge strong {
    color: var(--text);
}

/* Wins List */
.wins-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.win-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--border-light);
    border-radius: 8px;
}

.win-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.win-game {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.win-date {
    font-size: 11px;
    color: var(--text-muted);
}

.win-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--success);
}

.empty-wins, .empty-transactions {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

.empty-wins span, .empty-transactions span {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

/* Transactions */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--border-light);
    border-radius: 10px;
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--white);
}

.transaction-item.win .tx-icon { background: #10B98115; }
.transaction-item.bet .tx-icon { background: #3B82F615; }

.tx-info {
    flex: 1;
}

.tx-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.tx-date {
    font-size: 12px;
    color: var(--text-muted);
}

.tx-amount {
    font-size: 15px;
    font-weight: 700;
}

.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--text-muted); }

.play-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

/* Settings */
.settings-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 24px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.settings-card > p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.settings-card.danger {
    border-color: #FEE2E2;
    background: #FEF2F2;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.avatar-option {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--border-light);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-option:hover {
    border-color: var(--border);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.avatar-option input {
    display: none;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.color-option {
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text);
}

.color-option input {
    display: none;
}

.color-option svg {
    width: 20px;
    height: 20px;
}

.settings-field {
    margin-bottom: 14px;
}

.settings-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.settings-field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.settings-field input:focus {
    border-color: var(--primary);
}

.save-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover {
    background: var(--primary-dark);
}

.danger-btn {
    padding: 12px 24px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.danger-btn:hover {
    background: #DC2626;
}

@media (max-width: 768px) {
    .profile-page {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    
    .profile-nav {
        flex-direction: row;
        position: static;
        overflow-x: auto;
    }
    
    .profile-nav-item {
        white-space: nowrap;
        padding: 10px 14px;
    }
    
    .profile-nav-item span {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .avatar-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Alerts */
.alert-success {
    background: #D1FAE5;
    border: 1px solid #A7F3D0;
    color: #059669;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   LEVEL SYSTEM - Visual Rewards
   ======================================== */

/* Level Badge Styles */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bronze - Basic */
.level-badge.bronze,
.profile-level.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

/* Silver - Clean metallic */
.level-badge.silver,
.profile-level.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

/* Gold - Shiny golden */
.level-badge.gold,
.profile-level.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.5);
    animation: goldShine 3s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% { box-shadow: 0 2px 12px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.8); }
}

/* Diamond - Animated gradient */
.level-badge.diamond,
.profile-level.diamond {
    background: linear-gradient(135deg, #00CED1 0%, #4169E1 25%, #9400D3 50%, #00CED1 75%, #4169E1 100%);
    background-size: 200% 200%;
    color: white;
    animation: diamondGradient 3s ease infinite;
    box-shadow: 0 2px 15px rgba(65, 105, 225, 0.6);
}

@keyframes diamondGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Legendary - Rainbow animated */
.level-badge.legendary,
.profile-level.legendary {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 100%;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    animation: legendaryRainbow 4s linear infinite;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

@keyframes legendaryRainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

/* ========================================
   AVATAR FRAMES BY LEVEL
   ======================================== */

/* Base avatar frame */
.avatar-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-frame::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    z-index: -1;
}

/* Bronze frame */
.avatar-frame.bronze::before {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
}

/* Silver frame */
.avatar-frame.silver::before {
    background: linear-gradient(135deg, #E8E8E8, #A8A8A8, #C0C0C0);
}

/* Gold frame - glowing */
.avatar-frame.gold::before {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    animation: goldFramePulse 2s ease-in-out infinite;
}

@keyframes goldFramePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* Diamond frame - animated gradient */
.avatar-frame.diamond::before {
    background: linear-gradient(45deg, #00CED1, #4169E1, #9400D3, #4169E1, #00CED1);
    background-size: 300% 300%;
    animation: diamondFrame 3s ease infinite;
}

@keyframes diamondFrame {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Legendary frame - rainbow spinning */
.avatar-frame.legendary::before {
    background: conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    animation: legendaryFrameSpin 2s linear infinite;
}

@keyframes legendaryFrameSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.avatar-frame.legendary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    z-index: 0;
}

/* ========================================
   PLAYER CARD STYLES BY LEVEL
   ======================================== */

.player-item.bronze .player-avatar { border: 2px solid #CD7F32; }
.player-item.silver .player-avatar { border: 2px solid #C0C0C0; }

.player-item.gold .player-avatar {
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.player-item.diamond .player-avatar {
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(45deg, #00CED1, #4169E1, #9400D3) border-box;
    animation: diamondPlayerBorder 3s ease infinite;
}

.player-item.legendary .player-avatar {
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
                conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) border-box;
    animation: legendaryPlayerBorder 2s linear infinite;
}

@keyframes diamondPlayerBorder {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

@keyframes legendaryPlayerBorder {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ========================================
   CHAT MESSAGE STYLES BY LEVEL
   ======================================== */

.chat-msg.bronze .chat-avatar { border: 2px solid #CD7F32; }
.chat-msg.silver .chat-avatar { border: 2px solid #C0C0C0; }

.chat-msg.gold .chat-avatar {
    border: 2px solid #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.chat-msg.gold .msg-user {
    color: #B8860B;
    font-weight: 700;
}

.chat-msg.diamond .chat-avatar {
    border: 2px solid #4169E1;
    box-shadow: 0 0 10px rgba(65, 105, 225, 0.5);
    animation: diamondAvatarGlow 2s ease infinite;
}

.chat-msg.diamond .msg-user {
    background: linear-gradient(90deg, #00CED1, #4169E1, #9400D3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

@keyframes diamondAvatarGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(65, 105, 225, 0.5); }
    50% { box-shadow: 0 0 15px rgba(148, 0, 211, 0.6); }
}

.chat-msg.legendary .chat-avatar {
    border: 3px solid transparent;
    background: linear-gradient(var(--border-light), var(--border-light)) padding-box,
                conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) border-box;
    animation: legendaryAvatarSpin 3s linear infinite;
}

.chat-msg.legendary .msg-user {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: legendaryTextShift 3s linear infinite;
    font-weight: 800;
}

@keyframes legendaryAvatarSpin {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes legendaryTextShift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ========================================
   ROULETTE ITEM STYLES BY LEVEL
   ======================================== */

.roulette-item.bronze { border: 2px solid #CD7F32; }
.roulette-item.silver { border: 2px solid #C0C0C0; }

.roulette-item.gold {
    border: 2px solid #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.roulette-item.diamond {
    border: 2px solid transparent;
    background: linear-gradient(#f9f9f9, #f9f9f9) padding-box,
                linear-gradient(45deg, #00CED1, #4169E1, #9400D3) border-box;
}

.roulette-item.legendary {
    border: 2px solid transparent;
    background: linear-gradient(#f9f9f9, #f9f9f9) padding-box,
                conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) border-box;
    animation: legendaryRouletteItem 3s linear infinite;
}

@keyframes legendaryRouletteItem {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ========================================
   HEADER USER BUTTON BY LEVEL
   ======================================== */

.user-btn.bronze { border: 2px solid #CD7F32; }
.user-btn.silver { border: 2px solid #C0C0C0; }

.user-btn.gold {
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.user-btn.diamond {
    border: 2px solid transparent;
    background: linear-gradient(var(--white), var(--white)) padding-box,
                linear-gradient(45deg, #00CED1, #4169E1, #9400D3) border-box;
    animation: diamondUserBtn 3s ease infinite;
}

@keyframes diamondUserBtn {
    0%, 100% { box-shadow: 0 0 10px rgba(65, 105, 225, 0.4); }
    50% { box-shadow: 0 0 15px rgba(148, 0, 211, 0.5); }
}

.user-btn.legendary {
    border: 3px solid transparent;
    background: linear-gradient(var(--white), var(--white)) padding-box,
                conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) border-box;
    animation: legendaryUserBtn 2s linear infinite;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

@keyframes legendaryUserBtn {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ========================================
   LEVEL COLORS (Premium colors for high levels)
   ======================================== */

/* Gold exclusive colors */
.color-option.gold-exclusive {
    position: relative;
}
.color-option.gold-exclusive::after {
    content: '👑';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
}

/* Diamond exclusive - animated gradient colors */
.color-option.diamond-exclusive {
    background: linear-gradient(45deg, var(--c1), var(--c2), var(--c1)) !important;
    background-size: 200% 200% !important;
    animation: gradientColorOption 3s ease infinite;
}

@keyframes gradientColorOption {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Legendary exclusive - rainbow colors */
.color-option.legendary-exclusive {
    background: conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) !important;
    animation: rainbowColorOption 2s linear infinite;
}

@keyframes rainbowColorOption {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ========================================
   PROFILE PAGE LEVEL ENHANCEMENTS
   ======================================== */

.profile-banner.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 140, 0, 0.2) 100%) !important;
}

.profile-banner.diamond {
    background: linear-gradient(135deg, rgba(0, 206, 209, 0.3) 0%, rgba(65, 105, 225, 0.3) 50%, rgba(148, 0, 211, 0.2) 100%) !important;
    animation: diamondBannerShift 5s ease infinite;
}

@keyframes diamondBannerShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

.profile-banner.legendary {
    background: linear-gradient(90deg, 
        rgba(255, 0, 0, 0.2), 
        rgba(255, 127, 0, 0.2), 
        rgba(255, 255, 0, 0.2), 
        rgba(0, 255, 0, 0.2), 
        rgba(0, 0, 255, 0.2), 
        rgba(148, 0, 211, 0.2),
        rgba(255, 0, 0, 0.2)
    ) !important;
    background-size: 300% 100%;
    animation: legendaryBanner 5s linear infinite;
}

@keyframes legendaryBanner {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.profile-avatar-large.gold {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
}

.profile-avatar-large.diamond {
    box-shadow: 0 4px 25px rgba(65, 105, 225, 0.6);
    animation: diamondAvatarLargePulse 2s ease infinite;
}

@keyframes diamondAvatarLargePulse {
    0%, 100% { box-shadow: 0 4px 25px rgba(65, 105, 225, 0.6); }
    50% { box-shadow: 0 4px 35px rgba(148, 0, 211, 0.7); }
}

.profile-avatar-large.legendary {
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
    animation: legendaryAvatarLarge 3s linear infinite;
}

@keyframes legendaryAvatarLarge {
    0% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.6); }
    16% { box-shadow: 0 0 30px rgba(255, 127, 0, 0.6); }
    33% { box-shadow: 0 0 30px rgba(255, 255, 0, 0.6); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.6); }
    66% { box-shadow: 0 0 30px rgba(0, 0, 255, 0.6); }
    83% { box-shadow: 0 0 30px rgba(148, 0, 211, 0.6); }
    100% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.6); }
}

/* Level progress bar on profile */
.level-progress {
    margin-top: 16px;
    padding: 16px;
    background: var(--border-light);
    border-radius: 12px;
}

.level-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.level-progress-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.level-progress-next {
    font-size: 12px;
    color: var(--text-muted);
}

.level-progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.level-progress-fill.bronze { background: linear-gradient(90deg, #CD7F32, #8B4513); }
.level-progress-fill.silver { background: linear-gradient(90deg, #C0C0C0, #808080); }
.level-progress-fill.gold { background: linear-gradient(90deg, #FFD700, #FFA500); }
.level-progress-fill.diamond { 
    background: linear-gradient(90deg, #00CED1, #4169E1, #9400D3);
    background-size: 200% 100%;
    animation: diamondProgress 2s ease infinite;
}

@keyframes diamondProgress {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.level-progress-fill.legendary {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000);
    background-size: 300% 100%;
    animation: legendaryProgress 3s linear infinite;
}

@keyframes legendaryProgress {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ========================================
   AVATAR FRAMES
   ======================================== */

/* Silver ring */
.frame-silver-ring {
    border: 3px solid #C0C0C0 !important;
}

/* Gold glow */
.frame-gold-glow {
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6) !important;
}

/* Diamond animated */
.frame-diamond-animated {
    border: 3px solid transparent !important;
    background: linear-gradient(var(--white, #fff), var(--white, #fff)) padding-box,
                linear-gradient(45deg, #00CED1, #4169E1, #9400D3, #00CED1) border-box !important;
    background-size: 300% 300%;
    animation: diamondFrameAnim 3s ease infinite !important;
}

@keyframes diamondFrameAnim {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Legendary rainbow */
.frame-legendary-rainbow {
    border: 3px solid transparent !important;
    background: linear-gradient(var(--white, #fff), var(--white, #fff)) padding-box,
                conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) border-box !important;
    animation: legendaryFrameRotate 2s linear infinite !important;
}

@keyframes legendaryFrameRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ========================================
   NAME EFFECTS
   ======================================== */

.effect-none { }

.effect-bold {
    font-weight: 800 !important;
}

.effect-gold-text {
    color: #FFD700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
}

.effect-gradient-text {
    background: linear-gradient(90deg, #00CED1, #4169E1, #9400D3) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.effect-rainbow-text {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) !important;
    background-size: 200% auto !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    animation: rainbowTextAnim 3s linear infinite !important;
}

@keyframes rainbowTextAnim {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.effect-animated-glow {
    color: #fff !important;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff !important;
    animation: glowTextAnim 2s ease infinite !important;
}

@keyframes glowTextAnim {
    0%, 100% { text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff; }
    50% { text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff; }
}

/* Roulette items with frames */
.roulette-item .item-avatar.frame-silver-ring { border: 2px solid #C0C0C0; }
.roulette-item .item-avatar.frame-gold-glow { border: 2px solid #FFD700; box-shadow: 0 0 8px rgba(255,215,0,0.5); }
.roulette-item .item-avatar.frame-diamond-animated { 
    border: 2px solid transparent;
    background: linear-gradient(#f9f9f9, #f9f9f9) padding-box,
                linear-gradient(45deg, #00CED1, #4169E1, #9400D3) border-box;
}
.roulette-item .item-avatar.frame-legendary-rainbow {
    border: 2px solid transparent;
    background: linear-gradient(#f9f9f9, #f9f9f9) padding-box,
                conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #9400d3, #ff0000) border-box;
    animation: legendaryFrameRotate 2s linear infinite;
}
