/*
 * The installable player (jah-app.php). A page of its own, so it carries its
 * own small stylesheet rather than the theme's: same paper, ink, seal and
 * type, written out as plain values because WordPress's colour variables are
 * not printed here.
 */
:root {
	--paper: #F2F3F5;
	--ink: #14161A;
	--ink-soft: #363A40;
	--muted: #5B6068;
	--rule: #D7DAE0;
	--seal: #C23B1E;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	background-color: var(--paper);
	background-size: 420px 420px;
	color: var(--ink);
	font-family: "Barlow Semi Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior: none;
	user-select: none; -webkit-user-select: none;
}
a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { color: var(--seal); border-bottom-color: var(--seal); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.jah-app-frame {
	min-height: 100%;
	max-width: 30rem;
	margin: 0 auto;
	display: flex; flex-direction: column;
	padding: calc(1.25rem + env(safe-area-inset-top)) calc(1.5rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) calc(1.5rem + env(safe-area-inset-left));
}

/* Head: wordmark left, chip right. */
.jah-app-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.jah-wordmark { font-size: 1rem; letter-spacing: 0.22em; white-space: nowrap; }
.jah-wordmark strong { font-weight: 500; }
.jah-wordmark span { font-weight: 200; }
.jah-onair {
	display: inline-flex; align-items: center; gap: 0.5rem;
	padding: 0.35rem 0.7rem;
	background: var(--seal); color: #FFF;
	font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
}
.jah-onair::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.jah-onair.is-off { background: transparent; color: var(--muted); border: 1px solid var(--rule); }

.jah-label {
	margin: 0 0 0.4rem;
	font-size: 0.75rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase;
	color: var(--muted);
}

/* The player: the ensō with the button at its centre, the words beneath. */
.jah-player { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 1rem 0; }
.jah-live, .jah-between { display: flex; flex-direction: column; align-items: center; text-align: center; }

.jah-app-enso { position: relative; width: min(72vw, 46vh, 19rem); aspect-ratio: 929 / 910; }
/* Mirrored and tilted exactly as the home page sets it: heavy stroke to the right. */
.jah-app-enso img { display: block; width: 100%; height: 100%; pointer-events: none; transform: scaleX(-1) rotate(-4deg); }
.jah-app-enso-sm img { transform: none; }
.jah-app-enso-sm { width: min(46vw, 10rem); aspect-ratio: 1; }
.jah-between .jah-app-enso { opacity: 0.55; }

.jah-play {
	position: absolute; left: 48.5%; top: 43.5%;   /* the centre of the brushed circle, not of the picture: the splatter hangs low */
	width: 31%; aspect-ratio: 1;
	transform: translate(-50%, -50%);
	display: grid; place-items: center;
	padding: 0; border: none; border-radius: 50%;
	background: var(--seal);
	cursor: pointer;
	font-size: clamp(0.8rem, 3.6vw, 1.15rem);
	transition: transform 120ms ease;
}
.jah-play:hover { transform: translate(-50%, -50%) scale(1.05); }
.jah-play:active { transform: translate(-50%, -50%) scale(0.97); }
.jah-play-icon {
	width: 0; height: 0;
	margin-left: 0.35em;
	border-left: 1.15em solid #FFF;
	border-top: 0.72em solid transparent;
	border-bottom: 0.72em solid transparent;
}
.jah-play.is-playing .jah-play-icon {
	width: 1.05em; height: 1.2em; margin-left: 0; border: none;
	background: linear-gradient(to right, #FFF 0 35%, transparent 35% 65%, #FFF 65% 100%);
}
.jah-play.is-loading { animation: jah-pulse 1.1s ease-in-out infinite; }
.jah-play.is-loading .jah-play-icon { opacity: 0.45; }
@keyframes jah-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .jah-play.is-loading { animation: none; opacity: 0.6; } }

.jah-live-text { margin-top: 1.5rem; width: 100%; min-height: 5.5rem; }
.jah-live.is-on .jah-live-state { color: var(--seal); }
.jah-np { margin: 0; line-height: 1.2; }
.jah-np-title { display: block; font-size: clamp(1.25rem, 5.5vw, 1.625rem); font-weight: 400; text-wrap: balance; }
.jah-np-artist { display: block; margin-top: 0.25rem; font-size: 1.0625rem; font-weight: 300; color: var(--muted); }
.jah-np-artist:empty { display: none; }
.jah-app-replay { margin: 1rem 0 0; font-weight: 300; }

/* You just heard — three records, and only in a window tall enough to hold
   them without crowding the ensō. The player builds five; the rest stay hidden. */
.jah-heard { width: 100%; max-width: 22rem; margin: 1.25rem auto 0; text-align: left; }
.jah-heard[hidden] { display: none; }
.jah-heard .jah-label { margin: 0 0 0.25rem; text-align: center; }
.jah-heard-list { margin: 0; padding: 0; list-style: none; }
.jah-heard-list li {
	display: flex; gap: 0.5rem; align-items: baseline;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--rule);
	font-size: 0.9375rem; line-height: 1.25;
	white-space: nowrap; overflow: hidden;
}
.jah-heard-list li:nth-child(n+4) { display: none; }
.jah-heard-artist { font-weight: 500; flex-shrink: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.jah-heard-title { font-weight: 300; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 659px) { .jah-heard { display: none; } }

/* Foot */
.jah-app-foot { text-align: center; font-size: 0.8125rem; color: var(--muted); }
.jah-app-foot p { margin: 0.6rem 0 0; }
.jah-app-site { letter-spacing: 0.12em; }
.jah-app-site a { border-bottom: none; }
.jah-app-install-btn {
	font: inherit; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.75rem;
	padding: 0.6rem 1.1rem;
	background: var(--ink); color: var(--paper);
	border: 1px solid var(--ink); cursor: pointer;
}
.jah-app-install-btn:hover { background: var(--seal); border-color: var(--seal); }
.jah-app-install-how { display: block; font-weight: 300; }
.jah-app-install-btn:not([hidden]) + .jah-app-install-how:empty { display: none; }

/* The dock exists only to hold the audio for jah-player.js; it is never shown here. */
.jah-dock { display: none !important; }
.jah-sc { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* A short, wide window: put the words beside the ensō. */
@media (max-height: 420px) and (min-width: 480px) {
	.jah-live, .jah-between { flex-direction: row; justify-content: center; gap: 1.75rem; text-align: left; }
	.jah-app-enso { width: min(58vh, 12rem); flex-shrink: 0; }
	.jah-live-text { margin-top: 0; width: auto; min-height: 0; max-width: 20rem; }
	.jah-player { padding: 0.5rem 0; }
}
