:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #334155;
    --secondary-hover: #475569;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --highlight: #10b981;
}

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

body {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
.logo {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--primary), #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.view-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.highlight-text {
    color: var(--highlight);
    font-weight: 700;
}
.danger-text {
    color: var(--danger);
    font-weight: 700;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: white;
}

.btn:active {
    transform: scale(0.98);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary-btn {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.secondary-btn {
    background: var(--secondary);
}
.secondary-btn:hover:not(:disabled) {
    background: var(--secondary-hover);
}

.danger-btn {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
.danger-btn:hover:not(:disabled) {
    background: var(--danger-hover);
}

.icon-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    width: auto;
}

/* Forms */
input, select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, select:focus {
    border-color: var(--primary);
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}
.join-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    margin: 10px 0;
}
.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--glass-border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* Lists */
ul {
    list-style: none;
}
ul li {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
ul li:last-child {
    border-bottom: none;
}
.players-list {
    margin-top: 20px;
    max-height: 50vh;
    overflow-y: auto;
}
.players-list h3 {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Voting List */
#list-voting-players li {
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
    margin-bottom: 5px;
    border: 1px solid transparent;
}
#list-voting-players li:hover {
    background: rgba(255, 255, 255, 0.05);
}
#list-voting-players li.selected {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
}

/* Views & States */
.view {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeIn 0.3s ease forwards;
}
.view.active {
    display: flex;
}
.hidden {
    display: none !important;
}

.status-msg {
    text-align: center;
    color: var(--text-muted);
    margin: 20px 0;
    font-style: italic;
}

/* Overlays & Modals */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease forwards;
}
.modal {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal h2, .modal h3 {
    margin-bottom: 10px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Specific UI elements */
.room-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.timer-container {
    text-align: center;
    margin-bottom: 30px;
}
#game-timer {
    font-size: 4rem;
    font-variant-numeric: tabular-nums;
    margin-top: 10px;
}

.role-card {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
    border-top: 4px solid var(--primary);
}
.role-card.imposter {
    border-top-color: var(--danger);
}
.role-card.imposter h2 {
    color: var(--danger);
}
.role-card h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--highlight);
}
.role-card .secret-word-display {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 20px 0;
    letter-spacing: 1px;
}

.lang-selector {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
}
.lang-selector a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.2s;
}
.lang-selector a.active, .lang-selector a:hover {
    color: var(--primary);
    font-weight: 700;
}

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