/* A single master switch and three independent mix levels. */
.topbar { z-index: 4; }
.audio-tools { position: relative; display: flex; align-items: center; border: 1px solid #6f85794f; background: #18221f88; }
.audio-toggle, .audio-settings { display: inline-flex; justify-content: center; align-items: center; min-height: 33px; color: #c4cfc9; }
.audio-toggle { gap: 7px; padding: 0 9px; font-size: 11px; }
.audio-toggle[aria-pressed="true"] { color: #aae8c7; }
.audio-settings { width: 32px; border-left: 1px solid #78978338; }
.audio-settings .ic { --size: 15px; }
.audio-tools button:hover, .audio-settings[aria-expanded="true"] { background: #354439a8; color: white; }
.mix-panel { position: absolute; z-index: 3; top: calc(100% + 10px); right: -1px; width: min(300px,91vw); padding: 15px 17px 18px; border: 1px solid #66786d; border-top: 2px solid #9cc9ae; background: linear-gradient(126deg,#24302bfa,#111a19fd 70%); box-shadow: 0 16px 42px #0009; }
.mix-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; font-size: 14px; }
#mix-close { display:flex; width:100%; min-height:44px; margin-top:10px; }
.mix-panel label { display: grid; grid-template-columns: auto 1fr 34px; align-items: center; gap: 12px; font-size: 12px; min-height: 33px; color: #d5e0d7; }
.mix-panel output { text-align: right; font: 12px var(--mono); color: #b6d7c3; }
.mix-panel input { appearance: none; width: 100%; height: 22px; margin: 0; cursor: pointer; background: transparent; accent-color: #ade5c2; }
.mix-panel input::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg,#a8d9ba var(--fill),#53645a var(--fill)); }
.mix-panel input::-webkit-slider-thumb { appearance: none; width: 10px; height: 13px; margin-top: -5px; border: 1px solid #dafae4; border-radius: 1px; background: #a2c6b1; }
.mix-panel input::-moz-range-track { height: 3px; background: #53645a; }
.mix-panel input::-moz-range-progress { height: 3px; background: #a8d9ba; }
.mix-panel input::-moz-range-thumb { width: 9px; height: 12px; border: 1px solid #dafae4; border-radius: 1px; background: #a2c6b1; }
.mix-panel input:focus-visible { outline: 1px solid #a0d9ba; outline-offset: 2px; }

.draw-button {
  isolation: isolate; overflow: hidden;
  background: linear-gradient(105deg,#26251fee 0%,#443b2aeb 36%,#383226eb 72%,#25241fee);
  border-color: #c9ad71; box-shadow: inset 0 1px #fff3bb43,inset 0 -2px #e2c276,0 6px 25px #05060852;
  transition: background .16s, box-shadow .16s, transform .12s;
}
.draw-button::before { content: ""; position: absolute; inset: 4px 5px; z-index: -1; pointer-events: none; border: solid #e7cca93a; border-width: 0 1px; }
.draw-button::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(110deg,transparent 33%,#fff0ab29 47%,transparent 62%); transform: translateX(-110%); }
.draw-button:is(:hover,:focus-visible)::after { animation: control-glint .74s ease-out; }
.draw-button:active { transform: translateY(2px); box-shadow: inset 0 2px 5px #120f0c95, inset 0 -1px #e5ce8c; }
@keyframes control-glint { to { transform: translateX(110%); } }

/* The three original line titles remain individual, playable controls. */
.voice-lines { display: grid; width: 100%; gap: 6px; }
.voice-line {
  min-width: 0; display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 7px 13px;
  color: #f6f2e5; background: linear-gradient(100deg,#2a2a26dd,#393931c9);
  border: 1px solid #d3c9a545; border-left: 2px solid #beae8a91;
  text-align: left; font-size: clamp(11px,1.04vw,15px); line-height: 1.4; backdrop-filter: blur(5px);
}
.voice-line .ic { --size: 15px; color: #e3d1a6; }
.voice-line:hover { background: #42473cde; border-color: #cabf9aba; }
.voice-line[aria-pressed="true"] { border-left-color: #b9e4c9; background: linear-gradient(95deg,#264032ee,#303c35df); color: #daffea; }
.voice-line[aria-pressed="true"] .ic { color: #afe4c1; }
.voice-wave { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-left: auto; height: 15px; width: 13px; opacity: 0; color: #b6ebc9; }
.voice-wave i { display: block; width: 2px; height: 100%; background: currentColor; transform: scaleY(.4); }
[data-voice-pool][aria-pressed="true"] .voice-wave { opacity: 1; }
[data-voice-pool][aria-pressed="true"] .voice-wave i { animation: syllable .58s ease-in-out infinite alternate; }
.voice-wave i:nth-child(2) { animation-delay: -.37s !important; }
.voice-wave i:nth-child(3) { animation-delay: -.17s !important; }
.voice-wave i:nth-child(4) { animation-delay: -.48s !important; }
@keyframes syllable { 0% { transform: scaleY(.18); } 55% { transform: scaleY(.95); } 100% { transform: scaleY(.41); } }
#inspect-voices { width: min(78%,420px); z-index: 2; }
.loot-inspector[data-item="voice"] .inspect-art { z-index: 2; }
.loot-inspector[data-item="voice"] #inspect-image { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.voice-replay { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #647469; padding: 4px 6px; color: #cbe0cf; font-size: 11px; }
.voice-replay .ic { --size: 12px; }
.voice-replay .voice-wave { display: none; }
.voice-replay[aria-pressed="true"] { background: #263e30; }
.gift-voices { margin-top: 12px; font-size: 12px; }
.gift-voices summary { width: fit-content; padding: 4px 0; color: #c4d5cb; cursor: pointer; }
.gift-voices .voice-lines { margin-top: 6px; max-width: 390px; }

/* Award cards use the authentic art on the same surface as its name and receipt. */
#dialog[data-view="result"] { width: min(816px,calc(100vw - 36px)); }
#dialog[data-view="result"] .dialog-heading { padding-block: 15px 13px; }
#dialog[data-view="result"][data-grade="gold"] { border-top-color: #d8c28e; }
#dialog[data-view="result"][data-grade="red"] { border-top-color: #ec9586; }
.reward-show { isolation: isolate; position: relative; display: grid; grid-template-columns: minmax(0,.96fr) minmax(0,1.55fr); grid-template-areas: "name visual"; align-items: center; gap: 0; min-height: clamp(220px,31svh,345px); padding: 15px 19px; overflow: hidden; background: #20221f; border: 1px solid #857a5766; border-bottom: 2px solid var(--tint); }
.reward-haze { position: absolute; z-index: -3; inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(24px) saturate(.78) brightness(.68); }
.reward-show::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#111818ef,#151b19bc 30%,#191b152c 60%); }
.reward-show .award-art { grid-area: visual; display: grid; grid-template: minmax(0,1fr)/minmax(0,1fr); place-items: center; height: clamp(190px,28svh,305px); border: none; background: none; }
.reward-show .award-art::before { display: none; }
.reward-show .award-art img { width: auto; height: auto; min-height: 0; min-width: 0; max-width: 100%; max-height: 100%; mask-image: linear-gradient(90deg,transparent,#000 5%,#000 96%,transparent),linear-gradient(0deg,transparent,#000 5%,#000 95%,transparent); mask-composite: intersect; }
.reward-copy { grid-area: name; position: relative; z-index: 1; padding: 6px 8px 6px 2px; text-shadow: 0 2px 9px #060d0f85; }
.reward-copy .reward-type { letter-spacing: .025em; }
.reward-copy h3 { margin: 11px 0 8px; text-wrap: balance; line-height: 1.35; }
.reward-copy p { color: #c4ccc3; }
.reward-show[data-item="voice"] .award-art { opacity: 0; }
.result-voices { z-index: 2; grid-area: visual; justify-self: stretch; padding: 0 3px; }
.result-voices .voice-line { min-height: 42px; font-size: 13px; }
.result-light { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.result-light::before { content: ""; position: absolute; inset: -24%; background: linear-gradient(111deg,transparent 43%,#f9e2ac16 48%,#fff7c83d 50%,transparent 53%); transform: translateX(103%); animation: reveal-brush .88s cubic-bezier(.16,.63,.29,1) both; }
.result-light::after { content: ""; position: absolute; inset: 7px; border: 1px solid #f7e0a23d; clip-path: polygon(0 0,22px 0,22px 1px,1px 1px,1px 14px,0 14px,0 0,100% 100%,calc(100% - 22px) 100%,calc(100% - 22px) calc(100% - 1px),calc(100% - 1px) calc(100% - 1px),calc(100% - 1px) calc(100% - 14px),100% calc(100% - 14px),100% 100%); }
@keyframes reveal-brush { from { transform: translateX(-105%); } to { transform: translateX(105%); } }
.jackpot-visual { min-height: clamp(226px,33svh,355px); border-color: #af6b60; border-bottom-color: #f7937d; background: radial-gradient(ellipse at 36% 78%,#75372a,#241e21 70%); }
.jackpot-visual > img { max-width: 88%; mask-image: linear-gradient(90deg,transparent,#000 19%); }
.jackpot-visual::before { background: linear-gradient(90deg,#291b1cef 5%,#3f2523d1 33%,transparent 78%),linear-gradient(0deg,#15151bb3,transparent 52%); }
.jackpot-visual .result-light::before { background: linear-gradient(111deg,transparent 39%,#fca38d1a 45%,#fed7a44a 50%,transparent 55%); animation-duration: 1.15s; }
.reveal-content .jackpot-visual::after { display: none; }
.jackpot-visual h3 { text-shadow: 0 3px 13px #090b0e55; }
.jackpot-visual h3, .jackpot-visual p, .jackpot-visual small { position: relative; z-index: 1; }
.jackpot-visual small { color: #ffc3ab; }
#film-sweep { opacity: 0; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(108deg,transparent 33%,#d1d1b606 43%,#f0e1be26 49%,#e8d8aa07 52%,transparent 62%); }
#film-voices { position: absolute; left: 50%; top: 50%; z-index: 1; width: min(445px,86vw); transform: translate(-50%,-50%); }
#theater[data-prize="voice"] #film-still { inset: -3%; width: 106%; height: 106%; object-fit: cover; filter: blur(25px) brightness(.48); }
#theater[data-phase="reward"] .film-caption h2 { color: #f5e3b6; }
#theater[data-phase="reward"] #film-still { animation: award-focus .52s cubic-bezier(.17,.76,.29,1) both; }
@keyframes award-focus { from { opacity: .65; scale: 1.025; } to { opacity: 1; scale: 1; } }
.film-trace { height: 2px; }
.film-trace i { box-shadow: 0 0 7px #f0d59e60; }

@media (max-width: 720px) {
  .audio-toggle { min-height: 30px; padding: 0 6px; }
  .audio-toggle > span { display: none; }
  .audio-toggle .ic { --size: 15px; }
  .audio-settings { min-height: 30px; width: 27px; }
  .audio-settings .ic { --size: 13px; }
  .loot-inspector[data-item="voice"] { display: flex; flex-direction: column; justify-content: flex-end; min-height: 217px; height: auto; padding: 11px; }
  .loot-inspector[data-item="voice"] .inspect-caption { position: relative; bottom: auto; left: auto; order: -1; margin-bottom: 9px; max-width: 100%; }
  .loot-inspector[data-item="voice"] .inspect-art { position: relative; width: 100%; height: auto; }
  #inspect-voices { width: 100%; }
  .voice-line { min-height: 35px; padding: 5px 9px; font-size: 12px; }
  .mix-panel { width: min(275px,90vw); }
  #dialog[data-view="result"] { width: calc(100vw - 20px); }
  .reward-show { padding: 11px; min-height: 195px; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); }
  .reward-show .award-art { height: 160px; }
  .reward-copy .reward-type { gap: 5px; font-size: 10px; }
  .reward-copy .result-thumb { width: 28px; height: 28px; }
  .reward-copy p { font-size: 11px; }
  .reward-show[data-item="voice"] { grid-template: auto auto / minmax(0,1fr); grid-template-areas: "name" "visual"; gap: 9px; }
  .reward-show[data-item="voice"] .award-art { display: none; }
  .reward-show[data-item="voice"] .reward-copy { padding: 0; }
  .award-state { z-index: 1; }
  .result-voices { padding: 0; }
  .result-voices .voice-line { min-height: 34px; font-size: 12px; }
  .jackpot-visual { min-height: 210px; }
  .log li { gap: 5px; }
  .voice-replay { font-size: 10px; padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .voice-wave i, .result-light::before, .draw-button::after, #film-still { animation: none !important; }
  .result-light::before { opacity: 0; }
}
