/* BGM MODE の STUDY（v0.57.0・案A ベース）。単語解説：青（覚える言葉）は左・赤（地図で探せる名前）は右のコメントのカード。曲解説：ミントの線で左右交互。
   トークのアイコン（丸い顔・地球）は付けない。赤い警告色・小テスト・正解数は無し。強調はオレンジのマーカー＋太字。CSS の filter・ぼかしは使わない */
.study { display: flex; flex-direction: column; --bubble: #0f3a47; --mark: rgba(255,159,67,.5); }
.st-head { flex: none; padding: 2px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.st-ttl { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; text-align: center; }
.st-ttl b { max-width: 100%; font: 400 15px/1.1 var(--ui); letter-spacing: .12em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-ttl small { max-width: 100%; font: 400 11px/1.2 var(--jp); color: rgba(230,246,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 切りかえ「単語解説｜曲解説」：選んでいる方を --mint */
.st-seg { align-self: center; display: grid; grid-template-columns: 1fr 1fr 1fr; width: min(100%, 340px); padding: 3px; border-radius: 999px; border: 1px solid rgba(230,246,255,.14); background: rgba(6,20,31,.55); }
.st-seg button { height: 34px; border-radius: 999px; font: 600 13px/1 var(--jp); letter-spacing: .08em; color: rgba(255,255,255,.55); }
.st-seg button.on { background: var(--mint); color: var(--deep); }

.st-wrap { position: relative; flex: 1; min-height: 0; margin-bottom: calc(var(--bottom) - 8px); }
.st-talk { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 32px 0 12px; scrollbar-width: none; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent); }
.st-in { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 40px; }
.st-in[hidden] { display: none; }
.st-empty { margin: 0; padding: 18vh 12px 0; text-align: center; font: 400 13px/1.8 var(--jp); color: rgba(230,246,255,.55); }
.study .off { display: none !important; }

/* 歌詞の行＝中央の小さな区切り。言葉の色は 赤＝coral・青＝sky。解説に結ばれた言葉は下線（タップでそのカードへ） */
.st-dv { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.st-dv i { flex: 1; height: 1px; background: rgba(230,246,255,.12); }
.st-dv p { margin: 0; max-width: 80%; text-align: center; padding: 3px 10px; border-radius: 999px; background: rgba(6,20,31,.6); font: 500 11.5px/1.6 var(--jp); color: rgba(230,246,255,.62); letter-spacing: .02em; }
.st-dv.on p { color: #fff; background: rgba(15,58,71,.9); }
.st-dv .w.r { color: var(--coral); } .st-dv .w.b { color: var(--sky); }
.st-dv .tap { cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(230,246,255,.4); }
.st-dv .tap:active { background: rgba(127,227,196,.18); border-radius: 4px; }

/* コメントのカード：左寄せ（L）は左端に、右寄せ（R）は右端に色の線 3px。地は深い色 */
.st-row { display: flex; }
.st-row.R { justify-content: flex-end; }
.st-card { position: relative; max-width: 80%; padding: 9px 13px 10px; background: var(--bubble); border: 0 solid var(--sky); }
.st-row.L .st-card { border-left-width: 3px; border-radius: 4px 16px 16px 16px; transform-origin: 0 0; }
.st-row.R .st-card { border-right-width: 3px; border-radius: 16px 4px 16px 16px; transform-origin: 100% 0; }
.st-card.r { border-color: var(--coral); } .st-card.c { border-color: var(--mint); }
.st-hd { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font: 700 15px/1.3 var(--jp); color: var(--sky); }
.st-card.r .st-hd { color: var(--coral); } .st-card.c .st-hd { color: var(--mint); font-size: 14px; }
.st-row.R .st-hd { justify-content: flex-end; }
.st-hd small { font: 400 10px/1 var(--jp); color: rgba(230,246,255,.5); }
.st-hd .who { padding: 2px 7px; border-radius: 999px; background: rgba(127,227,196,.16); font: 600 10px/1.3 var(--jp); letter-spacing: .1em; }
.st-card p { margin: 4px 0 0; font: 400 13.5px/1.55 var(--jp); color: rgba(230,246,255,.92); }
.st-card.c p { font-size: 13px; line-height: 1.6; }
/* jubeat の飛び込み：1.15 倍から 0.18 秒で縮んで着地 */
.st-row.pop .st-card { animation: stPop .18s cubic-bezier(.2,.8,.3,1) var(--d, 0s) backwards; }
@keyframes stPop { from { transform: scale(1.15); opacity: .4; } to { transform: none; opacity: 1; } }
/* 続けて出る言葉（dn）：小さめに詰める */
.st-row.dn { margin-top: -4px; }
.st-row.dn .st-card { padding: 5px 11px 6px; }
.st-row.dn .st-hd { font-size: 13.5px; }
.st-row.dn .st-card p { margin-top: 2px; font-size: 12.5px; line-height: 1.45; }
/* くり返しで歌われた時：前のカードを軽く光らせる */
.st-row.glow .st-card { animation: stGlow 1.2s ease-out; }
@keyframes stGlow { 0% { box-shadow: 0 0 0 0 rgba(127,227,196,0); } 20% { box-shadow: 0 0 0 3px rgba(127,227,196,.55); } 100% { box-shadow: 0 0 0 0 rgba(127,227,196,0); } }
/* オレンジのマーカー（タップで戻った時に左から 0.6 秒で引く）＋太字 */
.st-card .mk { background: linear-gradient(transparent 55%, var(--mark) 55%) no-repeat 0 0 / 0% 100%; font-weight: 700; }
.st-row.marked .mk { animation: stMk .6s cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes stMk { to { background-size: 100% 100%; } }

/* 「いまへ」：言葉をタップして戻った時・指で動かした時だけ、下のプレーヤーの上に出る */
.st-now { position: absolute; z-index: 6; left: 50%; bottom: calc(var(--bottom) - 4px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--mint); color: var(--deep); font: 600 12px/1 var(--jp); letter-spacing: .1em; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.st-now svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .st-row.pop .st-card, .st-row.glow .st-card { animation: none; } .st-row.marked .mk { animation-duration: 1ms; } }

/* 曲名タップで曲を選ぶ：曲名の右に ▾ */
.st-pick { display: inline-flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; min-height: 32px; padding: 0 8px; color: #fff; }
.st-pick b { min-width: 0; }
.st-pick .car { flex: none; width: 16px; height: 16px; color: var(--mint); }
.st-pk { max-height: 78%; }
.st-pk ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pk { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; border-radius: 10px; text-align: left; color: #fff; }
.pk.cur { background: rgba(127,227,196,.14); }
.pk:active { background: rgba(127,227,196,.2); }
.pk img { flex: none; width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.pk-t { flex: 1; min-width: 0; font: 400 14px/1.3 var(--ui); letter-spacing: .08em; }
.pk-s { flex: none; font: 600 11px/1 var(--jp); color: var(--mint); }
.pk-s.no { color: rgba(230,246,255,.45); font-weight: 400; }

/* 右の上下バー：当たり判定は幅 32px（見える太さは 8px）。▲＝曲の頭・▼＝今の所 */
.st-bar { position: absolute; z-index: 3; right: 0; top: 14px; bottom: 14px; width: 32px; display: flex; flex-direction: column; align-items: center; }
.st-bar[hidden] { display: none; }
.sb-cap { flex: none; width: 32px; height: 30px; font: 700 11px/1 var(--ui); color: var(--mint); }
.sb-cap:active { background: rgba(127,227,196,.18); border-radius: 8px; }
.sb-track { position: relative; flex: 1; width: 32px; min-height: 0; touch-action: none; }
.sb-track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(230,246,255,.14); border-radius: 2px; }
.sb-thumb { position: absolute; left: 50%; top: 0; width: 10px; margin-left: -5px; border-radius: 6px; background: var(--mint); opacity: .85; pointer-events: none; }

/* カード一覧：全部・曲に出てくる順。青＝覚える言葉・赤の系統（地名）の色分けは同じ */
.st-cards { gap: 8px; }
.st-cards[hidden] { display: none; }
.kc-bar { display: flex; align-items: center; justify-content: space-between; font: 500 12px/1 var(--jp); color: rgba(230,246,255,.6); }
.kc-bar button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(127,227,196,.5); color: var(--mint); font: 600 12px/1 var(--jp); }
.kc-bar button[aria-pressed="true"] { background: var(--mint); color: var(--deep); }
.st-kc { display: flex; align-items: stretch; background: var(--bubble); border-left: 3px solid var(--sky); border-radius: 4px 14px 14px 14px; }
.st-kc.r { border-color: var(--coral); }
.kc-main { flex: 1; min-width: 0; padding: 9px 6px 10px 12px; text-align: left; color: inherit; }
.st-kc .st-hd { color: var(--sky); } .st-kc.r .st-hd { color: var(--coral); }
.st-kc p { margin: 4px 0 0; font: 400 13px/1.55 var(--jp); color: rgba(230,246,255,.92); }
.st-cards.hide .st-kc:not(.open) p { display: none; }
.st-cards.hide .st-kc:not(.open) .kc-main { padding-bottom: 9px; }
.kc-go { flex: none; align-self: center; min-width: 56px; min-height: 40px; margin-right: 6px; padding: 0 8px; border-radius: 10px; font: 600 11px/1 var(--ui); color: var(--mint); font-variant-numeric: tabular-nums; }
.kc-go:active { background: rgba(127,227,196,.2); }

/* 地名カードの図（11/13）：右下の「図」の印 → カードの下に日本の白地図が開く（js/study-map.js）。陸＝うすいミント・対象＝オレンジ（赤は使わない） */
.st-row, .st-kc { flex-wrap: wrap; }
.st-ft { display: flex; justify-content: flex-end; margin: 2px -6px -4px 0; }
.mp-btn, .mo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 32px; padding: 0 8px; border-radius: 999px; color: var(--mint); font: 600 11px/1 var(--jp); letter-spacing: .06em; }
.mp-btn svg, .mo-btn svg { flex: none; width: 16px; height: 16px; }
.mp-btn[aria-expanded="true"], .mo-btn[aria-expanded="true"] { background: rgba(127,227,196,.18); }
.mp-btn:active, .mo-btn:active { background: rgba(127,227,196,.28); }
.st-row.dn .st-ft { margin-top: 0; margin-bottom: -6px; }
.st-map { flex: 0 0 100%; display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .18s ease-out, visibility 0s .18s; }
.st-map.open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .18s ease-out, visibility 0s 0s; }
.sm-in { min-height: 0; overflow: hidden; }
.sm { position: relative; height: 160px; margin-top: 8px; border-radius: 12px; overflow: hidden; background: #071a26; border: 1px solid rgba(230,246,255,.12); }
.sm-main { display: block; width: 100%; height: 100%; }
.sm-land { fill: rgba(190,240,225,.26); stroke: rgba(190,240,225,.6); stroke-width: .7px; stroke-linejoin: round; }
.sm-land path, .sm-land use { vector-effect: non-scaling-stroke; }
.sm-hl { fill: rgba(255,159,67,.8); stroke: #ffc78a; stroke-width: 1.2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sm-ln { fill: none; stroke: #ff9f43; stroke-width: 2.6px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sm-ar { fill: #ff9f43; stroke: #ff9f43; stroke-width: 1px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sm-dot { fill: #ff9f43; stroke: #071a26; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.sm-ring { fill: rgba(255,159,67,.22); stroke: #ff9f43; stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.sm-name { position: absolute; left: 8px; top: 8px; max-width: calc(100% - 90px); padding: 3px 9px; border-radius: 999px; background: rgba(6,20,31,.8); color: #ffc78a; font: 700 12.5px/1.4 var(--jp); letter-spacing: .04em; }
.sm-mini { position: absolute; right: 6px; bottom: 6px; width: 64px; height: 64px; border-radius: 8px; background: rgba(6,20,31,.88); border: 1px solid rgba(230,246,255,.22); }
.sm-mini .sm-land { stroke-width: .4px; }
.sm-box { fill: none; stroke: #ffc78a; stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.sm-none { margin: 8px 0 0; padding: 14px 12px; border-radius: 12px; background: #071a26; font: 400 12px/1.6 var(--jp); color: rgba(230,246,255,.6); text-align: center; }
@media (prefers-reduced-motion: reduce) { .st-map, .st-map.open { transition: none; } }

/* カード一覧：右側に「▶ 時刻」と「図」を縦に並べる・「図つきだけ」の切りかえ */
.kc-side { flex: none; align-self: center; display: flex; flex-direction: column; align-items: center; }
.kc-side .kc-go { align-self: auto; margin-right: 6px; }
.kc-side .mp-btn, .kc-side .mo-btn { margin-right: 6px; }
/* 「くわしく」（11/14）：説明の下に more の文が開く（0.18 秒・動きを減らす設定では動かさない）。赤は使わない */
.st-more { flex: 0 0 100%; display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .18s ease-out, visibility 0s .18s; }
.st-more.open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .18s ease-out, visibility 0s 0s; }
.mo-in { min-height: 0; overflow: hidden; }
.mo-t { margin: 6px 0 0; padding: 7px 10px; border-radius: 10px; background: rgba(127,227,196,.1); font: 400 12.5px/1.65 var(--jp); color: rgba(230,246,255,.95); }
.st-kc .st-more { margin: 0 6px 8px 8px; flex-basis: calc(100% - 14px); }
.st-cards.hide .st-kc:not(.open) .mo-btn, .st-cards.hide .st-kc:not(.open) .st-more { display: none; }
@media (prefers-reduced-motion: reduce) { .st-more, .st-more.open { transition: none; } }
.kc-bar { gap: 8px; }
.kc-bar span { flex: 1; }
.kc-bar button { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kc-bar button svg { width: 14px; height: 14px; }
.st-cards.onlymap .st-kc:not(.has-map) { display: none; }
.st-kc .st-map { margin: 0 6px 8px 8px; flex-basis: calc(100% - 14px); }

/* 写真（v0.62.0）：図の下（図の無いカードは写真だけ）。幅いっぱい・角丸。出典は小さく */
.sm-ph { margin: 8px 0 0; border-radius: 12px; overflow: hidden; background: #071a26; border: 1px solid rgba(230,246,255,.12); }
.sm-ph img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; }
.sm-ph figcaption { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 8px; font: 500 12px/1.4 "Hiragino Sans", sans-serif; color: rgba(230,246,255,.85); }
.sm-ph figcaption a { font-size: 10px; color: rgba(230,246,255,.5); text-decoration: none; overflow-wrap: anywhere; }

/* カード一覧の県ごとのまとまり（v0.64.0）：最初は閉じている。見出しを押すと開く */
.kc-g { display: flex; flex-direction: column; gap: 8px; }
.kc-g.none { display: none; }
.kc-gh { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; background: rgba(230,246,255,.06); border: 1px solid rgba(230,246,255,.12); color: var(--ice); text-align: left; }
.kc-gt { flex: 1; font: 700 15px/1.2 var(--jp); }
.kc-gn { font: 500 12px/1 var(--jp); color: rgba(230,246,255,.6); }
.kc-gh svg { width: 18px; height: 18px; color: var(--mint); transition: transform .18s; }
.kc-g.open .kc-gh svg { transform: rotate(180deg); }
.kc-gb { display: none; flex-direction: column; gap: 8px; }
.kc-g.open .kc-gb { display: flex; }
@media (prefers-reduced-motion: reduce) { .kc-gh svg { transition: none; } }

/* 県の列（v0.64.2・11/14 塾長「もっと小さく・右にまだあると分かるように・もう少し上に」）：上のぼかしを外して一番上に貼りつく。右にまだある時は右端を薄くして「›」を出す */
.st-talk.cards { -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 18px), transparent); }
.kc-navw { position: sticky; top: 0; z-index: 2; display: block; align-self: stretch; box-sizing: border-box; width: calc(100% + 8px); min-width: 0; margin: 0 -4px; padding: 4px; background: rgba(6,20,31,.96); border-radius: 0 0 12px 12px; }
.kc-nav { display: flex; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.kc-nav::-webkit-scrollbar { display: none; }
.kc-navw.more .kc-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.kc-navw::after { content: "›"; position: absolute; right: 2px; top: 50%; transform: translateY(-52%); font: 600 18px/1 var(--ui); color: var(--mint); opacity: 0; pointer-events: none; transition: opacity .15s; }
.kc-navw.more::after { opacity: 1; }
.kc-chip { flex: none; display: inline-flex; align-items: baseline; gap: 3px; min-height: 28px; padding: 0 9px; border-radius: 999px; border: 1px solid rgba(230,246,255,.2); color: var(--ice); font: 600 12px/28px var(--jp); white-space: nowrap; }
.kc-chip small { font: 500 10px/1 var(--jp); color: rgba(230,246,255,.55); }
.kc-chip.on { background: var(--mint); border-color: var(--mint); color: var(--deep); }
.kc-chip.on small { color: rgba(6,20,31,.7); }
.st-cards.onlymap .kc-chip.none { display: none; }

/* v0.66.0：くわしく 1 つにまとめた。説明をかくす時は、そのカードを開くまで、くわしく（文・地図・写真）も隠す */
.st-cards.hide .st-kc:not(.open) .st-map { display: none; }
.st-talk.cards { overflow-anchor: none; }   /* v0.66.0：カード一覧では、上の地図・写真が開いても画面を勝手にずらさない（県へ移る位置がずれたため） */

/* v0.66.2（11/15 塾長「くわしくのボタンもう少し小さく」）：見た目を小さく。押せる広さは見えない枠で上下左右 6px 広げて保つ */
.mo-btn { position: relative; min-width: 0; min-height: 24px; padding: 0 7px; gap: 3px; font-size: 10px; }
.mo-btn svg { width: 13px; height: 13px; }
.mo-btn::after { content: ""; position: absolute; inset: -6px; }
