/* Copyright (c) 2026 Donnie Chamberlin. All rights reserved. Proprietary and
confidential. Unauthorized copying, modification or distribution is
prohibited. */
/* Shared styles for host + singer pages. Colors come from the theme (see js/common.js). */
:root {
  --neon: #ff8a00; --bg: #120c07; --panel: #1f150d; --panel2: #2e2016; --line: #5c4033; --text: #fff4e8; --muted: #c9a27e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; }
[hidden] { display: none !important; }
a { color: var(--neon); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

.title-neon { font-family: 'Bungee', 'Arial Black', Impact, sans-serif; color: var(--text); letter-spacing: 1px;
  text-shadow: 0 0 8px var(--neon), 0 0 18px var(--neon), 0 0 32px color-mix(in srgb, var(--neon) 70%, transparent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: 700 15px Inter, system-ui, sans-serif;
  cursor: pointer; text-decoration: none; transition: transform .08s, border-color .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: var(--neon); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--neon); color: #000; border-color: var(--neon); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.red { background: #e52d27; border-color: #e52d27; color: #fff; }
.btn.danger { color: #ff7070; }
.btn.danger:hover { border-color: #ff5a5a; }
.btn.warn { background: #f5b301; color: #000; border-color: #f5b301; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 16px 20px; font-size: 18px; border-radius: 16px; width: 100%; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; padding: 4px; }

/* Inputs */
.input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: 16px Inter, system-ui, sans-serif; outline: none; }
.input:focus { border-color: var(--neon); box-shadow: 0 0 0 3px color-mix(in srgb, var(--neon) 25%, transparent); }
.lbl { display: block; font-weight: 700; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin-top: 8px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--neon); }
.err { color: #ff7a7a; font-size: 14px; min-height: 18px; margin-top: 8px; }

/* Pills */
.pill { display: inline-block; font: 800 11px Inter, sans-serif; letter-spacing: 1px; padding: 3px 9px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted); cursor: default; }
button.pill { cursor: pointer; }
.pill.ok { color: #3ef08a; border-color: #1f6b42; }
.pill.off { color: #ff7a7a; border-color: #6b1f1f; }
.pill.up { color: #000; background: var(--neon); border-color: var(--neon); }
.pill.warn { color: #000; background: #f5b301; border-color: #f5b301; }

/* Modals */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.modal { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--panel); border: 2px solid var(--line); border-radius: 20px; padding: 22px;
  box-shadow: 0 0 50px color-mix(in srgb, var(--neon) 25%, transparent); }
.modal.narrow { max-width: 420px; }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-title { font-family: 'Bungee', sans-serif; font-weight: 400; color: var(--neon); margin: 0 0 6px; font-size: 22px; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.account { margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; width: min(360px, calc(100vw - 32px)); }
.toast { max-width: 100%; overflow-wrap: anywhere; }
.crowd-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 7; }
.crowd-emoji { position: absolute; bottom: -74px; font-size: clamp(36px, 4.5vw, 72px); line-height: 1; animation: crowd-float 3s ease-out forwards; filter: drop-shadow(0 2px 4px #0008); }
@keyframes crowd-float { 0% { opacity: 0; transform: translate(0, 0) scale(.8); } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--drift), calc(-1 * var(--rise))) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .crowd-emoji { animation-name: crowd-fade; bottom: 20%; } }
@keyframes crowd-fade { 0%, 100% { opacity: 0; } 15%, 75% { opacity: 1; } }
.reaction-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.reaction-buttons .btn { min-width: 0; min-height: 56px; padding: 8px 0; font-size: 32px; }
.reaction-samples { font-size: 1.2em; line-height: 1.7; }
.toast { background: var(--panel2); color: var(--text); border: 1px solid var(--neon); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.5); transition: opacity .4s, transform .4s; }
.toast.error { border-color: #ff5a5a; }
.toast.warn { border-color: #f5b301; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* Show logos only change the layout when the host has uploaded one. */
img.custom-logo { object-fit: contain; }
.logo-settings #logo-preview { width: 72px; height: 60px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); padding: 4px; }
.idle-logo { display: block; width: min(240px, 100%); height: 110px; object-fit: contain; object-position: left center; margin: 0 0 16px; }
body.tv-display .idle-logo { width: min(380px, 100%); height: clamp(95px, 17vh, 180px); }
.bs-logo { display: none; }
body.bigscreen .bs-logo { display: block; position: absolute; top: 12px; left: 12px; width: clamp(120px, 10vw, 160px); height: clamp(80px, 7vw, 110px); object-fit: contain; opacity: .58; pointer-events: none; z-index: 6; }

/* Short host announcements sit above the video without taking over controls. */
.stage-message { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 90%; padding: 14px 22px; border: 2px solid var(--neon); border-radius: 18px; background: rgba(0,0,0,.88); color: var(--text); font: 800 clamp(22px, 3vw, 54px)/1.25 Inter, system-ui, sans-serif; text-align: center; overflow-wrap: anywhere; white-space: pre-wrap; pointer-events: none; z-index: 8; text-shadow: 0 0 14px var(--neon); box-shadow: 0 0 28px color-mix(in srgb, var(--neon) 35%, transparent); animation: message-in .18s ease-out; }
body.tv-display .stage-message { font-size: clamp(30px, 4vw, 72px); }
@keyframes message-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stage-message { animation: none; } }

/* Non-modal soundboard: the queue and player stay usable while it is open. */
.soundboard-panel { position: fixed; right: 18px; bottom: 90px; width: min(430px, calc(100vw - 24px)); max-height: calc(100vh - 110px); overflow-y: auto; z-index: 80; padding: 18px; border: 2px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 0 32px color-mix(in srgb, var(--neon) 25%, transparent); }
.soundboard-panel .modal-title { font-size: 20px; }
.soundboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.soundboard-grid > .btn { min-height: 60px; white-space: normal; justify-content: space-between; text-align: left; }
.soundboard-grid kbd { color: var(--muted); font: 600 12px Inter, sans-serif; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.soundboard-volume { margin: 14px 0; font-size: 14px; }
.soundboard-volume input { min-width: 0; flex: 1; accent-color: var(--neon); }
.soundboard-volume output { width: 40px; text-align: right; }
.soundboard-custom { margin-top: 14px; border-top: 1px solid var(--line); }
.soundboard-sayings { margin-top: 14px; border-top: 1px solid var(--line); }
.saying-actions { margin-top: 10px; }
.custom-sound { display: flex; align-items: stretch; gap: 4px; }
.custom-sound > .btn:first-child { min-width: 0; flex: 1; white-space: normal; overflow-wrap: anywhere; min-height: 54px; }
.custom-sound > .sound-delete { align-self: flex-start; padding: 4px 6px; }
@media (max-width: 640px) { .soundboard-panel { right: 12px; bottom: 12px; max-height: calc(100vh - 24px); } }

.song-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; background: var(--panel); font-size: 13px; }
.song-tools progress { width: 90px; accent-color: var(--neon); }
body.bigscreen .song-tools { display: none; }
.break-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: 70%; padding: 14px 22px; text-align: center; border: 2px solid var(--neon); border-radius: 14px; background: rgba(0,0,0,.94); z-index: 7; }
.break-banner strong { color: var(--neon); font: 800 clamp(18px, 2.5vw, 42px)/1.2 Inter, sans-serif; }
#break-countdown { font-size: clamp(16px, 1.8vw, 30px); margin: 8px 0; }
.break-banner small { color: var(--muted); }
.event-slide { margin-top: 18px; padding: 14px 18px; border-left: 4px solid var(--neon); border-radius: 10px; background: var(--panel2); overflow-wrap: anywhere; }
#event-slide-title { font-weight: 800; font-size: clamp(18px, 1.6vw, 30px); color: var(--neon); }
#event-slide-text { font-size: clamp(15px, 1.2vw, 24px); margin: 6px 0 0; white-space: pre-wrap; }
body.tv-display .idle-info { max-height: 100%; overflow-y: auto; }
body.tv-display.has-event-slides .idle-logo { width: min(280px, 100%); height: clamp(65px, 10vh, 100px); margin-bottom: 10px; }
body.tv-display.has-event-slides .idle-cta { font-size: clamp(30px, 3.5vw, 56px); }
body.tv-display.has-event-slides .idle-url { display: none; }
body.tv-display.has-event-slides .idle-next { margin-top: 14px; padding: 14px; }
body.tv-display.has-event-slides .idle-next .lbl { font-size: clamp(22px, 2.2vw, 34px); }
body.tv-display.has-event-slides .idle-next .nm { font-size: clamp(28px, 3vw, 46px); margin: 6px 0; }
body.tv-display.has-event-slides .idle-next .sg { font-size: clamp(18px, 1.7vw, 28px); margin-bottom: 0; }
body.tv-display.has-event-slides .idle-next .nm, body.tv-display.has-event-slides .idle-next .sg,
body.tv-display.has-event-slides #event-slide-title, body.tv-display.has-event-slides #event-slide-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.minutes-input { max-width: 85px; }
.show-files { display: grid; gap: 8px; margin-top: 12px; }
.show-files .grow { min-width: 0; overflow-wrap: anywhere; }
.show-files .row { padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.phone-break { margin: 14px 0 0; padding: 14px; border: 2px solid var(--neon); border-radius: 12px; font-weight: 700; }
.wait-estimate { color: var(--muted); font-size: 14px; margin-top: 12px; line-height: 1.5; }
/* Intro stays below the logo, QR, break timer and announcement overlays. */
.intro-wrap { position:absolute; inset:0; z-index:4; background:#000; }
.intro-wrap video { width:100%; height:100%; object-fit:contain; }
.intro-skip { position:absolute; bottom:18px; left:18px; opacity:.8; }
.intro-sound { position:absolute; bottom:72px; left:18px; }
body.preview-display .intro-sound { display:none; }
body.tv-display.intro-on:not(.preview-display) #bs-overlay { display:flex !important; }
body.preview-display .intro-skip { display:none; }
/* Shared laptop / TV call-to-stage screen, above decorative video and QR overlays. */
.call-overlay { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px; text-align: center; background: var(--bg); overflow: auto; }
.call-heading { font-family: Bungee, sans-serif; color: var(--neon); font-size: clamp(24px, 3.8vw, 70px); line-height: 1.2; overflow-wrap: anywhere; }
.call-song { font-size: clamp(18px, 2.2vw, 38px); overflow-wrap: anywhere; }
.call-count { font-weight: 900; font-size: clamp(62px, 9vw, 160px); line-height: 1.1; color: var(--neon); font-variant-numeric: tabular-nums; }
#call-actions { justify-content: center; }
#call-note { margin: 0; }
.call-ready { animation: call-ready 1s ease-in-out infinite alternate; }
@keyframes call-ready { to { box-shadow: 0 0 20px var(--neon); } }
body.tv-display #call-actions, body.tv-display #call-note { display: none; }
body.calling-on #intro-wrap, body.calling-on #bs-overlay { visibility: hidden; }
body.calling-on .bs-logo { z-index: 21; }
@media (max-width: 760px) { .call-overlay { padding: 12px; gap: 6px; } .call-heading { font-size: 23px; } .call-count { font-size: 62px; } #call-actions .btn { padding: 10px; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .call-ready { animation: none; outline: 3px solid var(--neon); } }
/* A small reserved footer row keeps the notice clear of playback controls. */
.copyright-footer { flex: none; margin: 0; padding: 3px 8px; text-align: center; color: var(--muted); background: var(--bg); font: 11px/14px Inter, system-ui, sans-serif; overflow-wrap: anywhere; }


/* Custom floating pictures use the same bounded animation as emoji. */
.crowd-emoji img { width: clamp(64px, 8vw, 120px); height: clamp(64px, 8vw, 120px); object-fit: contain; }
#reaction-buttons img { width: 42px; height: 42px; object-fit: contain; }
.custom-reaction-settings { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
#custom-reaction-list > div { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
#custom-reaction-list img { width: 56px; height: 56px; object-fit: contain; }
#custom-reaction-list span { flex: 1; overflow-wrap: anywhere; }
