/* ハモーレ：明るいカラオケ（並び・ワイプ・採点画面はカラオケ、色と形はずっしりトイ） */
:root { --sb: max(env(safe-area-inset-bottom), var(--vb, 0px)); --st: env(safe-area-inset-top); }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: var(--pg-bg); font-family: var(--pg-font); color: var(--pg-ink); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app { position: relative; width: 100%; height: 100%; overflow: hidden; }
#gl { position: absolute; inset: 0; }
button { font-family: var(--pg-font); }
.pg-btn.mini { font-size: 13px; padding: 6px 12px; border-radius: 11px; border-width: 2px; --pg-depth: 3px; }
.pg-btn.big { font-size: 24px; padding: 13px 38px; border-radius: 18px; }

/* ---- あそぶ画面 ---- */
#play { position: absolute; inset: 0; touch-action: none; cursor: ns-resize; }
#top { position: absolute; left: 10px; right: 10px; top: calc(8px + var(--st)); height: 38px; display: flex; align-items: center; gap: 10px; }
#songName { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#liveScore { background: #fff; border-radius: 12px; padding: 4px 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
#liveScore b { font-size: 20px; } #liveScore small { font-size: 12px; margin-left: 2px; }
#laneWrap { position: absolute; left: 8px; right: 8px; top: calc(52px + var(--st)); height: clamp(170px, 36vh, 320px); }
#lane { width: 100%; height: 100%; display: block; }
#modeTag { position: absolute; right: 8px; bottom: 6px; /* 右下：左の矢じり（いまの線）に重ねない */ font-size: 11px; font-weight: 800; background: var(--pg-ink); color: #fff; padding: 2px 8px; border-radius: 8px; pointer-events: none; }

/* 歌詞：2行を交互に。上の行は左寄せ、下の行は右寄せ。歌った所から朱に塗られる（ワイプ）
   例外（依頼者の決定）：歌詞だけは、カラオケのように白い字＋インクのふち */
#lyrics { position: absolute; left: 12px; right: 12px; bottom: calc(22px + var(--sb)); pointer-events: none; }
.ly { position: relative; height: 1.5em; font-size: clamp(20px, 6.4vw, 34px); font-weight: 800; white-space: nowrap; }
.ly.l1 { text-align: right; margin-top: 6px; }
.ly .line { position: relative; display: inline-block; transform-origin: left center; }
.ly.l1 .line { transform-origin: right center; }
.ly .base, .ly .sung { display: block; letter-spacing: 0.02em; }
.ly .base { color: #fff; }
.ly .sung { position: absolute; left: 0; top: 0; color: var(--pg-shu); clip-path: inset(0 100% 0 0); }
.ly .base, .ly .sung {
  text-shadow: 2.5px 0 0 var(--pg-ink), -2.5px 0 0 var(--pg-ink), 0 2.5px 0 var(--pg-ink), 0 -2.5px 0 var(--pg-ink),
    1.8px 1.8px 0 var(--pg-ink), -1.8px 1.8px 0 var(--pg-ink), 1.8px -1.8px 0 var(--pg-ink), -1.8px -1.8px 0 var(--pg-ink), 0 4px 0 rgba(36,40,39,.35);
}
.ly .line.music .base { color: var(--pg-ink); text-shadow: none; font-size: 0.8em; }

/* 曲の始まりの曲名カード（カラオケの「曲名／作詞／作曲」） */
#titleCard { position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%); background: #fff; border-radius: 18px; padding: 14px 22px; text-align: center; min-width: 220px; max-width: 86vw; opacity: 0; pointer-events: none; box-shadow: 0 6px 0 rgba(74,58,48,.18); }
#titleCard b { display: block; font-size: 26px; letter-spacing: -0.01em; }
#titleCard .cr { display: block; font-size: 12px; font-weight: 800; margin-top: 6px; line-height: 1.55; white-space: pre-line; }
#titleCard.show { animation: card 3.2s ease-in-out both; }
@keyframes card { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.9); } 10%, 82% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -56%); } }

/* ---- 重ねる画面 ---- */
.ov { position: absolute; inset: 0; display: none; }
.ov.show { display: flex; }
.title { flex-direction: column; justify-content: flex-start; padding: calc(30px + var(--st)) 7vw calc(26px + var(--sb)); box-sizing: border-box; pointer-events: none; }
.title > * { pointer-events: auto; }
.title .pg-title { font-size: clamp(46px, 14vw, 96px); }
.tSub { font-weight: 800; font-size: clamp(14px, 4vw, 20px); margin: 10px 0 0; }
/* ボタンは題名のすぐ下（画面の下に置かない：Android の X のアプリ内ブラウザで下が隠れる。依頼者に何度も言われた） */
.tFoot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 22px; }
.tBtns .pg-btn.big { font-size: 20px; padding: 11px 22px; }

.select { flex-direction: column; background: rgba(245,245,242,.82); padding: calc(14px + var(--st)) 0 0; box-sizing: border-box; }
.sHead { display: flex; align-items: center; gap: 12px; padding: 0 14px; }
.sHead .pg-title { font-size: 28px; }
.sHelp { font-size: 12px; font-weight: 800; margin: 8px 14px 6px; line-height: 1.5; }
#songList { list-style: none; margin: 0; padding: 4px 12px calc(30px + var(--sb)); overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
#songList li { background: #fff; border-radius: 16px; margin: 0 auto 10px; padding: 12px 14px; max-width: 560px; box-shadow: 0 4px 0 rgba(74,58,48,.14); cursor: pointer; }
#songList .sTitle { font-weight: 800; font-size: 19px; min-width: 0; }
#songList .sRow { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
#songList .sRanks { display: flex; gap: 6px; flex: none; }
#songList .sR { display: flex; flex-direction: column; align-items: center; width: 52px; font-weight: 800; }
#songList .sR small { order: -1; font-size: 9px; color: var(--pg-sub); }
#songList .sR b { font-size: 10px; font-variant-numeric: tabular-nums; }
#songList .sNext { display: inline-block; font-style: normal; font-size: 11px; color: #fff; background: var(--pg-shu); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 3px; }
#songList li.locked { background: rgba(255,255,255,.55); box-shadow: none; cursor: default; }
#songList li.locked .sTitle { color: #9a9f9c; }
#songList li.locked .sTitle::before { content: ''; display: inline-block; width: 14px; height: 17px; margin-right: 7px; vertical-align: -1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 17'%3E%3Cpath d='M3.5 8V5.5a3.5 3.5 0 0 1 7 0V8' fill='none' stroke='%239a9f9c' stroke-width='2.4'/%3E%3Crect x='0.5' y='7.5' width='13' height='9' rx='2.5' fill='%239a9f9c'/%3E%3C/svg%3E") no-repeat center / contain; }
#songList li.nope { animation: nope .3s; }
@keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.sProg { margin: 0 auto 6px; max-width: 560px; width: calc(100% - 24px); font-size: 13px; font-weight: 800; }
/* ランクのしるし：S＝朱／A＝墨／B＝白に墨のふち／C＝灰色／まだ＝点線 */
.rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-style: normal; font-weight: 800; font-size: 16px; line-height: 1; box-sizing: border-box; }
.rank.rS { background: var(--pg-shu); color: #fff; }
.rank.rA { background: var(--pg-ink); color: #fff; }
.rank.rB { background: #fff; color: var(--pg-ink); border: 2.5px solid var(--pg-ink); }
.rank.rC { background: #d9dbd8; color: #5b605d; }
.rank.r0 { background: transparent; color: #b9bdba; border: 2px dashed #c9ccc9; }
.rank.big { width: 64px; height: 64px; border-radius: 18px; font-size: 42px; flex: none; }
.rank.big.rB { border-width: 4px; }
.rank.big.in { animation: stamp .42s linear both; }
@keyframes stamp { 0% { transform: scale(2.4) rotate(-12deg); opacity: 0; } 45% { transform: scale(0.86, 1.12) rotate(-4deg); opacity: 1; } 65% { transform: scale(1.08, 0.92) rotate(-6deg); } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }
.rTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rUnlock { margin: 6px 0 0; padding: 6px 10px; border-radius: 12px; background: var(--pg-ink); color: #fff; font-weight: 800; font-size: 14px; }
.rUnlock.in { animation: thud .5s ease-out both; }
#songList .sMeta { font-size: 12px; font-weight: 800; margin-top: 4px; }
#songList .sBest { font-size: 12px; font-weight: 500; margin-top: 2px; }
#songList .sGo { display: none; gap: 10px; margin-top: 10px; }
#songList li.open .sGo { display: flex; }
#songList .sGo .pg-btn { flex: 1; font-size: 16px; padding: 9px 6px; }
#songList .sGo .pg-btn small { display: block; font-size: 10px; font-weight: 800; margin-top: 2px; }

.result { align-items: center; justify-content: center; background: rgba(245,245,242,.6); padding: calc(10px + var(--st)) 10px calc(10px + var(--sb)); box-sizing: border-box; }
.rCard { position: relative; background: #fff; border-radius: 22px; padding: 16px 18px 14px; width: min(420px, 100%); max-height: 100%; overflow-y: auto; box-sizing: border-box; box-shadow: 0 8px 0 rgba(74,58,48,.16); }
.rSong { font-weight: 800; font-size: 14px; margin: 0; }
.rScore { margin: 2px 0 0; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rScore b { font-size: clamp(48px, 15vw, 66px); letter-spacing: -0.03em; display: inline-block; }
.rScore b.thud { animation: thud .5s ease-out both; }
@keyframes thud { 0% { transform: translateY(-24px); } 30% { transform: translateY(0) scale(1.08, .88); } 50% { transform: scale(.97, 1.04); } 100% { transform: none; } }
.rScore small { font-size: 18px; margin-left: 4px; }
.rComment { font-weight: 800; font-size: 16px; margin: 6px 0 10px; }
.rBar { display: grid; grid-template-columns: 6.2em 1fr 3.2em; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; margin: 5px 0; }
.rBar i { height: 12px; border-radius: 6px; background: #ecece6; overflow: hidden; }
.rBar em { display: block; height: 100%; width: 0; background: var(--pg-ink); border-radius: 6px; transition: width .8s cubic-bezier(.3,1.3,.5,1); }
.rBar:first-child em { background: var(--pg-shu); }
.rBar b { text-align: right; font-variant-numeric: tabular-nums; }
#overview { width: 100%; height: 92px; display: block; margin-top: 10px; background: #f6f6f2; border-radius: 10px; }
.rLegend { font-size: 11px; font-weight: 800; margin: 6px 0 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lg { display: inline-block; width: 14px; height: 6px; border-radius: 3px; margin-left: 6px; }
.lg.guide { background: #ffd8c9; margin-left: 0; } .lg.me { background: var(--pg-shu); } .lg.mel { background: #8a908c; height: 3px; }
.rBest { font-size: 12px; font-weight: 800; margin: 8px 0 0; }
.rBtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.rBtns .pg-btn { flex: 1 1 40%; font-size: 15px; padding: 9px 10px; }
.rCard .pg-sign { display: block; text-align: right; }

/* 横長の画面（PC）：カラオケのモニターのように */
@media (min-aspect-ratio: 5/4) {
  #laneWrap { left: 4vw; right: 4vw; height: clamp(200px, 42vh, 420px); }
  .ly { font-size: clamp(24px, 3.6vw, 44px); }
  #lyrics { left: 6vw; right: 6vw; }
}

/* ---- ハモりの熱（v0.2）：連続ハモの数と、段が上がった時の帯 ---- */
#combo { font-weight: 800; font-size: 15px; color: var(--pg-shu); white-space: nowrap; font-variant-numeric: tabular-nums; }
#combo:empty { display: none; }
#combo.bump { animation: combo .35s ease-out both; }
@keyframes combo { 0% { transform: scale(1.5); } 40% { transform: scale(.92); } 100% { transform: none; } }
#heatBanner { position: absolute; left: 0; right: 0; top: 50%; text-align: center; pointer-events: none; z-index: 4; opacity: 0;
  font-weight: 800; font-size: clamp(30px, 10vw, 54px); color: var(--pg-shu); letter-spacing: -0.02em;
  text-shadow: 0 3px 0 #fff, 0 -3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 8px 0 rgba(74,58,48,.2); }
#heatBanner.show { animation: heat 1.5s ease-in both; }
@keyframes heat {
  0% { opacity: 1; transform: translateY(-70px); }
  16% { opacity: 1; transform: translateY(0) scale(1.12, .86); }
  26% { transform: scale(.96, 1.05); }
  34%, 76% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px) scale(1.04); }
}
.rStreak { font-size: 13px; font-weight: 800; margin: -4px 0 8px; }

/* 背の低い画面（横にしたスマホ・小さな窓）：音程バーと歌詞が重ならないように */
@media (max-height: 520px) {
  #laneWrap { height: 40vh; top: calc(46px + var(--st)); }
  .ly { font-size: clamp(16px, 5vh, 24px); }
  .ly.l1 { margin-top: 2px; }
  #lyrics { bottom: calc(8px + var(--sb)); }
  #heatBanner { top: 56%; font-size: 28px; }
}

/* 曲の前：ハモリのコツ（読みこみ）。下の64px（Android の X）より上に収める */
.load { align-items: center; justify-content: center; background: rgba(245,245,242,.86); padding: calc(16px + var(--st)) 16px calc(80px + var(--sb)); box-sizing: border-box; }
.ldCard { width: min(100%, 420px); background: #fff; border-radius: 22px; padding: 18px 18px 16px; box-sizing: border-box; box-shadow: 0 6px 0 rgba(0,0,0,.08); }
.ldHead { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ldHead b { font-size: 22px; }
.ldHead span { font-size: 12px; font-weight: 800; background: var(--pg-ink); color: #fff; border-radius: 8px; padding: 2px 8px; }
.ldNo { margin: 14px 0 2px; font-size: 12px; font-weight: 800; color: var(--pg-shu); }
.ldTip { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.45; }
.ldTip b { color: var(--pg-shu); }
#ldFig { display: block; width: 100%; height: 118px; margin: 12px 0 14px; border-radius: 12px; background: #fafaf7; }
.ldBar { height: 10px; border-radius: 5px; background: #ecece6; overflow: hidden; }
.ldBar em { display: block; height: 100%; width: 0; background: var(--pg-shu); border-radius: 5px; }
.ldSkip { margin: 10px 0 0; text-align: center; font-size: 13px; font-weight: 800; }
@media (max-width: 340px) { .ldTip { font-size: 17px; } .ldCard { padding: 14px; } }
#app .pg-goal { top: 60%; } /* 音程バーの矢じりに重ねない */
.sHelp .nw { display: inline-block; }

/* ---- オンライン ---- */
.tBtns { display: flex; gap: 10px; flex-wrap: wrap; }
.ov.online { display: none; align-items: center; justify-content: center; padding: 16px 16px calc(80px + var(--sb)); box-sizing: border-box; }
.ov.online.show { display: flex; }
.onCard { background: #fff; border-radius: 22px; padding: 18px; width: min(420px, 100%); box-shadow: 0 8px 0 rgba(74,58,48,.16); box-sizing: border-box; max-height: 100%; overflow-y: auto; }
.onCard h2 { font-size: 26px; margin: 0 0 6px; }
.onCard > div > .pg-btn:not(.mini) { display: block; width: 100%; margin: 10px 0 0; font-size: 18px; padding: 10px; }
.onCard .pg-btn small { display: block; font-size: 11px; font-weight: 800; margin-top: 2px; }
.onCard .pg-btn.mini { margin-top: 14px; }
.onHelp { font-size: 13px; font-weight: 800; line-height: 1.5; margin: 4px 0 0; }
.onCode { font-size: 14px; font-weight: 800; margin: 4px 0 8px; }
.onCode b { font-size: 24px; letter-spacing: 0.12em; }
.onRow .pg-btn { font-size: 14px; padding: 7px 12px; }
#roomMembers { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
#roomMembers li { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 4px 12px; background: #f1f1ec; }
#roomMembers li.me { background: var(--pg-ink); color: #fff; }
.onSong { display: block; font-size: 14px; font-weight: 800; margin-top: 12px; }
.onSong select { font: inherit; font-size: 15px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--pg-ink); max-width: 100%; }
#rTeam { list-style: none; margin: 8px 0 4px; padding: 0; }
#rTeam li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; padding: 3px 0; border-top: 1.5px solid #eee; }
#rTeam li:first-child { border-top: 0; }
#rTeam i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#rTeam span { flex: 1; }
#rTeam b { font-variant-numeric: tabular-nums; }
#rTeam li.harm { color: var(--pg-sub); }
.onCard [hidden] { display: none !important; }
#roomHost .pg-btn { display: block; width: 100%; margin: 10px 0 0; font-size: 18px; padding: 10px; }
.onCredit { font-size: 10px; font-weight: 800; color: var(--pg-sub); line-height: 1.5; margin: 12px 0 0; }
.tCredit { font-size: 10px; font-weight: 800; color: var(--pg-sub); line-height: 1.5; margin: 14px 0 0; max-width: 300px; }
.onRow { margin-top: 10px; }
.seg { display: flex; border: 2.5px solid var(--pg-ink); border-radius: 12px; overflow: hidden; }
.seg button { font: inherit; font-size: 15px; font-weight: 800; padding: 6px 16px; border: 0; background: #fff; color: var(--pg-ink); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.seg button + button { border-left: 2.5px solid var(--pg-ink); }
.seg button.on { background: var(--pg-ink); color: #fff; }
.seg button.soft.on { background: var(--soft-shu); color: var(--pg-ink); }
/* リプレイ中：モードの札を朱に（タップでとばせる） */
#app.replaying #modeTag { background: var(--pg-shu); }

/* 2026-11-14 背景を夕方の暗さに（依頼者「背景明るすぎる」）。背景の上にじかに置く文字は、明るい色にする */
:root { --on-bg: #f6f1ea; --on-bg-sub: #d9d2e0; }
.title .pg-title, .tSub, .title .pg-sign, #songName { color: var(--on-bg); }
.tCredit { color: var(--on-bg-sub); }
/* ガイドなし：うすい朱＋墨色の文字（依頼者 2026-11-14「このボタンの色強すぎ」。朱を白へ6割寄せた色） */
:root { --soft-shu: #ffb9a3; }
.pg-btn.soft { background: var(--soft-shu); color: var(--pg-ink); }
