/* Custom Fonts */
@font-face {
    font-family: 'Airstrike';
    src: url('fonts/Airstrike.f4da9d40.ttf') format('truetype'),
         url('шрифты/Airstrike.f4da9d40.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Winner overlay */
.winner-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), rgba(0,0,0,0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    opacity: 0;
    animation: overlayFade 300ms ease forwards;
}

.winner-card {
    background: linear-gradient(135deg, rgba(14,14,14,0.95), rgba(103,65,255,0.15));
    border: 1px solid rgba(103,65,255,0.35);
    border-radius: 16px;
    padding: 18px 22px;
    width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(103,65,255,0.35);
    transform: scale(0.98);
    animation: cardPop 300ms cubic-bezier(.22,.61,.36,1) forwards;
}

.winner-card .roulette-avatar { width: 120px; height: 120px; }
.winner-card .name { color: #ddd; font-size: 18px; margin-top: 8px; text-align: center; }
.winner-card .roulette-bet { color: #ffd700; font-size: 22px; font-weight: 800; text-align: center; margin-top: 8px; }
.winner-card .roulette-chance { color: #4ade80; text-align: center; }

@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardPop { to { transform: scale(1); } }

/* Right Sidebar */
.right-sidebar {
    background: linear-gradient(135deg, rgba(14, 14, 14, 0.9), rgba(103, 65, 255, 0.05));
    border: 1px solid rgba(103, 65, 255, 0.3);
    border-radius: 15px;
    padding: 16px;
    height: fit-content;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel-title {
    font-size: 16px;
    color: #bfbfff;
    margin-bottom: 10px;
    font-weight: 600;
}

.winner-card, .lb-item {
    background: rgba(20,20,24,0.7);
    border: 1px solid rgba(103,65,255,0.25);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.winner-left, .lb-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.winner-avatar, .lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(103,65,255,0.35);
    background: linear-gradient(45deg, #8a2be2, #da70d6);
    display: block;
}

.winner-avatar.fallback, .lb-avatar.fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.winner-name, .lb-name { color: #e5e7eb; font-size: 14px; }
.winner-meta { color: #8b8fa3; font-size: 12px; }
.winner-amount, .lb-amount { color: #4ade80; font-weight: 700; font-size: 14px; }

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

@font-face {
    font-family: 'Flama';
    src: url('fonts/Flama-Basic.88203ced.otf') format('opentype'),
         url('шрифты/Flama-Basic.88203ced.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Flama';
    src: url('fonts/Flama-Medium.6e31b126.otf') format('opentype'),
         url('шрифты/Flama-Medium.6e31b126.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Flama';
    src: url('fonts/Flama-Bold.e1e6fceb.otf') format('opentype'),
         url('шрифты/Flama-Bold.e1e6fceb.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Flama';
    src: url('fonts/Flama-Black.cdb51a71.otf') format('opentype'),
         url('шрифты/Flama-Black.cdb51a71.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Pixel';
    src: url('fonts/pixel-regular.6a8a3169.otf') format('opentype'),
         url('шрифты/pixel-regular.6a8a3169.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Flama', 'Inter', sans-serif;
    background: #0e0e0e url('background.webp') no-repeat center bottom;
    background-size: cover;
    background-attachment: fixed;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(103, 65, 255, 0.1) 0%, rgba(14, 14, 14, 0.8) 70%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(14, 14, 14, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(103, 65, 255, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between; /* logo at left, nav at right */
    align-items: center;
    padding: 15px 20px 15px 0; /* remove left padding to push logo to the edge */
    max-width: 100%;
    width: 100%;
    margin: 0; /* override centered .container */
    position: relative;
}

/* Burger button */
.burger {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(103, 65, 255, 0.35);
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
    margin-right: 10px;
    cursor: pointer;
    z-index: 1002;
}
.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #ddd;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile slide-out menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    width: 75%;
    max-width: 360px;
    background: rgba(14,14,14,0.95);
    border-left: 1px solid rgba(103, 65, 255, 0.35);
    box-shadow: -10px 0 30px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    backdrop-filter: blur(10px);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}
.mobile-link {
    color: #ccc;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 0;
}
.mobile-wallet-btn { 
    width: 100%; 
    justify-content: center; 
    /* remove glow/shimmer on mobile wallet button */
    box-shadow: none !important;
    filter: none !important;
    transition: none !important;
}
.mobile-wallet-btn::before { display: none !important; }
.mobile-wallet-btn:hover { box-shadow: none !important; transform: none !important; }

body.menu-open { overflow: hidden; }

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    white-space: nowrap; /* keep brand on one line */
    overflow: visible;
}

.logo::before {
    /* Disabled to avoid duplicate Solana icon on some hosts */
    content: none !important;
    display: none !important;
}

.logo h1 {
    font-family: 'Airstrike', sans-serif;
    font-size: 42px;
    font-weight: normal;
    background: linear-gradient(45deg, #6741FF, #da70d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(103, 65, 255, 0.5);
    /* 9 letters => 8 gaps; 8 * 0.375px = +3px total width */
    letter-spacing: 0.375px;
    display: inline-block;
    padding-right: 2px; /* space for glyph/glow so it doesn't tuck under .com */
    margin-right: 1px; /* 2px padding + 1px margin = 3px visual gap */
    overflow: visible; /* prevent glyph clipping */
}

.domain {
    color: #888;
    font-size: 30px;
    line-height: 1;
    position: relative;
    top: 2px;
    margin-left: 0; /* gap controlled by h1 margin-right */
}

/* Hidden by default; shown only on mobile */
.mobile-logo {
    display: none;
    font-family: 'Airstrike', sans-serif;
    font-size: 28px;
    background: linear-gradient(45deg, #6741FF, #da70d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 14px rgba(103, 65, 255, 0.45);
    letter-spacing: 0.3px;
    line-height: 1;
    padding: 0 6px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px; /* required equal gap */
}

/* Solana icon in header */
.solana-badge {
    height: 22px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    opacity: 0.95;
}

.leaderboard-link {
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.leaderboard-link:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.leaderboard-img {
    height: 24px;
    width: auto;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-family: 'Flama', sans-serif;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #6741FF;
    text-shadow: 0 0 10px rgba(103, 65, 255, 0.5);
}

.connect-wallet-btn {
    background: linear-gradient(45deg, #6741FF, #da70d6);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-family: 'Flama', sans-serif;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.connect-wallet-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.connect-wallet-btn:hover::before {
    left: 100%;
}

.connect-wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.3);
}

/* Main Layout */
.main {
    margin-top: 80px;
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Chat Sidebar */
.chat-sidebar {
    background: linear-gradient(135deg, rgba(14, 14, 14, 0.9), rgba(103, 65, 255, 0.05));
    border: 1px solid rgba(103, 65, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    height: fit-content;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.chat-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6741FF, transparent);
    animation: chatGlow 3s ease-in-out infinite;
}

@keyframes chatGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.chat-header h3 {
    color: #da70d6;
    font-size: 18px;
    font-family: 'Flama', sans-serif;
    font-weight: 600;
}

.online-count {
    font-size: 12px;
    color: #4ade80;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    max-height: 420px;
    padding-right: 6px;
    background: linear-gradient(180deg, rgba(103, 65, 255, 0.04), transparent 20%, transparent 80%, rgba(103,65,255,0.04));
    border-radius: 10px;
}

.chat-message {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    align-items: start;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(20, 20, 24, 0.7);
    border: 1px solid rgba(103, 65, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(103,65,255,0.35);
}

.chat-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.chat-username {
    color: #da70d6;
    font-weight: 600;
    font-size: 12px;
}

.chat-text {
    color: #ccc;
    font-size: 13px;
    margin-top: 2px;
}

.chat-time {
    color: #777;
    font-size: 11px;
    white-space: nowrap;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn {
    background: rgba(138, 43, 226, 0.3);
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    color: white;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Jackpot Section */
.jackpot-section {
    background: rgba(14, 14, 14, 0.8);
    border: 1px solid rgba(103, 65, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.jackpot-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(103, 65, 255, 0.05) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.jackpot-header {
    margin-bottom: 20px;
    position: relative;
}

.jackpot-header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: url('glow-burst.webp') no-repeat center;
    background-size: contain;
    opacity: 0.3;
    z-index: -1;
}

.jackpot-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Timer aligned to the right of the title on the same row */
.jackpot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.header-timer .timer-circle { width: 70px; height: 70px; }
.header-timer .timer-text { font-size: 22px; }
.header-timer .timer-label { margin: 0; opacity: 0.8; }

.jackpot-before {
    height: 40px;
    width: auto;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

.jackpot-after {
    height: 45px;
    width: auto;
    opacity: 0.9;
}

.jackpot-header h2 {
    font-family: 'Airstrike', sans-serif;
    font-size: 42px;
    background: linear-gradient(45deg, #6741FF, #da70d6, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
    text-shadow: 0 0 30px rgba(103, 65, 255, 0.6);
    letter-spacing: 2px;
}

.jackpot-amount {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
}

.amount {
    font-family: 'Flama', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.currency {
    font-family: 'Flama', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #da70d6;
}

/* Remove old vertical spacing of timer since it's now in header */
.jackpot-timer { margin-bottom: 0; }

.timer-circle {
    width: 100px;
    height: 100px;
    border: 3px solid #6741FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    background: radial-gradient(circle, rgba(103, 65, 255, 0.2), transparent);
    animation: pulse 2s infinite;
    position: relative;
}

.timer-circle::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: url('glare.webp') no-repeat center;
    background-size: contain;
    opacity: 0.3;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(103, 65, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(103, 65, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(103, 65, 255, 0); }
}

.timer-text {
    font-family: 'Pixel', monospace;
    font-size: 24px;
    font-weight: normal;
    color: #da70d6;
    text-shadow: 0 0 10px rgba(218, 112, 214, 0.5);
}

.timer-label {
    color: #888;
    font-size: 14px;
}

.players-container {
    margin-bottom: 30px;
}

.players-container h3 {
    color: #da70d6;
    margin-bottom: 20px;
    font-size: 20px;
    font-family: 'Flama', sans-serif;
    font-weight: 600;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.player-entry {
    background: linear-gradient(135deg, rgba(14, 14, 14, 0.9), rgba(103, 65, 255, 0.1));
    border: 2px solid rgba(103, 65, 255, 0.4);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(103, 65, 255, 0.1), rgba(14, 14, 14, 0.8));
    border: 1px solid rgba(103, 65, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.player-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(103, 65, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.player-entry:hover::before {
    left: 100%;
}

.player-entry:hover {
    transform: translateX(5px);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #8a2be2, #da70d6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.player-details h4 {
    color: #da70d6;
    font-size: 16px;
    margin-bottom: 2px;
}

.player-details p {
    color: #888;
    font-size: 12px;
}

.player-stats {
    text-align: right;
}

.bet-amount {
    color: #ffd700;
    font-weight: 700;
    font-size: 16px;
}

.win-chance {
    color: #4ade80;
    font-size: 12px;
}

.jackpot-status {
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.jackpot-status p {
    font-size: 18px;
    color: #da70d6;
}

.bet-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bet-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.bet-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    padding: 12px 50px 12px 15px;
    color: white;
    font-size: 16px;
    width: 150px;
}

.bet-input:focus {
    outline: none;
    border-color: #6741FF;
    box-shadow: 0 0 15px rgba(103, 65, 255, 0.4);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.bet-currency {
    position: absolute;
    right: 15px;
    color: #da70d6;
    font-weight: 600;
}

.bet-btn {
    background: linear-gradient(45deg, #6741FF, #da70d6);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    color: white;
    font-family: 'Flama', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bet-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.bet-btn:hover::before {
    left: 100%;
}

.bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.3);
}

/* Floating Popup */
.floating-popup {
    position: fixed;
    right: -350px;
    top: 20px;
    width: 320px;
    background: rgba(14, 14, 14, 0.95);
    border: 1px solid rgba(103, 65, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    padding: 15px;
    z-index: 2000;
    transition: transform 0.4s ease, right 0.4s ease;
    transform: translateY(10px) scale(0.98);
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: none !important; /* fully disabled */
}

.floating-popup::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: url('3d-sol.webp') no-repeat center;
    background-size: contain;
    opacity: 0.8;
}

.floating-popup.show { right: 20px; transform: translateY(0) scale(1); }

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.popup-close:hover {
    opacity: 1;
}

.popup-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

/* Popup Solana logo */
.popup-logo {
    width: 50px;
    height: 80px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    /* использовать уже применяемое в проекте фиолетовое свечение */
    filter: drop-shadow(0 0 18px rgba(103, 65, 255, 0.6));
}

/* Small exchange rate ticker */
.rate-ticker {
    margin-top: 8px;
    font-size: 12px;
    color: #9aa0b4;
    opacity: 0.9;
}

.popup-content h4 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.popup-content p {
    text-align: center;
    margin-bottom: 20px;
    opacity: 0.9;
}

.claim-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.claim-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, rgba(14, 14, 14, 0.95), rgba(103, 65, 255, 0.05));
    border-top: 1px solid rgba(103, 65, 255, 0.3);
    padding: 40px 0;
    margin-top: 50px;
    backdrop-filter: blur(20px);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #6741FF, transparent);
    opacity: 0.6;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: #da70d6;
    margin-bottom: 15px;
    font-size: 18px;
    font-family: 'Flama', sans-serif;
    font-weight: 600;
}

.footer-section p {
    color: #888;
    line-height: 1.6;
}

.disclaimer {
    font-size: 12px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
    }
    .chat-sidebar { order: 2; max-height: 320px; }
    .jackpot-section { order: 1; }
    .right-sidebar { order: 3; max-height: initial; }
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    .burger { display: none !important; }
    /* Hide site logo and name on mobile */
    .logo { display: none !important; }
    .domain { display: none !important; }
    /* Show compact SOLAPOT logo on mobile */
    .mobile-logo { display: inline-block; }
    /* Hide wallet emoji on mobile */
    .wallet-icon { display: none !important; }
    .chat-sidebar { order: 2; max-height: 300px; }
    .jackpot-section { order: 1; padding: 20px; }
    .right-sidebar { order: 3; }
    
    .roulette-container {
        height: 300px;
    }
    
    .roulette-card {
        min-width: 160px;
        height: 100px;
        padding: 10px;
    }
    
    .nav {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .nav .nav-link,
    .nav .leaderboard-link { display: none; }

    /* Keep Solana icon visible on mobile */
    .solana-badge { display: inline-block; }

    /* Hide JACKPOT title text on mobile */
    .jackpot-header h2 { display: none !important; }

    /* Hide before/after images around JACKPOT on mobile */
    .jackpot-before,
    .jackpot-after { display: none !important; }

    /* Remove grey square in header (logo placeholder) on mobile */
    .logo::before { display: none !important; }

    .user-balance {
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
        border-radius: 8px;
        border: 1px solid rgba(103, 65, 255, 0.35);
        background: rgba(20,20,24,0.6);
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
    }

    .connect-wallet-btn {
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 14px;
    }
    
    .header .container {
        justify-content: space-between;
    }
    
    .amount {
        font-size: 36px;
    }
    
    .jackpot-header h2 {
        font-size: 28px;
    }
    
    .jackpot-header::before {
        width: 150px;
        height: 150px;
    }
    
    .bet-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .floating-popup {
        width: 280px;
        right: -300px;
    }
    
    .floating-popup.show {
        right: 10px;
    }
}"

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .jackpot-section {
        padding: 15px;
    }
    
    .amount {
        font-size: 28px;
    }
    
    .timer-circle {
        width: 80px;
        height: 80px;
    }
    
    .timer-text {
        font-size: 18px;
    }
    
    /* Compact header controls on very small screens */
    .header .container { gap: 8px; }
    .user-balance { font-size: 11px; padding: 3px 6px; }
    .connect-wallet-btn { padding: 8px 10px; font-size: 13px; }
}

/* Roulette Animation */
.roulette-container {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(103, 65, 255, 0.15), rgba(14, 14, 14, 0.9));
    border: 2px solid rgba(103, 65, 255, 0.4);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 50px rgba(103, 65, 255, 0.1);
    perspective: 1200px; /* for 3D reel */
}

.roulette-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(103, 65, 255, 0.1) 0%, 
        transparent 20%, 
        transparent 80%, 
        rgba(103, 65, 255, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.roulette-track {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 10px;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0) translateY(-50%);
}

/* 3D Jackpot Reel (from пример дизайна) */
#jackpot-reel {
    position: absolute;
    left: 0;
    right: 0;
    top: 150px; /* lowered further by ~70px (half card) */
    bottom: 20px;
    margin: auto;
    width: 100%;
    height: auto;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 5s cubic-bezier(0.25, 1.4, 0.61, 0.98);
    pointer-events: none;
    display: none; /* shown only during spin */
}

.jackpot-spinning #jackpot-reel {
    display: block;
    animation: jackpotSpin 5s cubic-bezier(0.25, 1.4, 0.61, 0.98);
}

@keyframes jackpotSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-360deg); }
}

.jackpot-item {
    position: absolute;
    inset-inline: 0;
    margin-inline: auto;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.jackpot-item .card, .roulette-card.reel-card .card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 140px;
    aspect-ratio: 1 / 1;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(42,46,55,0));
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.jackpot-item .name, .roulette-card.reel-card .name {
    color: #8C8C8C;
    font-size: 10px;
    margin-top: 6px;
    max-width: 90px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Neutralize default horizontal card chrome when using reel look */
.roulette-card.reel-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
    height: auto;
}
.roulette-card.reel-card::before,
.roulette-card.reel-card::after { display: none; }

/* Double size for horizontal cards only */
.roulette-track .roulette-card.reel-card .card {
    width: 280px; /* 2x from 140px */
    padding: 14px;
}
.roulette-track .roulette-card.reel-card .roulette-avatar {
    width: 120px; /* 2x from 60px */
    height: 120px;
}
.roulette-track .roulette-card.reel-card .name {
    font-size: 14px;
}
.roulette-track .roulette-card.reel-card .roulette-bet {
    color: #ffd700;
    font-weight: 800;
    font-size: 20px;
    margin-top: 6px;
}
.roulette-track .roulette-card.reel-card .roulette-chance {
    color: #4ade80;
    font-size: 12px;
}

.roulette-card {
    min-width: 200px;
    height: 120px;
    background: linear-gradient(135deg, rgba(14, 14, 14, 0.9), rgba(103, 65, 255, 0.1));
    border: 2px solid rgba(103, 65, 255, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.roulette-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(103, 65, 255, 0.2);
}

.roulette-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(138, 43, 226, 0.3), transparent);
    transition: left 0.5s ease;
}

.roulette-card.winner {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(0, 0, 0, 0.7));
}

.roulette-card.winner::before {
    left: 100%;
}

.roulette-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(138, 43, 226, 0.5);
}

.roulette-info {
    flex: 1;
}

.roulette-username {
    color: #da70d6;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
}

.roulette-bet {
    color: #ffd700;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 3px;
}

.roulette-chance {
    color: #4ade80;
    font-size: 12px;
}

.roulette-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid #ffd700;
    z-index: 10;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    animation: pointerGlow 2s ease-in-out infinite;
}

@keyframes pointerGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1));
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* .roulette-spinning no longer used */

/* Removed keyframes for old class-based spin; now using JS-driven transitions */

/* Regular Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.player-entry.new {
    animation: slideInRight 0.5s ease;
}

@keyframes jackpotRoll {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.jackpot-rolling .players-list {
    animation: jackpotRoll 0.5s ease-in-out infinite;
}

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

.winner-announcement {
    animation: winnerGlow 2s ease-in-out infinite;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(200px) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced visual effects */
.jackpot-amount .amount {
    animation: amountPulse 3s ease-in-out infinite;
}

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

/* Particle effects */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #6741FF;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 4s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 1;
    }
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(103, 65, 255, 0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #8a2be2, #da70d6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #da70d6, #8a2be2);
}
