:root {
    --bg-dark: #0a0a0a;
    --bg-grey: #1a1a1a;
    --neon-yellow: #faff00;
    --text-white: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: rgba(0, 0, 0, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 2px solid var(--neon-yellow);
    will-change: transform;
    transform: translate3d(0, 0, 0); /* Force GPU acceleration */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo img {
    height: 50px;
}

.back-link {
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--neon-yellow);
}

/* Registration Hero Section */
.registration-hero {
    position: relative;
    min-height: 100vh;
    padding: 120px 0 60px;
    background: url('images/cricket_bg.png') center/cover no-repeat;
    background-attachment: fixed;
    background-color: #000;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 10, 10, 0.7) 50%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.registration-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-text {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease;
    width: 100%;
}

.title-with-sponsors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 5px;
    position: relative;
    width: 100%;
}

.sponsor-group {
    display: flex;
    gap: 15px;
    transition: all 0.5s ease;
}

.sponsor-logo {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(204, 255, 0, 0.05) 0%, rgba(0,0,0,0.8) 100%);
    border: 2px solid rgba(204, 255, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-yellow);
    font-size: 1.8rem;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: sponsorPulse 2s infinite alternate ease-in-out;
    will-change: transform, box-shadow, border-color;
}

@keyframes sponsorPulse {
    from {
        box-shadow: 0 0 5px rgba(204, 255, 0, 0.1);
        border-color: rgba(204, 255, 0, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(204, 255, 0, 0.3);
        border-color: rgba(204, 255, 0, 0.5);
    }
}

.sponsor-logo:hover {
    border-color: var(--neon-yellow);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(250, 255, 0, 0.15);
    animation-play-state: paused;
}

.sponsor-logo.mystery ion-icon {
    filter: blur(6px);
    opacity: 0.3;
    transition: all 0.5s ease;
}

.sponsor-logo:hover.mystery ion-icon {
    filter: blur(3px);
    opacity: 0.6;
}

.status-badge {
    position: absolute;
    bottom: -8px;
    background: var(--neon-yellow);
    color: var(--bg-dark);
    font-size: 0.55rem;
    padding: 3px 12px;
    border-radius: 30px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(250, 255, 0, 0.4);
    border: 1px solid var(--bg-dark);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.header-text h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem; /* Slightly bigger */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-text .highlight {
    color: var(--neon-yellow);
}

.header-text p {
    font-family: 'Teko', sans-serif;
    font-size: 2rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: -10px;
}

.header-text .sub-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--neon-yellow);
    letter-spacing: 0.5px;
    margin-top: 5px;
    font-weight: 400;
}

/* Form Styles */
.form-wrapper {
    background-color: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--neon-yellow);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"],
input[type="tel"],
select {
    width: 100%;
    padding: 14px 18px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s;
}

input[type="text"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: var(--neon-yellow);
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.2);
}

/* Phone input with prefix wrapper */
.phone-input-wrapper:focus-within {
    border-color: var(--neon-yellow) !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.2);
}

.phone-input-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

/* Custom Select */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ccff00" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: center;
}

select option {
    background-color: var(--bg-grey);
    color: var(--text-white);
}

/* Radio Buttons Group */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-white) !important;
    text-transform: none !important;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label span {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.radio-label input[type="radio"]:checked+span {
    background-color: var(--neon-yellow);
    color: var(--bg-dark);
    border-color: var(--neon-yellow);
    font-weight: 600;
}

/* Specific styling for size group to make them square-ish pills */
.size-group {
    gap: 12px;
}

.size-group .radio-label span {
    padding: 12px 20px;
    min-width: 60px;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* File Upload */
.file-upload-wrapper input[type="file"] {
    display: none;
}

.file-upload-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow) !important;
}

.file-upload-label ion-icon {
    font-size: 1.5rem;
}

/* Image Preview */
.preview-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

#imagePreview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--neon-yellow);
    box-shadow: 0 0 15px rgba(204, 255, 0, 0.3);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    background-color: var(--neon-yellow);
    color: var(--bg-dark);
    border: none;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.btn-submit:hover {
    background-color: #aacc00;
    box-shadow: 0 0 25px rgba(204, 255, 0, 0.6);
    transform: scale(1.05);
    /* Slight scale animation */
}

.btn-submit:disabled {
    background-color: #556600;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner Animation */
.spinner {
    display: none;
    align-items: center;
    justify-content: center;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    font-size: 1.8rem;
    color: var(--bg-dark); /* Contrast against yellow button */
    margin-right: 12px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-submit.loading {
    background-color: #99bb00;
    pointer-events: none;
}

/* Status Message */
.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.status-message.success {
    display: block;
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #28a745;
    animation: fadeIn 0.5s ease;
}

.status-message.error {
    display: block;
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #ff6b6b;
    animation: fadeIn 0.5s ease, shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Footer */
footer {
    padding: 30px 0;
    background-color: #050505;
    border-top: 1px solid #1a1a1a;
}

.text-center {
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--bg-grey);
    padding: 40px 30px;
    border-radius: 12px;
    border: 1px solid var(--neon-yellow);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(30px);
    transition: transform 0.4s ease;
    box-shadow: 0 10px 40px rgba(204, 255, 0, 0.15);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.success-icon {
    font-size: 4rem;
    color: var(--neon-yellow);
    margin-bottom: 20px;
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.btn-close-modal {
    margin-top: 25px;
    padding: 10px 30px;
    background-color: transparent;
    border: 2px solid var(--neon-yellow);
    color: var(--neon-yellow);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close-modal:hover {
    background-color: var(--neon-yellow);
    color: var(--bg-dark);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000; /* Above everything */
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

.loader-content {
    text-align: center;
    position: relative;
    padding: 30px;
}

.loader-content h3 {
    color: var(--neon-yellow);
    margin-top: 50px;
    letter-spacing: 2px;
    font-size: 1.8rem;
    animation: textGlow 1.5s infinite alternate;
}

.loader-content p {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 10px;
}

/* 3D Cricket 'Hit a Six' Animation Overhaul */
.scene-3d {
    position: relative;
    width: 200px;
    height: 150px;
    margin: 0 auto;
    perspective: 800px;
    transform-style: preserve-3d;
}

.cricket-ball {
    width: 28px;
    height: 28px;
    background: radial-gradient(circle at 35% 35%, #ff4d4d 0%, #cc0000 50%, #660000 100%);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -14px 0 0 -14px;
    box-shadow: inset -4px -4px 8px rgba(0,0,0,0.5), 0 10px 20px rgba(0,0,0,0.4);
    z-index: 10;
    transform-style: preserve-3d;
    animation: ball3DMove 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ball Seam Detail */
.cricket-ball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-top: 1px dashed rgba(255,255,255,0.5);
    border-bottom: 1px dashed rgba(255,255,255,0.5);
    transform: translateY(-50%) rotateX(45deg);
}

.cricket-bat {
    width: 18px;
    height: 100px;
    background: linear-gradient(90deg, #d2691e 0%, #8b4513 50%, #5d2e0d 100%);
    border-radius: 4px;
    position: absolute;
    top: 30px;
    left: 50%;
    margin-left: 30px;
    transform-origin: top center;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    z-index: 5;
    transform: rotateX(20deg) rotateZ(45deg);
    animation: bat3DSwing 2s infinite ease-in-out;
}

/* Bat Handle */
.cricket-bat::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    width: 10px;
    height: 35px;
    background: #222;
    border-radius: 5px 5px 0 0;
    transform: translateX(-50%);
}

/* Impact Sparks */
.spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #faff00;
    border-radius: 50%;
    opacity: 0;
    z-index: 15;
}

.s1 { animation: sparkMove 2s infinite 0.8s; }
.s2 { animation: sparkMove 2s infinite 0.85s; }
.s3 { animation: sparkMove 2s infinite 0.9s; }

@keyframes ball3DMove {
    0% { transform: translate3d(-200px, 100px, -500px) scale(0.5); opacity: 0; filter: blur(2px); }
    15% { opacity: 1; filter: blur(0); }
    /* Contact at 40% */
    40% { transform: translate3d(25px, 0, 0) scale(1.1); filter: blur(0); }
    /* Flying Away */
    60% { transform: translate3d(150px, -120px, 300px) scale(1.5); filter: blur(1px); opacity: 1; }
    100% { transform: translate3d(300px, -250px, 800px) scale(0); filter: blur(5px); opacity: 0; }
}

@keyframes bat3DSwing {
    0%, 20% { transform: rotateX(20deg) rotateY(-30deg) rotateZ(80deg); }
    /* Swing through */
    40% { transform: rotateX(0deg) rotateY(10deg) rotateZ(-20deg); }
    60% { transform: rotateX(-10deg) rotateY(20deg) rotateZ(-60deg); }
    100% { transform: rotateX(-10deg) rotateY(20deg) rotateZ(-60deg); }
}

@keyframes sparkMove {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    1% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    30% { transform: translate(calc(-50% + (var(--dir-x, 30px))), calc(-50% + (var(--dir-y, -30px)))) scale(0); opacity: 0; }
    100% { opacity: 0; }
}

.s1 { --dir-x: -40px; --dir-y: -20px; }
.s2 { --dir-x: 10px; --dir-y: -50px; }
.s3 { --dir-x: 30px; --dir-y: 10px; }

@keyframes textGlow {
    from { text-shadow: 0 0 10px var(--neon-yellow); transform: scale(1); }
    to { text-shadow: 0 0 25px var(--neon-yellow), 0 0 40px var(--neon-yellow); transform: scale(1.05); }
}

/* Responsive */
/* Responsive Improvements */
@media (max-width: 768px) {
    .header-text h1 {
        font-size: 2.8rem;
    }

    .header-text p {
        font-size: 1.3rem;
    }

    .registration-hero {
        padding: 100px 15px 40px;
        background-attachment: scroll !important; /* Fix for mobile flickering */
    }

    .form-wrapper {
        padding: 25px 20px;
        border-radius: 12px;
    }

    .radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .radio-label span {
        width: 100%;
        text-align: center;
        display: block;
        padding: 15px; /* Bigger touch area */
    }

    .navbar {
        padding: 15px 20px;
    }

    .logo img {
        height: 35px;
    }

    .back-link {
        font-size: 0.9rem;
    }

    .title-with-sponsors {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        margin-bottom: 50px; /* Stronger separation for mobile */
    }

    .header-text h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
        order: -1;
        width: 100%;
        margin-bottom: 25px;
    }

    .header-text p {
        font-size: 1.4rem; /* Bigger for better legibility */
        margin-top: 15px;
        display: block;
        padding-top: 5px;
        font-family: var(--font-heading);
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-white);
    }

    .sponsor-logo {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .status-badge {
        font-size: 0.45rem;
        bottom: -7px;
        padding: 2px 8px;
    }
}

/* Specific for small mobile screens (e.g. iPhone SE) */
@media (max-width: 480px) {
    .header-text h1 {
        font-size: 2.2rem;
    }

    .header-text p {
        font-size: 1.25rem;
        margin-top: 12px;
        display: block;
    }

    .btn-submit {
        font-size: 1.2rem;
        padding: 12px;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .success-icon {
        font-size: 3rem;
    }
    
    .status-message {
        font-size: 0.9rem;
        padding: 10px;
    }

    .sponsor-logo {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .status-badge {
        font-size: 0.35rem;
        bottom: -5px;
        padding: 1px 5px;
    }
}