/* ===== Base & Reset ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden { display: none !important; }

/* ===== Main Box ===== */
.main-box {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto;
    max-height: 85vh;
    min-height: 300px;
}

.login-box {
    height: auto;
    min-height: auto;
    padding: 40px;
}

/* ===== Header ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 12px 15px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 15px 0;
}

/* ===== Lobby ===== */
.lobby-container {
    margin: 12px 15px;
    padding: 10px;
    min-height: 50px;
}

/* ===== Room List ===== */
.room-list { list-style: none; }

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

/* ===== Positioning ===== */
.top-controls {
    position: fixed;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 50;
}

.footer-links {
    position: fixed;
    bottom: 10px;
    left: 20px;
    z-index: 50;
}

/* ===== Theme Switch ===== */
.theme-switch-container {
    position: fixed;
    bottom: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 50;
}

/* ===== Modal ===== */
.modal-overlay,
.room-pw-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.legal-overlay {
    z-index: 1100;
}

.modal {
    width: 90%;
    max-width: 450px;
    padding: 25px;
}

/* ===== Flex Utilities ===== */
.lobby-user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 10px;
}

.header-controls {
    display: flex;
    gap: 6px;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.form-group {
    margin-bottom: 5px;
}
