/* 名前だけ知らないラジオ：サイト共通のプレイヤーのバー（テーマの CSS と混ざらないよう wr-bar の中だけ） */

.wr-bar {
	--wr-bar-bg: #111;
	--wr-bar-fg: #fff;
	--wr-bar-muted: #a3a3a3;
	--wr-bar-line: #2e2e2e;
	--wr-bar-onair: #e5484d;
	--wr-bar-height: 72px;

	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
	min-height: var(--wr-bar-height);
	padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--wr-bar-line);
	background: var(--wr-bar-bg);
	color: var(--wr-bar-fg);
	font: 14px/1.4 "LINE Seed JP", system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

body:has(.wr-bar) {
	padding-bottom: 72px;
}

/* 再生ボタン：白い丸に ▶（聴いているあいだは ■、つないでいるあいだは回る輪） */

.wr-bar-play {
	position: relative;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wr-bar-fg);
	color: var(--wr-bar-bg);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.wr-bar-play:hover {
	transform: scale(1.06);
}

.wr-bar-play:active {
	transform: scale(0.96);
}

.wr-bar-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	margin: -9px 0 0 -5px;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent currentColor;
}

.wr-bar[data-state="playing"] .wr-bar-icon {
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 0;
	border-radius: 2px;
	background: currentColor;
}

.wr-bar[data-state="loading"] .wr-bar-icon {
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: wr-bar-spin 0.8s linear infinite;
}

@keyframes wr-bar-spin {
	to {
		transform: rotate(360deg);
	}
}

/* 今の番組 */

.wr-bar-now {
	display: flex;
	flex: 1 1 auto;
	gap: 12px;
	align-items: center;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.wr-bar-image {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border: 1px solid var(--wr-bar-line);
	border-radius: 8px;
	object-fit: cover;
}

.wr-bar-image[hidden] {
	display: none;
}

.wr-bar-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wr-bar-onair {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	color: var(--wr-bar-onair);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.08em;
	line-height: 1;
}

.wr-bar-onair::before {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	content: "";
}

.wr-bar[data-state="playing"] .wr-bar-onair::before {
	animation: wr-bar-pulse 1.6s ease-in-out infinite;
}

@keyframes wr-bar-pulse {
	50% {
		opacity: 0.25;
	}
}

.wr-bar-title {
	overflow: hidden;
	font-size: 16px;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}


.wr-bar[data-state="empty"] .wr-bar-play,
.wr-bar[data-state="empty"] .wr-bar-volume,
.wr-bar[data-state="empty"] .wr-bar-onair {
	display: none;
}

.wr-bar-status {
	flex: 0 1 auto;
	color: var(--wr-bar-muted);
	font-size: 12px;
}

.wr-bar-volume {
	flex: 0 0 120px;
}

.wr-bar-volume input {
	display: block;
	width: 100%;
	margin: 0;
	accent-color: var(--wr-bar-fg);
}

.wr-bar-play:focus-visible,
.wr-bar-now:focus-visible,
.wr-bar-volume input:focus-visible {
	outline: 2px solid var(--wr-bar-fg);
	outline-offset: 3px;
}

.wr-bar-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.wr-bar-play,
	.wr-bar[data-state="playing"] .wr-bar-onair::before {
		transition: none;
		animation: none;
	}
}

/* スマホは本体の音量ボタンで足りる（iPhone はそもそもページから音量を変えられない）。 */
@media (max-width: 450px) {
	.wr-bar {
		gap: 12px;
		padding-right: 16px;
		padding-left: 16px;
	}

	.wr-bar-volume {
		display: none;
	}

	.wr-bar-image {
		width: 40px;
		height: 40px;
	}
}
