:root {
    color-scheme: light dark;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fg: #1c1c1e;
    --muted: #8a8a8e;
    --line: #e5e5ea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 3rem 1.5rem;
    background: #fff;
    color: var(--fg);
    line-height: 1.5;
}

main {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

#app-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

#app-content[hidden],
#login-card[hidden] {
    display: none;
}

h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.user-box[hidden] {
    display: none;
}

#user-name {
    font-weight: 500;
    white-space: nowrap;
}

.card {
    padding: 0;
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
}

input {
    padding: 0.6rem 0;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 1rem;
    color: var(--fg);
    background: transparent;
}

input:focus {
    outline: none;
    border-bottom-color: var(--fg);
}

button {
    padding: 0.55rem 1rem;
    border: 1px solid var(--fg);
    border-radius: 6px;
    background: var(--fg);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

button:hover {
    opacity: 0.75;
}

button#refresh-btn,
button#join-cancel,
#logout-btn {
    background: transparent;
    color: var(--fg);
    border-color: var(--line);
}

button#refresh-btn:hover,
button#join-cancel:hover,
#logout-btn:hover {
    opacity: 1;
    border-color: var(--fg);
}

ul {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

li:first-child {
    border-top: 1px solid var(--line);
}

.room-info {
    display: flex;
    flex-direction: column;
}

.room-name {
    font-weight: 500;
}

.room-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

dialog {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.75rem;
    max-width: 400px;
    width: 90%;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.25);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.error {
    color: #d70015;
}