* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    background: #073832;
    color: #f8f8f3;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

body {
    position: relative;
}

[hidden] {
    display: none !important;
}

.texture-layer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: #073832;
}

.screen-shell {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    padding: 22px;
}

.info-sidebar {
    position: absolute;
    left: 22px;
    top: 22px;
    bottom: 22px;
    width: 370px;
}

.table-stage {
    position: absolute;
    left: 414px;
    top: 22px;
    right: 22px;
    bottom: 22px;
}

.topbar,
.bottom-zone,
.table-core,
.turn-panel,
.boneyard-panel,
.action-burst,
.celebration-panel,
.end-cap,
.player-chip {
    border: 1px solid #2a7168;
    background: #092c2c;
}

.topbar {
    padding: 20px 22px;
    border-radius: 18px;
}

.brand-block {
    position: relative;
}

.eyebrow {
    display: block;
    color: #b9d8d1;
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.brand-block h1 {
    margin: 6px 0 8px;
    color: #fff8e8;
    font-size: 52px;
    line-height: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-line {
    margin: 0;
    color: #cfe2dc;
    font-size: 17px;
    line-height: 1.35;
}

.pill-row {
    margin-top: 18px;
}

.pill {
    display: inline-block;
    min-width: 88px;
    margin: 0 8px 8px 0;
    padding: 10px 14px;
    border: 1px solid #376e69;
    border-radius: 999px;
    background: #062222;
    color: #f8f8f3;
    font-size: 15px;
    text-align: center;
}

.score-table-heading {
    margin: 0 0 10px;
    color: #b9d8d1;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.qr-panel {
    display: block;
}

.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(1);
}

.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;
}

.bottom-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 342px;
    padding: 16px;
    overflow: hidden;
    border-radius: 18px;
}

.table-core {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 26px;
    background: #0d4b43;
}

.felt-shadow {
    position: absolute;
    left: 18px;
    top: 18px;
    right: 18px;
    bottom: 18px;
    border: 1px solid #2d8778;
    border-radius: 22px;
    background: #0f5a4f;
}

.table-aura {
    display: none;
}

.table-top {
    position: absolute;
    left: 28px;
    top: 28px;
    right: 28px;
    height: 112px;
    z-index: 2;
}

.turn-panel {
    width: 560px;
    max-width: 62%;
    min-height: 98px;
    margin: 0 auto;
    padding: 14px 24px;
    border-radius: 999px;
    text-align: center;
}

.turn-label,
.pile-caption {
    color: #b9d8d1;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.turn-name {
    margin-top: 4px;
    color: #fff8e8;
    font-size: 28px;
    font-weight: bold;
    line-height: 1.1;
    text-transform: uppercase;
}

.turn-hint {
    margin-top: 4px;
    color: #dcece7;
    font-size: 16px;
    line-height: 1.2;
}

.boneyard-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 172px;
    min-height: 100px;
    padding: 12px;
    border-radius: 16px;
    text-align: center;
}

.boneyard-pile {
    position: relative;
    width: 120px;
    height: 58px;
    margin: 9px auto 0;
}

.bone-tile {
    position: absolute;
    width: 102px;
    height: 51px;
}

.bone-tile svg,
.board-tile svg {
    display: block;
    width: 100%;
    height: 100%;
}

.table-middle {
    position: absolute;
    left: 28px;
    top: 158px;
    right: 28px;
    bottom: 82px;
    z-index: 1;
}

.board-surface {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border: 1px solid #22786c;
    border-radius: 18px;
    background: #0a403a;
}

.end-strip {
    position: absolute;
    left: 18px;
    top: 16px;
    right: 18px;
    height: 52px;
    z-index: 2;
}

.end-cap {
    width: 116px;
    padding: 8px 12px;
    border-radius: 13px;
    text-align: center;
}

.end-cap span {
    display: block;
    color: #b9d8d1;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.end-cap strong {
    display: block;
    color: #ffe2a2;
    font-size: 25px;
    line-height: 1;
}

#leftEndCap {
    float: left;
}

#rightEndCap {
    float: right;
}

.board-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 430px;
    max-width: 80%;
    color: #dcece7;
    text-align: center;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.board-empty-title {
    color: #fff8e8;
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
    text-transform: uppercase;
}

.board-empty-copy {
    margin-top: 10px;
    font-size: 18px;
    line-height: 1.35;
}

.board-track {
    position: absolute;
    left: 18px;
    top: 78px;
    right: 18px;
    bottom: 18px;
    z-index: 2;
}

.board-tile {
    position: absolute;
    -webkit-transform-origin: center center;
    transform-origin: center center;
}

.board-tile.is-pending {
    outline: 4px solid #ffe2a2;
}

.table-bottom {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 24px;
    z-index: 3;
    text-align: center;
}

.action-burst {
    display: inline-block;
    min-width: 260px;
    max-width: 90%;
    padding: 13px 24px;
    border-radius: 14px;
    color: #fff8e8;
    font-size: 17px;
    line-height: 1.25;
}

.action-burst.is-play {
    border-color: #ffe2a2;
}

.action-burst.is-warning,
.action-burst.is-skip,
.action-burst.is-pass {
    border-color: #d9765c;
}

.celebration-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 520px;
    max-width: 88%;
    padding: 26px 28px;
    border-radius: 22px;
    text-align: center;
    transform: translate(-50%, -50%);
    z-index: 6;
}

.celebration-eyebrow,
.celebration-timer-label {
    color: #ffe2a2;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.celebration-name {
    margin-top: 8px;
    color: #fff8e8;
    font-size: 56px;
    font-weight: bold;
    line-height: 0.95;
    text-transform: uppercase;
}

.celebration-copy {
    margin-top: 12px;
    color: #dcece7;
    font-size: 18px;
    line-height: 1.35;
}

.celebration-timer-wrap {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 20px;
    border: 1px solid #376e69;
    border-radius: 14px;
    background: #062222;
}

.celebration-timer {
    display: block;
    margin-top: 3px;
    color: #ffe2a2;
    font-size: 38px;
    font-weight: bold;
    line-height: 1;
}

.motion-layer {
    display: none;
}

.player-rail {
    width: 100%;
}

.player-chip {
    display: block;
    min-height: 58px;
    margin-bottom: 10px;
    padding: 11px 12px;
    border-radius: 13px;
    overflow: hidden;
}

.player-chip.is-current {
    border-color: #ffe2a2;
    background: #1b5142;
}

.player-chip.is-waiting,
.player-chip.is-disconnected {
    opacity: 0.62;
}

.player-name-row,
.player-meta-row {
    display: block;
    clear: both;
    overflow: hidden;
}

.player-name-row strong {
    float: left;
    max-width: 65%;
    overflow: hidden;
    color: #fff8e8;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-seat,
.player-badge {
    float: right;
    text-align: right;
}

.player-seat {
    color: #b9d8d1;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.player-meta-row {
    margin-top: 6px;
    color: #cfe2dc;
    font-size: 14px;
}

.player-meta-row span:first-child {
    float: left;
}

.player-badge {
    min-width: 58px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #062222;
    color: #fff8e8;
}

@media (max-width: 1100px), (max-height: 700px) {
    .screen-shell {
        padding: 12px;
    }

    .info-sidebar {
        left: 12px;
        top: 12px;
        bottom: 12px;
        width: 230px;
    }

    .table-stage {
        left: 254px;
        top: 12px;
        right: 12px;
        bottom: 12px;
    }

    .topbar {
        padding: 13px 14px;
        border-radius: 14px;
    }

    .brand-block h1 {
        margin: 4px 0;
        font-size: 28px;
    }

    .eyebrow {
        font-size: 10px;
    }

    .status-line,
    .turn-hint,
    .action-burst {
        font-size: 12px;
    }

    .pill-row {
        margin-top: 10px;
    }

    .pill {
        min-width: 64px;
        margin: 0 4px 4px 0;
        padding: 6px 8px;
        font-size: 11px;
    }

    .bottom-zone {
        max-height: 156px;
        padding: 9px;
        border-radius: 14px;
    }

    .table-core {
        border-radius: 18px;
    }

    .felt-shadow {
        left: 10px;
        top: 10px;
        right: 10px;
        bottom: 10px;
        border-radius: 14px;
    }

    .table-top {
        left: 16px;
        top: 16px;
        right: 16px;
        height: 78px;
    }

    .turn-panel {
        width: 340px;
        min-height: 70px;
        padding: 9px 16px;
    }

    .turn-label,
    .pile-caption {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .turn-name {
        font-size: 17px;
    }

    .boneyard-panel {
        width: 112px;
        min-height: 70px;
        padding: 8px;
        border-radius: 12px;
    }

    .boneyard-pile {
        width: 82px;
        height: 38px;
        margin-top: 6px;
    }

    .bone-tile {
        width: 72px;
        height: 36px;
    }

    .table-middle {
        left: 16px;
        top: 106px;
        right: 16px;
        bottom: 58px;
    }

    .board-track {
        left: 10px;
        top: 58px;
        right: 10px;
        bottom: 10px;
    }

    .end-strip {
        left: 10px;
        top: 10px;
        right: 10px;
        height: 40px;
    }

    .end-cap {
        width: 82px;
        padding: 6px 8px;
        border-radius: 10px;
    }

    .end-cap span {
        font-size: 8px;
    }

    .end-cap strong {
        font-size: 18px;
    }

    .board-empty-title {
        font-size: 25px;
    }

    .board-empty-copy {
        font-size: 12px;
    }

    .table-bottom {
        left: 16px;
        right: 16px;
        bottom: 14px;
    }

    .action-burst {
        min-width: 180px;
        padding: 8px 14px;
        border-radius: 10px;
    }

    .player-chip {
        min-height: 38px;
        margin-bottom: 6px;
        padding: 7px 8px;
        border-radius: 10px;
    }

    .player-name-row strong {
        font-size: 12px;
    }

    .player-seat {
        font-size: 8px;
    }

    .player-meta-row {
        margin-top: 3px;
        font-size: 10px;
    }

    .player-badge {
        min-width: 42px;
        padding: 1px 5px;
    }

    .celebration-panel {
        width: 350px;
        padding: 18px 20px;
        border-radius: 16px;
    }

    .celebration-name {
        font-size: 34px;
    }

    .celebration-copy {
        font-size: 13px;
    }

    .celebration-timer {
        font-size: 25px;
    }
}

@media (orientation: landscape) {
    .bottom-zone {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        max-height: 38vh;
        margin-top: 18px;
    }

    .qr-panel {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
    }

    .qr-panel .rcRoomQrCodeLink {
        margin-left: 0;
        margin-right: 0;
        transform-origin: bottom left;
        transform: scale(0.75);
    }
}

@media (orientation: portrait) {
    html,
    body {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
    }

    .screen-shell {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .info-sidebar,
    .table-stage {
        position: absolute;
        width: auto;
    }

    .info-sidebar {
        left: 1.5vh;
        right: 1.5vh;
        top: 1.5vh;
        bottom: auto;
        height: 14.5vh;
    }

    .table-stage {
        left: 1.5vh;
        right: 1.5vh;
        top: 17vh;
        bottom: 19vh;
        height: auto;
        margin-top: 0;
    }

    .topbar {
        height: auto;
        min-height: 0;
        padding: 1.15vh 1.55vh;
        border-radius: 1.7vh;
        overflow: hidden;
    }

    .bottom-zone {
        position: fixed;
        left: 1.5vh;
        right: 23vh;
        bottom: 1.5vh;
        width: auto;
        max-height: 17vh;
        margin-top: 0;
        padding: 0.85vh 1vh;
        border-radius: 1.7vh;
        overflow: hidden;
    }

    .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;
        transform: scale(0.72);
    }

    .brand-block h1 {
        margin: 0.15vh 0 0.25vh 0;
        font-size: 3.4vh;
    }

    .eyebrow {
        font-size: 1.15vh;
        letter-spacing: 0.22vh;
    }

    .status-line {
        font-size: 1.45vh;
    }

    .pill-row {
        margin-top: 0.65vh;
    }

    .pill {
        min-height: 2.45vh;
        padding: 0.35vh 0.8vh;
        font-size: 1.18vh;
    }

    .table-top {
        left: 2vh;
        top: 2vh;
        right: 2vh;
        height: 112px;
    }

    .turn-panel {
        width: 62%;
        min-height: 98px;
    }

    .boneyard-panel {
        width: 150px;
    }

    .table-middle {
        top: 148px;
        bottom: 76px;
    }
}

@media (max-width: 520px) and (orientation: portrait) {
    .screen-shell {
        min-height: 0;
        padding: 0;
    }

    .brand-block h1 {
        font-size: 3.15vh;
    }

    .status-line {
        font-size: 1.32vh;
    }

    .table-stage {
        top: 17vh;
        bottom: 19vh;
        height: auto;
        margin-top: 0;
    }

    .table-top {
        left: 10px;
        top: 10px;
        right: 10px;
        height: 78px;
    }

    .turn-panel {
        width: 100%;
        max-width: none;
        min-height: 68px;
        padding: 8px 12px;
    }

    .turn-name {
        font-size: 16px;
    }

    .turn-hint {
        font-size: 11px;
    }

    .boneyard-panel {
        display: none;
    }

    .table-middle {
        left: 10px;
        top: 98px;
        right: 10px;
        bottom: 54px;
    }

    .board-track {
        top: 54px;
    }
}
