/*****************************************************
	
	オーディオタグ
	
*****************************************************/
.audiobox {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
	width:100%;
	max-width: 230px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
}
.audiobox .lbox{
	width: 75%;
	max-width:170px;
	border:1px solid #e1e1e1;
	border-radius:25vh;
	background:#fff;
	box-sizing:border-box;
	padding: 0.15rem 0.2rem 0.2rem;
	margin:0;
}
.audiobox .rbox{
	width: 25%;
}
.bgm-switch{
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	width:100%;
	align-items: center;
	font-size:0.8em;
}
.switch-tx{
	width: 30%;
	text-align:right;
}
.switch-bt{
	width: 70%;
	text-align:center;
}
.bt-on,.bt-off{
	border:0;
	background:#fff;
	font-family:"Zen Old Mincho";
}
.bt-on:visited,.bt-off:visited{
	background:#d5d5d5;
}

#bgm {
  display: none;
}
.bt-on, .bt-off {
    border: 0;
    background: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    margin:0 0 0.3rem;
    color:#111;
    font-size: 0.8em;
}
.bt-on{
	/* margin: 0 0 0.3rem 0; */
}
/* active状態の背景（visited の代わりにこれを使う） */
.bt-on.active,
.bt-off.active {
    background: #d5d5d5;
}


/* アニメーションバー */
.sound-wave {
    display: flex;
    align-items: flex-end;
    height: 40px;
    width: 40px;
    justify-content: space-between;
    margin: 0 auto;
}

/* 外側：高さ制御だけやる */
.bar-wrap {
    width: 4px;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    transform-origin: bottom;
    transition: transform 0.35s ease;
    transform: scaleY(1);
}

/* OFF のとき */
.sound-wave:not(.active) .bar-wrap {
    transform: scaleY(1);   /* ←完全に 0 へ */
}

/* 内側：wave のみ担当（transform はアニメ以外で触らない） */
.bar {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transform-origin: bottom;
    animation: wave 1.2s ease-in-out infinite;
}

.sound-wave:not(.active) .bar {
    animation-play-state: paused;    /* ←animation: none は使わない */
}

@keyframes wave {
    0%, 100% { transform: scaleY(0.2); }
    50%      { transform: scaleY(1.0); }
}

/* 遅延 */
.bar-wrap:nth-child(1) .bar { animation-delay: 0.1s; }
.bar-wrap:nth-child(2) .bar { animation-delay: 0.25s; }
.bar-wrap:nth-child(3) .bar { animation-delay: 0.4s; }
.bar-wrap:nth-child(4) .bar { animation-delay: 0.55s; }
.bar-wrap:nth-child(5) .bar { animation-delay: 0.7s; }
.audiobox {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.audiobox.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}