* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, #172643 0%, #09111f 55%, #050912 100%);
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
}

header {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 38px;
    background: rgba(13, 24, 43, .95);
    border-bottom: 1px solid #253550;
}

.brand {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 1px;
}

.studio-name {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #41506a;
    color: #a9b7cd;
}

main {
    width: 94%;
    max-width: 1250px;
    margin: 0 auto;
}

.screen {
    padding: 55px 0;
}

.hidden {
    display: none !important;
}

h1 {
    text-align: center;
    font-size: 42px;
    margin: 15px 0;
}

.lead {
    text-align: center;
    color: #aebbd1;
    font-size: 18px;
    margin-bottom: 45px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 390px));
    justify-content: center;
    gap: 32px;
}

.home-card {
    background: rgba(24, 36, 60, .93);
    border: 1px solid #293b5c;
    border-radius: 18px;
    padding: 38px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.home-card .icon {
    font-size: 42px;
}

.home-card h2 {
    font-size: 25px;
}

.home-card p {
    color: #afbdd2;
    min-height: 45px;
}

input {
    width: 100%;
    padding: 14px 15px;
    border-radius: 8px;
    border: 1px solid #384c6d;
    background: #101a2c;
    color: #fff;
    font-size: 15px;
    margin-bottom: 12px;
}

button {
    border: 0;
    background: #31415c;
    color: #fff;
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.12);
}

.primary {
    background: #e1252d;
}

.secondary {
    background: #1866d1;
}

.danger {
    background: #c41920;
}

.preview-box {
    width: min(850px, 100%);
    margin: 30px auto;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 20px 70px rgba(0,0,0,.4);
}

.preview-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.message {
    text-align: center;
    color: #b7c5d9;
    padding: 16px;
}

.studio-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.studio-top h2 {
    margin: 0 0 8px;
}

.room-info {
    background: #18253c;
    padding: 12px 18px;
    border-radius: 8px;
}

.status {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 13px;
}

.status.waiting {
    background: #5b4617;
    color: #ffda71;
}

.status.connected {
    background: #124d35;
    color: #63e5a9;
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.video-card {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid #263b5d;
}

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

#localVideo {
    transform: scaleX(-1);
}

.nameplate {
    position: absolute;
    left: 13px;
    bottom: 13px;
    background: rgba(0,0,0,.72);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.waiting-box {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8e9eb6;
    background: #111b2d;
}

.waiting-icon {
    font-size: 45px;
    margin-bottom: 10px;
}

.invite-panel {
    margin-top: 20px;
    background: #142136;
    border: 1px solid #283c5c;
    border-radius: 12px;
    padding: 18px;
}

.invite-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.invite-row input {
    margin: 0;
}

.studio-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

.ended-box {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    background: #17253d;
    padding: 50px;
    border-radius: 18px;
}

@media(max-width: 800px) {

    .home-grid,
    .video-grid {
        grid-template-columns: 1fr;
    }

    .studio-top {
        display: block;
    }

    .room-info {
        margin-top: 15px;
    }

    h1 {
        font-size: 32px;
    }

    header {
        padding: 0 20px;
    }
}
