:root {
    --bg-dark: #0f111a;
    --primary: #4e54c8;
    --primary-glow: #8f94fb;
    --accent: #ff4757;
    --text-main: #f1f2f6;
    --text-muted: #a4b0be;
    --success: #2ed573;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: radial-gradient(circle at top, #1a1c29 0%, #0f111a 100%);
}

#app-container {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Typografia i Menu */
.menu-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.game-title {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(143, 148, 251, 0.5);
    text-align: center;
    width: 100%;
}

.game-title .accent {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.subtitle {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.4);
}

.btn-secondary {
    background: #2f3542;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn:active {
    transform: scale(0.95);
}

.btn-block {
    width: 100%;
}

/* GAME UI */
.game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.screen-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Safely center items */
    gap: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary-glow);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    flex-wrap: wrap;
}

input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

input[type="text"]:focus {
    border-color: var(--primary-glow);
}

.gender-toggle {
    display: flex;
    gap: 10px;
    width: 100%;
}

.gender-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: bold;
}

.gender-toggle input[type="radio"] {
    display: none;
}

.gender-toggle input[type="radio"]:checked + label {
    background: var(--primary);
    color: white;
    border-color: var(--primary-glow);
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.2);
    padding: 10px 15px;
    border-radius: 10px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #2f3542;
    border: 2px solid var(--primary);
}

.remove-btn {
    color: var(--accent);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Secret role screen */
.role-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 30px 0;
}

.avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 4px solid var(--primary-glow);
}

.secret-word-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    border-radius: 10px;
    border: 1px dashed var(--success);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--success);
}

.impostor-box {
    border-color: var(--accent);
    color: var(--accent);
}

.voting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:active, .vote-btn.selected {
    border-color: var(--accent);
    background: rgba(255, 71, 87, 0.1);
    transform: scale(0.95);
}

.vote-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

footer {
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
