/* Layout scoped to the select screen. Gameplay uses the existing field and HUD. */
.rhythm-lobby.screen-title {
  align-items: center;
  justify-content: start;
  flex-direction: column;
  gap: 0;
  padding: max(13px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 64% 1%, #502919 0%, #241715 45%, #1e1515 86%);
  color: #fff3dd;
}
.rhythm-lobby .rhythm-board { width: min(100%, 640px); margin: 0; gap: 11px; }
.rhythm-head { display:flex; justify-content:space-between; align-items:end; gap:10px; padding:0 2px 3px; }
.rhythm-head h1 { margin:1px 0 0; color:#ffe4a9; font-size:clamp(26px,6.8vw,35px); line-height:1.12; font-weight:900; }
.rhythm-home { color:#eac7ad; text-decoration:none; min-height:32px; display:inline-flex; align-items:center; font-size:12px; }
html[lang^=zh] .rhythm-home::before { content:'‹'; margin-inline-end:5px; }
.rhythm-language .mm-lang button { min-height:40px; }
.rhythm-lobby .song-current {
  position:relative; display:flex; align-items:end; overflow:hidden; isolation:isolate; min-height:clamp(175px,29svh,230px);
  border:1px solid #e8b7736b; border-radius:18px; padding:17px; background:#4b2a22;
}
.rhythm-cover { position:absolute; z-index:-2; inset:0; height:100%; width:100%; object-fit:cover; object-position:50% 46%; }
.rhythm-lobby .song-current::before { position:absolute; z-index:-1; inset:0; content:''; background:linear-gradient(0deg,#24120ceb,transparent 69%),linear-gradient(90deg,#230e0c8c,transparent 58%); }
.rhythm-song-content h2 { margin:0; font-size:clamp(34px,8.7vw,55px); line-height:1.06; font-weight:900; color:#fff5d6; text-shadow:0 3px 0 #603110,0 5px 14px #21130d; }
.rhythm-song-content p { display:flex; gap:9px; margin:8px 0 0; }
.rhythm-song-content p span { color:#ffe1af; border:1px solid #e4b9825e; border-radius:8px; background:#251511ae; padding:3px 8px; font-size:12px; line-height:1.3; font-variant-numeric:tabular-nums; }
.rhythm-lobby .song-list { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.rhythm-lobby .song-choice { padding:0; gap:0; min-height:71px; overflow:hidden; justify-content:flex-end; background:#332120; border:1px solid #b0866158; border-radius:11px; position:relative; isolation:isolate; }
.rhythm-lobby .song-choice[aria-checked=true] { border-color:#ffce7d; box-shadow:inset 0 0 0 1px #ffce7d76; }
.rhythm-lobby .song-choice img { position:absolute; z-index:-2; inset:0; width:100%; height:100%; object-fit:cover; object-position:50% 38%; opacity:.68; }
.rhythm-lobby .song-choice::before { content:''; position:absolute; z-index:-1; inset:0; background:linear-gradient(0deg,#21120ff0,transparent 93%); }
.rhythm-lobby .song-choice b { font-size:13px; padding:13px 7px 7px; font-weight:900; color:#fff3de; line-height:1.14; }
.rhythm-lobby .song-choice[aria-checked=true] b { color:#ffe1a2; }
.rhythm-levels { display:grid; gap:5px; }
.rhythm-lobby .diff-list { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.rhythm-lobby .diff { min-height:67px; padding:7px 5px; gap:2px; align-items:center; justify-content:center; text-align:center; border:1px solid #b0866158; border-radius:11px; background:#352524; }
.rhythm-lobby .diff[aria-checked=true] { border-color:#ffce7d; background:linear-gradient(#684233,#50302a); box-shadow:inset 0 0 0 1px #ffce7d66; }
.rhythm-lobby .diff b { font-size:16px; line-height:1.18; }
.rhythm-lobby .diff .stars { font-size:11px; letter-spacing:0; color:#ffd792; }
.rhythm-lobby .diff .best:empty { display:none; }
.rhythm-lobby .diff .best { color:#ffddba; line-height:1.15; }
.rhythm-lobby .song-heat { text-align:left; color:#e6c9b3; margin:0 2px; font-size:12px; }
.rhythm-lobby .song-heat:empty { display:none; }
.rhythm-lobby #btn-start { min-height:55px; margin:0 0 4px; color:#411c13; background:linear-gradient(#ffe6a6,#ffc077); border:1px solid #ffdc9c; border-radius:12px; box-shadow:0 4px 0 #a8522b; font-size:23px; letter-spacing:.02em; font-weight:900; }
.rhythm-lobby #btn-start:active { transform:translateY(2px); box-shadow:0 2px 0 #a8522b; }
.rhythm-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.rhythm-tools > .btn { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:4px; padding:5px; font-size:12px; min-height:46px; text-align:center; text-decoration:none; border:1px solid #b0866158; border-radius:10px; color:#f5e1c9; background:#362625; }
.rhythm-lobby .brand-credit { margin:0; text-align:center; color:#c5a795; }
.rhythm-lobby :is(button,a):focus-visible { outline:2px solid #ffe0a4; outline-offset:2px; }
.rhythm-dialog { position:fixed; inset:0; margin:auto; padding:0 16px 16px; max-height:84dvh; width:min(calc(100% - 24px),590px); border:1px solid #d29d66; border-radius:17px; background:#31201d; color:#fff0d7; overscroll-behavior:contain; touch-action:pan-y; }
.rhythm-dialog::backdrop { background:#1c0e0cce; }
.rhythm-dialog header { position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; gap:9px; padding:9px 0; background:#31201d; }
.rhythm-dialog h2 { font-size:21px; margin:0; }
.rhythm-dialog .settings { margin:5px 0; }
@media(max-height:690px) and (max-width:719px) {
  .rhythm-lobby .rhythm-board { gap:8px; }
  .rhythm-lobby .song-current { min-height:160px; }
}

/* Song labels sit above the original soft-focus MV stills. */
.rhythm-lobby .song-choice b {
  font-family:system-ui,-apple-system,"PingFang TC","Microsoft JhengHei",sans-serif;
  font-weight:800;
}
.rhythm-lobby .song-choice[aria-checked=true]::after {
  content:'✓'; display:grid; place-items:center; position:absolute; inset:5px 5px auto auto;
  width:18px; height:18px; border-radius:50%; background:#ffdc95; color:#3c2016; font:700 12px/1 system-ui,sans-serif;
}


.rhythm-lobby .diff .meta { display:none; }
.rhythm-lobby .diff b small { margin-inline:auto !important; }
.rhythm-lobby .rhythm-levels .diff { min-height:55px; }
.rhythm-dialog .hint { margin:10px 0; line-height:1.55; }

.rhythm-lobby .diff-list:has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}
.rhythm-lobby .diff-list:has(> :nth-child(5):last-child) > .diff { grid-column: span 2; }
.rhythm-lobby .diff-list:has(> :nth-child(5):last-child) > .diff:nth-last-child(-n+2) { grid-column: span 3; }

/* Six songs have two rows with enough room for all localized labels. */
.rhythm-lobby .song-list:has(> :nth-child(6)) {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.rhythm-lobby .song-list:has(> :nth-child(6)) .song-choice { min-height:59px; }
.rhythm-lobby .song-list:has(> :nth-child(6)) .song-choice b {
  padding-inline:5px;
  overflow-wrap:anywhere;
}
@media(max-height:690px) and (max-width:719px) {
  .rhythm-lobby .song-current:has(~ .song-list > :nth-child(6)) { min-height:145px; }
}
.rhythm-lobby #song-subtitle:not([hidden]) {
  display:block;
  color:#ffe1af;
  font:600 13px/1.2 system-ui,sans-serif;
  margin:5px 0 0;
}
.rhythm-lobby #song-subtitle[hidden] { display:none; }
