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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '✨';
    position: fixed;
    font-size: 20px;
    animation: sparkle1 3s infinite;
    top: 10%;
    left: 10%;
    opacity: 0;
    pointer-events: none;
}

body::after {
    content: '💜';
    position: fixed;
    font-size: 18px;
    animation: sparkle2 4s infinite 1s;
    top: 20%;
    right: 15%;
    opacity: 0;
    pointer-events: none;
}

@keyframes sparkle1 {
    0%, 100% { opacity: 0; transform: translateY(0) rotate(0deg); }
    50% { opacity: 0.8; transform: translateY(-20px) rotate(180deg); }
}

@keyframes sparkle2 {
    0%, 100% { opacity: 0; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.7; transform: scale(1.3) rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

header::after {
    content: '✨ ⭐ 💫 ✨ ⭐ 💫';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0.6;
    letter-spacing: 30px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

h1 {
    font-size: 2.5em;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2), 0 0 40px rgba(255, 255, 255, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.2); }
    to { text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2), 0 0 40px rgba(255, 255, 255, 0.5); }
}

nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.section {
    display: none;
    padding: 40px;
}

.section.active {
    display: block;
}

.vote-counter {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2em;
    color: #666;
}

.matchup {
    text-align: center;
}

.matchup h2 {
    color: #333;
    margin-bottom: 40px;
    font-size: 2em;
    position: relative;
}

.matchup h2::after {
    content: '💜';
    margin-left: 10px;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
}

.albums {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.album-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 30px;
    width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.album-card::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-card:hover::before {
    opacity: 0.8;
    animation: spin 1s linear infinite;
}

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

.album-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4), 0 8px 16px rgba(0, 0, 0, 0.1), 0 0 30px rgba(118, 75, 162, 0.3);
}

.album-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.album-card:hover img {
    transform: scale(1.05);
}

.album-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.vote-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.vote-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.vote-btn:hover::before {
    width: 300px;
    height: 300px;
}

.vote-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.5);
}

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

.vs {
    font-size: 3em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ea67b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s ease-in-out infinite;
    background-size: 200% 200%;
}

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

.rankings-list {
    margin-top: 30px;
}

.ranking-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rank {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    width: 60px;
    text-align: center;
}

.ranking-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin: 0 20px;
}

.album-info {
    flex: 1;
}

.album-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.elo-score {
    color: #666;
    font-size: 1.1em;
}

/* Two-column rankings for personal page */
.rankings-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.rankings-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item-compact {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.ranking-item-compact:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3), 0 0 20px rgba(118, 75, 162, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #ffffff 0%, #f8f3ff 100%);
}

.rank-compact {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.ranking-item-compact img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    margin: 0 10px;
    flex-shrink: 0;
}

.album-info-compact {
    flex: 1;
    min-width: 0;
}

.album-info-compact h3 {
    color: #333;
    margin-bottom: 3px;
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-info-compact .elo-score {
    color: #666;
    font-size: 0.85em;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    font-size: 1.2em;
    color: #666;
    flex-wrap: wrap;
}

.stats p {
    margin: 0;
}

/* About Section Styles */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.about-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.about-card p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 10px;
}

.about-card ul, .about-card ol {
    color: #555;
    line-height: 1.8;
    margin-left: 20px;
}

.about-card li {
    margin-bottom: 8px;
}

.about-card strong {
    color: #667eea;
}

.formula {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

.about-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
}

.about-footer p {
    color: #667eea;
    font-size: 1.2em;
    margin: 10px 0;
}

.small-text {
    font-size: 0.9em !important;
    color: #999 !important;
}

.share-link {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.share-link p {
    margin-bottom: 10px;
    color: #666;
}

#share-url {
    width: 70%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 0.9em;
}

#copy-link {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

#copy-link:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #ea6767 0%, #a24b76 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(234, 103, 103, 0.3);
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c75555 0%, #8a3f62 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 103, 103, 0.4);
}

/* Global Rank Display */
.global-rank {
    font-size: 1em;
    font-weight: 600;
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
}

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

.global-rank.hidden {
    visibility: hidden;
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

.global-rank.higher {
    background: linear-gradient(135deg, #e8dff5 0%, #e0d4f7 100%);
    color: #764ba2;
    border: 1px solid rgba(118, 75, 162, 0.2);
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.15);
}

.global-rank.lower {
    background: linear-gradient(135deg, #764ba2 0%, #5a3678 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(118, 75, 162, 0.3);
}

/* Next Matchup Button */
#next-matchup-btn-container {
    text-align: center;
    margin-bottom: 20px;
    min-height: 60px;
}

#next-matchup-btn-container.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    }
    50% {
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
    }
}

.next-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
    animation: none;
}

.next-btn:active {
    transform: translateY(-1px) scale(1.03);
}

@media (max-width: 768px) {
    .albums {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .vs {
        font-size: 1.1em;
        margin: 4px 0;
    }

    .album-card {
        width: 85%;
        max-width: 200px;
        padding: 10px;
    }

    .album-card img {
        width: 100%;
        margin-bottom: 6px;
    }

    .album-card h3 {
        font-size: 0.85em;
        margin-bottom: 6px;
    }

    h1 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    header {
        padding: 20px 15px;
    }

    .tab-btn {
        padding: 8px 18px;
        font-size: 0.9em;
    }

    .matchup h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .vote-counter {
        margin-bottom: 10px;
    }

    .vote-counter p {
        font-size: 0.85em;
    }

    #share-url {
        width: 100%;
        margin-bottom: 10px;
    }

    .result-info {
        flex-direction: column;
        gap: 15px;
    }

    .global-rank {
        font-size: 0.75em;
        padding: 5px;
        margin: 5px 0;
    }

    .vote-btn {
        padding: 8px 16px;
        font-size: 0.85em;
    }

    .section {
        padding: 15px 10px;
    }

    /* Rankings layout on mobile */
    .rankings-columns {
        gap: 4px;
        grid-template-columns: 1fr 1fr !important;
    }

    .rankings-column {
        gap: 4px;
    }

    .ranking-item-compact {
        padding: 4px;
    }

    .rank-compact {
        font-size: 0.75em;
        width: 22px;
    }

    .ranking-item-compact img {
        width: 28px;
        height: 28px;
        margin: 0 3px;
    }

    .album-info-compact h3 {
        font-size: 0.65em;
        line-height: 1.1;
    }

    .album-info-compact .elo-score {
        font-size: 0.55em;
    }
}

/* Support Footer */
.support-footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

.support-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.support-footer a:hover {
    color: white;
    border-bottom-color: white;
}
