/* Canvas owns the effects. The display chrome stays deliberately lean for signage hardware. */
* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    color: #eefaff;
    background: #030916;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    position: relative;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    -ms-touch-action: none;
    touch-action: none;
    cursor: crosshair;
    outline: none;
}

.hud {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    pointer-events: none;
}

.brand {
    position: absolute;
    top: 18px;
    left: 20px;
    padding-left: 12px;
    border-left: 3px solid #53e6ff;
}

.brandKicker,
.brandTitle {
    display: block;
}

.brandKicker {
    color: #78b9c9;
    font-family: Consolas, monospace;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.15em;
}

.brandTitle {
    margin-top: 3px;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.missionHud {
    position: absolute;
    top: 18px;
    left: 50%;
    min-width: 260px;
    padding: 9px 16px 8px;
    border: 1px solid rgba(99, 221, 255, 0.38);
    border-radius: 4px;
    background: rgba(4, 15, 34, 0.82);
    text-align: center;
    transform: translateX(-50%);
}

.missionLabel,
.missionProgress {
    display: block;
    white-space: nowrap;
}

.missionLabel {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.missionProgress {
    margin-top: 3px;
    color: #72c6d9;
    font-family: Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.11em;
}

.bossHud {
    position: absolute;
    right: 20%;
    bottom: 24px;
    left: 20%;
}

.bossHud.hidden {
    display: none;
}

.bossLabels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: #ffb2ba;
    font-family: Consolas, monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.11em;
}

.bossTrack {
    height: 9px;
    border: 1px solid rgba(255, 119, 139, 0.62);
    background: rgba(37, 5, 17, 0.88);
}

.bossFill {
    display: block;
    width: 100%;
    height: 100%;
    background: #ff526f;
}

.roster {
    position: absolute;
    top: 82px;
    left: 20px;
    width: 248px;
}

.rosterCard {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 6px;
    padding: 7px 9px 7px 12px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 232, 0.27);
    border-radius: 4px;
    background: rgba(3, 15, 33, 0.78);
}

.rosterCard:before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: #53e6ff;
    content: "";
}

.rosterCard.destroyed {
    opacity: 0.48;
}

.rosterShip {
    position: relative;
    width: 38px;
    height: 22px;
    margin-right: 9px;
    flex: none;
}

.rosterShip:before {
    position: absolute;
    top: 6px;
    left: 2px;
    width: 31px;
    height: 10px;
    border-radius: 10px 70% 70% 10px;
    background: currentColor;
    content: "";
}

.rosterShip:after {
    position: absolute;
    top: 2px;
    left: 10px;
    border-right: 12px solid transparent;
    border-bottom: 9px solid #fff;
    content: "";
}

.rosterShip.spriteReady {
    background-image: url("player-sprites.png");
    background-repeat: no-repeat;
    background-size: 800% 300%;
}

.rosterShip.spriteReady:before,
.rosterShip.spriteReady:after {
    display: none;
}

.rosterIdentity {
    min-width: 0;
    flex: 1;
}

.rosterName,
.rosterMeta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rosterName {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.rosterMeta {
    margin-top: 2px;
    color: #7fb8c5;
    font-family: Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.06em;
}

.rosterScore {
    margin-left: 8px;
    color: #ffe684;
    font-family: Consolas, monospace;
    font-size: 15px;
    font-weight: bold;
}

.centerMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 620px;
    max-width: 72vw;
    padding: 25px 28px 23px;
    border-top: 1px solid rgba(91, 224, 255, 0.45);
    border-bottom: 1px solid rgba(91, 224, 255, 0.45);
    background: rgba(3, 12, 29, 0.78);
    text-align: center;
    transform: translate(-50%, -50%);
}

.centerMessage.hidden {
    display: none;
}

.messageKicker {
    color: #75dff2;
    font-family: Consolas, monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.22em;
}

.messageTitle {
    margin-top: 7px;
    color: #fff;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
}

.messageBody {
    margin-top: 11px;
    color: #a8ced8;
    font-size: 14px;
    letter-spacing: 0.03em;
}

.soundButton {
    position: absolute;
    right: 18px;
    bottom: 16px;
    padding: 9px 11px;
    border: 1px solid rgba(102, 218, 244, 0.32);
    border-radius: 3px;
    color: #78bccb;
    background: rgba(4, 16, 34, 0.82);
    font-family: Consolas, monospace;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.08em;
    pointer-events: auto;
}

.soundButton.armed {
    color: #baf9ff;
    border-color: rgba(100, 235, 255, 0.62);
}

.scanPanel {
    position: fixed;
    left: 18px;
    bottom: 16px;
    z-index: 6;
}

.rcRoomQrCodeLink {
    display: block;
    border: solid 7px #fff;
    border-radius: 4px;
    color: #fff;
    background-color: #fff;
    text-align: center;
    text-decoration: none;
    transform: scale(0.54);
    transform-origin: bottom left;
}

.rcTechLabel,
.rcRoomId {
    margin: 0;
    padding: 5px;
    color: #d8f9ff;
    background-color: #07152d;
    font-family: Consolas, monospace;
    font-weight: bold;
    white-space: nowrap;
}

.rcTechLabel {
    margin-bottom: 7px;
    font-size: 11px;
}

.rcRoomQrCode {
    display: block;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.rcRoomId {
    margin-top: 7px;
    font-size: 15px;
    letter-spacing: 0.13em;
}

@media (max-width: 900px) {
    .brand {
        top: 10px;
        left: 10px;
    }

    .brandKicker {
        display: none;
    }

    .brandTitle {
        font-size: 15px;
    }

    .missionHud {
        top: 8px;
        min-width: 190px;
        padding: 7px 10px;
    }

    .missionLabel {
        font-size: 12px;
    }

    .roster {
        top: 60px;
        left: 10px;
        width: 205px;
    }

    .bossHud {
        right: 12%;
        left: 12%;
    }
}

@media (max-width: 560px) {
    .brand {
        display: none;
    }

    .missionHud {
        min-width: 176px;
    }

    .roster {
        top: 58px;
        width: 166px;
    }

    .rosterCard {
        min-height: 38px;
        margin-bottom: 4px;
        padding: 5px 6px 5px 9px;
    }

    .rosterShip {
        width: 27px;
        margin-right: 5px;
        transform: scale(0.78);
        transform-origin: left center;
    }

    .rosterName {
        font-size: 10px;
    }

    .rosterMeta {
        font-size: 8px;
    }

    .rosterScore {
        font-size: 11px;
    }

    .centerMessage {
        max-width: 88vw;
        padding: 18px 14px 17px;
    }

    .messageKicker {
        font-size: 9px;
    }

    .messageTitle {
        font-size: 29px;
    }

    .messageBody {
        font-size: 12px;
    }

    .scanPanel {
        right: 7px;
        bottom: 6px;
        left: auto;
    }

    .rcRoomQrCodeLink {
        transform: scale(0.43);
        transform-origin: bottom right;
    }

    .soundButton {
        right: auto;
        bottom: 6px;
        left: 7px;
        padding: 7px 8px;
        font-size: 8px;
    }

    .bossHud {
        right: 7%;
        bottom: 12px;
        left: 7%;
    }
}
