@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    --background-color-light: #f0f2f5;
    --container-bg-light: #ffffff;
    --primary-color-light: #4a90e2;
    --secondary-color-light: #50e3c2;
    --text-color-light: #333;
    --shadow-color-light: rgba(0, 0, 0, 0.1);
    
    --background-color-dark: #121212;
    --container-bg-dark: #1e1e1e;
    --primary-color-dark: #bb86fc;
    --secondary-color-dark: #03dac6;
    --text-color-dark: #e0e0e0;
    --shadow-color-dark: rgba(255, 255, 255, 0.1);

    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color-light);
    color: var(--text-color-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-image: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%);
    transition: background-color 0.3s, color 0.3s;
}

body[data-theme='dark'] {
    background-color: var(--background-color-dark);
    color: var(--text-color-dark);
    background-image: linear-gradient(120deg, #37474f 0%, #263238 100%);
}

header {
    width: 100%;
    background: var(--primary-color-light);
    box-shadow: 0 2px 5px var(--shadow-color-light);
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    position: relative;
}

body[data-theme='dark'] header {
    background: var(--primary-color-dark);
    box-shadow: 0 2px 5px var(--shadow-color-dark);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: color 0.3s;
    padding: 1.5rem 1rem;
    display: block;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

nav a:hover::after, nav a.active::after {
    transform: scaleX(1);
}

#theme-toggle {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.container {
    background: var(--container-bg-light);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color-light);
    text-align: center;
    max-width: 800px;
    width: 100%;
    transition: background-color 0.3s;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

body[data-theme='dark'] .container {
    background: var(--container-bg-dark);
    box-shadow: 0 10px 30px var(--shadow-color-dark);
}

h1, h2 {
    color: var(--primary-color-light);
    margin-bottom: 2rem;
    font-weight: 600;
    transition: color 0.3s;
}

body[data-theme='dark'] h1, body[data-theme='dark'] h2 {
    color: var(--primary-color-dark);
}

.feature {
    margin-bottom: 2rem;
}

.lotto-machine {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    perspective: 1000px; /* For 3D effect */
}

.numbers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.number-ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: draw-ball 0.5s ease-out forwards;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.number-ball:hover {
    transform: translateY(-5px) scale(1.05);
}

@keyframes draw-ball {
    0% {
        transform: scale(0) rotateY(180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

.btn {
    background-image: linear-gradient(to right, var(--primary-color-light), var(--secondary-color-light));
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
    margin-top: 1rem;
    text-decoration: none;
}

body[data-theme='dark'] .btn {
    background-image: linear-gradient(to right, var(--primary-color-dark), var(--secondary-color-dark));
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.6);
}

body[data-theme='dark'] .btn:hover {
    box-shadow: 0 8px 20px rgba(187, 134, 252, 0.6);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.4);
}

body[data-theme='dark'] .btn:active {
    box-shadow: 0 4px 10px rgba(187, 134, 252, 0.4);
}

#lotto-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

#lotto-form input[type="email"] {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

#disqus_thread {
    margin-top: 4rem;
    width: 100%;
}

#rps-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#countdown {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--primary-color-light);
}

body[data-theme='dark'] #countdown {
    color: var(--primary-color-dark);
}

.game-choices {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    align-items: center;
}

.choice-display {
    font-size: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.choice-display .emoji {
    font-size: 3rem;
}

#result {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 1rem;
    color: var(--secondary-color-light);
}

body[data-theme='dark'] #result {
    color: var(--secondary-color-dark);
}


#webcam-container {
    margin-top: 1rem;
}

#label-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem 0;
    }
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        width: 100%;
    }
    nav a {
        padding: 1rem;
        width: 100%;
        text-align: center;
    }
    #theme-toggle {
        position: static;
        transform: none;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    h1 {
        font-size: 1.8rem;
    }
    .number-ball {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    .btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    .choice-display {
        font-size: 3rem;
    }
}
