html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    background: #102430;
    color: #f7f1e6;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

body {
    overflow: hidden;
}

.page-shell {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 14px;
    background: #102430;
    box-sizing: border-box;
}

.main-grid {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.card {
    background: #132d3d;
    border: 1px solid #31586a;
    border-radius: 22px;
    box-sizing: border-box;
}

.side-column {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 420px;
}

.board-panel {
    position: absolute;
    left: 434px;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 18px;
    overflow: hidden;
}

.title-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 154px;
    padding: 18px 18px 24px;
    cursor: pointer;
    overflow: hidden;
}

.score-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 168px;
    bottom: 150px;
    padding: 18px;
    overflow: hidden;
}

.qr-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    height: 124px;
}

.eyebrow,
.panel-label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
    color: #f8be5c;
}

.title-panel h1,
.board-topbar h2,
.score-header h2,
.stopped-panel h2 {
    margin: 0;
}

.title-panel h1 {
    font-size: 32px;
    line-height: 34px;
}

.hero-status {
    margin: 8px 0 0;
    max-width: 210px;
    max-height: 54px;
    overflow: hidden;
    color: #d8d4ca;
    font-size: 14px;
    line-height: 18px;
}

.board-topbar {
    position: relative;
    min-height: 62px;
    padding-right: 168px;
}

.board-topbar h2 {
    font-size: 27px;
    line-height: 31px;
}

.topbar-pill {
    position: absolute;
    right: 0;
    top: 0;
    padding: 8px 14px 10px;
    background: #1b3b4f;
    border: 1px solid #3c6878;
    border-radius: 20px;
    text-align: center;
    white-space: nowrap;
}

.pill-phase {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d8d4ca;
}

.pill-sep {
    display: none;
}

.pill-timer {
    display: block;
    margin-top: 4px;
    font-size: 26px;
    line-height: 30px;
    font-weight: bold;
    color: #f7f1e6;
}

.score-header {
    position: relative;
    min-height: 30px;
}

.score-columns {
    position: relative;
    margin-top: 10px;
    padding: 0 4px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 10px;
    color: #b0b7b7;
    border-bottom: 1px solid #2b4d5f;
}

.score-columns span {
    display: block;
}

.score-columns span+span {
    position: absolute;
    right: 4px;
    top: 0;
    width: 70px;
    text-align: right;
}

.player-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 88px;
    bottom: 18px;
    overflow: auto;
}

.player-item,
.empty-item {
    position: relative;
    margin: 0 0 8px;
    padding: 10px 82px 10px 12px;
    background: #18384a;
    border: 1px solid #31586a;
    border-radius: 14px;
}

.empty-item {
    padding-right: 12px;
    color: #d8d4ca;
    line-height: 19px;
}

.player-main strong,
.player-stat {
    display: block;
}

.player-main strong {
    font-size: 15px;
    line-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-status {
    margin-top: 3px;
    font-size: 12px;
    color: #b8bdbb;
}

.player-status.drawer {
    color: #f8be5c;
}

.player-status.solved {
    color: #72e1a8;
}

.player-status.away {
    color: #879094;
}

.player-stat {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 58px;
    margin-top: -10px;
    text-align: right;
    font-weight: bold;
    color: #f7f1e6;
}

.rcRoomQrCodeLink,
.rcRoomQrCodeLink * {
    box-sizing: content-box;
}

.rcRoomQrCodeLink {
    display: block;
    width: 150px;
    margin-top: 8px;
    margin-bottom: 8px;
    margin-left: auto;
    margin-right: auto;
    border: solid 8px #fff;
    border-radius: 8px;
    color: #fff;
    background-color: #fff;
    box-shadow: 0 0 0 1px #fff;
    text-align: center;
    transition: opacity 1s ease;
    text-decoration: none;
    transform-origin: top left;
    transform: scale(0.8);
}

.rcTechLabel {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding: 4px;
    letter-spacing: 0.2em;
}

.rcRoomQrCode {
    width: 150px;
    height: 150px;
}

.rcRoomId {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
    padding: 4px;
    margin: 8px 0 0 0;
    letter-spacing: 0.25em;
}


@media (orientation: landscape) {
    .score-panel {
        bottom: auto;
        height: auto;
        max-height: 300px;
        padding-bottom: 12px;
    }

    .player-list {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        max-height: 222px;
        margin-top: 6px;
        overflow: hidden;
    }

    .player-list:after {
        content: "";
        display: block;
        clear: both;
    }

    .player-item,
    .empty-item {
        float: left;
        width: 49%;
        padding-right: 58px;
        box-sizing: border-box;
    }

    .player-item:nth-child(2n+1),
    .empty-item:nth-child(2n+1) {
        clear: left;
        margin-right: 2%;
    }

    .qr-panel .rcRoomQrCodeLink {
        position: absolute;
        left: 0;
        bottom: 0;
        margin-left: 0;
        margin-right: 0;
        transform-origin: bottom left;
    }
}

.stage-wrap {
    position: relative;
    margin: 14px auto 0;
    width: 600px;
    height: 600px;
    overflow: hidden;
    background: #f7f7f2;
    border: 2px solid #d7d2c8;
    border-radius: 8px;
}

#drawingCanvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #ffffff;
}

.stage-overlay {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #173649;
    border: 1px solid #31586a;
    color: #f7f1e6;
    text-align: center;
    line-height: 18px;
}

.stopped-panel {
    display: none;
    max-width: 720px;
    margin: 40px auto 0;
    padding: 24px 28px;
}

.stopped-panel p {
    margin: 10px 0 0;
    color: #d8d4ca;
}

@media (max-width: 1100px),
(max-height: 650px) {
    .page-shell {
        padding: 10px;
    }

    .side-column {
        width: 360px;
    }

    .board-panel {
        left: 370px;
        padding: 14px;
    }

    .title-panel {
        height: 126px;
        padding: 14px 14px 20px;
    }

    .title-panel h1 {
        max-width: 220px;
        font-size: 24px;
        line-height: 26px;
        white-space: nowrap;
    }

    .hero-status {
        font-size: 12px;
        line-height: 15px;
        max-width: 235px;
        max-height: 45px;
    }

    .score-panel {
        top: 136px;
        bottom: auto;
        height: auto;
        max-height: 216px;
        padding: 14px;
    }

    .qr-panel {
        height: 154px;
    }

    .eyebrow,
    .panel-label {
        margin-bottom: 7px;
        font-size: 10px;
        letter-spacing: 1px;
    }

    .board-topbar h2 {
        font-size: 20px;
        line-height: 23px;
    }

    .board-topbar {
        padding-right: 128px;
    }

    .topbar-pill {
        padding: 6px 10px 8px;
    }

    .pill-phase {
        font-size: 10px;
    }

    .pill-timer {
        font-size: 20px;
        line-height: 24px;
    }

    .player-list {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        max-height: 158px;
        margin-top: 6px;
        overflow: hidden;
    }

    .player-item,
    .empty-item {
        margin-bottom: 6px;
        padding-top: 8px;
        padding-bottom: 8px;
        border-radius: 11px;
    }

    .player-main strong {
        font-size: 13px;
        line-height: 15px;
    }

    .player-status {
        font-size: 10px;
    }


    .stage-overlay {
        left: 14px;
        right: 14px;
        bottom: 14px;
        padding: 10px 12px;
        font-size: 12px;
        line-height: 15px;
    }
}

@media (orientation: portrait) {

    html,
    body {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
    }

    .page-shell {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .main-grid {
        width: 100%;
        height: 100%;
        max-width: none;
    }

    .side-column {
        position: absolute;
        left: 1.5vh;
        right: 1.5vh;
        top: 1.5vh;
        bottom: auto;
        width: auto;
        height: 10.5vh;
    }

    .title-panel {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: auto;
        height: auto;
        min-height: 0;
        padding: 1.15vh 1.55vh;
        border-radius: 1.7vh;
        overflow: hidden;
    }

    .title-panel h1 {
        max-width: 36vh;
        margin-top: 0.15vh;
        font-size: 2.95vh;
        line-height: 1;
        white-space: nowrap;
    }

    .eyebrow {
        margin-bottom: 0.5vh;
        font-size: 1.1vh;
        letter-spacing: 0.22vh;
    }

    .hero-status {
        max-width: 40vh;
        margin-top: 0.55vh;
        font-size: 1.2vh;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .timer-card {
        right: 9.5vh;
        top: 0;
        width: 8.8vh;
        padding: 0.65vh 0.7vh;
        border-radius: 1.5vh;
    }

    .timer-label {
        font-size: 1vh;
        letter-spacing: 0.18vh;
    }

    .timer-value {
        margin-top: 0.25vh;
        font-size: 2.45vh;
        line-height: 1;
    }

    .board-panel {
        position: absolute;
        left: 1.5vh;
        right: 1.5vh;
        top: 13vh;
        bottom: 25vh;
        width: auto;
        height: auto;
        padding: 1.25vh;
        border-radius: 1.7vh;
    }

    .board-topbar {
        min-height: 5.8vh;
        padding-right: 14vh;
    }

    .board-topbar .panel-label {
        margin-bottom: 0.45vh;
        font-size: 1vh;
        letter-spacing: 0.18vh;
    }

    .board-topbar h2 {
        font-size: 2.2vh;
        line-height: 1.08;
    }

    .topbar-pill {
        padding: 0.55vh 1vh 0.75vh;
        border-radius: 1.5vh;
    }

    .pill-phase {
        font-size: 1vh;
        letter-spacing: 0.18vh;
    }

    .pill-timer {
        margin-top: 0.2vh;
        font-size: 2.2vh;
        line-height: 1;
    }

    .stage-wrap {
        margin-top: 1vh;
        max-width: 100%;
        max-height: 100%;
    }

    .stage-overlay {
        left: 1.3vh;
        right: 1.3vh;
        bottom: 1.3vh;
        padding: 1vh 1.2vh;
        border-radius: 1.35vh;
        font-size: 1.35vh;
        line-height: 1.25;
    }

    .score-panel {
        position: fixed;
        left: 1.5vh;
        right: 23vh;
        bottom: 1.5vh;
        top: auto;
        width: auto;
        height: 22vh;
        max-height: 22vh;
        margin: 0;
        padding: 0.85vh 1vh;
        border-radius: 1.7vh;
        overflow: hidden;
    }

    .score-header {
        min-height: 3.5vh;
    }

    .score-header .panel-label {
        margin-bottom: 0.25vh;
        font-size: 1vh;
        letter-spacing: 0.18vh;
    }

    .score-header h2 {
        font-size: 1.85vh;
        line-height: 1;
    }

    .score-columns {
        margin-top: 0.55vh;
        padding: 0 0.35vh 0.5vh;
        font-size: 0.95vh;
        letter-spacing: 0.14vh;
    }

    .player-list {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        max-height: none;
        height: 14.2vh;
        margin-top: 0.55vh;
        overflow: hidden;
    }

    .player-item,
    .empty-item {
        float: left;
        font-size: 1.2vh;
        margin-bottom: 0.55vh;
        padding: 0.55vh 5.6vh 0.55vh 0.7vh;
        border-radius: 1.25vh;
        box-sizing: border-box;
    }

    .player-item:nth-child(2n+1),
    .empty-item:nth-child(2n+1) {
        clear: left;
        margin-right: 2%;
    }

    .player-main strong {
        font-size: 1.2vh;
        line-height: 1.08;
    }

    .player-status {
        margin-top: 0.25vh;
        font-size: 1vh;
    }

    .player-stat {
        right: 0.8vh;
        width: 4.4vh;
        margin-top: -0.75vh;
        font-size: 1.2vh;
        line-height: 1.1;
    }

    .qr-panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: auto;
        display: block;
        width: 22vh;
        height: 22vh;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow: hidden;
    }

    .rcRoomQrCodeLink {
        position: fixed;
        top: auto;
        right: 1.5vh;
        bottom: 1.5vh;
        margin: 0;
        transform-origin: bottom right;
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    .title-panel h1 {
        max-width: 32vh;
        font-size: 2.8vh;
    }

    .hero-status {
        max-width: 36vh;
        font-size: 1.15vh;
    }

    .board-topbar h2 {
        font-size: 2vh;
    }

    .round-pill {
        padding-left: 0.8vh;
        padding-right: 0.8vh;
    }
}