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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(46, 204, 113, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(52, 152, 219, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(155, 89, 182, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Nickname Screen */
#nickname-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.logo h1 {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    background: linear-gradient(135deg, #2ecc71, #3498db, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 0.1em;
}

.logo .subtitle {
    display: block;
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    letter-spacing: 0.5em;
    margin-bottom: 3rem;
}

.nick-form {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
    padding: 0 1rem;
}

.nick-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #1a1a3a;
    border-radius: 12px;
    background: #111128;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.nick-form input:focus {
    border-color: #2ecc71;
}

.nick-form input::placeholder {
    color: #555;
}

.nick-form button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.nick-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* Games Screen */
#games-screen {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h2 {
    font-size: 1.8rem;
    font-weight: 300;
    color: #ccc;
}

header h2 span {
    color: #2ecc71;
    font-weight: 600;
}

.header-sub {
    color: #666;
    margin-top: 0.5rem;
    font-size: 1rem;
}

#games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.game-tile {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #111128, #1a1a3a);
    border: 2px solid #1e1e40;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.game-tile:hover {
    border-color: #2ecc71;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(46, 204, 113, 0.15);
}

.game-tile:hover::before {
    opacity: 1;
}

.tile-icon {
    flex-shrink: 0;
}

.tile-info {
    flex: 1;
}

.tile-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.3rem;
}

.tile-info p {
    color: #888;
    font-size: 0.9rem;
}

.tile-players {
    flex-shrink: 0;
    background: #0a0a1a;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #2ecc71;
    font-weight: 600;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #e74c3c;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    z-index: 1000;
    transition: transform 0.3s;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 3rem;
    }
    .nick-form {
        flex-direction: column;
    }
    .game-tile {
        padding: 1.2rem 1.5rem;
    }
}
