/**
 * Audience view. Mobile first, dark, high contrast: this is used by hundreds
 * of different phones in a dark room.
 *
 * Every selector is scoped with .wk-app. The standalone page drops theme CSS
 * (see WK_Frontend::dequeue_theme_styles), but the shortcode runs inside the
 * theme, and a single `li { display: block }` rule there is enough to break
 * the song rows.
 */

.wk-app {
	--wk-bg: #0d0d10;
	--wk-surface: #17171b;
	--wk-surface-2: #1f1f25;
	--wk-accent: #ff3f6e;
	--wk-accent-2: #ffb800;
	--wk-text: #f4f3ef;
	--wk-muted: #8b8b93;
	--wk-border: #2a2a30;
	/* Ranking bar wash: strong enough to compare, too weak to read as "selected". */
	--wk-wash: rgba(255, 63, 110, 0.1);
	--wk-radius: 12px;
	--wk-font-head: "Oswald", "Helvetica Neue", Impact, system-ui, sans-serif;
	--wk-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--wk-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	padding: 0 16px 56px;
	background: var(--wk-bg);
	color: var(--wk-text);
	font-family: var(--wk-font-body);
	font-size: 17px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}

.wk-app *,
.wk-app *::before,
.wk-app *::after {
	box-sizing: border-box;
}

/* [hidden] has to beat the display values we set below. */
.wk-app [hidden] {
	display: none !important;
}

/* Scoped list reset. Kept at low specificity so the lists below can opt out. */
.wk-app ol,
.wk-app ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wk-app li {
	margin: 0;
	padding: 0;
}

/* Standalone view owns the whole document. */
body.wk-body {
	margin: 0;
	padding: 0;
	background: #0d0d10;
	color: #f4f3ef;
}

.wk-app--standalone {
	min-height: 100vh;
}

.wk-app .wk-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.wk-app :focus-visible {
	outline: 3px solid var(--wk-accent-2);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- header */

.wk-app .wk-header {
	padding: 28px 0 18px;
	text-align: center;
}

.wk-app .wk-title {
	margin: 0 0 6px;
	font-family: var(--wk-font-head);
	font-size: 30px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--wk-text);
}

.wk-app .wk-intro {
	margin: 0;
	font-size: 15px;
	color: var(--wk-muted);
}

/* ------------------------------------------------------------ code gate */

.wk-app .wk-gate {
	margin: 24px 0;
	padding: 24px 20px;
	background: var(--wk-surface);
	border: 1px solid var(--wk-border);
	border-radius: var(--wk-radius);
	text-align: center;
}

.wk-app .wk-gate__title {
	margin: 0 0 6px;
	font-family: var(--wk-font-head);
	font-size: 22px;
	font-weight: 500;
	text-transform: uppercase;
}

.wk-app .wk-gate__hint {
	margin: 0 0 18px;
	font-size: 15px;
	color: var(--wk-muted);
}

.wk-app .wk-gate__form {
	display: flex;
	gap: 8px;
}

.wk-app .wk-gate__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 52px;
	padding: 0 14px;
	font-family: var(--wk-font-mono);
	font-size: 18px;
	color: var(--wk-text);
	background: var(--wk-bg);
	border: 1px solid var(--wk-border);
	border-radius: 10px;
}

.wk-app .wk-gate__input::placeholder {
	color: var(--wk-muted);
}

.wk-app .wk-gate__submit {
	flex: 0 0 auto;
	min-height: 52px;
	padding: 0 22px;
	font-family: var(--wk-font-head);
	font-size: 17px;
	text-transform: uppercase;
	color: #fff;
	background: var(--wk-accent);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.wk-app .wk-gate__error {
	margin: 14px 0 0;
	font-size: 15px;
	color: var(--wk-accent);
}

/* ---------------------------------------------------------- budget bar */

.wk-app .wk-budget {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 -16px 14px;
	padding: 14px 16px;
	background: rgba(13, 13, 16, 0.94);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--wk-border);
	font-size: 15px;
}

.wk-app .wk-budget--empty {
	color: var(--wk-accent-2);
}

.wk-app .wk-budget__left {
	font-family: var(--wk-font-mono);
	font-size: 19px;
	color: var(--wk-accent);
}

.wk-app .wk-budget--empty .wk-budget__left {
	color: var(--wk-accent-2);
}

.wk-app .wk-budget__total {
	font-family: var(--wk-font-mono);
}

.wk-app .wk-budget__dots {
	display: flex;
	flex: 0 0 auto;
	gap: 5px;
}

.wk-app .wk-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 1px solid var(--wk-accent);
}

.wk-app .wk-dot--used {
	background: var(--wk-accent);
}

/*
 * Status band. "before" and "break" are invitations to keep voting, "ended"
 * is a goodbye - so only the last one dims the list.
 */
.wk-app .wk-status {
	margin: 0 0 14px;
	padding: 13px 16px;
	text-align: center;
	font-size: 15px;
	line-height: 1.4;
	color: var(--wk-text);
	background: var(--wk-surface);
	border: 1px solid var(--wk-border);
	border-radius: var(--wk-radius);
}

.wk-app .wk-status--before {
	color: var(--wk-accent);
	border-color: var(--wk-accent);
	background: rgba(255, 63, 110, 0.08);
}

.wk-app .wk-status--break {
	color: var(--wk-accent-2);
	border-color: rgba(255, 184, 0, 0.55);
	background: rgba(255, 184, 0, 0.08);
}

.wk-app .wk-status--ended {
	color: var(--wk-muted);
}

.wk-app .wk-list--locked .wk-row {
	opacity: 0.4;
	cursor: default;
}

.wk-app .wk-list--locked .wk-row:active {
	transform: none;
}

.wk-app .wk-note {
	margin: 0 0 12px;
	padding: 10px 12px;
	font-size: 14px;
	color: var(--wk-accent-2);
	background: rgba(255, 184, 0, 0.08);
	border-radius: 10px;
}

.wk-app .wk-state {
	margin: 24px 0;
	padding: 28px 20px;
	text-align: center;
	font-size: 17px;
	color: var(--wk-muted);
	background: var(--wk-surface);
	border: 1px solid var(--wk-border);
	border-radius: var(--wk-radius);
}

/* ------------------------------------------------------------ song list */

.wk-app .wk-list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * One row = two columns: everything readable on the left, the vote pill on
 * the right. The pill carries the count and the own-vote state at once, so
 * there is a single place for the thumb to aim at.
 */
.wk-app .wk-row {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 68px;
	margin: 0 0 8px;
	padding: 11px 11px 11px 14px;
	text-align: left;
	font: inherit;
	color: var(--wk-text);
	background: var(--wk-surface);
	border: 1px solid var(--wk-border);
	border-radius: var(--wk-radius);
	cursor: pointer;
	overflow: hidden;
	transition: transform 260ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

/* Ranking bar. Its own wash, never a full card fill. */
.wk-app .wk-row__fill {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 0;
	background: var(--wk-wash);
	transition: width 400ms ease;
	pointer-events: none;
}

.wk-app .wk-row__body {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 9px;
	min-width: 0;
}

.wk-app .wk-row__rank {
	flex: 0 0 auto;
	font-family: var(--wk-font-mono);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: var(--wk-muted);
}

.wk-app .wk-row__text {
	min-width: 0;
}

/* Long titles stay on one line so the row height never jumps. */
.wk-app .wk-row__title {
	display: block;
	font-family: var(--wk-font-head);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wk-app .wk-row__artist {
	display: block;
	margin-top: 1px;
	font-size: 13px;
	color: var(--wk-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wk-app .wk-row__pill {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 64px;
	height: 44px;
	padding: 0 13px;
	background: var(--wk-bg);
	border: 1px solid var(--wk-border);
	border-radius: 22px;
	transition: background-color 160ms ease, border-color 160ms ease;
}

.wk-app .wk-row__num {
	font-family: var(--wk-font-mono);
	font-size: 18px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

/* The check grows out of zero width so the pill does not jump on tap. */
.wk-app .wk-row__mark {
	width: 0;
	overflow: hidden;
	font-size: 13px;
	line-height: 1;
	color: transparent;
	transition: width 140ms ease;
}

/* Own vote: filled pill plus check mark, never colour alone. */
.wk-app .wk-row--voted {
	border-color: var(--wk-accent);
}

.wk-app .wk-row--voted .wk-row__pill {
	color: #fff;
	background: var(--wk-accent);
	border-color: var(--wk-accent);
}

.wk-app .wk-row--voted .wk-row__mark {
	width: 13px;
	color: #fff;
}

/* Budget spent: still readable, clearly not available. */
.wk-app .wk-row--blocked {
	opacity: 0.42;
}

.wk-app .wk-row--pending {
	opacity: 0.7;
}

.wk-app .wk-row:active {
	transform: scale(0.99);
}

/* ---------------------------------------------------------- played list */

.wk-app .wk-played {
	margin-top: 28px;
	border-top: 1px solid var(--wk-border);
	padding-top: 14px;
}

.wk-app .wk-played__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	padding: 0;
	font-family: var(--wk-font-body);
	font-size: 15px;
	color: var(--wk-muted);
	background: none;
	border: 0;
	cursor: pointer;
}

.wk-app .wk-played__count {
	font-family: var(--wk-font-mono);
}

.wk-app .wk-played__chevron {
	margin-left: auto;
	transition: transform 160ms ease;
}

.wk-app .wk-played__toggle[aria-expanded="true"] .wk-played__chevron {
	transform: rotate(180deg);
}

.wk-app .wk-played__list {
	margin: 6px 0 0;
	padding: 0 0 0 22px;
	list-style: decimal;
	color: var(--wk-muted);
	font-size: 15px;
}

.wk-app .wk-played__list li {
	padding: 5px 0;
	text-decoration: line-through;
}

/* ---------------------------------------------------------------- toast */

.wk-app .wk-toast {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 50;
	max-width: 90vw;
	padding: 12px 18px;
	transform: translateX(-50%);
	font-size: 15px;
	color: var(--wk-text);
	background: var(--wk-surface-2);
	border: 1px solid var(--wk-accent);
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.wk-app .wk-footer {
	margin-top: 32px;
	text-align: center;
	font-size: 13px;
	color: var(--wk-muted);
}

.wk-app .wk-footer p {
	margin: 0;
}

/*
 * The band's way in. Quiet, but deliberately not hidden: the protection is
 * the stage code and the lockout, not obscurity, and on stage this has to be
 * found in seconds.
 */
.wk-app .wk-band {
	margin-top: 4px;
}

.wk-app .wk-band__link {
	display: inline-block;
	padding: 8px 10px;
	font-size: 13px;
 	color: #d3d3d3;
    text-decoration: underline;
	border-bottom: 1px solid transparent;
}

.wk-app .wk-band__link:hover,
.wk-app .wk-band__link:focus-visible {
	color: var(--wk-text);
	border-bottom-color: var(--wk-border);
}

@media (min-width: 560px) {
	.wk-app .wk-title {
		font-size: 38px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wk-app *,
	.wk-app *::before,
	.wk-app *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
