.header-container {
    text-align: center;
    padding: 2rem 0;
}

.title {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -3px;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
}

.rust {
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.magic {
    color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.prize-badge {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.prize-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.prize-group:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, white, #8b5cf6);
}

.coin-icon {
    width: 28px;
    height: 28px;
    filter: 
      brightness(1.2) 
      drop-shadow(0 0 3px rgba(245, 158, 11, 0.7));
}

.divider {
    color: rgba(255,255,255,0.3);
}

.prize-label {
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
}

.leaderboard{
    margin-top: 2rem;
}


.lb-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-top: 2rem;
    padding-bottom: 2rem;
    perspective: 1000px;
}

.lb-card {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 12px;
    width: 260px;
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;

    transform-style: preserve-3d;
    will-change: transform;
    transition: transform .5s;

}


.lb-first {
    order: 1;
    transform: translateY(-30px);

}

.lb-second {
    order: 0;
    
}

.lb-third {
    order: 2;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139, 92, 246, 0.3);
    margin: 0 auto 1rem;
    display: block;
}

.lb-first .avatar {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold);
}

.lb-second .avatar {
    border-color: var(--silver);
    box-shadow: 0 0 15px var(--silver);
}

.lb-third .avatar {
    border-color: var(--bronze);
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.3);
}

.lb-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;     
}

.username {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    color: white;

    white-space: nowrap;      
    overflow: hidden;         
    text-overflow: ellipsis;  
    display: inline-block;   
    max-width: 100%;      
}
/*
.lb-first .username {
    color: #fcd34d;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}*/

.wager-section {
    background: rgba(15, 15, 35, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.wager-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple-accent), transparent);
}

.wager-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--purple-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

/*
.wager-label::before {
    content: '⚡';
    font-size: 0.8rem;
}*/

.wager-amount {
    font-size: 1rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.prize-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.prize-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gold .prize-amount { color: var(--gold); }
.silver .prize-amount { color: var(--silver); }
.bronze .prize-amount { color: var(--bronze); }

.coin-icon {
    width: 24px;
    height: 24px;
    filter: 
        brightness(1.1)
        drop-shadow(0 0 2px rgba(139, 92, 246, 0.3));
}


.lb-rankings{
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.lb-table-header {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr 1fr;
    grid-template-areas: "rank user wagered prize";
    /*padding: 1.5rem 2.5rem;*/
    padding: 0.5rem;
    width: 845px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);

    letter-spacing: 1px;
    /*
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    */

    /*border-bottom: 2px solid rgba(255, 255, 255, 0.1);*/
    margin-bottom: 15px;
}

.header-rank {
    grid-area: rank;
}

.header-user {
    grid-area: user;
    text-align: left;
}

.header-wagered {
    grid-area: wagered;
}

.header-prize {
    grid-area: prize;
}

.lb-rank-row{
    display: grid;
    grid-template-columns: 1fr 3fr 1fr 1fr;
    grid-template-areas: "rank user prize wagered";
    align-items: center;
    border-radius: 15px;

    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);    

    width: 845px;
    padding: 0.5rem;
    margin-bottom: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 75px;
}

.lb-rank-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lb-rank-row:hover {
    background: rgba(30, 30, 46, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translate(12px, -5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.lb-rank-row:hover::before {
    opacity: 1;
}

.rank-area  {
    justify-self: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    /*border: 2px solid rgba(139, 92, 246, 0.3);*/
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--purple-accent);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.user-area{
    display: flex;
    align-items: center;
    gap: 1.2rem;
    justify-self: start;
    min-width: 0;
}


.rank-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.lb-rank-row:hover .rank-avatar {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.rank-username{
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wager-area {
    justify-self: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.prize-area {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.lb-rank-row:hover .prize-area {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.prize-area .prize-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.prize-area .coin-icon {
    width: 22px;
    height: 22px;
    filter: brightness(1.1) drop-shadow(0 0 3px rgba(139, 92, 246, 0.3));
    vertical-align: middle;
}

@media (max-width: 1200px) {
    .lb-table-header,
    .lb-rank-row {
        width: 95%;
        max-width: 800px;
    }
}

@media (max-width: 992px) {
    .title {
        font-size: 3.5rem;
    }
    
    .prize-badge {
        font-size: 1.2rem;
    }
    
    .lb-podium {
        gap: 1.5rem;
    }
    
    .lb-card {
        width: 220px;
        padding: 1.2rem;
    }
    
    .lb-table-header,
    .lb-rank-row {
        padding: 0.5rem 1rem;
    }
    
    .rank-username {
        font-size: 1.1rem;
    }
    
    .wager-area,
    .prize-area .prize-amount {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 1.5rem 0;
    }
    
    .title {
        font-size: 2.8rem;
    }
    
    .lb-podium {
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .lb-card {
        width: 45%;
        min-width: 200px;
        margin-bottom: 1rem;
    }
    
    .lb-first {
        transform: none;
        order: 0;
    }
    
    .lb-table-header {
        font-size: 0.75rem;
    }
    
    .rank-avatar {
        width: 38px;
        height: 38px;
    }
    
    .rank-username {
        font-size: 1rem;
    }
    
    .prize-area .coin-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 576px) {
    .title {
        font-size: 2.2rem;
    }
    
    .prize-badge {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .divider {
        display: none;
    }
    
    .lb-card {
        width: 100%;
        max-width: 280px;
    }
    
    .lb-table-header,
    .lb-rank-row {
        grid-template-columns: 40px 1fr 1fr 1fr;
    }
    
    .rank-area {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .rank-avatar {
        width: 32px;
        height: 32px;
    }
    
    .rank-username {
        font-size: 0.9rem;
    }
    
    .wager-area,
    .prize-area .prize-amount {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .lb-table-header,
    .lb-rank-row {
        grid-template-columns: 30px 1fr 1fr 1fr;
        font-size: 0.8rem;
    }
    
    .rank-area {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .rank-username {
        font-size: 0.85rem;
    }
    
    .wager-area,
    .prize-area .prize-amount {
        font-size: 0.8rem;
    }
    
    .prize-area .coin-icon {
        width: 16px;
        height: 16px;
    }
}


.lb-first:hover {
    box-shadow: 
        0 20px 40px rgba(252, 211, 77, 0.2);
    transform: translateY(-40px);
}

.lb-second:hover {
    box-shadow: 0 20px 40px rgba(156, 163, 175, 0.2);
    /*transform: translateZ(10px) rotateX(20deg) rotateY(20deg);*/
    transform: translateY(-10px);
}

.lb-third:hover {
    box-shadow: 0 20px 40px rgba(180, 83, 9, 0.2);
    transform: translateY(-10px);
}


.lb-timer-section {
    /*margin: 1.5rem 0;*/
    text-align: center;
}

.timer-header h2 {
    font-size: 1.2rem;
    color: var(--primary-light);
    margin-bottom: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.timer-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.timer-unit {
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 0.8rem 0;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.timer-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.timer-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.2rem;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.timer-unit:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.timer-unit:hover .timer-number {
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.7);
}

.timer-unit:hover .timer-label {
    color: var(--primary-light);
    text-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}

.lb-last-updated-text {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .timer-display {
        gap: 0.6rem;
    }
    .timer-unit {
        width: 60px;
        padding: 0.6rem 0;
    }
    .timer-number {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
        text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
    }
    .timer-label {
        font-size: 0.65rem;
    }
}

.lb-last-updated-text {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(30, 30, 46, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lb-last-updated-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lb-last-updated-text:hover {
    color: var(--text-secondary);
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

.lb-last-updated-text:hover::before {
    opacity: 1;
}

.updated-icon {
    color: var(--primary-light);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.lb-last-updated-text:hover .updated-icon {
    color: var(--primary-color);
    transform: rotate(45deg);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

@media (max-width: 768px) {
    .lb-last-updated-text {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

.lb-ended-message {
    backdrop-filter: blur(4px);
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--border-radius);
    padding: var(--spacing-medium);
    margin: var(--spacing-medium) auto;
    max-width: 600px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    
    &:hover {
        border-color: rgba(139, 92, 246, 0.4);
        box-shadow: var(--shadow-glow);
    }
}

.leaderboard-ended-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-light); /* #818cf8 */
    margin-bottom: var(--spacing-small);
    text-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
    letter-spacing: 0.5px;
}

.leaderboard-ended-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary); /* #e2e8f0 */
    line-height: 1.5;
}

@media (max-width: 768px) {
    .lb-ended-message {
        padding: var(--spacing-small);
        margin: var(--spacing-small) auto;
    }
    
    .leaderboard-ended-title {
        font-size: var(--font-size-lg);
    }
    
    .leaderboard-ended-text {
        font-size: var(--font-size-sm);
    }
}

.code-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
    margin: var(--spacing-medium) 0;
}

.code-highlight {
    color: var(--purple-accent);
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-highlight:hover {
    color: var(--primary-light);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.code-container {
    position: relative;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  background: rgba(30, 30, 46, 0.95);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  transform: translateX(-100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  opacity: 0;
  transform: translateY(20px);
}

.toast::before {
  content: '✓';
  color: var(--success-color);
  font-weight: bold;
}

/* Gold theme version */
.gold-theme .toast {
  background: rgba(25, 20, 5, 0.95);
  border: 1px solid var(--gold);
}

.gold-theme .toast::before {
  color: var(--gold);
}