:root {
    --primary-red: #bc1823;
    --dark-red: #973549;
    --white: #FFFFFF;
    --black: #000000;
    --gray: #6C6B80;
    --light-gray: #F5F5F5;
    --pointer-color: #9AD0E6;
    --font-primary: 'Open Sans', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
}

input:invalid {
    border-color: #FF0000;
    outline: none;
}

input:focus:invalid {
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}


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

body {
    font-family: var(--font-primary);
    background-color: var(--primary-red);
    min-height: 100vh;
    overflow-x: hidden;
}

.main-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('background_wide.png');
    /* background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px); */
    /* background-size: 50px 50px; */
    background-position: 0 0, 25px 25px;
    z-index: -1;
}

.background-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-image: 
        linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%); */
    /* background-size: 30px 30px; */
    background-position: 0 0, 0 15px, 15px -15px, -15px 0px;
}

/* Content Wrapper */
.content-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 5px;
    z-index: 1;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    max-width: 110px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Typography */
.main-title {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--black);
    text-align: center;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.description {
    color: var(--black);
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Form Section */
.form-section {
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 100vh; */
}

.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.registration-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.form-group select {
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn-jogar {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--white);
}

.btn-girar {
    background: var(--white);
    color: var(--black);
}

.btn-jogar,
.btn-girar {
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-jogar::before,
.btn-girar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-jogar:hover::before,
.btn-girar:hover::before {
    left: 100%;
}

.btn-jogar:hover,
.btn-girar:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 0, 0, 0.4);
}

.btn-jogar:active,
.btn-girar:active {
    transform: translateY(0);
}

/* Wheel Section */
.wheel-section {
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 100vh; */
    flex-direction: column;
}

.wheel-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.wheel-wrapper {
    position: relative;
    display: inline-block;
    margin: 40px 0;
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 8px solid var(--dark-red);
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    z-index: 10;
    color: var(--pointer-color);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border: 4px solid var(--dark-red);
    z-index: 5;
}

.center-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
}

button.btn-jogar.disabled {
    background: #868585;
    color: #ffffff;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    transition: none;
    transform: none;
}

#wheel-canvas {
  transition: transform 3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Spinning Animation */
@keyframes spin-wheel {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(var(--final-rotation));
    }
}

.wheel-spinning {
    transition: transform 3s cubic-bezier(0.23, 1, 0.32, 1);
    transform: rotate(var(--final-rotation));
}

/* Result Section */
.result-section {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 10;
  padding: 15px;
  text-align: center;
}

.result-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    /* width: 100%; */
    text-align: center;
    backdrop-filter: blur(10px);
    margin: 0 auto;
}

.result-title {
    font-family: var(--font-secondary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-red);
}

.result-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--black);
    margin-bottom: 30px;
}

.prize-display {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--white);
    padding: 20px;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.3);
}

/* Confetti Animation */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-red);
    animation: confetti-fall 3s linear infinite;
}

.confetti:nth-child(odd) {
    background: var(--white);
    border-radius: 50%;
}

.confetti:nth-child(3n) {
    background: var(--dark-red);
    transform: rotate(45deg);
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .background-pattern {
        background: url('background.png');
    }

    .form-container,
    .result-container {
        padding: 20px 15px;
        margin: 15px;
    }

    /* #wheel-canvas {
        width: 300px;
        height: 300px;
    } */

    .wheel-center {
        width: 60px;
        height: 60px;
    }

    .center-logo {
        width: 45px;
        height: 45px;
    }

    .wheel-pointer {
        width: 45px;
        height: 45px;
        top: -15px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }

    .background-pattern {
        background: url('background.png');
    }

    .description {
        font-size: 1rem;
    }

    #wheel-canvas {
        width: 350px;
        height: 350px;
    }

    .btn-jogar,
    .btn-girar {
        padding: 15px 30px;
        font-size: 1rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-loading {
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}