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

:root {
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --accent-color: #fbbf24;
    --dark-bg: #0f172a;
    --light-bg: #1e293b;
    --text-color: #f1f5f9;
    --success-color: #10b981;
    --terence-color: #3b82f6;
    --breno-color: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); /* Fallback */
    color: var(--text-color);
    color: #f1f5f9; /* Fallback */
    min-height: 100vh;
    overflow-x: hidden;
    /* Cross-browser compatibility */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.main-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-section {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 3rem 2rem;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.floating-emoji {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.7;
}

.floating-emoji:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-emoji:nth-child(2) {
    top: 20%;
    right: 10%;
    animation-delay: 1s;
}

.floating-emoji:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
}

.floating-emoji:nth-child(4) {
    bottom: 30%;
    right: 15%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.glitch-text {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    text-align: center;
    position: relative;
    color: var(--text-color);
    letter-spacing: 2px;
    animation: glitch 2s infinite;
    text-shadow: 2px 2px 4px rgba(99, 102, 241, 0.5);
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 2px 2px 4px rgba(99, 102, 241, 0.5);
    }
    25% {
        text-shadow: -2px 0 var(--secondary-color), 2px 0 var(--accent-color);
    }
    50% {
        text-shadow: 2px 0 var(--primary-color), -2px 0 var(--secondary-color);
    }
    75% {
        text-shadow: 0 2px var(--accent-color), 0 -2px var(--primary-color);
    }
}

.subtitle {
    font-size: 1.5rem;
    margin-top: 1rem;
    opacity: 0.9;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.countdown {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-item span {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.countdown-item label {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rsvp-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin: 2rem auto;
}

.rsvp-subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.rsvp-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Cross-browser compatibility */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.rsvp-form input,
.rsvp-form textarea {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    background: #1e293b; /* Fallback for browsers that don't support rgba */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border: 1px solid #334155; /* Fallback for browsers that don't support rgba */
    border-radius: 10px;
    color: var(--text-color);
    color: #f1f5f9; /* Fallback for browsers that don't support CSS variables */
    font-size: 1rem;
    transition: all 0.3s;
    /* Cross-browser compatibility */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Ensure consistent rendering */
    box-sizing: border-box;
}

.rsvp-form input:focus,
.rsvp-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    border-color: #6366f1; /* Fallback for browsers that don't support CSS variables */
    background: rgba(255, 255, 255, 0.08);
    background: #2d3748; /* Fallback for browsers that don't support rgba */
    /* Cross-browser focus styles */
    -webkit-box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    -moz-box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.plusone-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plusone-label {
    font-size: 0.9rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.disabled-input {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08) !important;
    background: #1a2332 !important; /* Fallback for browsers that don't support rgba */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border: 1px solid #2d3748 !important; /* Fallback for browsers that don't support rgba */
    border-radius: 10px;
    color: rgba(241, 245, 249, 0.8) !important;
    color: #cbd5e0 !important; /* Fallback for browsers that don't support rgba */
    cursor: not-allowed !important;
    font-style: italic;
    font-size: 1rem;
    /* Firefox-specific fixes */
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    /* Ensure visibility across all browsers */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Firefox-specific fixes for disabled inputs */
@-moz-document url-prefix() {
    .disabled-input {
        background: #1a2332 !important;
        border: 1px solid #2d3748 !important;
        color: #cbd5e0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        /* Override any Firefox-specific hiding */
        -moz-user-select: text;
        -moz-user-modify: read-only;
    }
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-container {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-container:hover {
    background: rgba(255, 255, 255, 0.08);
}

.radio-container input[type="radio"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    /* Cross-browser radio button styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border: 2px solid #475569; /* Fallback */
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.radio-container input[type="radio"]:checked {
    background: var(--primary-color);
    background: #6366f1; /* Fallback */
    border-color: var(--primary-color);
    border-color: #6366f1; /* Fallback */
}

.radio-container input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.submit-btn {
    padding: 1.2rem 2rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-emoji {
    font-size: 1.5rem;
}

.confirmation {
    text-align: center;
    padding: 2rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-top: 2rem;
}

.confirmation.hidden {
    display: none;
}

.voting-section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.voting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.vote-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    text-align: center;
}

.vote-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.vote-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-color);
}

.vote-icon {
    font-size: 3rem;
    margin: 1.5rem 0;
    animation: bounce 2s infinite;
}

.vote-video {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 15px;
    margin: 1.5rem auto;
    display: block;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.vote-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin: 1rem 0;
}

.vote-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.vote-count {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: bold;
}

.democracy-popover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.democracy-popover.hidden {
    display: none;
}

.popover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.popover-content {
    position: relative;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
    animation: popoverAppear 0.5s ease-out;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4);
}

@keyframes popoverAppear {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.popover-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popover-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.popover-btn {
    padding: 1rem 2rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.popover-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.battle-section {
    margin-top: 4rem;
}

.battle-subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 3rem;
}

.battle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.battle-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.battle-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.battle-card h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.battle-animation {
    display: flex;
    justify-content: space-around;
    align-items: center;
    min-height: 150px;
    position: relative;
}

.character {
    position: relative;
    width: 80px;
    height: 80px;
}

.character img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.lightsaber {
    position: absolute;
    width: 3px;
    height: 0;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    transition: height 0.3s;
}

.lightsaber.blue {
    background: linear-gradient(to top, transparent, var(--terence-color));
    box-shadow: 0 0 10px var(--terence-color);
}

.lightsaber.red {
    background: linear-gradient(to top, transparent, var(--breno-color));
    box-shadow: 0 0 10px var(--breno-color);
}

.lightsaber.active {
    height: 60px;
}

.vs-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.battle-btn {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.battle-btn:hover {
    transform: scale(1.05);
}

.battle-result {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--success-color);
}

.race-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    position: relative;
    height: 100px;
}

.racer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    transition: left 2s ease-out;
    left: 0;
}

.racer:first-child {
    top: 20%;
}

.racer:last-child {
    bottom: 20%;
}

.racer-emoji {
    font-size: 2rem;
}

.racer-name {
    font-size: 0.9rem;
    opacity: 0.8;
}

.game-scores {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
}

.score-display {
    text-align: center;
}

.score {
    font-size: 3rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.strength-meter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.strength-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 30px;
    position: relative;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 2s ease-out;
    position: absolute;
    border-radius: 10px;
}

.terence-strength {
    background: linear-gradient(90deg, var(--terence-color), var(--primary-color));
}

.breno-strength {
    background: linear-gradient(90deg, var(--breno-color), var(--secondary-color));
}

.strength-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    z-index: 1;
}

.fun-facts {
    margin-top: 4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    margin-top: 0.5rem;
    opacity: 0.8;
}

.party-details {
    margin-top: 4rem;
}

.contact-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    display: block;
}

.contact-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.contact-card p {
    font-size: 1rem;
    opacity: 0.9;
    word-break: break-all;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.detail-note {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-joke {
    margin-top: 0.5rem;
    opacity: 0.6;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .glitch-text {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .main-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .countdown {
        gap: 0.5rem;
    }
    
    .countdown-item {
        padding: 0.8rem;
    }
    
    .countdown-item span {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 3rem 1rem;
    }
    
    .voting-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .vote-card {
        padding: 1.5rem;
    }
    
    .vote-video {
        max-width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    .battle-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .character {
        width: 60px;
        height: 60px;
    }
    
    .popover-content {
        max-width: 90%;
        padding: 2rem 1.5rem;
    }
    
    .popover-content h3 {
        font-size: 1.5rem;
    }
    
    .popover-content p {
        font-size: 1rem;
    }
}

@keyframes jediWin {
    0% {
        transform: translateX(0) rotate(0deg);
    }
    50% {
        transform: translateX(20px) rotate(360deg);
    }
    100% {
        transform: translateX(0) rotate(720deg);
    }
}

@keyframes jediLose {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-20px) rotate(-15deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-30px) rotate(-30deg);
        opacity: 0.5;
    }
}

.character.winning {
    animation: jediWin 2s ease-in-out;
}

.character.losing {
    animation: jediLose 2s ease-in-out;
}