/* 大厅 / 登录：全屏立绘 + 浮层 UI */

#screen-auth {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: calc(0.6rem + var(--safe-t)) 1rem calc(1.1rem + var(--safe-b));
  overflow: hidden;
  z-index: 2;
}
#screen-auth.active { display: flex; }

.auth-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #060a18;
}

.auth-girl-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 8%;
  transform: scale(1.02);
  animation: girl-breathe 7s ease-in-out infinite;
  pointer-events: none;
}

.auth-stage-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 8, 22, 0.2) 0%, transparent 22%),
    linear-gradient(0deg, rgba(4, 8, 22, 0.96) 0%, rgba(4, 8, 22, 0.72) 32%, rgba(4, 8, 22, 0.25) 55%, transparent 72%),
    linear-gradient(90deg, rgba(4, 8, 22, 0.3) 0%, transparent 42%);
  pointer-events: none;
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  flex: 0 1 auto;
  max-height: calc(var(--app-h) - 2.2rem - var(--safe-t) - var(--safe-b));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.1rem 1rem 1rem;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(16, 28, 58, 0.88), rgba(8, 14, 32, 0.94));
  border: 1px solid rgba(160, 200, 255, 0.28);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand {
  margin-bottom: 0.35rem;
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  line-height: 1.15;
  background: linear-gradient(180deg, #fff6c8, #f0c75e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0.3rem 0 0.12rem;
}

.auth-brand p {
  color: rgba(220, 235, 255, 0.75);
  font-size: 0.82rem;
  margin: 0 0 0.85rem;
  line-height: 1.35;
}

.auth-glyph {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: #1a1208;
  background: linear-gradient(180deg, #ffe08a, #d4a017);
  box-shadow: 0 0 0 4px rgba(240, 199, 94, 0.25);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.auth-tab {
  border: 1px solid rgba(140, 190, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(230, 240, 255, 0.75);
  border-radius: 999px;
  padding: 0.55rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: linear-gradient(180deg, #5b8cff, #2f5ad8);
  color: #fff;
  border-color: transparent;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.auth-form[hidden] { display: none !important; }

.auth-form input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(140, 190, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #eef4ff;
  font-family: inherit;
  font-size: 16px; /* 避免 iOS 聚焦放大导致整页错位 */
  outline: none;
}

.auth-error {
  margin-top: 0.55rem;
  color: #fb7185;
  font-size: 0.85rem;
}

/* ===== Lobby：全屏立绘 ===== */
#screen-lobby {
  overflow: hidden;
  display: none;
  flex-direction: column;
  justify-content: flex-start !important;
  align-items: stretch !important;
  text-align: left !important;
  background: #050912;
  isolation: isolate;
}
#screen-lobby.active { display: flex; }

.club-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #050912;
}

.club-girl-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 6%;
  transform-origin: 52% 28%;
  animation: girl-breathe 7.5s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

.club-stage-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 9, 20, 0.55) 0%, rgba(5, 9, 20, 0.12) 18%, transparent 36%),
    linear-gradient(0deg, rgba(5, 9, 20, 0.94) 0%, rgba(5, 9, 20, 0.72) 22%, rgba(5, 9, 20, 0.25) 48%, transparent 68%),
    linear-gradient(105deg, rgba(5, 9, 20, 0.2) 0%, transparent 38%, rgba(5, 9, 20, 0.45) 78%, rgba(5, 9, 20, 0.62) 100%);
}

.club-stage-spark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 220, 140, 0.16), transparent 18%),
    radial-gradient(circle at 82% 30%, rgba(120, 170, 255, 0.14), transparent 22%);
  animation: pulse-glow 5s ease-in-out infinite;
}

@keyframes girl-breathe {
  0%, 100% { transform: scale(1.03) translateY(0); }
  50% { transform: scale(1.06) translateY(-1.2%); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.club-top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: calc(0.55rem + var(--safe-t)) 0.75rem 0.5rem;
}

.club-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border-radius: 999px;
  background: rgba(6, 12, 28, 0.42);
  border: 1px solid rgba(160, 200, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.club-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #1a1208;
  background: linear-gradient(145deg, #ffe08a, #e0a020);
  border: 2px solid rgba(255, 230, 150, 0.9);
  box-shadow: 0 0 12px rgba(80, 140, 255, 0.35);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  cursor: pointer;
}
.club-avatar.has-img {
  color: transparent;
  background-color: #1a2740;
}

.club-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
  padding-right: 0.25rem;
}

.club-user-meta strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.club-id-row {
  font-size: 0.68rem;
  color: rgba(220, 235, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.club-mini {
  border: none;
  border-radius: 6px;
  padding: 0.08rem 0.35rem;
  font-size: 0.62rem;
  background: rgba(70, 130, 255, 0.35);
  color: #dce8ff;
  cursor: pointer;
}

.club-currency {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.35rem 0.28rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 80, 180, 0.72), rgba(20, 40, 100, 0.82));
  border: 1px solid rgba(120, 180, 255, 0.4);
  font-weight: 800;
  color: #ffe9a0;
  font-size: 0.88rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.club-plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #7dffb2, #22c55e);
  color: #053018;
  font-weight: 900;
  cursor: pointer;
}

.club-notice {
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(8, 14, 32, 0.45);
  color: #e8f0ff;
  border: 1px solid rgba(140, 190, 255, 0.3);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* display:inline-flex 会盖掉原生 hidden，管理入口必须显式隐藏 */
.club-notice[hidden],
#btn-admin[hidden] {
  display: none !important;
}

.club-marquee {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0.75rem 0;
  padding: 0.35rem 0.4rem 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.club-marquee-track {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.72rem;
  color: rgba(240, 244, 255, 0.78);
  letter-spacing: 0.06em;
  animation: marquee-slide 16s linear infinite;
}

@keyframes marquee-slide {
  0% { transform: translateX(6%); }
  100% { transform: translateX(-65%); }
}

.club-pill-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 220, 160, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f8efd0;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.club-rooms {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 0.65rem 0.4rem;
  margin-top: auto;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 0.75rem 0.6rem 0.65rem;
  min-height: 148px;
  cursor: pointer;
  color: #f4f7ff;
  overflow: hidden;
  background: rgba(10, 14, 28, 0.52);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, border-color 0.18s, background 0.18s;
}
.room-card:active { transform: scale(0.98); }
.room-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 18px 0 0 18px;
  background: var(--room-accent, #c9a227);
}
.room-card.theme-cyan { --room-accent: #5ec8ff; border-color: rgba(94, 200, 255, 0.28); }
.room-card.theme-green { --room-accent: #6dffb0; border-color: rgba(109, 255, 176, 0.28); }
.room-card.theme-violet { --room-accent: #c4a1ff; border-color: rgba(196, 161, 255, 0.28); }
.room-card.theme-gold { --room-accent: #f0c75e; border-color: rgba(240, 199, 94, 0.38); }

.room-card.locked {
  opacity: 0.55;
}
.room-card.locked .room-go { display: none; }

.room-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--room-accent, #c9a227);
  opacity: 0.9;
  letter-spacing: 0.08em;
}

.room-name {
  margin-top: 0.45rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.room-line {
  display: block;
  width: 28px;
  height: 2px;
  margin: 0.45rem 0 0.55rem;
  border-radius: 2px;
  background: var(--room-accent, #c9a227);
  opacity: 0.75;
}

.room-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: auto;
  font-size: 0.68rem;
  color: rgba(230, 236, 255, 0.72);
  line-height: 1.35;
}
.room-meta b {
  color: #ffe9a8;
  font-weight: 800;
  margin-left: 0.15rem;
}

.room-go,
.room-lock {
  margin-top: 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.room-go { color: var(--room-accent, #c9a227); }
.room-lock { color: rgba(255, 180, 180, 0.85); }

.club-side-actions {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.3rem 0.7rem 0.55rem;
}

.club-side-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 0.72rem 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f4f7ff;
  background: rgba(12, 16, 32, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s, border-color 0.15s;
}
.club-side-btn:active { transform: scale(0.98); }
.side-create {
  border-color: rgba(109, 255, 176, 0.35);
  background: linear-gradient(180deg, rgba(40, 90, 70, 0.55), rgba(12, 28, 24, 0.65));
}
.side-join {
  border-color: rgba(120, 180, 255, 0.35);
  background: linear-gradient(180deg, rgba(40, 70, 120, 0.55), rgba(12, 20, 40, 0.65));
}

.club-bottom {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.2rem;
  width: 100%;
  margin-top: 0;
  padding: 0.4rem 0.35rem calc(0.55rem + var(--safe-b));
  background: rgba(6, 10, 22, 0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.club-nav {
  background: transparent;
  border: none;
  border-radius: 12px;
  color: rgba(230, 236, 255, 0.78);
  padding: 0.3rem 0.1rem 0.2rem;
  font-size: 0.62rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  cursor: pointer;
}
.club-nav span { line-height: 1; }
.club-nav:active { color: #ffe9a8; }

.nav-ico {
  width: 22px;
  height: 22px;
  position: relative;
  display: block;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.9;
}

.nav-music::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.nav-music::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 4px;
  width: 1.5px;
  height: 14px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 4px 2px 0 -1px currentColor;
}

.nav-skin {
  border: 1.5px solid currentColor;
  border-radius: 6px;
}
.nav-skin::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  background:
    linear-gradient(135deg, #f0c75e 0 33%, transparent 34%),
    linear-gradient(225deg, #7eb6ff 0 33%, transparent 34%),
    linear-gradient(45deg, #6dffb0 0 40%, transparent 41%);
  opacity: 0.85;
}

.nav-card {
  border: 1.5px solid currentColor;
  border-radius: 3px;
  transform: rotate(-12deg);
}
.nav-card::after {
  content: "";
  position: absolute;
  inset: -2px -2px 2px 2px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.45;
  transform: rotate(18deg);
}

.nav-rule {
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.nav-rule::before,
.nav-rule::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}
.nav-rule::before { top: 7px; }
.nav-rule::after { top: 12px; box-shadow: 0 5px 0 currentColor; }

.nav-user {
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.nav-user::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.nav-user::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 12px;
  height: 6px;
  margin-left: -6px;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.nav-exit {
  border: 1.5px solid currentColor;
  border-radius: 4px;
}
.nav-exit::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 7px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-right: none;
  border-radius: 2px 0 0 2px;
}
.nav-exit::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 10px;
  width: 8px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 2px -2.5px 0 -0.2px currentColor, 2px 2.5px 0 -0.2px currentColor;
}

@media (min-width: 720px) {
  /* #app 本身限制在 480px，登录面板保持居中贴底，勿再右推造成“错位” */
  .auth-girl-full { object-position: 50% 6%; }
  .club-girl-full { object-position: 48% 6%; }
  .club-rooms { gap: 0.7rem; padding-left: 1rem; padding-right: 1rem; }
  .room-card { min-height: 168px; padding: 0.9rem 0.75rem 0.75rem; }
  .room-name { font-size: 1.05rem; }
}

@media (max-width: 380px) {
  .room-card { min-height: 136px; padding: 0.6rem 0.45rem 0.55rem; }
  .room-name { font-size: 0.88rem; }
  .room-mark { font-size: 1.15rem; }
  .club-side-btn { font-size: 0.74rem; padding: 0.62rem 0.25rem; }
  .club-nav { font-size: 0.56rem; }
}

@media (max-height: 640px) {
  .club-rooms { padding-top: 0.5rem; }
  .room-card { min-height: 124px; }
  .room-mark { font-size: 1.1rem; }
  .room-name { margin-top: 0.3rem; }
}
