/* Base styles */
body {
    font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
    background: #a4ff8f;
    color: black;
    margin: 0;
    padding: 20px;
    font-weight: 900;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

h1 {
    font-size: 4em;
    margin-bottom: 30px;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.3);
    color: black;
    text-align: center;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
}

h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.2);
    color: black;
    text-align: center;
    font-weight: 900;
    letter-spacing: 2px;
}

.tea-purple {
    color: #d5affe;
}

.fun-suffix {
    font-size: 0.34em;
    vertical-align: baseline;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

/* Voting page styles */
.voting-body {
    text-align: center;
}

.voting-container {
    max-width: 800px;
}

.vs-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 40px 0;
}

.image-option {
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    cursor: pointer;
    border: 3px solid transparent;
    position: relative;
}

.image-container {
    position: relative;
    border-radius: 10px;
    padding: 10px;
    width: 280px;
    height: 280px;
}

.image-option.slide-in-left {
    animation: slideInFromLeft 0.6s ease-out;
}

.image-option.slide-in-right {
    animation: slideInFromRight 0.6s ease-out;
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-150%) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(10%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(150%) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(-10%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.image-option:hover {
    transform: scale(1.05);
    border: 3px solid #d5affe;
}

.image-option.winner {
    animation: winnerPulse 0.3s ease-out;
    transform: scale(1.1);
    border: 5px solid #d5affe;
    box-shadow: 0 0 20px rgba(213, 175, 254, 0.8);
}

.image-option.loser {
    animation: loserFade 0.3s ease-out;
    opacity: 0.8;
    transform: scale(0.9);
    filter: grayscale(70%);
}

.image-option.slide-out {
    animation: slideOut 0.4s ease-in forwards;
}

@keyframes slideOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.7) translateY(-20px);
        opacity: 0;
    }
}

@keyframes winnerPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(213, 175, 254, 0.8);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 30px rgba(213, 175, 254, 1);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(213, 175, 254, 0.8);
    }
}

@keyframes loserFade {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: grayscale(0%);
    }
    100% {
        opacity: 0.8;
        transform: scale(0.9);
        filter: grayscale(70%);
    }
}

.image-option img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 5px;
}

.enlarge-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(213, 175, 254, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.enlarge-btn:hover {
    background: #d5affe;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.elo-display {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(0px);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
}

.elo-display.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.elo-number {
    color: #d5affe;
    font-size: 16px;
    transition: all 0.3s ease;
}

.elo-display.elo-up {
    background: rgba(46, 204, 113, 1);
    transform: translateX(-50%) translateY(-10px) scale(1.1);
}

.elo-display.elo-down {
    background: rgba(231, 76, 60, 1);
    transform: translateX(-50%) translateY(10px) scale(1.1);
}

.elo-display.elo-up .elo-number {
    color: white;
}

.elo-display.elo-down .elo-number {
    color: white;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.2s;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #d5affe;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vs {
    font-size: 5em;
    font-weight: 900;
    color: #d5affe;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.3);
    letter-spacing: 5px;
    text-transform: uppercase;
}

.instructions {
    font-size: 1.8em;
    margin: 40px 0;
    color: black;
    font-weight: 900;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

.stats {
    margin-top: 40px;
    background: rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;

    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1em;
}

/* Navigation */
.nav {
    text-align: center;
    margin-bottom: 30px;
}

.nav a {
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.2s ease;

    background: white;
    color: #d5affe;
}

.nav a:hover {
    background: rgba(0,0,0,0.8);
    border-color: #d5affe;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Stats summary */
.stats-summary {
    background: rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
}

.stats-summary h3 {
    margin-top: 0;
    color: #d5affe;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 5px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: black;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(0,0,0,0.1);
}

.tab.active {
    background: #d5affe;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Leaderboard */
.leaderboard {
    display: grid;
    gap: 15px;
}

.rank-item {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 10px;
    transition: background 0.2s;
}

.rank-item:hover {
    background: rgba(0,0,0,0.15);
}

.rank-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #d5affe;
    width: 3.5em;
    text-align: center;
}

.rank-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin: 0 20px;
}

.rank-info {
    flex: 1;
}

.rank-filename {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    color: black;
}

.rank-stats {
    opacity: 0.8;
    color: black;
}

.elo-rating {
    font-size: 1.4em;
    font-weight: bold;
    color: #d5affe;
    margin-left: auto;
    text-align: right;
    min-width: 100px;
}

.top3 {
    background: linear-gradient(45deg, rgba(213,175,254,0.3), rgba(0,0,0,0.1));
}

.top3 .rank-number {
    color: #d5affe;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.no-votes {
    opacity: 0.9;
}

/* Links */
a {
    color: #d5affe;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

a:hover {
    text-decoration: underline;
}

.switch-mode-link {
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);

    background: white;
    color: #d5affe;
}

.switch-mode-link:hover {
    background: rgba(0,0,0,0.8);
    border-color: #d5affe;
    transform: translateY(-2px);
    text-decoration: none;
}

.leaderboard-link {
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);

    background: white;
    color: #d5affe;
}

.leaderboard-link:hover {
    background: rgba(0,0,0,0.8);
    border-color: #d5affe;
    transform: translateY(-2px);
    text-decoration: none;
}

@media (min-width: 1000px) {
    .image-option img {
        width: 420px;
        height: 420px;
    }

    .image-container {
        width: 420px;
        min-width: 420px;
        height: 420px;
    }

    .vs {
        font-size: 3em;
    }
}

@media (max-width: 800px) {
    .image-option img {
        width: 220px;
        height: 220px;
    }
    .image-container {
        width: 220px;
        min-width: 220px;
        height: 220px;
    }

    .vs {
        font-size: 2em;
    }
}

@media (max-width: 600px) {
    .vs-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .image-option img {
        width: 300px;
        height: 300px;
    }
    .image-container {
        width: 300px;
        height: 300px;
    }
    
    .vs {
        font-size: 2em;
    }
    
    .rank-item {
        flex-direction: column;
        text-align: center;
    }
    
    .rank-item img {
        margin: 10px 0;
        width: 70vw;
        height: 70vw;
    }
    
    .elo-rating {
        margin: 10px 0 0 0;
    }
}

.footer {
    text-align: center;
    padding-top: 20px;
    margin-top: auto;
    color: rgba(0,0,0,0.3);
    font-size: 0.9em;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}
