* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a0033 0%, #2d0052 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
}

.screen {
    display: none;
    background: #1a0033;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 40px;
    animation: fadeIn 0.3s ease-in;
    border: 2px solid #ffd700;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    color: #ffd700;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h2 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hidden {
    display: none !important;
}

.setup-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #ffd700;
    font-size: 1.1em;
}

.form-group input[type="number"],
.form-group textarea {
    padding: 12px;
    border: 2px solid #6b0080;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
    background: #2d0052;
    color: #ffd700;
}

.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.roles-setup {
    background: #f5f5f500;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #ffd700;
}

.roles-setup h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: white;
}

.role-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: #1a0033;
    border-radius: 8px;
    border: 1px solid #6b0080;
}

.role-input label {
    font-weight: 500;
    color: white;
    flex: 1;
}

.role-input input {
    width: 70px;
    padding: 8px;
    border: 2px solid #ffd700;
    border-radius: 6px;
    text-align: center;
    font-size: 1em;
}

.role-input input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.btn-primary,
.btn-secondary,
.btn-next,
.btn-role {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #6b0080, #2d0052);
    color: #ffd700;
    width: 100%;
    margin-top: 20px;
    border: 2px solid #ffd700;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #8b0099, #3d0066);
}

.btn-secondary,
.btn-next {
    background: #1a1a1a;
    color: #ffd700;
    border: 2px solid #ffd700;
}

.btn-secondary:hover,
.btn-next:hover {
    background: #333333;
    border-color: #ffed4e;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.btn-role {
    background: linear-gradient(135deg, #6b0080, #4a0066);
    color: #ffd700;
    width: 100%;
    font-size: 1.3em;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #ffd700;
}

.btn-role:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #8b0099, #5a0080);
}

.btn-next {
    width: 100%;
    background: linear-gradient(135deg, #6b0080, #4a0066);
    color: #ffd700;
    border: 2px solid #ffd700;
    font-size: 1.2em;
    padding: 18px;
    margin-top: 20px;
}

.btn-next:hover {
    background: linear-gradient(135deg, #8b0099, #5a0080);
}

.btn-next.hidden {
    display: none;
}

.btn-secondary {
    align-self: flex-start;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #ffd700;
}

.game-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: #ffd700;
}

.game-content {
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.role-display {
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.role-display.hidden {
    display: none;
}

.role-card {
    background: linear-gradient(135deg, #6b0080 0%, #3d0066 100%);
    color: white;
    padding: 50px 30px;
    border-radius: 20px;
    text-align: center;
    font-size: 1.3em;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease-out;
    border: 3px solid #ffd700;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.role-card .role-name {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
}

.role-card .role-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: white;
}

.role-card .role-emoji {
    font-size: 3em;
    margin-bottom: 15px;
}

.error-message {
    color: #d32f2f;
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
}

.message {
    margin-top: 20px;
    font-size: 1.1em;
    color: #ffd700;
    text-align: center;
    min-height: 30px;
}

.game-footer {
    margin-top: 20px;
    text-align: center;
}

.roles-review {
    background: #2d0052;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #6b0080;
}

.role-item {
    background: #1a0033;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.role-item strong {
    color: #ffd700;
}

@media (max-width: 500px) {
    .screen {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .btn-secondary {
        align-self: center;
    }

    .role-card {
        min-width: 250px;
        padding: 30px 20px;
    }
}
