/* Stanze Binaurali 3D */
:root {
    --br-bg: #070b16;
    --br-panel: rgba(17, 25, 45, 0.92);
    --br-panel-2: rgba(30, 41, 70, 0.7);
    --br-line: rgba(255, 255, 255, 0.1);
    --br-ink: #e8eef8;
    --br-dim: #9aa8c2;
    --br-left: #7dd3fc;
    --br-right: #f9a8d4;
    --br-accent: #c4b5fd;
    --br-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* il palco usa tutta la larghezza, come le altre stanze immersive */
body.binaural-rooms-active .main-container {
    max-width: 100%;
    padding: 0;
}

.br-app {
    position: relative;
    width: 100%;
    background: var(--br-bg);
    color: var(--br-ink);
    font-family: var(--br-font);
    padding-bottom: 40px;
}
.br-app [hidden] { display: none !important; }
.br-app h1, .br-app h2 { color: var(--br-ink); }

/* ---------------- palco ---------------- */
.br-stage {
    position: relative;
    width: 100%;
    height: 74vh;
    min-height: 480px;
    max-height: 860px;
    overflow: hidden;
    background: #05070d;
}
.br-stage:fullscreen { height: 100vh; max-height: none; }
#brScene { display: block; width: 100%; height: 100%; }

.br-bar {
    position: absolute;
    left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    z-index: 3;
    flex-wrap: wrap;
}
.br-bar-top { top: 0; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,0)); }
.br-bar-bottom { bottom: 0; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.6)); padding-top: 30px; }
.br-group { display: flex; gap: 8px; align-items: center; }
.br-push { margin-left: auto; }

.br-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    min-width: 46px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(10, 16, 32, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font: 600 15px/1 var(--br-font);
    cursor: pointer;
    transition: background .15s, transform .1s, border-color .15s;
}
.br-btn:hover { background: rgba(30, 44, 80, 0.8); }
.br-btn:active { transform: scale(0.97); }
.br-btn-icon { padding: 0; font-size: 22px; }
.br-btn[aria-pressed="true"] { background: rgba(124, 58, 237, 0.7); border-color: #c4b5fd; }
.br-counter {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
}
.br-play {
    min-width: 150px;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    border-color: transparent;
    font-size: 17px;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}
.br-play:hover { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.br-vol {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(10, 16, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.br-vol .br-range { width: 140px; }

.br-title {
    position: absolute;
    left: 20px;
    bottom: 96px;
    right: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.br-title-emoji { font-size: 44px; line-height: 1; }
.br-title h1 { margin: 0; font-size: clamp(24px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.01em; }
.br-title p { margin: 6px 0 0; max-width: 640px; color: #dbe4f3; font-size: 15px; line-height: 1.45; }

.br-ear {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    padding: 16px 22px;
    border-radius: 18px;
    font: 800 20px var(--br-font);
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    z-index: 4;
    pointer-events: none;
}
.br-ear-l { left: 24px; background: rgba(125, 211, 252, 0.9); color: #082f49; }
.br-ear-r { right: 24px; background: rgba(249, 168, 212, 0.9); color: #500724; }
.br-ear.is-on { opacity: 1; transform: translateY(-50%) scale(1); }

.br-start {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: radial-gradient(circle at center, rgba(5, 8, 20, 0.45), rgba(5, 8, 20, 0.8));
    padding: 16px;
}
.br-start-card {
    max-width: 440px;
    text-align: center;
    padding: 28px 26px;
    border-radius: 22px;
    background: rgba(12, 18, 36, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.br-start-icon { font-size: 54px; animation: br-bob 2.6s ease-in-out infinite; }
@keyframes br-bob { 50% { transform: translateY(-6px); } }
.br-start-card h2 { margin: 8px 0 8px; font-size: 26px; }
.br-start-card p { margin: 0 0 18px; color: #cfd8ea; line-height: 1.5; }
.br-start-card small { display: block; margin-top: 14px; color: var(--br-dim); }
.br-start-btn { min-height: 54px; padding: 0 26px; font-size: 18px; }

/* ---------------- pannelli ---------------- */
.br-deck {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    max-width: 1500px;
    margin: 22px auto 0;
    padding: 0 16px;
}
/* largo: radar | mixer | (sinistra/destra sopra i battimenti) */
@media (min-width: 1100px) {
    .br-deck { grid-template-columns: 1.05fr 1fr 1fr; align-items: start; }
    .br-radar-card { grid-row: span 2; }
    .br-mixer-card { grid-row: span 2; }
}
.br-card {
    background: var(--br-panel);
    border: 1px solid var(--br-line);
    border-radius: 20px;
    padding: 18px;
    min-width: 0;
}
.br-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.br-card h2 { margin: 0; font-size: 18px; font-weight: 700; }
.br-hint { margin: 6px 0 12px; color: var(--br-dim); font-size: 13.5px; line-height: 1.45; }

.br-radar-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 460px; margin: 0 auto; }
#brRadar { display: block; width: 100%; height: 100%; touch-action: none; }
#brRadar.is-dragging { cursor: grabbing !important; }

.br-row { margin-top: 14px; }
.br-row > label { display: flex; justify-content: space-between; font-size: 14px; color: #cfd8ea; margin-bottom: 4px; }
.br-row > label b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.br-row-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.br-row-inline .br-range { flex: 1; min-width: 120px; }
.br-mini { font-size: 13px; color: var(--br-dim); }

.br-chip, .br-toggle {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--br-panel-2);
    color: #fff;
    font: 600 14px var(--br-font);
    cursor: pointer;
}
.br-chip:hover, .br-toggle:hover { border-color: rgba(255, 255, 255, 0.35); }
.br-toggle[aria-pressed="true"] { background: linear-gradient(135deg, #6d28d9, #9333ea); border-color: #c4b5fd; }

.br-bal { display: flex; align-items: center; gap: 10px; }
.br-bal .br-range { flex: 1; }
.br-bal-l, .br-bal-r { font-weight: 800; width: 18px; text-align: center; }
.br-bal-l { color: var(--br-left); }
.br-bal-r { color: var(--br-right); }

/* slider grandi: il pollice deve prenderli al primo colpo */
.br-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 44px;
    background: transparent;
    cursor: pointer;
    margin: 0;
}
.br-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, #334155, #475569); }
.br-range::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, #334155, #475569); }
.br-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px; height: 26px; margin-top: -9px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #8b5cf6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.br-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid #8b5cf6; }
.br-range-bal::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--br-left), #475569 50%, var(--br-right)); }
.br-range-bal::-moz-range-track { background: linear-gradient(90deg, var(--br-left), #475569 50%, var(--br-right)); }

/* mixer */
.br-mixer { display: flex; flex-direction: column; gap: 6px; }
.br-src {
    display: grid;
    grid-template-columns: 50px 1fr 46px;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: background .2s, opacity .2s, border-color .2s;
}
.br-src.is-flash { background: rgba(196, 181, 253, 0.12); }
.br-src.is-selected { border-color: rgba(255, 255, 255, 0.35); }
.br-src.is-solo { border-color: #fcd34d; }
.br-src.is-muted { opacity: 0.45; }
.br-src-ico {
    width: 50px; height: 50px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 16, 32, 0.7);
    font-size: 24px;
    cursor: pointer;
}
.br-src.is-muted .br-src-ico { text-decoration: line-through; filter: grayscale(1); }
.br-src-main { min-width: 0; }
.br-src-head { display: flex; gap: 8px; align-items: baseline; }
.br-src-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-src-mot { font-size: 11px; color: var(--br-accent); white-space: nowrap; }
.br-src-where { font-size: 12px; color: var(--br-dim); font-variant-numeric: tabular-nums; }
.br-src-main .br-range { height: 30px; }
.br-src-btn {
    width: 46px; height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--br-panel-2);
    color: #fff;
    font: 800 15px var(--br-font);
    cursor: pointer;
}
.br-src.is-solo .br-src-solo { background: #fcd34d; color: #422006; }

/* battimenti */
.br-beat-card.is-off .br-beat-viz, .br-beat-card.is-off .br-beat-info { opacity: 0.4; }
.br-beat-viz { display: block; width: 100%; height: 90px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.br-beat-info { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13.5px; color: #cfd8ea; font-variant-numeric: tabular-nums; }
.br-beat-info b:first-child { color: var(--br-left); }
.br-beat-band { color: var(--br-accent); font-weight: 600; }
#brBeatInfo b:nth-of-type(2) { color: var(--br-right); }
.br-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.br-preset {
    min-height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--br-panel-2);
    color: #fff;
    font: 700 13px var(--br-font);
    cursor: pointer;
}
.br-preset small { font-weight: 500; color: var(--br-dim); font-size: 11px; margin-top: 2px; }
.br-preset.is-active { background: linear-gradient(135deg, #4f46e5, #7c3aed); border-color: #c4b5fd; }
.br-preset.is-active small { color: #e0e7ff; }
.br-check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: #cfd8ea; min-height: 44px; cursor: pointer; }
.br-check input { width: 22px; height: 22px; accent-color: #8b5cf6; }

/* galleria */
.br-rooms { max-width: 1500px; margin: 34px auto 0; padding: 0 16px; scroll-margin-top: 80px; }
.br-rooms h2 { font-size: 24px; margin: 0 0 14px; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.br-room-card {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    min-height: 118px;
    padding: 16px;
    border-radius: 18px;
    border: 2px solid transparent;
    background: linear-gradient(160deg, var(--c1), var(--c2) 60%, var(--c3));
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    font-family: var(--br-font);
}
.br-room-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.1)); pointer-events: none; }
.br-room-card > * { position: relative; z-index: 1; }
.br-room-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.br-room-card.is-active { border-color: #fff; box-shadow: 0 0 0 3px rgba(196, 181, 253, 0.5); }
.br-room-emoji { font-size: 34px; line-height: 1; }
.br-room-txt strong { display: block; font-size: 16px; margin-bottom: 4px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.br-room-txt small { display: block; font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.br-room-n { position: absolute; top: 10px; right: 12px; font-size: 12px; font-weight: 700; opacity: 0.7; }

.br-seo { max-width: 900px; margin: 40px auto 0; padding: 0 16px; color: #cfd8ea; line-height: 1.65; }
.br-seo h2 { font-size: 20px; margin: 26px 0 8px; }
.br-seo p { margin: 0; }

@media (max-width: 720px) {
    .br-stage { height: 68vh; min-height: 440px; }
    .br-hide-sm { display: none; }
    .br-bar { padding: 10px 12px; gap: 8px; }
    .br-bar-bottom { padding-top: 24px; }
    .br-play { min-width: 0; flex: 1; }
    .br-vol { flex: 1 1 100%; order: 5; }
    .br-vol .br-range { width: 100%; }
    .br-title { bottom: 150px; left: 14px; right: 14px; }
    .br-title-emoji { font-size: 34px; }
    .br-title p { font-size: 13.5px; }
    .br-deck { grid-template-columns: 1fr; padding: 0 12px; }
    .br-card { padding: 14px; }
    .br-presets { grid-template-columns: repeat(3, 1fr); }
    .br-ear { font-size: 16px; padding: 12px 14px; }
}
