html:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) { overflow: hidden; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) {
    height: 100dvh;
    margin: 0;
    padding: 4px 8px;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) .header-inner { padding: 0; gap: 6px; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #settings {
    display: inline-flex;
    gap: 4px;
    max-width: min(48vw, 16rem);
    white-space: nowrap;
}
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #display-name { overflow: hidden; text-overflow: ellipsis; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) .page,
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #room-view {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) .page { grid-template-rows: auto minmax(0, 1fr); }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #room-view { grid-row: 2; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #room-header { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #room-phase { display: none; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #room-title { font-size: 1rem; margin: 0; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) .room-tools { min-width: 0; gap: 4px 8px; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #table-details { margin: 0; position: relative; z-index: 2; width: fit-content; }
.table-details > .room-details-content {
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: 0;
    box-sizing: border-box;
    width: min(24rem, calc(100vw - 16px));
    max-height: 50dvh;
    overflow: auto;
    overflow-wrap: anywhere;
    padding: .5rem .75rem;
    border: 1px solid;
    border-radius: .5rem;
    background: Canvas;
    color: CanvasText;
}
.room-details-content > :first-child { margin-block-start: 0; }
.room-details-content > :last-child { margin-block-end: 0; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #game-result { margin: 0; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #game-result h2, body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #rematch-note:empty { display: none; }
body:has(:where(#room-view:not([hidden]) > #game-mount:not([hidden])), .card-table:not([hidden] .card-table)) #rematch-note { margin: 0; }
#game-mount:has(.card-table) { min-height: 0; }
#room-view > #game-mount {
    grid-row: 3;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

body:has(.card-table) .site-header a { color: inherit; }
