:root {
    color-scheme: dark;
    font:
        16px/1.5 system-ui,
        sans-serif;
    background: #101521;
    color: #edf3ff;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
main {
    max-width: 1180px;
    padding: 24px;
    margin: auto;
}
header,
.row,
nav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
header {
    justify-content: space-between;
    margin-bottom: 24px;
}
h1 {
    font-size: 1.6rem;
    margin: 0;
}
h2 {
    font-size: 1.2rem;
}
a {
    color: #9bc5ff;
}
button,
input,
select {
    font: inherit;
    border: 1px solid #465573;
    border-radius: 8px;
    padding: 10px 14px;
    color: inherit;
    background: #202c43;
}
button {
    cursor: pointer;
}
button:hover:not(:disabled) {
    border-color: #a2c5ff;
    background: #2e4366;
}
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
input:not([type='checkbox']):not([type='range']),
select {
    max-width: 100%;
}
input[type='checkbox'] {
    width: 20px;
    height: 20px;
}
label {
    display: flex;
    align-items: center;
    gap: 8px;
}
form {
    display: grid;
    gap: 16px;
}
.field {
    display: grid;
    gap: 5px;
}
section,
.panel {
    background: #171f30;
    border: 1px solid #2e3c56;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}
.login {
    max-width: 430px;
    margin: 12vh auto;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.card {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 160px;
}
.card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
}
.muted,
small {
    color: #a4b2cd;
}
.danger {
    border-color: #d86d78;
}
.primary {
    background: #275ab8;
}
.badge {
    background: #294939;
    border-radius: 20px;
    padding: 3px 12px;
}
#notice {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30000;
    max-width: 90vw;
    border-radius: 10px;
    background: #293449;
    padding: 10px 16px;
    pointer-events: none;
}
#notice:empty {
    display: none;
}
.stream {
    position: fixed;
    inset: 0;
    background: #05080e;
    z-index: 100;
}
.stream canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.stream.fill canvas {
    object-fit: cover;
}
.stream .waiting {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
    color: #adc3e6;
}
.stream .touch-toolbar {
    z-index: 200;
}
.stream .touch-toolbar,
.stream .touch-toolbar:not(.is-open) {
    max-width: calc(100% - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right)));
}
.stream .touch-toolbar > .room-quick-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.room-quick-actions [data-action='microphone'] {
    min-width: 44px;
    min-height: 44px;
}
.room-quick-actions [data-state='on'] {
    background: #22613e;
}
.room-quick-actions [data-state='pending'] {
    background: #594115;
}
.stream .touch-toolbar label {
    font-size: 12px;
}
.stream [hidden] {
    display: none !important;
}
.touch-gamepad {
    pointer-events: none;
}
.touch-control {
    pointer-events: auto;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 10px;
    border-bottom: 1px solid #35425a;
    text-align: left;
}
.editor-preview {
    position: relative;
    width: min(100%, 900px);
    aspect-ratio: 16/9;
    background: #26344d;
    margin: 16px auto;
}
.editor-preview.portrait {
    width: min(80vw, 320px);
    aspect-ratio: 9/16;
}
dialog {
    color: inherit;
    background: #171f30;
    border: 1px solid #526482;
    border-radius: 12px;
    width: min(960px, 95vw);
    max-height: 95dvh;
    overflow: auto;
}
dialog::backdrop {
    background: #000b;
}
.grant-list {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding: 8px 0;
}
@media (max-width: 600px) {
    main {
        padding: 14px;
    }
    section {
        padding: 14px;
    }
    .row > * {
        max-width: 100%;
    }
}
