html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    font-family: "Arial Black", Impact, "Trebuchet MS", sans-serif;
    background: #060c1d;
}

body {
    position: relative;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: pointer;
    outline: none;
}

.hud {
    position: fixed;
    top: 18px;
    left: 18px;
    right: 150px;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    pointer-events: none;
}

.brandPanel {
    max-width: min(48vw, 520px);
    padding: 16px 18px;
    border: 3px solid rgba(140, 240, 255, 0.18);
    background: linear-gradient(180deg, rgba(18, 34, 75, 0.88), rgba(12, 20, 46, 0.78));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.eyebrow {
    color: #76f6ff;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.brandPanel h1 {
    margin: 6px 0 6px;
    color: #eaf8ff;
    font-size: clamp(26px, 4vw, 52px);
    line-height: 0.92;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(114, 240, 255, 0.24);
}

.subtitle {
    margin: 0;
    color: #9bb7d4;
    font-family: "Trebuchet MS", sans-serif;
    font-size: clamp(12px, 1.4vw, 16px);
    line-height: 1.4;
}

.scorePanel {
    display: flex;
    gap: 12px;
}

.scoreCard {
    min-width: 124px;
    padding: 14px 16px;
    border: 3px solid rgba(118, 246, 255, 0.2);
    background: linear-gradient(180deg, rgba(18, 34, 75, 0.88), rgba(8, 14, 35, 0.82));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.bestCard {
    border-color: rgba(255, 221, 101, 0.22);
}

.scoreLabel {
    display: block;
    color: #7aa5d5;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.scoreValue {
    display: block;
    margin-top: 8px;
    color: #fbfdff;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1;
    text-shadow: 0 0 18px rgba(118, 246, 255, 0.18);
}

.messageBanner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 3;
    min-width: min(72vw, 520px);
    padding: 12px 18px;
    color: #eefbff;
    font-size: clamp(12px, 1.7vw, 18px);
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    border: 3px solid rgba(118, 246, 255, 0.22);
    background: rgba(9, 16, 34, 0.78);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
    pointer-events: none;
}

.scanPanel {
    position: fixed;
    right: 18px;
    top: 18px;
    width: 132px;
    z-index: 3;
    padding: 14px;
    border: 3px solid rgba(118, 246, 255, 0.22);
    background: linear-gradient(180deg, rgba(14, 28, 63, 0.88), rgba(9, 16, 34, 0.84));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.scanHeader {
    color: #f5fbff;
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.scanCopy {
    margin-top: 6px;
    color: #92acd0;
    font-family: "Trebuchet MS", sans-serif;
    font-size: 11px;
    line-height: 1.35;
}

.qrLink {
    display: block;
    margin-top: 10px;
    text-decoration: none;
}

.qrCode {
    width: 104px;
    height: 104px;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
}

.controllerState {
    margin-top: 10px;
    color: #ffe17b;
    font-family: "Trebuchet MS", sans-serif;
    font-size: 11px;
    line-height: 1.35;
}

@media (max-width: 920px) {
    .hud {
        right: 18px;
        flex-direction: column;
        gap: 12px;
    }

    .brandPanel {
        max-width: calc(100vw - 190px);
    }

    .scanPanel {
        width: 120px;
    }
}

@media (max-width: 700px) {
    .hud {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .brandPanel {
        max-width: none;
        padding: 12px 14px;
    }

    .scorePanel {
        width: 100%;
    }

    .scoreCard {
        flex: 1;
        min-width: 0;
    }

    .scanPanel {
        top: auto;
        right: 10px;
        bottom: 92px;
        width: 120px;
        padding: 10px;
    }

    body.hasStarted .scanPanel {
        display: none;
    }

    .messageBanner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        transform: none;
        min-width: 0;
    }
}