:root {
    --bg-color: #1e1e2f;
    --text-color: #ffffff;
    --primary: #ff4757;
    --secondary: #2ed573;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    text-align: center;
}

.screen {
    display: none;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.input-group {
    display: flex;
    width: 100%;
    gap: 8px; /* Pienennetty väliä hieman kapeille näytöille */
    margin-bottom: 20px;
}

input[type="text"] {
    flex: 1 1 0%; /* Taikasana: pakottaa kentän kutistumaan tilan puuttuessa */
    min-width: 0;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

.btn-add {
    flex-shrink: 0; /* TÄMÄ ESTÄÄ NAPPIA PIILOUTUMASTA! */
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--secondary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-add:hover { background-color: #26b360; }

#player-list {
    list-style: none;
    margin-bottom: 30px;
}

#player-list li {
    background: rgba(255,255,255,0.1);
    margin: 5px 0;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-main {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--primary), #ff6b81);
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    transition: transform 0.2s;
}

.btn-main:hover { transform: translateY(-2px); }
.btn-main:disabled { background: gray; cursor: not-allowed; box-shadow: none; }

/* Wheel Styles */
.wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 30px auto;
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: white;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

#turn-display {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ffd32a;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal.active { display: flex; }

.modal-content {
    background: #2f3542;
    padding: 40px;
    border-radius: 15px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h2 { font-size: 2rem; margin-bottom: 15px; }
.modal-content p { font-size: 1.2rem; margin-bottom: 30px; line-height: 1.5; }

/* Bonus Effect */
.bonus-glow {
    animation: goldGlow 1.5s infinite alternate;
    background: linear-gradient(135deg, #ffd32a, #ff9f43);
    color: #000;
}
.bonus-glow .btn-main { background: #000; color: #ffd32a; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes goldGlow { from { box-shadow: 0 0 10px #ffd32a; } to { box-shadow: 0 0 40px #ffd32a, 0 0 20px #ff9f43; } }

/* Pelaajan nimi modaalissa */
.modal-player {
    font-size: 1.2rem;
    color: var(--secondary); /* Käyttää teeman vihreää väriä */
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}