.songcatch-lobby-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: url('/assets/songcatch-background.png') center / cover fixed no-repeat;
}

.songcatch-lobby-header {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.songcatch-lobby-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  padding: 40px 20px;
}

.songcatch-lobby-card {
  width: min(520px, calc(100vw - 32px));
  padding: 38px 46px 34px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 32px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 20px 58px rgba(91, 62, 150, .16);
  backdrop-filter: blur(14px);
  animation: songcatch-card-in .55s cubic-bezier(.2, .85, .3, 1) both;
}

.songcatch-lobby-logo {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: -7px auto 14px;
  border-radius: 24px;
  background: linear-gradient(145deg, #f3efff, #ffe9f1);
  box-shadow: 0 10px 24px rgba(108, 92, 231, .2);
  transform: rotate(-5deg);
  animation: songcatch-logo-bob 4s ease-in-out .45s infinite;
}

.songcatch-lobby-logo img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 18px;
  transform: rotate(5deg);
}

.songcatch-lobby-card > .eyebrow,
.songcatch-lobby-card h1,
.songcatch-lobby-copy {
  text-align: center;
}

.songcatch-lobby-card h1 {
  margin: 0;
  color: var(--music2);
  font-size: clamp(2.65rem, 8vw, 3.9rem);
  line-height: .95;
  letter-spacing: -.07em;
}

.songcatch-lobby-copy {
  margin: 18px 0 28px;
  color: var(--muted);
  line-height: 1.55;
}

.songcatch-nickname-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.songcatch-nickname-row {
  position: relative;
}

.songcatch-nickname-row input {
  width: 100%;
  padding: 12px 60px 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.songcatch-nickname-row input:focus {
  border-color: var(--music2);
  box-shadow: 0 0 0 4px rgba(108, 76, 255, .12);
  transform: translateY(-1px);
}

.songcatch-nickname-row input::placeholder {
  color: #9b9eaa;
}

.songcatch-nickname-row span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #a2a5ae;
  font-size: .76rem;
  transform: translateY(-50%);
}

.songcatch-field-help {
  margin: 7px 2px 17px;
  color: #999da8;
  font-size: .74rem;
}

.songcatch-main-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.songcatch-main-actions button,
.songcatch-code-button {
  min-height: 52px;
  border-radius: 14px;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.songcatch-main-actions button:hover,
.songcatch-code-button:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(50, 42, 90, .13); }
.songcatch-main-actions button:active,
.songcatch-code-button:active { transform: translateY(0) scale(.98); }

.songcatch-code-button {
  width: 100%;
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.songcatch-personal-link {
  display: block;
  margin: 18px auto 0;
  color: var(--muted);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: .82rem;
}

.songcatch-connection {
  margin: 17px 0 -9px;
  color: #a0a3ae;
  text-align: center;
  font-size: .68rem;
}

.songcatch-connection.connected {
  color: var(--good);
}

.songcatch-lobby-features {
  width: min(700px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.songcatch-lobby-features div {
  padding: 15px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(10px);
  animation: songcatch-feature-in .45s ease-out both;
}

.songcatch-lobby-features div:nth-child(1) { animation-delay: .16s; }
.songcatch-lobby-features div:nth-child(2) { animation-delay: .24s; }
.songcatch-lobby-features div:nth-child(3) { animation-delay: .32s; }

.songcatch-lobby-features span,
.songcatch-lobby-features strong,
.songcatch-lobby-features small {
  display: block;
}

.songcatch-lobby-features span {
  font-size: 1.35rem;
}

.songcatch-lobby-features strong {
  margin: 5px;
  font-size: .8rem;
}

.songcatch-lobby-features small {
  color: var(--muted);
  font-size: .68rem;
}

.music-lobby-modal {
  width: min(540px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  padding: 26px;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 24px 90px rgba(38, 32, 78, .35);
}

.music-lobby-modal::backdrop {
  background: rgba(31, 27, 52, .52);
  backdrop-filter: blur(4px);
}

.music-lobby-modal[open] {
  animation: songcatch-modal-in .2s ease-out;
}

@keyframes songcatch-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
}

.music-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.music-modal-heading h2 {
  margin: 0;
}

.music-modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: #f1f0f8;
  font-size: 1.2rem;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}

.music-modal-close:hover { color: var(--music2); background: #eae7ff; transform: rotate(6deg) scale(1.05); }

.songcatch-toggle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.songcatch-toggle-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: .78rem;
  font-weight: 750;
}

.songcatch-toggle-list input {
  width: auto;
  accent-color: var(--music2);
}

.music-rooms-modal {
  width: min(820px, calc(100vw - 28px));
}

.music-room-filters {
  display: grid;
  grid-template-columns: 1fr 150px auto auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.music-room-filters #roomSearch,
.music-room-filters #roomSort {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.music-room-filters #roomSearch:focus,
.music-room-filters #roomSort:focus {
  border-color: var(--music2);
  box-shadow: 0 0 0 4px rgba(108, 76, 255, .12);
}

.music-room-filters #roomSearch::placeholder {
  color: #9b9eaa;
}

.music-check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 750;
}

.music-check-inline input {
  width: auto;
  accent-color: var(--music2);
}

.music-compact {
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 800;
}

.music-public-rooms {
  display: grid;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
}

.music-room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  animation: songcatch-room-in .28s ease-out both;
}

.music-room-card:nth-child(2) { animation-delay: .04s; }
.music-room-card:nth-child(3) { animation-delay: .08s; }
.music-room-card:nth-child(4) { animation-delay: .12s; }
.music-room-card:nth-child(n+5) { animation-delay: .16s; }
.music-room-card:hover { border-color: #d8d1ff; box-shadow: 0 10px 24px rgba(66, 53, 126, .1); transform: translateY(-2px); }

.music-room-card h3 {
  margin: 6px 0 4px;
  font-size: 1rem;
}

.music-room-card p {
  margin: 0;
  color: var(--muted);
  font-size: .77rem;
}

.music-room-card-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-room-card-side strong {
  font-size: .8rem;
  white-space: nowrap;
}

.music-status-pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 100px;
  color: #007958;
  background: #d7fff2;
  font-size: .65rem;
  font-weight: 800;
}

.music-status-pill.playing,
.music-status-pill.roundResult {
  color: #a85e00;
  background: #fff0c7;
}

.music-status-pill.finished {
  color: #666b77;
  background: #ececf2;
}

.music-empty-state {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 50px 10px;
  color: var(--muted);
  text-align: center;
}

.music-empty-state span {
  font-size: 2.5rem;
}

.music-empty-state b {
  color: var(--ink);
}

.music-code-modal {
  width: min(410px, calc(100vw - 28px));
}

.music-code-modal #code {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 1.35rem;
  font-weight: 900;
}

.songcatch-lobby-notice {
  position: fixed;
  z-index: 100;
  bottom: 24px;
  left: 50%;
  width: min(500px, calc(100vw - 28px));
  margin: 0;
  box-shadow: 0 12px 36px rgba(36, 31, 63, .22);
  transform: translateX(-50%);
  animation: songcatch-notice-in .22s ease-out both;
}

@keyframes songcatch-card-in { from { opacity: 0; transform: translateY(22px) scale(.975); } }
@keyframes songcatch-logo-bob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-7px) rotate(-2deg); }
}
@keyframes songcatch-feature-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes songcatch-room-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes songcatch-notice-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 600px) {
  .songcatch-lobby-header {
    height: 56px;
    padding: 0 18px;
  }

  .songcatch-lobby-shell {
    min-height: calc(100vh - 56px);
    padding: 22px 12px;
  }

  .songcatch-lobby-card {
    padding: 30px 22px 28px;
    border-radius: 24px;
  }

  .songcatch-main-actions {
    grid-template-columns: 1fr;
  }

  .songcatch-lobby-features {
    gap: 5px;
  }

  .songcatch-lobby-features div {
    padding: 10px 4px;
  }

  .songcatch-lobby-features small {
    display: none;
  }

  .music-lobby-modal {
    padding: 22px 18px;
  }

  .music-lobby-modal .field-row,
  .songcatch-toggle-list {
    grid-template-columns: 1fr;
  }

  .music-room-filters {
    grid-template-columns: 1fr;
  }

  .music-room-card-side {
    flex-direction: column;
    gap: 5px;
  }
}

@media (min-width: 601px) and (max-width: 760px) {
  .music-room-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .songcatch-lobby-card,
  .songcatch-lobby-logo,
  .songcatch-lobby-features div,
  .music-lobby-modal[open],
  .music-room-card,
  .songcatch-lobby-notice { animation: none; }

  .songcatch-nickname-row input,
  .songcatch-main-actions button,
  .songcatch-code-button,
  .music-modal-close,
  .music-room-card { transition: none; }
}
