*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --color-bg: #bfefff;
    --color-bg-card: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #666;
    --color-primary: #0066cc;
    --color-primary-hover: #0052a3;
    --color-border: #ddd;
    --color-success: #22c55e;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin: 0 0 2rem;
    font-weight: 700;
}

.welcome {
    text-align: center;
}

.join-form {
    background: var(--color-bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.join-form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--color-text-muted);
}

.join-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.join-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.join-form button {
    width: 100%;
    padding: 0.875rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.join-form button:hover {
    background: var(--color-primary-hover);
}

.join-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hint {
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.room-container {
    width: 100%;
    max-width: 600px;
}

.room-header {
    text-align: center;
    margin-bottom: 2rem;
}

.room-header h1 {
    margin-bottom: 0.5rem;
}

.room-url {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

.card {
    background: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.player-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.player-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-list li:last-child {
    border-bottom: none;
}

.player-list .you {
    font-weight: 600;
}

.player-list .status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
}

.name-form {
    display: flex;
    gap: 0.5rem;
}

.name-form input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
}

.name-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.name-form button {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.name-form button:hover {
    background: var(--color-primary-hover);
}

.empty-state {
    color: var(--color-text-muted);
    font-style: italic;
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}

.loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem;
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .join-form, .card {
        padding: 1.5rem;
    }
}
