* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Tahoma, "Vazirmatn", sans-serif;
    background: #202124;
    color: #e8eaed;
    direction: rtl;
}

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.card {
    background: #292a2d;
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.card h1 {
    margin-top: 0;
    font-size: 22px;
    text-align: center;
}

.card p.subtitle {
    text-align: center;
    color: #9aa0a6;
    margin-top: -8px;
    margin-bottom: 24px;
    font-size: 14px;
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #bdc1c6;
}

input[type=text] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid #5f6368;
    background: #202124;
    color: #e8eaed;
    font-size: 15px;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    padding: 10px 16px;
}

.btn-primary {
    width: 100%;
    background: #8ab4f8;
    color: #202124;
    font-weight: bold;
}

.btn-primary:hover { background: #aecbfa; }

.hint {
    font-size: 12px;
    color: #9aa0a6;
    text-align: center;
    margin-top: 14px;
}

/* room page */
.room-wrap {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    padding: 10px 16px;
    font-size: 14px;
    color: #bdc1c6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-code-badge {
    background: #3c4043;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
}

#videos {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    padding: 8px;
    overflow-y: auto;
    align-content: start;
}

.video-tile {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-tile .name-tag {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: #202124;
}

.ctrl-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #3c4043;
    color: #e8eaed;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn.active-off {
    background: #ea4335;
}

.ctrl-btn.leave {
    background: #ea4335;
    width: auto;
    padding: 0 24px;
    border-radius: 26px;
}
