/* CSS Variables */
:root {
    --primary-color: #6c5ce7;
    --primary-dark: #5b4cdb;
    --secondary-color: #00cec9;
    --danger-color: #e74c3c;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --bg-color: #1a1a2e;
    --bg-secondary: #16213e;
    --card-bg: #0f3460;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--bg-secondary) 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Logo */
.logo {
    text-align: center;
    padding: 40px 0 30px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Input Groups */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid var(--primary-color);
}

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

.btn-link {
    background: none;
    color: var(--secondary-color);
    padding: 10px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: auto;
}

.btn-large {
    padding: 18px 32px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Lobby */
.lobby-header {
    text-align: center;
    margin-bottom: 24px;
}

.lobby-header h2 {
    margin-bottom: 16px;
}

.game-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 8px;
}

.game-code-display .code {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--secondary-color);
}

/* Players List */
.players-list {
    list-style: none;
    margin: 16px 0;
}

.players-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.player-name {
    font-weight: 600;
}

.player-badge {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary-color);
    margin-left: 6px;
}

.player-badge.host {
    background: var(--warning-color);
    color: #333;
}

.player-badge.you {
    background: var(--secondary-color);
    color: #333;
}

/* Host Controls */
.host-controls {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none !important;
}

.waiting-message {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* Role Card */
.role-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.role-card.crasher {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
}

.role-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.role-card .theme-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.role-card .role-hint {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* Locations Grid */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.location-item {
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    padding: 14px 28px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

/* Responsive */
@media (max-width: 400px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .role-card .theme-name {
        font-size: 1.5rem;
    }
}
