/**
 * Laserzone Jukebox: guest app styles.
 *
 * Styles the guest phone app rendered by the [lz_jukebox] shortcode (guest.js): code entry, now
 * playing, the music allowance bar, song search, the request queue with voting, and the venue games
 * (join card, questions, poll results, Reaction Race tap pad, teams). Everything is scoped to
 * .lzj-app so the host WordPress theme is not affected, and colours come from the --lzj-* custom
 * properties below. The toast is the one exception: it is attached to <body>, outside .lzj-app,
 * so it repeats its colours as literal values.
 *
 * @copyright 2026 Approved Systems. All rights reserved.
 * @license   Proprietary. Unauthorised copying, modification or distribution is prohibited.
 */

/* ---------------------------------------------------------------- Theme and base */

.lzj-app {
	--lzj-bg: #0d0b1a;
	--lzj-card: #17142b;
	--lzj-line: #2c2750;
	--lzj-text: #f4f2ff;
	--lzj-muted: #a7a1c9;
	--lzj-accent: #39ff9f;
	--lzj-accent-2: #ff3cac;
	--lzj-accent-ink: #06140d;
	--lzj-warn: #ffcf5c;
	--lzj-error: #ff6b7d;
	--lzj-radius: 14px;
	font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--lzj-text);
	background: var(--lzj-bg);
	border-radius: var(--lzj-radius);
	padding: 16px;
	max-width: 640px;
	margin: 0 auto;
	box-sizing: border-box;
}
.lzj-app *, .lzj-app *::before, .lzj-app *::after { box-sizing: border-box; }
/* Themes often restyle form controls; inherit the app font instead. */
.lzj-app button, .lzj-app input { font: inherit; }
.lzj-loading, .lzj-center { text-align: center; }
.lzj-muted { color: var(--lzj-muted); }
/* Visually hidden but still read by screen readers (used for field labels). */
.lzj-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lzj-pad { padding: 4px 2px 8px; }

/* ---------------------------------------------------------------- Cards and code entry */

.lzj-card {
	background: var(--lzj-card);
	border: 1px solid var(--lzj-line);
	border-radius: var(--lzj-radius);
	padding: 16px;
	margin-bottom: 12px;
}
.lzj-eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--lzj-muted); }
.lzj-entry h2 { margin: 4px 0 8px; font-size: 26px; color: var(--lzj-text); }
.lzj-form { display: grid; gap: 8px; margin-top: 12px; }
.lzj-form label { font-size: 14px; color: var(--lzj-muted); }
.lzj-form input, .lzj-search input {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--lzj-line);
	background: #0f0d20;
	color: var(--lzj-text);
}
/* Screen code field: large, spaced capitals to match the code shown on the TV. */
#lzj-code { font-size: 24px; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.lzj-form input:focus, .lzj-search input:focus { outline: 2px solid var(--lzj-accent); outline-offset: 1px; }
.lzj-booking { margin-top: 16px; color: var(--lzj-muted); }
.lzj-booking summary { cursor: pointer; }

/* ---------------------------------------------------------------- Buttons */

/* 44px minimum height meets the recommended touch target size on phones. */
.lzj-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 10px 18px;
	border-radius: 999px; border: 1px solid var(--lzj-line);
	background: #221e3d; color: var(--lzj-text);
	cursor: pointer; font-weight: 600;
}
.lzj-btn:disabled { opacity: .45; cursor: not-allowed; }
.lzj-btn-primary { background: var(--lzj-accent); color: var(--lzj-accent-ink); border-color: var(--lzj-accent); }
.lzj-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; flex-shrink: 0; }
.lzj-link { background: none; border: 0; padding: 0; color: var(--lzj-accent); cursor: pointer; font-weight: 600; }
.lzj-more { width: 100%; margin-top: 8px; }

/* ---------------------------------------------------------------- Header, music mode and allowance */

.lzj-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
/* Content mode badge (all ages, mixed, adults); the class suffix is the zone's current mode. */
.lzj-mode { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; }
.lzj-mode-all_ages { color: var(--lzj-accent); }
.lzj-mode-mixed { color: var(--lzj-warn); }
.lzj-mode-adults { color: var(--lzj-accent-2); }

/* Music time allowance; the bar shows the share remaining. Also used for track progress. */
.lzj-allowance { margin-bottom: 12px; }
.lzj-allowance-text { font-size: 14px; color: var(--lzj-muted); margin-bottom: 6px; }
.lzj-allowance-text strong { color: var(--lzj-text); }
.lzj-bar, .lzj-progress { height: 6px; background: var(--lzj-line); border-radius: 999px; overflow: hidden; }
.lzj-bar span, .lzj-progress span { display: block; height: 100%; background: var(--lzj-accent); border-radius: 999px; transition: width 1s linear; }

/* ---------------------------------------------------------------- Now playing and track rows */

.lzj-now { display: flex; gap: 14px; align-items: center; }
.lzj-now-body { flex: 1; min-width: 0; }
.lzj-now .lzj-title { font-size: 18px; }
.lzj-now .lzj-progress { margin-top: 10px; }
.lzj-now.compact { margin-top: 12px; }
.lzj-now-empty { display: block; }
.lzj-art { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #221e3d; }
.lzj-art-lg { width: 84px; height: 84px; border-radius: 10px; }
.lzj-art-none { display: flex; align-items: center; justify-content: center; color: var(--lzj-muted); font-size: 22px; }
.lzj-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lzj-artist { color: var(--lzj-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lzj-by { font-size: 13px; color: var(--lzj-muted); margin-top: 2px; }
.lzj-by strong { color: var(--lzj-accent); }

/* ---------------------------------------------------------------- Notices */

.lzj-banner { background: #2a2413; border: 1px solid #5c4a17; color: var(--lzj-warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.lzj-banner.error { background: #2e1419; border-color: #6b2330; color: var(--lzj-error); }
.lzj-hint { font-size: 13px; color: var(--lzj-muted); margin: 8px 2px; }

/* ---------------------------------------------------------------- Tabs (Up next, Request, My songs) */

.lzj-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--lzj-card); border: 1px solid var(--lzj-line); border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.lzj-tab { border: 0; background: none; color: var(--lzj-muted); border-radius: 999px; padding: 10px 4px; cursor: pointer; font-weight: 600; min-height: 44px; white-space: nowrap; font-size: 15px; }
.lzj-tab.active { background: #2a2550; color: var(--lzj-text); }
/* Item count badge on a tab label. */
.lzj-count { display: inline-block; vertical-align: 1px; margin-left: 2px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--lzj-accent-2); color: #fff; font-size: 12px; line-height: 20px; }

/* ---------------------------------------------------------------- Search results and queue lists */

.lzj-search { margin-bottom: 8px; }
.lzj-list { list-style: none; margin: 0; padding: 0; }
/* .mine highlights the guest's own requests in the queue. */
.lzj-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--lzj-line); }
.lzj-row.mine { background: rgba(57, 255, 159, .06); border-radius: 10px; }
.lzj-row-body { flex: 1; min-width: 0; }
.lzj-pos { width: 20px; text-align: center; color: var(--lzj-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
/* Shown instead of the request button when a song cannot be requested yet. */
.lzj-na { font-size: 12px; color: var(--lzj-muted); flex-shrink: 0; }
/* Up and down vote buttons on queued songs, with the net score between them. */
.lzj-votes { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.lzj-vote { border: 1px solid var(--lzj-line); background: #1f1b38; color: var(--lzj-muted); width: 40px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.lzj-vote.up.on { color: var(--lzj-accent-ink); background: var(--lzj-accent); border-color: var(--lzj-accent); }
.lzj-vote.down.on { color: #fff; background: var(--lzj-accent-2); border-color: var(--lzj-accent-2); }
.lzj-score { font-size: 13px; font-weight: 700; padding: 2px 0; font-variant-numeric: tabular-nums; }
/* Request status on My songs; !important overrides the muted .lzj-by colour on the same element. */
.lzj-status-playing, .lzj-status-dispatched { color: var(--lzj-accent) !important; font-weight: 700; }

/* ---------------------------------------------------------------- Toast */

/* Attached to <body> outside .lzj-app, so colours and font are literal rather than custom properties. */
.lzj-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px);
	background: #221e3d; color: #f4f2ff; border: 1px solid #2c2750;
	padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px);
	font: 15px/1.4 system-ui, sans-serif; opacity: 0; pointer-events: none;
	transition: opacity .2s, transform .2s; z-index: 99999; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.lzj-toast.show { opacity: 1; transform: translate(-50%, 0); }
.lzj-toast.ok { border-color: #39ff9f; }
.lzj-toast.error { border-color: #ff6b7d; }

/* ---------------------------------------------------------------- Small phones and reduced motion */

@media (max-width: 380px) {
	.lzj-app { padding: 12px; }
	.lzj-art-lg { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
	.lzj-bar span, .lzj-progress span, .lzj-toast { transition: none; }
}

/* ---------------------------------------------------------------- Games */

/* Join card shown above the music tabs while a game is on; .joined is the compact "back to the game" form. */
.lzj-game-join { border-color: var(--lzj-accent); }
.lzj-game-join h3 { margin: 4px 0 6px; font-size: 20px; }
.lzj-game-join.joined { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Full game screen: top bar (game, round, score), a phase body, and the link back to the music. */
.lzj-game { display: flex; flex-direction: column; gap: 14px; min-height: 70vh; }
.lzj-game-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lzj-game-me { font-size: 14px; color: var(--lzj-muted); }
.lzj-game-me strong { color: var(--lzj-accent); }
/* Central message panel (lobby, results, podium); .good and .bad colour it for right and wrong. */
.lzj-game-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 8px; border-radius: var(--lzj-radius); background: var(--lzj-card); border: 1px solid var(--lzj-line); }
.lzj-game-center.good { border-color: var(--lzj-accent); box-shadow: 0 0 0 2px var(--lzj-accent) inset; }
.lzj-game-center.bad { border-color: var(--lzj-error); }
.lzj-game-center p { margin: 6px 0; }
.lzj-game-big { font-size: 30px; font-weight: 800; line-height: 1.15; margin-bottom: 6px; }
.lzj-game-prize { font-size: 18px; color: var(--lzj-warn); font-weight: 700; }
/* Question screen. The timer bar is updated several times a second, hence the short transition. */
.lzj-game-q { display: flex; flex-direction: column; gap: 12px; }
.lzj-game-timer { height: 6px; border-radius: 999px; background: var(--lzj-line); overflow: hidden; }
.lzj-game-timer span { display: block; height: 100%; background: var(--lzj-accent); transition: width .25s linear; }
.lzj-game-text { font-size: 20px; font-weight: 700; line-height: 1.3; }
/* Answer buttons: a colour and shape per position (a0 to a3), matching the answers on the TV. */
.lzj-game-answers { display: grid; gap: 10px; }
.lzj-game-ans { display: flex; align-items: center; gap: 12px; min-height: 64px; border: 0; border-radius: 12px; padding: 12px 16px; color: #fff; font-weight: 700; font-size: 18px; text-align: left; cursor: pointer; transition: opacity .2s, transform .1s; }
.lzj-game-ans i { font-style: normal; font-size: 18px; opacity: .9; }
.lzj-game-ans:active { transform: scale(.98); }
.lzj-game-ans.a0 { background: #d7385e; }
.lzj-game-ans.a1 { background: #2f6fde; }
.lzj-game-ans.a2 { background: #b98500; }
.lzj-game-ans.a3 { background: #1f9d5a; }
/* After answering, the chosen button is outlined and the rest are dimmed. */
.lzj-game-ans.dim { opacity: .3; }
.lzj-game-ans.picked { box-shadow: 0 0 0 3px #fff; }
.lzj-game-ans:disabled { cursor: default; }
.lzj-game-note { text-align: center; color: var(--lzj-muted); margin: 4px 0 0; }
/* Poll and Majority Rules results: each row's <em> is a percentage bar drawn behind the text. */
.lzj-game-poll { display: grid; gap: 8px; }
.lzj-game-pollrow { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--lzj-card); border: 1px solid var(--lzj-line); }
.lzj-game-pollrow span, .lzj-game-pollrow b { position: relative; z-index: 1; }
.lzj-game-pollrow em { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(57, 255, 159, .18); }
.lzj-game-pollrow.mine { border-color: var(--lzj-accent); }
/* Reaction Race tap pad. touch-action and the selection and highlight resets stop double-tap zoom,
   text selection and the tap flash from delaying or obscuring a tap. */
.lzj-game-pad { flex: 1; min-height: 55vh; width: 100%; border: 0; border-radius: 18px; background: #3b1d2c; color: #ffd1dc; font-size: 28px; font-weight: 800; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.lzj-game-pad.go { background: #16c464; color: #fff; font-size: 48px; }
.lzj-game-music { align-self: center; }
/* Team Battle: join buttons and the team chip in the top bar. The .lzj-app prefix outranks .lzj-btn. */
.lzj-team-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.lzj-app .lzj-team-red { background: #e0314b; border-color: #e0314b; color: #fff; }
.lzj-app .lzj-team-blue { background: #2f6fde; border-color: #2f6fde; color: #fff; }
.lzj-team-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.lzj-team-chip.t-red { background: #e0314b; }
.lzj-team-chip.t-blue { background: #2f6fde; }
/* Majority Rules shows its result panel above the vote bars, so it must not stretch to fill the screen. */
.lzj-game-q .lzj-game-center { flex: none; padding: 16px 8px; }
