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

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(135deg, #200052 0%, #0E100F 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Mobile Detection */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        align-items: flex-start;
        padding-top: 20px;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Character1.png'), url('Character2.png');
    background-size: 40%, 35%;
    background-position: 0% bottom, 95% bottom;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Hide character images on mobile for better performance */
@media (max-width: 768px) {
    body::before {
        background-image: none;
    }
}

/* Rules Button Styling */
.rules-btn {
    background: #A0055D !important;
}

.rules-btn:hover {
    background: #8B0450 !important;
}

/* Rules Modal Content */
.rules-content {
    margin: 20px 0;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
}

.rule-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(131, 110, 249, 0.1);
    border-radius: 10px;
    border-left: 4px solid #836EF9;
}

.rule-section h3 {
    margin: 0 0 10px 0;
    color: #200052;
    font-size: 1.2rem;
}

.rule-section p {
    margin: 5px 0;
    color: #200052;
    font-size: 1rem;
    line-height: 1.6;
}

.mute-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.mute-btn:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

.leaderboard-menu-btn {
    margin-top: 20px;
}

#gameContainer {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.menu {
    background: linear-gradient(145deg, rgba(251, 250, 249, 0.95), rgba(251, 250, 249, 0.85));
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 
        0 20px 50px rgba(131, 110, 249, 0.4),
        0 10px 25px rgba(160, 5, 93, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(131, 110, 249, 0.3);
    position: relative;
}

.menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(131, 110, 249, 0.05) 50%, transparent 70%);
    border-radius: 20px;
    pointer-events: none;
}

.menu h1 {
    font-size: 3.5rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #836EF9, #A0055D, #836EF9, #200052);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(131, 110, 249, 0.5));
    position: relative;
    z-index: 2;
}

.logo {
    max-width: 350px;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 15px rgba(131, 110, 249, 0.5));
    position: relative;
    z-index: 2;
}

.menu h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #200052;
    text-shadow: 0 2px 4px rgba(131, 110, 249, 0.3);
    position: relative;
    z-index: 2;
}

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

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.menu-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    background: #836EF9;
    color: #FBFAF9;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 20px rgba(131, 110, 249, 0.5),
        0 4px 10px rgba(131, 110, 249, 0.3);
    position: relative;
    z-index: 2;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(131, 110, 249, 0.7),
        0 8px 25px rgba(131, 110, 249, 0.5);
    background: #A0055D;
    filter: brightness(1.1);
}

.menu-btn:active {
    transform: translateY(-1px);
}

.instructions {
    color: #200052;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.instructions p {
    margin-bottom: 5px;
}

.end-message {
    color: #200052;
    font-size: 1.1rem;
    line-height: 1.8;
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    font-weight: bold;
}

.end-message p {
    margin-bottom: 10px;
}

.twitter-link {
    color: #836EF9;
    text-decoration: none;
    transition: all 0.3s ease;
}

.twitter-link:hover {
    color: #A0055D;
    text-decoration: underline;
}

.twitter-link strong {
    font-weight: bold;
}

.hidden {
    display: none !important;
}

#gameUI {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gameStats {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #FBFAF9;
    text-shadow: 2px 2px 4px rgba(32, 0, 82, 0.8);
}

#gameStats > div {
    background: #836EF9;
    padding: 8px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 250, 249, 0.3);
    box-shadow: 
        0 4px 15px rgba(131, 110, 249, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#gameCanvas {
    border: 3px solid rgba(131, 110, 249, 0.5);
    border-radius: 15px;
    box-shadow: 
        0 15px 40px rgba(131, 110, 249, 0.4),
        0 10px 25px rgba(160, 5, 93, 0.3),
        inset 0 1px 0 rgba(251, 250, 249, 0.2);
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs><radialGradient id="glow"><stop offset="0%25" stop-color="%23836EF9" stop-opacity="1"/><stop offset="50%25" stop-color="%23836EF9" stop-opacity="0.8"/><stop offset="100%25" stop-color="%23836EF9" stop-opacity="0"/></radialGradient></defs><circle cx="16" cy="16" r="12" fill="url(%23glow)"/><circle cx="16" cy="16" r="6" fill="%23836EF9"/></svg>') 16 16, auto;
}

#gameOver, #whitelistModal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(251, 250, 249, 0.95), rgba(251, 250, 249, 0.9));
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 
        0 25px 50px rgba(131, 110, 249, 0.5),
        0 15px 30px rgba(160, 5, 93, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(131, 110, 249, 0.4);
    z-index: 20;
    max-width: 500px;
    width: 90%;
}

#gameOver h2, #whitelistModal h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #836EF9, #A0055D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(131, 110, 249, 0.3));
}

#whitelistModal p {
    color: #200052;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

#qualifyingScore {
    font-weight: bold;
    color: #836EF9;
    font-size: 1.3rem;
}

#ethereumAddress {
    width: 100%;
    padding: 12px 20px;
    margin: 20px 0;
    border: 2px solid rgba(131, 110, 249, 0.3);
    border-radius: 10px;
    background: rgba(251, 250, 249, 0.9);
    color: #200052;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(131, 110, 249, 0.1);
}

#ethereumAddress:focus {
    outline: none;
    border-color: #836EF9;
    box-shadow: 
        inset 0 2px 5px rgba(131, 110, 249, 0.2),
        0 0 0 3px rgba(131, 110, 249, 0.2);
}

#submissionMessage {
    min-height: 25px;
    margin: 10px 0;
    font-weight: bold;
    font-size: 0.95rem;
}

#submissionMessage.success {
    color: #28a745;
}

#submissionMessage.error {
    color: #dc3545;
}

.secondary-btn {
    background: rgba(131, 110, 249, 0.3) !important;
    color: #200052 !important;
}

.secondary-btn:hover {
    background: rgba(160, 5, 93, 0.3) !important;
}

/* Leaderboard Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.leaderboard-container {
    background: linear-gradient(145deg, rgba(251, 250, 249, 0.95), rgba(251, 250, 249, 0.9));
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 50px rgba(131, 110, 249, 0.5),
        0 15px 30px rgba(160, 5, 93, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(131, 110, 249, 0.4);
}

.leaderboard-container h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #836EF9, #A0055D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(131, 110, 249, 0.3));
    text-align: center;
}

.day-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(131, 110, 249, 0.1);
    border-radius: 10px;
}

.day-btn {
    padding: 10px 20px;
    background: #836EF9;
    color: #FBFAF9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(131, 110, 249, 0.3);
}

.day-btn:hover {
    background: #A0055D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 5, 93, 0.4);
}

.day-btn.active {
    background: #A0055D;
    box-shadow: 0 4px 12px rgba(160, 5, 93, 0.5);
    transform: scale(1.05);
}

.day-btn.current-day {
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#leaderboardContent {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    position: sticky;
    top: 0;
    background: #836EF9;
    color: #FBFAF9;
    z-index: 1;
}

.leaderboard-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #A0055D;
}

.leaderboard-table th:first-child {
    width: 60px;
    text-align: center;
}

.leaderboard-table th:last-child {
    width: 100px;
    text-align: right;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(131, 110, 249, 0.2);
    transition: background 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(131, 110, 249, 0.1);
}

.leaderboard-table tbody tr:nth-child(1) {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), transparent);
}

.leaderboard-table tbody tr:nth-child(2) {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), transparent);
}

.leaderboard-table tbody tr:nth-child(3) {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), transparent);
}

.leaderboard-table td {
    padding: 10px 12px;
    color: #200052;
}

.leaderboard-table td:first-child {
    text-align: center;
    font-weight: bold;
    color: #836EF9;
}

.leaderboard-table td:last-child {
    text-align: right;
    font-weight: bold;
    color: #A0055D;
}

.leaderboard-table td.address {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #836EF9;
    font-size: 1.2rem;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    font-size: 1.1rem;
}

/* Scrollbar styling for leaderboard */
#leaderboardContent::-webkit-scrollbar {
    width: 8px;
}

#leaderboardContent::-webkit-scrollbar-track {
    background: rgba(131, 110, 249, 0.1);
    border-radius: 4px;
}

#leaderboardContent::-webkit-scrollbar-thumb {
    background: #836EF9;
    border-radius: 4px;
}

#leaderboardContent::-webkit-scrollbar-thumb:hover {
    background: #A0055D;
}

.download-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    margin-bottom: 15px;
}

.download-btn:hover:not(:disabled) {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.download-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Countdown Timer Styling */
.countdown-timer {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(131, 110, 249, 0.1), rgba(160, 5, 93, 0.1));
    border-radius: 12px;
    border: 2px solid rgba(131, 110, 249, 0.3);
    text-align: center;
}

.countdown-label {
    font-size: 0.9rem;
    color: #200052;
    margin-bottom: 8px;
    font-weight: 500;
}

.countdown-display {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #836EF9, #A0055D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.countdown-display span {
    display: inline-block;
    min-width: 30px;
}

#finalScore {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #200052;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(131, 110, 249, 0.2);
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        touch-action: none;
    }
    
    .menu {
        padding: 20px;
        margin: 10px;
        max-width: 90vw;
    }
    
    .menu h1 {
        font-size: 2rem;
    }
    
    .logo {
        max-width: 280px;
    }
    
    .menu h2 {
        font-size: 1.5rem;
    }
    
    .menu-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .instructions {
        font-size: 0.8rem;
    }
    
    #gameCanvas {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0;
        border: none;
    }
    
    #gameUI {
        width: 100vw;
        height: 100vh;
    }
    
    #gameStats {
        font-size: 0.9rem;
        top: 10px;
        left: 10px;
        gap: 5px;
    }
    
    #gameStats > div {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    #gameOver {
        padding: 25px;
        max-width: 85vw;
    }
    
    #gameOver h2 {
        font-size: 1.8rem;
    }
    
    #finalScore {
        font-size: 1.2rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .menu h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        max-width: 240px;
    }
    
    .menu {
        padding: 15px;
    }
    
    .menu-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Animation for slice effects */
@keyframes sliceEffect {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.slice-effect {
    animation: sliceEffect 0.5s ease-out forwards;
}

/* Combo text animation */
@keyframes comboText {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: scale(1) translateY(-40px);
    }
}

.combo-text {
    animation: comboText 1s ease-out forwards;
    position: absolute;
    font-weight: bold;
    font-size: 1.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 15;
}

