:root {
    --bg-gradient: linear-gradient(to right, #fdfbfb, #ebedee);
    --container-bg: rgba(255, 255, 255, 0.9);
    --text-color: #333;
    --number-bg: #eee;
    --number-text: #333;
    --btn-bg: #ff4081;
    --btn-hover: #f50057;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --modal-bg: white;
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(to right, #2c3e50, #000000);
    --container-bg: rgba(255, 255, 255, 0.1);
    --text-color: white;
    --number-bg: white;
    --number-text: #333;
    --btn-bg: #ff4081;
    --btn-hover: #f50057;
    --nav-bg: rgba(0, 0, 0, 0.5);
    --modal-bg: #333;
}

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--bg-gradient);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

/* Navigation */
nav {
    width: 100%;
    padding: 15px 0;
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-logo {
    margin-left: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 15px;
    margin-right: 20px;
    align-items: center;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background-color: rgba(128, 128, 128, 0.2);
}

.auth-buttons button {
    margin-left: 10px;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--text-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.auth-buttons button.primary {
    background-color: var(--btn-bg);
    color: white;
    border: none;
}

/* Main Content Layout */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 80px; /* Space for fixed nav */
    padding-bottom: 20px;
}

.container {
    text-align: center;
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
}

/* Sections */
.content-section {
    display: none;
    animation: fadeIn 0.5s;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

h1 {
    margin-bottom: 30px;
}

/* Lotto Styles */
.lotto-numbers {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.number {
    width: 50px;
    height: 50px;
    background-color: var(--number-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--number-text);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-btn {
    padding: 15px 30px;
    font-size: 18px;
    color: white;
    background-color: var(--btn-bg);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(255, 64, 129, 0.4);
}

.action-btn:hover {
    background-color: var(--btn-hover);
    box-shadow: 0 8px 20px rgba(255, 64, 129, 0.6);
}

/* Mini Game Styles */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.rps-choices {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.rps-btn {
    font-size: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--text-color);
    background: var(--container-bg);
    cursor: pointer;
    transition: transform 0.2s;
}

.rps-btn:hover {
    transform: scale(1.1);
}

.game-result {
    font-size: 1.5rem;
    font-weight: bold;
    min-height: 2em;
}

.score-board {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 30px;
    border-radius: 10px;
    width: 300px;
    position: relative;
    color: var(--text-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Button Group */
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Character Styles */
.character {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 150px;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 500;
    pointer-events: none;
    display: block !important; /* Override hidden if set via class but we want transition */
    opacity: 0; /* Hidden by default via opacity */
}

.character.show {
    opacity: 1;
    bottom: 20%;
    animation: shake 0.5s ease-in-out infinite;
}

.character.tear-action {
    animation: swipe 0.2s forwards;
}

@keyframes shake {
    0% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-5deg); }
    75% { transform: translateX(-50%) rotate(5deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

@keyframes swipe {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2) rotate(-10deg); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Tearing Animation for Lotto Numbers */
.lotto-numbers.destroyed {
    animation: rip 0.8s forwards;
}

@keyframes rip {
    0% { transform: scale(1); opacity: 1; }
    20% { transform: scale(1.1) rotate(5deg); }
    40% { transform: scale(1.1) rotate(-5deg); }
    100% { transform: translateY(200px) rotate(20deg); opacity: 0; }
}

.character.hidden {
    display: none !important;
}