* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body {
    /* Приємний сучасний градієнтний фон */
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-y: auto; /* Дозволяє скрол, якщо екран малий */
    padding: 15px;
}

#app {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.85); /* Напівпрозора біла картка */
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    padding: 25px 20px;
    margin: auto; /* Відцентрує по вертикалі, якщо є місце */
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

.screen {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.screen.active {
    display: flex;
}

label {
    font-weight: 600;
    font-size: 16px;
    color: #4a5568;
    margin-bottom: -10px;
}

textarea {
    width: 100%;
    padding: 15px;
    background: #ffffff;
    color: #333;
    border: 2px solid #cbd5e0;
    border-radius: 16px;
    font-size: 18px;
    resize: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

textarea:focus {
    outline: none;
    border-color: #8ec5fc;
}

button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px; /* Сучасні круглі кнопки */
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    touch-action: manipulation;
}

button:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.4);
}

button:disabled {
    background: #a0aec0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: #ffffff;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.checkbox-group label, .radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 16px;
    margin: 0;
    cursor: pointer;
}

input[type="radio"], input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #764ba2;
}

.highlight {
    color: #e53e3e; /* Червоний колір для імен та шпигуна */
    font-size: 36px;
    font-weight: 800;
}

#reveal-area {
    width: 100%;
    height: 35vh; /* Фіксована висота, щоб не з'їжджала кнопка */
    min-height: 250px;
    background-color: #edf2f7;
    border: 3px dashed #cbd5e0;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    touch-action: none;
    overflow: hidden;
}

#reveal-hint {
    font-size: 18px;
    color: #718096;
    font-weight: bold;
    pointer-events: none;
}

#reveal-content {
    display: none;
    /* 0.15 означає 15% видимості білого кольору */
    background: rgba(255, 255, 255, 0.15); 
    /* Додаємо легке розмиття картинки під текстом для читабельності */
    backdrop-filter: blur(6px); 
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    /* Додаємо білу тінь тексту, щоб він не зливався з темними картинками */
    text-shadow: 0px 0px 5px rgba(255, 255, 255, 0.9);
}

#role-title { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
#role-subtitle { font-size: 20px; color: #4a5568; }
#role-extra { font-size: 16px; color: #e53e3e; margin-top: 10px; font-weight: bold; }

#hint-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

#hint-box p {
    color: #718096;
    margin-bottom: 10px;
    font-size: 14px;
}

#spy-list {
    list-style: none;
    font-size: 24px;
    color: #e53e3e;
    font-weight: bold;
    padding: 20px;
    background: #fff5f5;
    border-radius: 16px;
}
