/* A single centered arrival sequence, using the same gold/navy language as the lobby. */
#s-home {
  position: relative;
  isolation: isolate;
}

#s-home::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: min(720px, 85vh);
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 9, 21, .54), rgba(4, 9, 21, .82) 58%, #050b17 100%),
    url("/assets/discuss-room-wide.png") center top / cover no-repeat;
}

#s-home .wrap {
  max-width: 1080px;
}

#s-home .hero {
  width: min(100%, 1020px);
  margin: 6px auto 14px;
  border: 1px solid rgba(232, 194, 108, .7);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .54), 0 0 0 4px rgba(5, 12, 27, .72);
}

#s-home .hero .cast {
  aspect-ratio: 1400 / 686;
  object-fit: cover;
  object-position: center bottom;
}

#s-home .home-challenge,
#s-home .home-entry {
  width: min(100%, 760px);
  margin-inline: auto;
  text-align: center;
}

#s-home .home-challenge {
  margin-top: 0;
  padding: 28px clamp(20px, 4vw, 42px) 25px;
}

#s-home .home-challenge .serif {
  font-size: clamp(23px, 2.3vw, 30px) !important;
}

#s-home .home-challenge .hint {
  max-width: 590px;
  margin: 12px auto 0;
  font-size: 15.5px;
}

#s-home .home-entry {
  padding: 31px clamp(18px, 4vw, 43px) 30px;
  border-color: rgba(241, 211, 132, .82);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(25, 45, 76, .98), rgba(7, 17, 35, .99) 72%);
  box-shadow:
    inset 0 1px rgba(255, 243, 203, .16),
    inset 0 0 0 5px rgba(193, 148, 53, .08),
    0 24px 56px rgba(0, 0, 0, .48);
}

#s-home .home-entry .frame-title {
  background: linear-gradient(180deg, #253d64, #101d34);
}

#s-home .home-entry #name-input,
#s-home .home-entry .row {
  max-width: 600px;
  margin-inline: auto;
}

#s-home .home-entry #name-input {
  min-height: 54px;
  background: rgba(3, 10, 24, .72);
  border-color: rgba(228, 192, 110, .58);
}

#s-home .home-entry #host-btn {
  display: block;
  width: min(100%, 600px);
  min-height: 58px;
  margin: 14px auto 0 !important;
  font-size: 17px;
}

#s-home .home-entry #host-btn[hidden] {
  display: none;
}

#s-home .home-entry .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, auto);
  gap: 9px;
  margin-top: 12px !important;
}

#s-home .home-entry #join-code {
  min-width: 0;
  background: rgba(3, 10, 24, .72);
  border-color: rgba(228, 192, 110, .48);
}

#s-home .home-entry #join-btn {
  width: 112px;
  min-height: 50px;
  border-color: rgba(228, 192, 110, .6);
  color: #f2dca2;
}

/* A first-time invite has a locked code and a longer destination label.
   Keep both readable instead of retaining the compact normal-Join column. */
#s-home .home-entry #host-btn[hidden] + .row {
  grid-template-columns: minmax(0, 1fr);
}
#s-home .home-entry #host-btn[hidden] + .row #join-btn {
  width: 100%;
}

#s-home .home-rules,
#s-home .home-legend,
#s-home .home-records {
  padding: 28px clamp(18px, 2.5vw, 28px) 23px;
  border-color: rgba(225, 188, 99, .55);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(22, 39, 67, .96), rgba(7, 17, 35, .98));
}

#s-home .home-rules .listrow,
#s-home .home-legend .legend {
  line-height: 1.5;
}

#s-home .home-legend .legend {
  gap: 12px 14px;
}

#s-home .home-records {
  width: min(100%, 760px);
  margin-inline: auto;
}

/* The public leaderboard supplies its own account photos, not room handles. */
#board .brow {
  gap: 12px;
  padding: 12px;
}

#board .board-player {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

#board .player-avatar {
  width: 52px;
  height: 52px;
  margin-right: 0;
  font-size: 20px;
}

#board .board-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

#board .player-avatar__fallback {
  font-size: inherit;
}

#board .sc {
  flex: none;
  font-size: 24px;
}

@media (max-width: 600px) {
  #board .brow { gap: 8px; padding: 10px 8px; }
  #board .board-player { gap: 8px; }
  #board .player-avatar { width: 44px; height: 44px; }
  #board .board-player-name { font-size: 18px; }
  #board .sc { font-size: 22px; }
}

@media (min-width: 900px) {
  #s-home .hero { margin-bottom: 0; }

  #s-home .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 18px;
  }

  #s-home .wrap > :not(.home-rules):not(.home-legend) {
    grid-column: 1 / -1;
  }

  #s-home .wrap > .frame {
    margin-bottom: 0;
  }

  #s-home .home-rules,
  #s-home .home-legend {
    min-width: 0;
    margin-bottom: 0;
  }

  #s-home .home-rules { grid-column: 1; }
  #s-home .home-legend { grid-column: 2; }
}

@media (max-width: 899px) {
  #s-home .hero {
    margin-top: 8px;
  }

  #s-home .home-challenge,
  #s-home .home-entry,
  #s-home .home-rules,
  #s-home .home-legend,
  #s-home .home-records {
    margin-bottom: 19px;
  }
}

@media (max-width: 390px) {
  #s-home .home-entry .row {
    grid-template-columns: minmax(0, 1fr) 98px;
  }

  #s-home .home-entry #join-btn {
    width: 98px;
    font-size: 15px;
  }

  #s-home .home-entry #join-code {
    padding-inline: 10px;
    font-size: 15px;
  }

  #s-home .home-legend .legend {
    column-gap: 8px;
    font-size: 14px;
  }
}
