/* styles.css */

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 600px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    background: #fff;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}

header {
    display: flex;
    justify-content: flex-end;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
}

.intro {
    text-align: center;
}

.intro h1 {
    margin-bottom: 20px;
}

#player-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#player-form input, #player-form select {
    padding: 10px;
    font-size: 1em;
}

#player-form button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #007bff;
    border: none;
    color: #fff;
    border-radius: 4px;
}

#player-form button:hover {
    background-color: #0056b3;
}

.game {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 10px;
}

.cell {
    width: 100px;
    height: 100px;
    background: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
    transition: background 0.3s;
}

#reset-btn {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #dc3545;
    border: none;
    color: #fff;
    border-radius: 4px;
}

#reset-btn:hover {
    background-color: #c82333;
}

.result {
    display: none;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 20px;
}

.dark-mode {
    background-color: #1e1e1e;
    color: #f0f0f0;
}

.dark-mode .container {
    background-color: #2c2c2c;
}

.dark-mode .cell {
    background: #444444;
}

.dark-mode #player-form button,
.dark-mode #reset-btn {
    background-color: #444444;
    color: #f0f0f0;
    border: 1px solid #f0f0f0;
}

.dark-mode #player-form button:hover,
.dark-mode #reset-btn:hover {
    background-color: #666666;
}

.dark-mode #theme-toggle {
    color: #f0f0f0;
}

.dark-mode .intro h1 {
    color: #f0f0f0;
}

/* Winning animation */
@keyframes drop {
    0% { transform: translateY(-100vh) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(720deg); }
}

.confetti-piece {
    width: 10px;
    height: 30px;
    background: #ff3;
    position: absolute;
    top: -100px;
    animation: drop 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.1s);
}

.confetti-piece:nth-child(even) { background: #3f3; }
.confetti-piece:nth-child(odd) { background: #f3f; }