html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background: #071019;
    color: #f3f6fb;
    overflow: hidden;
}

:root {
    --hud-gap: 1rem;
    --qr-width: min(10rem, 30vw);
}

.drumsShell {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(126, 181, 255, 0.12), transparent 28%),
        radial-gradient(circle at 18% 24%, rgba(255, 170, 86, 0.12), transparent 22%),
        linear-gradient(180deg, #071019 0%, #05080f 100%);
}

.drumsCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hudPanel,
.qrPanel,
.roomBadge,
.legendPanel {
    position: absolute;
    z-index: 2;
    box-sizing: border-box;
    backdrop-filter: blur(18px);
}

.hudPanel {
    top: var(--hud-gap);
    left: var(--hud-gap);
    width: min(31rem, calc(100vw - (var(--hud-gap) * 3) - var(--qr-width)));
    padding: 1rem 1.1rem;
    border-radius: 1.1rem;
    background: rgba(9, 16, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.35);
}

.eyebrow {
    color: #8cc6ff;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
}

.title {
    margin: 0.3rem 0 0;
    font-size: clamp(1.7rem, 3.4vw, 2.8rem);
    line-height: 0.98;
}

.copy {
    margin: 0.65rem 0 0;
    color: rgba(243, 246, 251, 0.8);
    line-height: 1.48;
    max-width: 44ch;
}

.statusLine,
.metaLine,
.orientationLine {
    margin-top: 0.65rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.statusLine {
    color: #9fe2b1;
}

.metaLine {
    color: #8cc6ff;
}

.orientationLine {
    color: rgba(243, 246, 251, 0.72);
    font-family: Consolas, "Courier New", monospace;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.audioButton,
.audioHint {
    border-radius: 999px;
    padding: 0.72rem 1rem;
    font: inherit;
}

.audioButton {
    appearance: none;
    border: 0;
    background: linear-gradient(135deg, #ffc07a 0%, #ff945d 100%);
    color: #21120a;
    font-weight: 700;
    cursor: pointer;
}

.audioHint {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(243, 246, 251, 0.78);
}

.qrPanel {
    top: var(--hud-gap);
    right: var(--hud-gap);
    width: var(--qr-width);
    padding: 0.85rem;
    border-radius: 1rem;
    background: rgba(250, 252, 255, 0.92);
    color: #0e1621;
    text-decoration: none;
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.28);
}

.qrTitle {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.qrPanel img,
.qrPanel canvas {
    display: block;
    width: 100%;
    height: auto;
}

.legendPanel {
    right: var(--hud-gap);
    bottom: calc(var(--hud-gap) + 3.2rem);
    width: min(15rem, calc(100vw - 2rem));
    padding: 0.85rem 0.9rem;
    border-radius: 1rem;
    background: rgba(9, 16, 28, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.legendTitle {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(243, 246, 251, 0.6);
}

.legendGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.legendChip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    font-size: 0.84rem;
    color: rgba(243, 246, 251, 0.86);
}

.legendDot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.roomBadge {
    left: var(--hud-gap);
    bottom: var(--hud-gap);
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: rgba(9, 16, 28, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(243, 246, 251, 0.78);
    font-size: 0.84rem;
    letter-spacing: 0.1em;
}

@media (max-width: 760px) {
    :root {
        --hud-gap: 0.85rem;
        --qr-width: min(7rem, 28vw);
    }

    .hudPanel {
        width: calc(100vw - 1.7rem);
        padding-right: calc(0.95rem + var(--qr-width));
    }

    .legendPanel {
        left: var(--hud-gap);
        right: auto;
        bottom: 4.2rem;
        width: calc(100vw - 1.7rem);
    }
}

@media (max-width: 560px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .audioButton,
    .audioHint {
        border-radius: 1rem;
    }

    .legendGrid {
        grid-template-columns: 1fr;
    }
}
