/* css */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: rgb(31, 30, 30);
}

.red {
    color: red !important;
}

.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px;
    color: #fff;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
}

.room-header a {
    color: #fff;
    text-decoration: none;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
    transition: 0.3s;
}

.room-header a:hover {
    cursor: pointer;
    transform: scale(1.1);
}

.room-header button,
.channel-enter {
    padding: 8px 14px;
    background-color: #2d8cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}

.room-header button:hover,
.channel-enter:hover {
    background-color: #1761b6;
}

.channel-page {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0;
    color: #fff;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.channel-header h1 {
    margin: 0 0 10px;
    font-size: 36px;
}

.channel-header p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
}

.channel-warning {
    color: #ffb86c !important;
}

.channel-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.channel-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(248, 248, 248, 0.219);
    border-radius: 8px;
    background-color: rgb(44, 43, 43);
}

.channel-card h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.channel-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

#canvas {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
}
#video-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.video-tile {
    position: relative;
    height: 300px;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(20, 20, 20);
    color: #fff;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.video-tile video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    background-color: #000;
}

.video-tile:fullscreen {
    width: 100vw;
    height: 100vh !important;
    min-width: 0;
    background-color: #000;
}

.video-tile:fullscreen video {
    width: 100%;
    height: 100%;
}

.fullscreen-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 6px 10px;
    background-color: rgba(0, 0, 0, 0.72);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    cursor: pointer;
}

.fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.cursor-overlay {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.shared-cursor {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 1;
    transform: translate(0, 0);
    transition: opacity 0.18s ease;
}

.shared-cursor.is-idle {
    opacity: 0.32;
}

.shared-cursor-pointer {
    width: 0;
    height: 0;
    border-left: 9px solid var(--cursor-color);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.shared-cursor-label {
    max-width: 120px;
    padding: 3px 6px;
    overflow: hidden;
    color: #fff;
    background-color: var(--cursor-color);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.voice-placeholder {
    font-size: 20px;
}

.chat-panel {
    margin: 0 24px 12px;
    padding: 14px;
    border-top: 1px solid rgba(248, 248, 248, 0.219);
    background-color: rgb(38, 37, 37);
    color: #fff;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.chat-header h2 {
    margin: 0;
    font-size: 18px;
}

.chat-header p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.7);
}

.chat-header label {
    display: grid;
    gap: 4px;
    min-width: 160px;
    font-size: 14px;
}

.chat-header input,
.chat-form textarea {
    background-color: rgb(20, 20, 20);
    color: #fff;
    border: 1px solid rgba(248, 248, 248, 0.219);
    border-radius: 6px;
    font: inherit;
}

.chat-header input {
    padding: 7px 9px;
}

.chat-messages {
    height: 160px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    overflow-y: auto;
}

.chat-message {
    padding: 7px 0;
    border-bottom: 1px solid rgba(248, 248, 248, 0.1);
}

.chat-message-meta {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

.chat-message-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-form textarea {
    flex: 1;
    min-height: 42px;
    max-height: 90px;
    padding: 8px 10px;
    resize: vertical;
}

.chat-form button {
    padding: 0 18px;
    background-color: #2d8cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}

.chat-form button:hover {
    background-color: #1761b6;
}

#main {
    display: flex;
    height: 100vh;
    justify-content: space-between;
    flex-direction: column;
    background-color: rgb(31, 30, 30);
}

#buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 1px 0;
    background-color: rgb(44, 43, 43);
    border-top: 1px solid rgba(248, 248, 248, 0.219);
}

#buttons div {
    padding: 10px 20px;
    font-family:
        'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 18px;
    color: #fff;
    border-radius: 10px;
    border: 1px solid rgba(248, 248, 248, 0.219);
}

#buttons div:hover {
    cursor: pointer;
}

#buttons div:active {
    transform: scale(0.95);
}

#destroyPeer {
    background-color: rgb(177, 14, 14);
}

#destroyPeer:hover {
    background-color: rgb(197, 22, 22);
}

#videoOptions {
    display: flex;
    justify-content: space-around;
    border: none !important;
}

#videoOptions:active {
    transform: none !important;
}

#toggleVideo {
    background-color: rgb(58, 57, 57);
    margin: 0 5px 0;
}
#toggleVideo:hover {
    background-color: rgb(65, 64, 64);
}

#shareScreen {
    background-color: rgb(58, 57, 57);
    margin: 0 5px 0;
}

#shareScreen:hover {
    background-color: rgb(65, 64, 64);
}

#toggleAudio {
    background-color: rgb(58, 57, 57);
}

#toggleAudio:hover {
    background-color: rgb(65, 64, 64);
}

/* utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

#join-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
}

#join-btn button {
    padding: 14px 36px;
    font-size: 1.2rem;
    background-color: #2d8cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition:
        background-color 0.2s,
        transform 0.1s;
    outline: none;
}

#join-btn button:hover,
#join-btn button:focus {
    background-color: #1761b6;
    transform: translateY(-2px) scale(1.03);
}

#join-btn.vanish {
    display: none !important;
}
