/* Desktop starts directly with quick join and the live-room mosaic. */
@media (min-width: 721px) {
  .home-view .discovery-shell {
    display: none;
  }

  .discovery-quick-join {
    margin-top: 24px;
  }
}
/* One2Event room discovery v4: full-bleed live-room mosaic using the local 4x2 sprite. */

.discovery-shell {
  overflow: hidden;
}

.room-grid {
  grid-auto-flow: dense;
  gap: 10px;
}

.room-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  color: #fff;
  border: 0;
  border-radius: 18px;
  background: #0a1020;
  box-shadow: 0 10px 26px rgba(10, 20, 45, .16);
  transform: translateZ(0);
}

.room-card:hover {
  border-color: transparent;
  transform: translateY(-3px);
}

.room-card:focus-visible {
  outline: 3px solid #2d5bff;
  outline-offset: 3px;
}

.room-card-top {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: auto;
  height: auto !important;
  margin: 0 !important;
  padding: 14px;
  overflow: hidden;
  color: #fff !important;
  background-color: #0a1020 !important;
  background-image: linear-gradient(180deg, rgba(6, 12, 28, .04) 12%, rgba(6, 12, 28, .30) 54%, rgba(6, 12, 28, .96) 100%) !important;
  background-repeat: no-repeat, no-repeat !important;
  background-size: 100% 100%, cover !important;
  background-position: center, center !important;
  transition: transform .35s ease;
}

.room-card:hover .room-card-top {
  transform: scale(1.025);
}

.room-card-top::before,
.room-card-top::after {
  display: none !important;
}

.room-visual-1 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.24) 50%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-01.webp') !important; background-position: center, center 42% !important; }
.room-visual-2 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.30) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-02.webp') !important; background-position: center, center 42% !important; }
.room-visual-3 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.30) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-03.webp') !important; background-position: center, center 46% !important; }
.room-visual-4 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.28) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-04.webp') !important; background-position: center, center 48% !important; }
.room-visual-5 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.30) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-05.webp') !important; background-position: center, center 50% !important; }
.room-visual-6 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.30) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-06.webp') !important; background-position: center, center 48% !important; }
.room-visual-7 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.30) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-07.webp') !important; background-position: center, center 45% !important; }
.room-visual-8 .room-card-top { background-image: linear-gradient(180deg, rgba(6,12,28,.03) 10%, rgba(6,12,28,.30) 52%, rgba(6,12,28,.96) 100%), url('/assets/rooms/live-room-08.webp') !important; background-position: center, center 48% !important; }

.room-card .live-badge {
  position: absolute;
  z-index: 3;
  top: 13px;
  left: 13px;
  padding: 6px 9px;
  color: #fff;
  background: #ef3767;
  box-shadow: 0 5px 16px rgba(239, 55, 103, .24);
}

.room-card .room-code {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 13px;
  padding: 5px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 12, 27, .78);
}

.room-art-label {
  position: absolute !important;
  z-index: 3;
  left: 14px !important;
  bottom: 76px !important;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 12, 27, .78);
  font-size: 9px !important;
  line-height: 1;
  letter-spacing: .12em !important;
}

.room-card h3 {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 34px;
  left: 14px;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .38);
}

.room-card p {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  left: 14px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .78);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-people {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 54px;
  margin: 0;
}

.room-people .mini-avatar {
  display: none;
}

.room-people span:last-child {
  margin: 0;
  padding: 5px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 12, 27, .78);
  font-size: 9px;
  font-weight: 800;
}

.room-card-footer {
  display: none;
}

@media (min-width: 1121px) {
  .home-wrap {
    width: min(1240px, calc(100% - 64px));
    padding-top: 24px;
  }

  .discovery-quick-join {
    min-height: 76px;
    margin: 0 0 24px;
    padding: 14px 16px 14px 20px;
    gap: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 35, 58, .07);
  }

  .discovery-quick-join .section-kicker { font-size: 9px; }
  .discovery-quick-join h2 { margin-top: 2px; font-size: 18px; }
  .discovery-quick-join form { width: min(490px, 54%); }
  .discovery-quick-join .code-input,
  .discovery-quick-join form > button { min-height: 46px; }

  .rooms-section .section-heading {
    align-items: center;
    margin-bottom: 14px;
  }

  .rooms-section .section-heading h2 {
    margin-top: 5px;
    font-size: 34px;
  }

  .room-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 174px;
    gap: 12px;
  }

  .room-card {
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(10, 20, 45, .14);
  }

  .room-card .live-badge,
  .room-card .room-code,
  .room-people span:last-child,
  .room-art-label {
    box-shadow: none;
  }

  .room-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .room-card:nth-child(4) {
    grid-column: span 2;
  }

  .room-card:nth-child(1) .live-badge,
  .room-card:nth-child(1) .room-code { top: 16px; }

  .room-card:nth-child(1) .room-art-label {
    bottom: 94px !important;
    font-size: 11px !important;
  }

  .room-card:nth-child(1) h3 {
    bottom: 46px;
    font-size: 30px;
  }

  .room-card:nth-child(1) p {
    bottom: 20px;
    font-size: 12px;
  }
}

@media (min-width: 1520px) {
  .home-wrap { width: 1280px; }
}

@media (min-width: 721px) and (max-width: 1120px) {
  .room-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 188px;
  }

  .room-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .room-card:nth-child(1) .room-art-label {
    bottom: 96px !important;
  }

  .room-card:nth-child(1) h3 {
    bottom: 45px;
    font-size: 28px;
  }

  .room-card:nth-child(1) p {
    bottom: 20px;
    font-size: 11px;
  }
}

@media (max-width: 720px) {
  .discovery-shell {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .room-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 132px;
    gap: 7px;
  }

  .room-card {
    border-radius: 13px;
  }

  .room-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .room-card:nth-child(8) {
    grid-column: span 2;
  }

  .room-card:only-child {
    grid-column: 1 / -1;
    grid-row: span 2;
  }

  .room-card:first-child:nth-last-child(2) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .room-card:first-child:nth-last-child(2) + .room-card {
    grid-column: span 1;
    grid-row: span 2;
  }

  .room-card .live-badge {
    top: 8px;
    left: 8px;
    padding: 4px 6px;
    font-size: 7px;
  }

  .room-card .live-badge::after {
    display: none;
  }

  .room-card .room-code {
    top: 8px;
    right: 8px;
    padding: 4px 5px;
    font-size: 7px;
  }

  .room-people {
    top: 31px;
    right: 8px;
  }

  .room-people span:last-child {
    padding: 4px 5px;
    font-size: 7px;
  }

  .room-art-label {
    left: 8px !important;
    bottom: 51px !important;
    padding: 3px 5px;
    font-size: 7px !important;
  }

  .room-card h3 {
    right: 8px;
    bottom: 18px;
    left: 8px;
    font-size: 12px;
  }

  .room-card p {
    display: none;
  }

  .room-card:nth-child(1) .room-art-label,
  .room-card:only-child .room-art-label {
    bottom: 72px !important;
    font-size: 8px !important;
  }

  .room-card:nth-child(1) h3,
  .room-card:only-child h3 {
    bottom: 35px;
    font-size: 21px;
  }

  .room-card:nth-child(1) p,
  .room-card:only-child p {
    display: block;
    right: 10px;
    bottom: 15px;
    left: 10px;
    font-size: 9px;
  }
}

@media (max-width: 370px) {
  .room-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 118px;
  }

  .room-card h3 {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-card,
  .room-card-top {
    transition: none !important;
  }
}
/* Mobile live-discovery shell: app-like navigation and immediate room mosaic. */
.mobile-discovery-primary,
.mobile-community-banner {
  display: none;
}

@media (max-width: 720px) {
  .app-header,
  .app-demo-notice { display: none; }

  .home-view { background: #fff; }
  .home-wrap { padding: 0 12px calc(96px + env(safe-area-inset-bottom)); }

  .mobile-discovery-primary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 44px;
    align-items: end;
    gap: 2px;
    min-height: 58px;
    margin: 0 -12px;
    padding: 10px 12px 0;
    color: rgba(255, 255, 255, .62);
    background: linear-gradient(118deg, #582cff 0%, #7841ff 52%, #2d5bff 100%);
  }

  .mobile-discovery-primary button {
    position: relative;
    min-width: 0;
    min-height: 48px;
    padding: 0 3px 11px;
    border: 0;
    color: inherit;
    background: transparent;
    font-size: 14px;
    font-weight: 850;
  }

  .mobile-discovery-primary button.is-active { color: #fff; font-size: 18px; }
  .mobile-discovery-primary button.is-active::after {
    content: "";
    position: absolute;
    right: 20%;
    bottom: 5px;
    left: 20%;
    height: 3px;
    border-radius: 999px;
    background: #b4ff3a;
  }

  .mobile-discovery-primary .mobile-room-code {
    align-self: center;
    min-height: 40px;
    margin-bottom: 6px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 12px;
    color: #fff;
    font-size: 24px;
  }

  .discovery-shell {
    margin: 0 -12px 9px;
    padding: 0 12px 10px;
    border: 0;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 24px rgba(31, 41, 74, .08);
  }
  .discovery-heading { display: none; }
  .room-category-tabs {
    min-height: 52px;
    margin: 0 -12px;
    padding: 2px 12px 0;
    background: #fff;
  }
  .room-category-tabs button { min-height: 50px; padding-right: 15px; padding-left: 15px; font-size: 14px; }

  .mobile-community-banner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 78px;
    margin-top: 10px;
    padding: 12px 13px;
    overflow: hidden;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(115deg, #07182c 0%, #123d57 64%, #2d5bff 100%);
  }
  .community-rank-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    color: #07111f;
    background: #b4ff3a;
  }
  .community-rank-mark span { font-size: 18px; line-height: 1; }
  .community-rank-mark b { margin-top: -5px; font-size: 8px; letter-spacing: .12em; }
  .community-rank-copy { min-width: 0; }
  .community-rank-copy small,
  .community-rank-copy strong { display: block; }
  .community-rank-copy small { color: #7eeeff; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
  .community-rank-copy strong { margin-top: 3px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .community-rank-faces { display: flex; padding-left: 10px; }
  .community-rank-faces i {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-left: -9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #0b1a2d;
    font-style: normal;
    font-size: 13px;
  }

  .discovery-quick-join,
  .rooms-section .section-heading { display: none; }
  .rooms-section { padding-top: 0; }
}
