* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: url('BG.jpg') center center / cover no-repeat fixed;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    padding-bottom: 80px; /* Space for fixed footer */
    position: relative;
}

/* Top Menu Bar */
.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.menu-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 40px;
    width: auto;
}

.menu-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Contract Address Box */
.contract-address-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #495057;
    user-select: none;
}

.contract-address-box:hover {
    background: #e9ecef;
    border-color: #91f1b3;
    transform: translateY(-1px);
}

.contract-address-box:active {
    transform: translateY(0);
    background: #dee2e6;
}

.contract-text {
    color: #6c757d;
    font-weight: bold;
}

.contract-address {
    color: #495057;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.copy-icon {
    color: #91f1b3;
    font-size: 10px;
    transition: color 0.2s ease;
}

.contract-address-box:hover .copy-icon {
    color: #28a745;
}

/* Pixelated Title */
.pixel-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 2px;
}

.pixel-letter {
    display: inline-block;
    text-shadow: 
        2px 2px 0px #000,
        -2px -2px 0px #000,
        2px -2px 0px #000,
        -2px 2px 0px #000,
        0px 2px 0px #000,
        2px 0px 0px #000,
        -2px 0px 0px #000,
        0px -2px 0px #000,
        4px 4px 0px rgba(0, 0, 0, 1);
    margin: 0 1px;
}

.p-letter { color: #ff6b6b; }
.i-letter { color: #4ecdc4; }
.x-letter { color: #45b7d1; }
.e-letter { color: #96ceb4; }
.l-letter { color: #ffd93d; }
.f-letter { color: #6c5ce7; }
.u-letter { color: #fd79a8; }
.n-letter { color: #ffa500; }

.menu-button {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.menu-button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.menu-button.pumpfun {
    background: #91f1b3;
    color: #333;
    border-color: #91f1b3;
}

.menu-button.pumpfun:hover {
    background: #7ce49b;
    border-color: #7ce49b;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 80px; /* Account for fixed top menu */
}

/* Main Content */
.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Canvas Panel */
.canvas-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    flex: 1;
}

/* Canvas Controls Row */
.canvas-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Color Palette */
.color-palette {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.color-box {
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-box:hover {
    transform: scale(1.1);
    border-color: #4ecdc4;
}

.color-box.active {
    border-color: #4ecdc4;
    border-width: 4px;
}

.color-box.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.color-box[data-color="#FFFFFF"].active::after {
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 12px;
    color: #666;
}

/* Cooldown Bar */
.cooldown-container {
    margin-top: 10px;
    width: 100%;
}

.cooldown-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

.cooldown-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ccc;
}

.cooldown-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ffaa44, #44ff44);
    width: 100%;
    border-radius: 3px;
}

/* Round Information */
.round-info {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.round-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.round-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.winning-chance {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}


/* Winner Notification Animation */
@keyframes winnerPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Winner Notification */
.winner-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 30px 50px;
    border-radius: 20px;
    border: 4px solid #ff6b35;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    animation: winnerPulse 2s ease-in-out;
    max-width: 600px;
    width: 90%;
}

.winner-notification .winner-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.winner-notification h3 {
    font-size: 16px;
    margin: 0;
    color: #ff6b35;
    text-shadow: 2px 2px 0px #000;
}

.winner-notification .trophy-icon {
    font-size: 24px;
    color: #ffd700;
    text-shadow: 2px 2px 0px #000;
}

.winner-notification .coins-icon {
    font-size: 16px;
    color: #ffd700;
    margin-right: 5px;
}

.winner-notification p {
    margin: 5px 0;
    font-size: 10px;
    line-height: 1.4;
}

.winner-notification .prize-amount {
    color: #27ae60;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 2px solid #dee2e6;
    padding: 15px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    margin: 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #6c757d;
}

.docs-button {
    background: #91f1b3;
    color: #333;
    border: 2px solid #91f1b3;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.docs-button:hover {
    background: #7dd3a0;
    border-color: #7dd3a0;
    transform: translateY(-1px);
}

.docs-button:active {
    transform: translateY(0);
}

/* Documentation Modal */
.docs-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.docs-header {
    padding: 20px 30px;
    border-bottom: 2px solid #dee2e6;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px 15px 0 0;
    position: relative;
}

.docs-header h2 {
    margin: 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.close-button {
    position: absolute;
    top: -30%;
    left: -4%;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-button:hover {
    background: #dee2e6;
    color: #333;
}

.docs-body {
    padding: 30px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    line-height: 1.6;
    color: #333;
    text-align: left;
}

.docs-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.docs-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.docs-section h3 {
    font-size: 12px;
    color: #91f1b3;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-section p {
    margin-bottom: 10px;
    color: #495057;
}

.docs-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.docs-section li {
    margin-bottom: 5px;
    color: #495057;
}

.docs-section strong {
    color: #333;
    font-weight: bold;
}

#requiredTokens,
#tokenContract {
    color: #91f1b3;
    font-weight: bold;
}


.canvas-controls {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 12px;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

#pixelCanvas {
    display: block;
    cursor: crosshair;
    background: white;
    user-select: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.zoom-display {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 5;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    gap: 20px;
}

.paint-button {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', monospace;
    pointer-events: auto;
}

.paint-button:hover {
    background: linear-gradient(45deg, #45b7d1, #4ecdc4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.canvas-overlay.hidden {
    display: none;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 350px;
}

/* Latest Winners */
.latest-winners {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-radius: 15px;
    border: 2px solid #fdcb6e;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.latest-winners h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.latest-winners h3 i {
    color: #ffd700;
}

.winners-list {
    max-height: 250px; /* Increased to show 5 items */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 12px;
    transition: transform 0.2s;
}

.winner-item:hover {
    transform: translateY(-2px);
}

.winner-round {
    font-weight: bold;
    color: #333;
    min-width: 60px;
}

.winner-prize {
    font-weight: bold;
    color: #27ae60;
    min-width: 70px;
    text-align: center;
}

.winner-address {
    color: #666;
    font-family: monospace;
    font-size: 10px;
    flex: 1;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Payouts Panel */
.payouts-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid #dee2e6;
}

.payouts-panel h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.payouts-panel h3 i {
    color: #ffd700;
}

.payouts-list {
    max-height: 250px; /* Increased to show 5 items */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payout-item {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #91f1b3;
    transition: transform 0.2s;
    font-size: 12px;
}

.payout-item:hover {
    transform: translateY(-2px);
}

.payout-amount {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.payout-address {
    font-size: 10px;
    color: #666;
    margin-bottom: 8px;
    word-break: break-all;
}

.payout-link {
    color: #4ecdc4;
    text-decoration: none;
    font-size: 10px;
    font-weight: bold;
}

.payout-link:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    margin: auto;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 700px;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.modal-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

#addressInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

#addressInput:focus {
    outline: none;
    border-color: #4ecdc4;
}

#submitAddress {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

#submitAddress:hover {
    transform: translateY(-2px);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

#justLooking {
    background: linear-gradient(45deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

#justLooking:hover {
    background: linear-gradient(45deg, #495057, #6c757d);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.error-message {
    color: #ff6b6b;
    margin-top: 15px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .payouts-panel {
        width: 100%;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .menu-content {
        padding: 0 15px;
    }
    
    .logo {
        height: 35px;
    }
    
    .pixel-title {
        font-size: 14px;
    }
    
    .menu-button {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .canvas-panel, .payouts-panel {
        padding: 20px;
    }
    
    .canvas-controls-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .color-palette {
        justify-content: center;
    }
    
    .user-info {
        align-items: center;
    }
}