/* LyricSync — 播放頁遊戲模式（節奏遊戲）的樣式。
   受擊墊、判定線、音符拖尾、判定字、連擊、FEVER、體力條、倒數、結算評級。 */
.mode-seg { display: flex; justify-content: center; margin-bottom: 18px; }
.game { position: relative; display: flex; flex-direction: column; max-width: 760px; width: 100%; margin: 0 auto; border-radius: var(--r-container); border: 1px solid var(--gold-line); background: var(--pop); box-shadow: var(--glow-shadow); overflow: hidden; outline: none; transition: box-shadow .3s, border-color .3s; }
.game.fever { border-color: var(--gold); box-shadow: 0 0 40px rgba(217,178,95,.35), inset 0 0 80px rgba(217,178,95,.08); }
.game.flashA::after, .game.flashB::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: rgba(217,178,95,.14); animation: flashA .25s ease-out forwards; }

/* HUD */
.ghud { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 22px 0; }
.ghud b { display: block; font: 800 28px var(--font-display); line-height: 1; font-variant-numeric: tabular-nums; }
.gscorebox .gmul { display: block; font: 700 11px var(--font-display); color: var(--gold); letter-spacing: .1em; min-height: 14px; }
.ghud .gcombo { text-align: center; }
.ghud .gcombo b { font-size: 46px; color: var(--ink-faint); transition: color .2s; }
.ghud .gcombo b.bump { animation: comboBump .18s ease-out; }
.ghud .gcombo.hot b { color: var(--gold); text-shadow: var(--glow-text); }
.ghud .gcombo span { font: 800 10px var(--font-display); letter-spacing: .2em; color: var(--ink-dim); }
.gaccbox { text-align: right; }
.ggauge { position: relative; height: 6px; margin: 10px 22px 0; border-radius: var(--r-pill); background: var(--line); }
.ggauge i { display: block; height: 100%; width: 30%; border-radius: var(--r-pill); background: var(--ink-dim); transition: width .25s, background .25s; }
.ggauge i.ok { background: var(--gold); box-shadow: var(--glow-text); }
.ggauge i.low { background: var(--red); }
.ggauge em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--ink-dim); }

/* 場地 */
.gfield { position: relative; flex: none; height: min(62vh, 560px); min-height: 320px; margin: 6px 14px 0; overflow: hidden; border-radius: 12px; }
.gfield.shakeA { animation: shakeA .16s ease-out; }
.gfield.shakeB { animation: shakeB .16s ease-out; }
.glane { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, rgba(217,178,95,.06) 70%, rgba(217,178,95,.12)); }
.glane::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 120px; transform: translateX(-50%); background: linear-gradient(to bottom, transparent, rgba(255,255,255,.03)); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.game.fever .glane { background: linear-gradient(to bottom, rgba(217,178,95,.06), rgba(217,178,95,.22)); }
.gline { position: absolute; left: 0; right: 0; bottom: 72px; height: 2px; background: var(--gold); box-shadow: var(--glow-text); }
.greceptor { position: absolute; left: 50%; bottom: 72px; width: 84px; height: 72px; transform: translate(-50%, 50%); border-radius: 16px; border: 2px solid var(--gold-line); background: rgba(217,178,95,.06); display: grid; place-items: center; font: 800 12px var(--font-display); letter-spacing: .2em; color: var(--ink-dim); }
.greceptor.pressA, .greceptor.pressB { animation: receptorHit .18s ease-out; }

/* 音符 */
.gnotes { position: absolute; inset: 0; pointer-events: none; }
.gnote { position: absolute; top: 0; left: 50%; width: 64px; height: 64px; border-radius: 18px; border: 2px solid var(--gold); background: var(--bg); color: var(--ink); display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0; padding: 0; box-shadow: 0 0 14px rgba(217,178,95,.25); will-change: transform; }
.gnote::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 4px; height: 40px; transform: translateX(-50%); background: linear-gradient(to top, rgba(217,178,95,.5), transparent); border-radius: 2px; }
.gnote.near { box-shadow: 0 0 22px rgba(217,178,95,.55); }
.touch .gnote { width: 72px; height: 72px; border-radius: 50%; }
.gnote .gk { font: 800 34px var(--font-display); color: var(--gold); line-height: 1; text-align: center; }
.gnote b { font: 800 22px/1 var(--font-ko); }
.gnote.gh-hit { background: var(--gold); color: var(--on-gold); transition: transform .22s, opacity .22s; opacity: 0; transform: translate(-50%, var(--y, 0)) scale(1.6) !important; }
.gnote.gh-hit .gk { color: var(--on-gold); }
.gnote.gh-miss { opacity: 0; transition: opacity .3s; border-color: var(--red); }

/* 特效 */
.gfx { position: absolute; inset: 0; pointer-events: none; }
.gring { position: absolute; left: 50%; bottom: 72px; width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--gold); transform: translate(-50%, 50%) scale(.3); opacity: .9; animation: ringOut .45s ease-out forwards; }
.gring.great { border-color: #8fd3ff; }
.gring.good { border-color: var(--ink-dim); border-width: 2px; }
.gpart { position: absolute; left: 50%; bottom: 72px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); color: var(--gold); pointer-events: none; animation: burst var(--dur) ease-out forwards; line-height: 1; font-size: 14px; }
.gpart.glyph { background: transparent; width: 14px; height: 14px; }
.gjudge { top: auto; bottom: 150px; left: 50%; font-size: 30px; letter-spacing: .12em; }
.gjudge.j-perfect { color: var(--gold); }
.gjudge.j-great { color: #8fd3ff; text-shadow: 0 0 12px rgba(143,211,255,.5); }
.gjudge.j-good { color: var(--ink); text-shadow: none; }
.gjudge.j-miss, .gjudge.j-wrong { color: var(--red); text-shadow: none; }
.gcallout { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 0); font: 800 40px var(--font-title); letter-spacing: .06em; color: var(--ink); text-shadow: var(--glow-text); opacity: 0; white-space: nowrap; pointer-events: none; }
.gcallout.fever { color: var(--gold); font-size: 56px; }
.gcallout.callA, .gcallout.callB { animation: callout .9s ease-out forwards; }
.gcount { position: absolute; inset: 0; display: grid; place-items: center; font: 800 72px var(--font-display); letter-spacing: .1em; color: var(--gold); text-shadow: var(--glow-text); opacity: 0; pointer-events: none; transition: opacity .2s; }
.gcount.show { opacity: 1; animation: countPop .5s ease-out; }
.gcount.go { font-size: 96px; }
.gfeverlabel { position: absolute; right: 14px; top: 12px; font: 800 12px var(--font-display); letter-spacing: .3em; color: var(--gold); opacity: 0; transition: opacity .3s; }
.game.fever .gfeverlabel { opacity: 1; animation: feverBlink 1s ease-in-out infinite; }

/* 按鍵墊與歌詞 */
.gkeys { display: flex; justify-content: center; gap: 10px; padding: 10px 0 0; }
.gkeys .pad { width: 44px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); display: grid; place-items: center; font: 700 16px var(--font-display); color: var(--ink-dim); cursor: pointer; user-select: none; }
.gkeys .pad.down { background: var(--gold); color: var(--on-gold); border-color: var(--gold); animation: padDown .14s ease-out; }
.glyric { padding: 12px 18px 16px; text-align: center; font: 800 24px var(--font-ko); min-height: 64px; border-top: 1px solid var(--line); }
.glyric .u { color: var(--ink-dim); transition: color .08s; }
.glyric .u.sung { color: var(--gold); text-shadow: var(--glow-text); }
.glyric .tr { font: 500 14px var(--font-body); color: var(--ink-dim); margin-top: 2px; }

/* 開始／結算 */
.gstart, .gresult { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; background: color-mix(in srgb, var(--pop) 90%, transparent); backdrop-filter: blur(6px); z-index: 3; padding: 20px; }
.gstart h3 { font-size: 26px; }
.gstart .label-caps, .gresult .label-caps { color: var(--gold); letter-spacing: .3em; }
.gopts { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-dim); }
.grank { font: 800 96px/1 var(--font-title); color: var(--gold); text-shadow: var(--glow-text); animation: rankIn .6s cubic-bezier(.2,.9,.3,1.2); }
.grank.r-A { color: #8fd3ff; text-shadow: 0 0 20px rgba(143,211,255,.5); }
.grank.r-B { color: var(--green); text-shadow: none; }
.grank.r-C, .grank.r-D { color: var(--ink-dim); text-shadow: none; }
.gfc { font: 800 14px var(--font-display); letter-spacing: .3em; color: var(--gold); border: 1px solid var(--gold); border-radius: var(--r-pill); padding: 3px 14px; }
.gresult .gbig { font: 800 44px var(--font-display); line-height: 1; }
.gresult .gnums { display: grid; grid-template-columns: repeat(6, auto); gap: 18px; }
.gresult .gnums b { display: block; font: 800 20px var(--font-display); line-height: 1; }
.gresult .gnums .p b { color: var(--gold); }
.gresult .gnums .g b { color: #8fd3ff; }
.gresult .gnums .m b { color: var(--red); }
.gresult .gnums span { display: block; font-size: 11px; color: var(--ink-dim); margin-top: 3px; }
.gbars { display: flex; width: min(420px, 90%); height: 6px; border-radius: var(--r-pill); overflow: hidden; background: var(--line); }
.gbars i { display: block; height: 100%; }
.gbars .b-perfect { background: var(--gold); }
.gbars .b-great { background: #8fd3ff; }
.gbars .b-good { background: var(--ink-dim); }
.gbars .b-miss { background: var(--red); }

@keyframes comboBump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes receptorHit { 0% { background: rgba(217,178,95,.45); transform: translate(-50%, 50%) scale(1.06); } 100% { background: rgba(217,178,95,.06); transform: translate(-50%, 50%) scale(1); } }
@keyframes ringOut { 0% { transform: translate(-50%, 50%) scale(.3); opacity: .9; } 100% { transform: translate(-50%, 50%) scale(1.6); opacity: 0; } }
@keyframes callout { 0% { transform: translate(-50%, 16px) scale(.7); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1.1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -18px) scale(1); opacity: 0; } }
@keyframes countPop { 0% { transform: scale(.5); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes feverBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes padDown { 0% { transform: translateY(2px) scale(.95); } 100% { transform: none; } }
@keyframes rankIn { 0% { transform: scale(2.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 900px) {
  .game { max-width: none; }
  .gfield { height: 52vh; min-height: 280px; margin: 6px 10px 0; }
  .gresult .gnums { grid-template-columns: repeat(3, auto); }
  .ghud b { font-size: 22px; }
  .ghud .gcombo b { font-size: 36px; }
  .gcount { font-size: 56px; }
  .grank { font-size: 72px; }
  .gcallout { font-size: 30px; }
  .gcallout.fever { font-size: 40px; }
}
.gnote .gk.word { font-size: 12px; letter-spacing: .12em; }
.gkeys .pad { width: auto; min-width: 44px; padding: 0 10px; font-size: 14px; letter-spacing: .06em; }

/* 長按音符：尾巴往上延伸（音符從上往下掉，尾巴在頭的上方），按住時頭釘在線上、尾巴縮短 */
.gnote.hold .tail { position: absolute; left: 50%; bottom: 50%; width: 22px; height: var(--tail, 0px); transform: translateX(-50%); background: linear-gradient(to top, rgba(217,178,95,.85), rgba(217,178,95,.25)); border-radius: 11px 11px 0 0; z-index: -1; }
.gnote.hold::before { display: none; }
.gnote.holding { background: var(--gold); color: var(--on-gold); box-shadow: 0 0 26px rgba(217,178,95,.7); }
.gnote.holding .gk { color: var(--on-gold); }
.gnote.holding .tail { background: linear-gradient(to top, var(--gold), rgba(217,178,95,.4)); animation: holdPulse .4s ease-in-out infinite alternate; }
@keyframes holdPulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }
