* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    width: 100%;
}

.game-panel {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.leaderboard-panel {
    width: 350px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.stats {
    display: flex;
    gap: 30px;
}

.stats > div {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

.stats span:not(.label) {
    font-size: 24px;
    font-weight: bold;
}

.lives {
    display: flex;
    gap: 5px;
    font-size: 28px;
}

.heart.lost {
    opacity: 0.3;
    filter: grayscale(100%);
}

.game-area {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    height: 600px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.start-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.start-screen p {
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.circle {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #fef08a 0%, #fbbf24 50%, #f59e0b 100%);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.9),
                0 0 50px rgba(251, 191, 36, 0.6),
                0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
    animation: pulse 1s infinite;
    border: 3px solid #fff;
}

.circle:hover {
    transform: scale(1.1);
}

.circle.clicked {
    animation: explode 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 0 0 50px rgba(251, 191, 36, 0.6), 0 4px 15px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 35px rgba(251, 191, 36, 1), 0 0 70px rgba(251, 191, 36, 0.8), 0 4px 15px rgba(0, 0, 0, 0.3);
        transform: scale(1.05);
    }
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Leaderboard */
.leaderboard-panel h2 {
    text-align: center;
    color: #6366f1;
    margin-bottom: 10px;
    font-size: 28px;
    text-shadow: 1px 1px 2px rgba(99, 102, 241, 0.2);
}

.leaderboard-subtitle {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.leaderboard {
    max-height: 640px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    border-radius: 10px;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    border: 2px solid #fef08a;
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    color: #1f2937;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(156, 163, 175, 0.3);
    border: 2px solid #f3f4f6;
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    color: #431407;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.3);
    border: 2px solid #fed7aa;
}

.rank {
    font-size: 24px;
    font-weight: bold;
    min-width: 40px;
}

.player-info {
    flex: 1;
    margin-left: 15px;
}

.player-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 3px;
}

.player-date {
    font-size: 12px;
    opacity: 0.8;
}

.player-score {
    font-size: 24px;
    font-weight: bold;
}

.loading, .no-scores {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 650px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #6366f1;
    margin-bottom: 20px;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(99, 102, 241, 0.2);
}

.final-score {
    margin: 30px 0;
}

.final-score p {
    color: #666;
    font-size: 18px;
    margin-bottom: 10px;
}

.final-score h1 {
    color: #8b5cf6;
    font-size: 64px;
    text-shadow: 3px 3px 6px rgba(139, 92, 246, 0.3);
}

.emoji-input {
    margin: 30px 0;
}

.emoji-input label {
    display: block;
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(99, 102, 241, 0.1);
}

.emoji-option {
    font-size: 32px;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    background: white;
    border: 2px solid #e0e7ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.emoji-option:hover {
    transform: scale(1.2);
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.emoji-option.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.6);
}

.selected-emoji-display {
    text-align: center;
    color: #666;
    font-size: 18px;
}

.selected-emoji {
    font-size: 36px;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .game-container {
        flex-direction: column;
    }
    
    .leaderboard-panel {
        width: 100%;
    }
}
