:root {
    --boy-color: #3b82f6;
    --boy-dark: #1e3a8a;
    --girl-color: #ec4899;
    --girl-dark: #831843;
    --text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background: #000;
}

.battle-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.side {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    position: relative;
    z-index: 10;
}

/* Background Layers */
.background-layer-boy {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: radial-gradient(circle at 20% 0%, #ffffff 0%, #C0E6F7 40%, #8bcae6 100%);
    z-index: 1;
}

.background-layer-girl {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 50%;
    background: radial-gradient(circle at 80% 100%, #ffffff 0%, #E1C2F4 40%, #c499de 100%);
    z-index: 1;
}

.content {
    z-index: 20;
    text-align: center;
    color: var(--text-color);
}

h1 {
    font-size: 4.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

p {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 2rem;
    /* Pastel Gradient Text */
    background: #fcfdfd;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    background: white;
    color: #000;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Boy Button Gradient */
.boy button {
    background: #fcfdfd;
    color: #0c4a6e;
}

/* Girl Button Gradient */
.girl button {
    background: #fcfdfd;
    color: #831843;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

button:active {
    transform: scale(0.95);
}

.vs-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: black;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 1.5rem;
    z-index: 20;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 4px solid rgba(0, 0, 0, 0.1);
}

/* Avatar Styles */
.avatar {
    position: absolute;
    bottom: 10%;
    height: 220px;
    z-index: 15;
    pointer-events: none;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transform-origin: bottom center;
}

#boy-avatar {
    right: -100px;
}

#girl-avatar {
    left: -90px;
    height: 210px;
}

/* Hover effect for avatars just for fun */
.side:hover #boy-avatar {
    transform: scale(1.05) rotate(-2deg);
}

.side:hover #girl-avatar {
    transform: scale(1.05) rotate(2deg);
}

/* Confetti Z-Index Fix */
canvas {
    z-index: 9999 !important;
}

/* Access Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-card h2 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 900;
}

.modal-card p {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-weight: 400;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: #475569;
}

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1rem;
}

.input-group input {
    padding: 0.8rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Outfit', sans-serif;
    width: 60%;
}

.input-group input:focus {
    border-color: #3b82f6;
}

.input-group button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.input-group button:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: bold;
    margin-bottom: 0;
}

.error-message.hidden {
    display: none;
}

/* Countdown & Dominance Styles */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.countdown-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.countdown-number {
    font-size: 15rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
    font-family: 'Outfit', sans-serif;
}

.winner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    width: 100%;
    text-align: center;
}

.winner-text.show {
    opacity: 1;
    animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.final-reveal-image {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    max-height: 80vh;
    z-index: 3500;
    opacity: 0;
    transition: bottom 2s ease-out, opacity 2s ease-out;
}

.final-reveal-image.show {
    bottom: 0;
    opacity: 1;
}

/* Specific fix for Boy Reveal on Mobile */
@media (max-width: 768px) {
    .final-reveal-image.reveal-boy.show {
        bottom: 15%;
        /* Lift it up significantly for mobile */
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Mobile-specific viewport lock */
    html,
    body {
        overflow: hidden !important;
        height: 100% !important;
        height: 100dvh !important;
        position: fixed !important;
        width: 100% !important;
    }

    .battle-container {
        flex-direction: row;
        /* Force Horizontal Split */
    }

    .side {
        width: 50%;
        height: 100%;
    }

    /* Adjust background layers for horizontal split */
    .background-layer-boy {
        width: 50%;
        height: 100%;
        top: 0;
        left: 0;
    }

    .background-layer-girl {
        width: 50%;
        height: 100%;
        top: 0;
        right: 0;
    }

    /* Avatars - Aggressive Scaling */
    .avatar {
        height: 150px;
        /* Much smaller */
        bottom: 15%;
        z-index: 5;
        opacity: 0.8;
    }

    #boy-avatar {
        right: -60px;
    }

    #girl-avatar {
        left: -55px;
        height: 140px;
    }

    /* Typography & Buttons - Aggressive Scaling */
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    p {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    button {
        padding: 0.8rem 1.5rem;
        position: relative;
    }

    .vs-badge {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        border-width: 2px;
    }

    .modal-card {
        padding: 1.5rem;
    }

    .modal-card h2 {
        font-size: 1.5rem;
    }

    .modal-card p {
        font-size: 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input {
        width: 100%;
    }

    .input-group button {
        width: 100%;
    }

    .winner-text {
        font-size: 3rem;
    }

    .countdown-number {
        font-size: 8rem;
    }

    .final-reveal-image {
        width: auto;
        height: 60dvh;
        max-width: 100%;
        max-height: none;
        z-index: 5000 !important;
        position: fixed !important;
        pointer-events: auto;
        bottom: -100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        opacity: 0;
        transition: bottom 2s ease-out, opacity 2s ease-out !important;
        object-fit: contain;
        object-position: bottom center;
        /* Ensure image hits the floor */
    }

    .final-reveal-image.show {
        bottom: 0 !important;
        opacity: 1 !important;
    }
}



/* Admin Controls */
.admin-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.admin-controls.hidden {
    display: none;
}

.reveal-btn {
    background: #10b981;
    color: white;
    font-size: 1.5rem;
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
    transition: transform 0.2s;
}

.reveal-btn:hover {
    background: #059669;
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}