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: "Trebuchet MS", "Gill Sans", sans-serif;
    background: linear-gradient(180deg, #7fe2ff 0%, #6ed6fb 58%, #dff6ff 58%, #dff6ff 100%);
}

body {
    position: relative;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.scanPanel {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: 112px;
    height: 160px;
    z-index: 5;
    padding: 9px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 30px rgba(14, 73, 103, 0.2);
    backdrop-filter: blur(8px);
}

.scanTitle {
    color: #5b3608;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.scanHint {
    margin-top: 4px;
    color: #845b22;
    font-size: 10px;
    line-height: 1.2;
}

.qrLink {
    display: block;
    margin-top: 8px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.qrCode {
    width: 100px;
    height: 100px;
    padding: 6px;
    border-radius: 12px;
    background: #fff;
}

.topHud {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.roundBanner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 0;
    max-width: min(calc(100vw - 220px), 520px);
    padding: 10px 18px;
    border-radius: 999px;
    color: #fff7cf;
    font-size: clamp(14px, 2vw, 30px);
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
    background: rgba(53, 33, 11, 0.62);
    box-shadow: 0 8px 30px rgba(42, 21, 5, 0.28);
    text-shadow: 0 3px 0 rgba(56, 33, 0, 0.9);
}

.roundBanner.hidden {
    display: none;
}

.roundBanner.scoreMode {
    max-width: min(46vw, 280px);
    padding: 8px 18px;
    border-radius: 16px;
    background: rgba(53, 33, 11, 0.62);
    box-shadow: 0 8px 24px rgba(42, 21, 5, 0.22);
    color: #fff9d7;
    font-size: clamp(36px, 6vw, 54px);
    letter-spacing: 0.02em;
}

.highScoreHud {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    color: #fff9d7;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(53, 33, 11, 0.62);
    box-shadow: 0 8px 24px rgba(42, 21, 5, 0.22);
    text-shadow: 0 2px 0 rgba(56, 33, 0, 0.8);
}

.roster {
    position: absolute;
    top: 70px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: min(32vw, 260px);
}

.rosterCard {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 12px;
    color: #fff;
    background: rgba(55, 36, 18, 0.62);
    box-shadow: 0 8px 18px rgba(31, 18, 6, 0.18);
}

.rosterSwatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    flex: none;
}

.rosterName {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.rosterScore {
    font-size: 16px;
    font-weight: 900;
    color: #ffe877;
}

.rosterCard.eliminated {
    opacity: 0.55;
}

@media (max-width: 900px) {
    .roster {
        top: 70px;
        left: 8px;
        max-width: min(52vw, 210px);
    }

    .roundBanner {
        top: 8px;
        max-width: calc(100vw - 168px);
        padding: 8px 14px;
    }

    .roundBanner.scoreMode {
        top: 10px;
        font-size: clamp(30px, 7vw, 44px);
    }

    .highScoreHud {
        top: 8px;
        right: 8px;
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 560px) {

    .roster {
        top: 70px;
        max-width: min(54vw, 180px);
        gap: 4px;
    }

    .rosterCard {
        gap: 7px;
        padding: 6px 8px;
    }

    .rosterSwatch {
        width: 14px;
        height: 14px;
    }

    .rosterName {
        font-size: 11px;
    }

    .rosterScore {
        font-size: 14px;
    }

    .roundBanner {
        max-width: calc(100vw - 132px);
        font-size: 12px;
        letter-spacing: 0.03em;
    }

    .roundBanner.scoreMode {
        font-size: clamp(28px, 9vw, 38px);
    }

    .highScoreHud {
        font-size: 11px;
        letter-spacing: 0.03em;
    }
}
