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

html {
    background-color: #111;
}

body {
    background-color: #111;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
}

body.game-page {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.bg-columns {
    position: fixed;
    inset: 0;
    display: flex;
    gap: 3px;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.bg-columns.visible {
    opacity: 1;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.82);
    z-index: 1;
    pointer-events: none;
}

.bg-col {
    flex: 1;
    overflow: hidden;
}

.bg-col-inner {
    display: flex;
    flex-direction: column;
}

.bg-col-inner img {
    width: 100%;
    aspect-ratio: 400 / 500;
    object-fit: cover;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.round-counter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: #05c3f7;
    margin-top: 0.25rem;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.status-message {
    text-align: center;
    font-size: 1.125rem;
    line-height: 1.6;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.card {
    position: relative;
    flex: 0 1 45%;
    aspect-ratio: 400 / 500;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #222;
    -webkit-tap-highlight-color: transparent;
}

.card:not(.chosen):not(.rejected):hover {
    border-color: #777;
    transform: scale(1.02);
}

.card:not(.chosen):not(.rejected):active {
    border-color: #777;
    transform: scale(0.97);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card.chosen {
    border-color: #22c55e;
}

.card.rejected {
    border-color: #ef4444;
}

.card.tied {
    border-color: #ed5000;
}

.percentage {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2.5rem 0 0.6rem;
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    line-height: 1;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.card.chosen .percentage {
    background: linear-gradient(to top, rgba(34, 197, 94, 0.95), rgba(34, 197, 94, 0));
}

.card.rejected .percentage {
    background: linear-gradient(to top, rgba(239, 68, 68, 0.95), rgba(239, 68, 68, 0));
}

.card.tied .percentage {
    background: linear-gradient(to top, rgba(237, 80, 0, 0.95), rgba(237, 80, 0, 0));
    font-size: 2rem;
}

.card.chosen .percentage,
.card.rejected .percentage,
.card.tied .percentage {
    opacity: 1;
}

.card:disabled,
.card.disabled {
    cursor: not-allowed;
}

.intro-screen {
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
}

.site-logo {
    width: 100%;
    max-width: 832px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.header-logo {
    max-width: 440px;
}

.leaderboard-logo {
    max-width: 640px;
    margin: 0 auto 1rem;
}

.intro-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.9rem;
    color: #fff;
    text-align: center;
    margin-top: -1.5rem;
}

.start-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: 0.05em;
    background: #22c55e;
    color: #fff;
    border: none;
    width: 100%;
    max-width: 520px;
    padding: 0.6em 1em;
    border-radius: 10px;
    cursor: pointer;
    transition: filter 0.15s ease;
    margin-top: 30px;
}

.start-btn:hover {
    filter: brightness(1.1);
}

.countdown-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.countdown-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #888;
}

.countdown-display {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    letter-spacing: 0.08em;
    color: #fff;
}

.score-tracker {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    font-size: 1.75rem;
    line-height: 1;
    min-height: 2rem;
}

.share-btn {
    background: #fff;
    color: #111;
    border: none;
    padding: 0.6rem 2.5rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
}

.share-btn:hover {
    background: #ddd;
}

.share-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.share-confirm {
    font-size: 0.875rem;
    color: #facc15;
    letter-spacing: 0.05em;
    min-height: 1.25rem;
    opacity: 0;
    visibility: hidden;
}

@keyframes fadeInOut {
    0%   { opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { opacity: 0; }
}

.share-confirm.visible {
    visibility: visible;
    animation: fadeInOut 4s ease forwards;
}

.summary-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.75rem;
    letter-spacing: 0.1em;
    color: #fff;
    text-align: center;
    margin-top: 1.5rem;
}

.featured-winner {
    width: 100%;
    max-width: 340px;
    margin: 0.75rem auto 0;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #22c55e;
}

.featured-winner img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 400 / 500;
}

.summary {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 10px;
}

.summary-round {
    flex: 0 1 calc(50% - 0.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #1e1e1e;
    border-radius: 8px;
    padding: 0.75rem;
}

.round-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: #fff;
    text-align: center;
}

.round-images {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.summary-card {
    position: relative;
    flex: 0 1 45%;
    aspect-ratio: 400 / 500;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #222;
}

.summary-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.summary-card.chosen {
    border-color: #22c55e;
}

.summary-card.chosen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(34, 197, 94, 0.3);
    pointer-events: none;
}

.summary-card.rejected {
    border-color: #ef4444;
}

.summary-card.rejected::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(239, 68, 68, 0.3);
    pointer-events: none;
}

.summary-card.tied {
    border-color: #ed5000;
}

.summary-card.tied::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(237, 80, 0, 0.3);
    pointer-events: none;
}

.summary-card .pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.9rem;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 600px) {
    body.playing {
        height: 100%;
        overflow: hidden;
    }

    body.playing .container {
        height: 100dvh;
        padding: 0.5rem;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    header {
        flex-shrink: 0;
        margin-bottom: 0.25rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    body.playing main {
        flex: 1 1 0;
        min-height: 0;
        gap: 0;
        overflow: hidden;
    }

    .share-confirm {
        min-height: 0;
    }

    body.playing .game-container {
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        flex-direction: column;
        gap: 0.5rem;
    }

    body.playing .card {
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
        aspect-ratio: unset;
    }

    .card img {
        object-fit: contain;
    }

    .percentage {
        font-size: 2.25rem;
        padding: 1.75rem 0 0.4rem;
    }

    .summary-round {
        flex: 0 1 100%;
    }

    .spr-logo {
        width: min(150px, 80vw);
        height: min(150px, 80vw);
    }
}

/* --- Sanspants Radio promo --- */

.spr-promo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.spr-label {
    font-size: 1rem;
    color: #fff;
}

.spr-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
}

/* --- Leaderboard button (intro screen) --- */

.leaderboard-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    background: #fff;
    color: #111;
    border: none;
    padding: 0.5em 2.5em;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: filter 0.15s ease;
    margin-bottom: 50px;
}

.leaderboard-btn:hover {
    filter: brightness(0.9);
}

.version-text {
    font-size: 0.75rem;
    color: #e1e1e1;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.5;
}

/* --- Leaderboard page --- */

.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.back-link {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: #888;
    text-decoration: none;
    position: absolute;
    left: 0;
    top: 0.25rem;
}

.back-link:hover {
    color: #fff;
}

.leaderboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.leaderboard-card {
    position: relative;
    flex: 0 1 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e1e;
    border: 2px solid #22c55e;
}

@media (min-width: 600px) {
    .leaderboard-card {
        flex: 0 1 calc(50% - 1rem);
    }
}

.leaderboard-card img {
    width: 100%;
    aspect-ratio: 400 / 500;
    object-fit: cover;
    display: block;
}

.leaderboard-rank {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    line-height: 1;
}

.leaderboard-votes {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    color: #facc15;
}

.leaderboard-empty {
    color: #888;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 600px) {
    .back-link {
        position: static;
        display: block;
        margin-bottom: 0.75rem;
    }
}
