:root {
    --bg-black: #080808;
    --card-black: #111111;
    --primary-red: #e61919;
    --secondary-red: #8b0000;
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.4);
    --text-white: #ffffff;
    --text-gray: #777777;
    --accent-glow: rgba(230, 25, 25, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-black);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(20, 20, 20, 0.5) 0%, transparent 100%),
        url("https://www.transparenttextures.com/patterns/carbon-fibre.png");
    background-attachment: fixed;
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(230, 25, 25, 0.05) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 8s infinite alternate ease-in-out;
}

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

.container {
    width: 100%;
    max-width: 850px;
    animation: fadeIn 0.8s ease-out;
    position: relative;
    z-index: 10;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 40px;
    padding-top: 20px;
}

.podium-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: slideIn 0.8s ease-out forwards;
    opacity: 0;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.podium-item.rank-2 { animation-delay: 0.2s; }
.podium-item.rank-1 { animation-delay: 0.4s; }
.podium-item.rank-3 { animation-delay: 0.6s; }

.podium-user {
    text-align: center;
    margin-bottom: 12px;
}

.podium-username {
    font-weight: 900;
    font-size: 1.1rem;
    margin-bottom: 3px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.podium-amount {
    font-weight: 800;
    color: var(--text-gray);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.podium-base {
    width: 100%;
    background: linear-gradient(180deg, #1a1a1a 0%, #111111 100%);
    border: 1px solid #333;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.podium-item:hover .podium-base {
    transform: translateY(-5px);
    border-color: #444;
}

.podium-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-gray);
    opacity: 0.2;
    position: absolute;
    bottom: -10px;
    right: 10px;
    line-height: 1;
}

.rank-1 .podium-base {
    height: 190px;
    border-color: var(--gold);
    background: linear-gradient(180deg, #2a1e00 0%, #111111 100%);
    box-shadow: 0 0 30px var(--gold-glow), inset 0 0 20px rgba(255, 215, 0, 0.05);
}

.rank-1 .podium-number {
    color: var(--gold);
    opacity: 0.3;
}

.rank-1 .podium-username {
    color: var(--gold);
    font-size: 1.4rem;
    text-shadow: 0 0 10px var(--gold-glow);
}

.rank-2 .podium-base {
    height: 150px;
}

.rank-3 .podium-base {
    height: 120px;
}

.podium-prize {
    background: var(--primary-red);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 900;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(230, 25, 25, 0.3);
}

.rank-1 .podium-prize {
    background: var(--gold);
    color: black;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
}

.branding {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--text-gray);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.branding span {
    color: white;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.timer-container {
    margin-top: 25px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    padding: 8px 20px;
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255,255,255,0.05);
}

.timer-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-gray);
    letter-spacing: 2px;
}

.timer {
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
    font-family: monospace;
    letter-spacing: 1px;
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -3px;
    color: var(--primary-red);
    text-shadow: 0 0 30px var(--accent-glow);
    margin-bottom: 5px;
    animation: glowRed 3s infinite alternate;
}

h1 span {
    color: white;
    text-shadow: 0 0 30px white;
}

.action-container {
    margin-top: 20px;
}

.join-btn {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    border-radius: 8px;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.join-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 40px var(--primary-red);
    border-color: white;
}

.subtitle {
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 6px;
    font-size: 0.8rem;
}

.leaderboard-header {
    display: flex;
    padding: 12px 25px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 1px solid #333;
    background: rgba(0,0,0,0.5);
    border-radius: 12px 12px 0 0;
}

.rank-col { width: 50px; flex-shrink: 0; }
.user-col { flex-grow: 1; min-width: 0; }
.wagered-col { width: 180px; flex-shrink: 0; text-align: right; padding-right: 34px; }

.leaderboard {
    background: var(--card-black);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    border: 1px solid #333;
    border-top: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.row {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    border-bottom: 1px solid #222;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
    position: relative;
    background-clip: padding-box;
}

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

.row:hover {
    background: #1a1a1a;
    transform: scale(1.01) translateX(5px);
    z-index: 5;
}

.rank {
    width: 50px;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-gray);
}

.user-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.username {
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prize-container {
    display: flex;
    align-items: center;
}

.prize {
    background: var(--primary-red);
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
}

.amount-container {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
}

.balance-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.top-row {
    background: linear-gradient(90deg, #1c0505 0%, #111111 100%);
    box-shadow: inset 4px 0 0 var(--primary-red);
}

.rank-1 .rank { color: var(--gold); font-size: 2rem; }
.rank-1 .username { color: var(--gold); font-size: 1.4rem; text-shadow: 0 0 10px var(--gold-glow); }
.rank-1 .prize { background: var(--gold); color: black; }

.raining-emojis {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.emoji {
    position: absolute;
    top: -20px;
    font-size: 1.2rem;
    color: var(--gold);
    opacity: 0.6;
    animation: rain linear infinite;
    text-shadow: 0 0 5px var(--gold-glow);
}

@keyframes rain {
    to { transform: translateY(200px); }
}

@keyframes glowRed {
    from { text-shadow: 0 0 10px var(--accent-glow); }
    to { text-shadow: 0 0 30px var(--primary-red); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
    h1 { font-size: 2.5rem; letter-spacing: -1px; }
    .container { padding: 0 10px; }
    .podium-container { gap: 10px; }
    .podium-username { font-size: 0.9rem; max-width: 100px; }
    .podium-amount { font-size: 0.8rem; }
    .rank-col, .rank { width: 35px; font-size: 1rem; }
    .wagered-col, .amount-container { width: 130px; font-size: 1rem; }
    .wagered-col { padding-right: 34px; }
    .row { padding: 15px 15px; }
    .username { font-size: 1rem; }
}
