:root {
  --bg: #05030a;
  --glass: rgba(20, 14, 34, 0.72);
  --glass2: rgba(40, 30, 62, 0.65);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f2ff;
  --dim: #aaa1c8;
  --accent: #ff4fa3;
  --accent2: #42e6ff;
  --gold: #ffd36a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-tap-highlight-color: transparent;
  touch-action: none; overscroll-behavior: none; }
input, textarea, button, a, .panel, .sheet, .chat, .dock, .hype { touch-action: manipulation; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 40%, #2a1240, #05030a 70%); z-index: 20; color: var(--dim);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.spin { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #ffffff22; border-top-color: var(--accent); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.loadbar { width: min(240px, 62vw); height: 8px; border-radius: 99px; background: #ffffff18; overflow: hidden; border: 1px solid var(--line); }
.loadbar i { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width 0.15s ease-out; }
#loadPct { font-size: 13px; color: var(--dim); }
.lprog { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.lprog .loadbar { width: 100%; }
.lprog span { color: var(--dim); font-size: 12px; }

.panel { position: fixed; right: max(16px, 4vw); top: 50%; transform: translateY(-50%); width: min(400px, calc(100% - 32px));
  background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 22px; backdrop-filter: blur(16px);
  box-shadow: 0 0 60px rgba(255, 79, 163, 0.22); max-height: calc(100% - 32px); overflow: auto; z-index: 10; }
#lobby.panel { display: flex; flex-direction: column; }
#lobby .primary { position: sticky; bottom: 0; z-index: 2; margin-bottom: 0; padding-bottom: 14px;
  background: linear-gradient(180deg, transparent, var(--glass) 28%, var(--glass)); }
@media (max-width: 760px) { .panel { right: max(16px, env(safe-area-inset-right)); left: max(16px, env(safe-area-inset-left)); top: auto; bottom: max(16px, env(safe-area-inset-bottom)); width: auto; transform: none; } }
.panel h1 { margin: 0; font-size: 30px; letter-spacing: 0.5px; }
.panel h1 span { color: var(--accent); }
.panel .sub { margin: 4px 0 14px; color: var(--dim); }
.panel label { display: flex; flex-direction: column; gap: 6px; color: var(--dim); font-size: 13px; margin-top: 14px; }
.panel input { background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 11px 12px; font-size: 15px; outline: none; }
.panel input:focus { border-color: var(--accent); }
.lbl { color: var(--dim); font-size: 13px; margin: 14px 0 8px; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.char { padding: 10px 8px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); text-align: center; font-size: 13px; }
.char i { display: block; height: 6px; border-radius: 3px; margin-bottom: 8px; }
.char.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(255, 211, 106, 0.1); }
.rooms { display: flex; flex-wrap: wrap; gap: 8px; }
.room { padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 13px; }
.room.on { background: var(--accent); border-color: var(--accent); }
.room small { opacity: 0.75; margin-left: 4px; }
.primary { margin-top: 18px; width: 100%; padding: 14px; border-radius: 14px; font-size: 17px; font-weight: 700; color: #1a0d10;
  background: linear-gradient(90deg, #ffe08a, #ffb0c8); box-shadow: 0 4px 24px rgba(255, 176, 200, 0.35); }

#hud .top { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.pill { pointer-events: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 14px; backdrop-filter: blur(10px); }
.pill.dim { color: var(--dim); } .pill.ok { color: #7dffb0; } .pill.bad { color: #ff7d7d; }
#shoutBanner { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px;
  background: rgba(20, 14, 34, 0.82); border: 1px solid #ff4fa366; padding: 8px 18px 8px 8px; border-radius: 999px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: pop 0.3s ease-out; backdrop-filter: blur(10px); }
#shoutBanner::before { content: '📣'; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #ff4fa3, #a35cff); flex: none; }
@keyframes pop { from { transform: translate(-50%, -10px); opacity: 0; } }
.hint { position: fixed; top: calc(104px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: var(--dim); font-size: 12px; pointer-events: none; transition: opacity 1s; white-space: nowrap; }

#hud .bottom { position: fixed; left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dock { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 6px; border-radius: 26px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); max-width: 100%; }
.dock button { width: 62px; padding: 8px 0 6px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: #e8e2ff; border: 1px solid transparent; }
.dock button b { font-size: 21px; font-weight: 400; }
.dock button.on { border-color: var(--gold); background: rgba(255, 211, 106, 0.08); }
.dock button:active { transform: scale(0.95); }
@media (max-width: 420px) { .dock button { width: 52px; font-size: 11px; } }
@media (pointer: coarse), (max-width: 700px) {
  .dock { padding: 8px; gap: 6px; }
  .dock button { width: 58px; min-height: 64px; padding: 10px 0 8px; font-size: 11px; }
  .dock button b { font-size: 24px; }
  .chat input, .chat button { min-height: 44px; }
  .primary { min-height: 48px; padding: 16px; }
  .char { min-height: 52px; padding: 12px 8px; }
  .room { padding: 10px 14px; min-height: 40px; }
}
.chat { display: flex; gap: 6px; width: min(520px, 100%); }
.chat input { flex: 1; min-width: 0; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; color: var(--text); padding: 11px 12px; font-size: 15px; outline: none; backdrop-filter: blur(10px); }
.chat button { border: 1px solid var(--line); background: var(--glass); border-radius: 14px; padding: 0 14px; }
.chat button[type=submit] { background: var(--accent); border-color: var(--accent); }

.sheet { position: fixed; left: 50%; bottom: calc(152px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: 52vh; overflow: auto;
  background: rgba(30, 24, 44, 0.82); border: 1px solid var(--line); border-radius: 22px; padding: 16px; backdrop-filter: blur(18px); animation: up 0.18s ease-out; }
@keyframes up { from { transform: translate(-50%, 10px); opacity: 0; } }
.sheet h3 { margin: 0 0 4px; font-size: 17px; } .sheet p { margin: 0 0 12px; color: var(--dim); font-size: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.grid4 button { padding: 13px 8px; border-radius: 14px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.grid4 button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.sticks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.sticks button { width: 38px; height: 38px; border-radius: 50%; background: #0007; border: 1px solid var(--line); display: grid; place-items: center; }
.sticks button i { width: 8px; height: 22px; border-radius: 4px; box-shadow: 0 0 10px currentColor; background: currentColor; }
.sticks button.on { box-shadow: 0 0 0 2px var(--accent); }
.sticks .none { width: auto; padding: 0 14px; border-radius: 999px; font-size: 13px; }
#toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: calc(100% - 40px); text-align: center;
  background: rgba(20, 14, 34, 0.86); border: 1px solid #ffd36a66; color: #fff; padding: 12px 20px; border-radius: 16px; font-weight: 600;
  backdrop-filter: blur(10px); pointer-events: none; animation: pop2 0.25s ease-out; z-index: 5; }
@keyframes pop2 { from { transform: translate(-50%, -40%); opacity: 0; } }
.drinks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.drinks button { padding: 12px 6px; border-radius: 14px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.drinks button b { font-size: 26px; font-weight: 400; }
.drinks button small { color: var(--dim); font-size: 11px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acts button { flex: 1 1 auto; padding: 11px 12px; border-radius: 14px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.acts button.hot { background: linear-gradient(90deg, #ffe08a, #ffb0c8); color: #1a0d10; border: 0; }
.acts button:disabled { opacity: 0.4; }
.note { color: var(--dim); font-size: 12px; margin: 10px 0 0; }
/* 嗨按钮：右下角竖排圆按钮，一按全场都看得到 */
.hype { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(150px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.hype button { width: 62px; height: 62px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,79,163,0.55), rgba(40,20,60,0.85));
  border: 1px solid #ff4fa366; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: #fff; backdrop-filter: blur(8px);
  box-shadow: 0 0 18px rgba(255,79,163,0.35); transition: transform 0.08s; }
.hype button b { font-size: 22px; font-weight: 400; line-height: 1.1; }
.hype button:active, .hype button.hit { transform: scale(0.88); box-shadow: 0 0 30px rgba(255, 211, 106, 0.8); }
.hype.drop button { animation: pulse 0.48s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 34px rgba(255, 211, 106, 0.9); } }
@media (max-width: 520px) { .hype { bottom: calc(160px + env(safe-area-inset-bottom)); right: max(10px, env(safe-area-inset-right)); } .hype button { width: 58px; height: 58px; } }
/* MC 喊麦 / 倒数 */
#mc { position: fixed; left: 50%; top: 26%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; white-space: nowrap;
  font-weight: 900; font-size: clamp(28px, 6vw, 64px); letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 12px #ff4fa3, 0 0 32px #ff4fa3, 0 0 60px #a35cff; animation: mcIn 0.35s cubic-bezier(.2,1.6,.4,1); }
#mc.count { font-size: clamp(80px, 18vw, 180px); color: #ffd36a; text-shadow: 0 0 20px #ffb347, 0 0 60px #ff4fa3; }
@keyframes mcIn { from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } }
.booths { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.booths button { padding: 12px 4px; border-radius: 14px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); font-weight: 700; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.booths button small { font-weight: 500; font-size: 12px; color: var(--dim); }
.booths button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(255, 211, 106, 0.1); }
.booths button:disabled { opacity: 0.45; }
.booths button i { font-style: normal; letter-spacing: 1px; font-size: 11px; }
.mates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mates span { padding: 4px 10px; border-radius: 999px; background: #ffffff12; font-size: 12px; }
.status { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #ffd36a1a; border: 1px solid #ffd36a44; font-size: 13px; }
.who { display: flex; flex-direction: column; }
.who div { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.who div i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #ffffff18; font-style: normal; }
.who div em { margin-left: auto; color: var(--dim); font-style: normal; font-size: 12px; }

/* 体力条 */
.stamina { display: flex; align-items: center; gap: 8px; }
.stamina i { display: block; width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #42e6ff, #7dffb0) 0 0 / var(--v, 100%) 100% no-repeat, #ffffff22; }
.stamina.low i { background: linear-gradient(90deg, #ff4f6a, #ffb347) 0 0 / var(--v, 100%) 100% no-repeat, #ffffff22; animation: pulse 0.8s infinite; }

/* 邀请朋友 */
.invite-hint { margin: 0 0 8px; color: var(--gold); font-size: 13px; }
#inviteBtn { cursor: pointer; }
#inviteMenu { position: fixed; top: 56px; left: 16px; z-index: 8; width: min(360px, calc(100% - 32px));
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 14px; backdrop-filter: blur(16px); }
#inviteMenu p { margin: 0 0 8px; font-size: 13px; color: var(--dim); }
#inviteMenu input { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 9px 10px; font-size: 13px; }
#inviteMenu .acts { margin-top: 10px; display: flex; gap: 8px; }
#inviteMenu .acts a, #inviteMenu .acts button { flex: 1; text-align: center; padding: 10px 8px; border-radius: 12px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: inherit; text-decoration: none; }
#inviteMenu .acts a.hot, #inviteMenu .acts button.hot { background: linear-gradient(90deg, #ffe08a, #ffb0c8); color: #1a0d10; border: 0; }
#inviteMenu .close { margin-top: 8px; width: 100%; padding: 8px; font-size: 12px; color: var(--dim); }
.who-acts { display: flex; gap: 6px; margin-left: 8px; flex: none; }
.who-acts button { padding: 4px 8px; border-radius: 999px; background: #ffffff14; border: 1px solid var(--line); font-size: 11px; }
.who-acts button.on { border-color: var(--gold); color: var(--gold); }

/* 换装面板 */
.wardrobe { margin-top: 4px; }
.ward-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ward-tabs button { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 13px; }
.ward-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ward-body { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.ward-lbl { color: var(--dim); font-size: 12px; margin-bottom: 6px; }
.ward-block { }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); font-size: 12px; }
.chip.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(255, 211, 106, 0.12); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #ffffff33; padding: 0; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.ward-acts { display: flex; gap: 8px; margin-top: 4px; }
.ward-acts button { flex: 1; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.wardrobe.compact .ward-body { max-height: none; }
@media (max-width: 760px) {
  .panel { max-height: calc(100% - 24px); }
}
#lobby .wardrobe { max-height: 34vh; overflow: auto; padding-right: 2px; }
@media (max-width: 760px) { #lobby .wardrobe { max-height: 28vh; } }
@media (max-width: 420px) { .dock button { width: 54px; font-size: 11px; } .dock button b { font-size: 18px; } }

/* 头顶昵称更易读（画布精灵本身在 JS 里，这里只保证 HUD 不挡） */
.stamina button { margin-left: 2px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.08); color: inherit; font-weight: 700; font-size: 12px; cursor: pointer; }
.stamina.low button, .stamina.tired button { border-color: #ffd36a; color: #ffd36a; box-shadow: 0 0 10px #ffd36a55; }
.booths.up { grid-template-columns: repeat(5, 1fr); margin-top: 8px; }
.lbl-mini { margin: 10px 0 6px; font-size: 12px; color: var(--dim); font-weight: 700; }

/* ===== Language toggle ===== */
.lang-toggle {
  pointer-events: auto;
  font: 700 12px/1 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.06em;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass, rgba(10, 6, 16, 0.7));
  color: var(--text);
  min-width: 42px;
}
.lang-toggle:active { transform: scale(0.96); }
.splash-lang { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 3; }
.lobby-lang { position: absolute; top: 14px; right: 14px; }
#lobby.panel { position: relative; }

/* ===== Club splash / loading ===== */
#loading {
  background:
    radial-gradient(80% 50% at 50% 110%, rgba(255, 79, 163, 0.28), transparent 60%),
    radial-gradient(40% 40% at 15% 20%, rgba(80, 40, 255, 0.35), transparent 55%),
    radial-gradient(40% 40% at 85% 10%, rgba(58, 208, 255, 0.22), transparent 50%),
    #07040c;
  z-index: 20;
  overflow: hidden;
}
#loading[hidden] { display: none !important; }
#loading .spin { display: none; }
.splash { position: relative; width: min(520px, 92vw); text-align: center; z-index: 1; }
.splash-lights { position: absolute; inset: -40vh -20vw 20%; pointer-events: none; }
.splash-lights .beam {
  position: absolute; top: -10%; left: 50%; width: 18vw; height: 90%;
  background: linear-gradient(to bottom, rgba(255, 79, 163, 0.0), rgba(255, 79, 163, 0.55), transparent);
  filter: blur(8px); transform-origin: top center; opacity: 0.7;
  animation: beamSweep 6s ease-in-out infinite;
}
.beam-a { margin-left: -22vw; animation-delay: 0s; background: linear-gradient(to bottom, transparent, rgba(255, 79, 163, 0.55), transparent); }
.beam-b { margin-left: -6vw; animation-delay: -2s; background: linear-gradient(to bottom, transparent, rgba(255, 210, 106, 0.45), transparent); }
.beam-c { margin-left: 8vw; animation-delay: -4s; background: linear-gradient(to bottom, transparent, rgba(58, 208, 255, 0.5), transparent); }
@keyframes beamSweep {
  0%, 100% { transform: rotate(-16deg) scaleY(1); opacity: 0.35; }
  50% { transform: rotate(14deg) scaleY(1.08); opacity: 0.85; }
}
.spot { position: absolute; bottom: 8%; width: 28vw; height: 22vw; border-radius: 50%; filter: blur(20px); opacity: 0.55; animation: spotPulse 2.4s ease-in-out infinite; }
.spot-l { left: 8%; background: #ff4fa3; }
.spot-r { right: 8%; background: #3ad0ff; animation-delay: -1.2s; }
@keyframes spotPulse { 50% { opacity: 0.2; transform: scale(1.15); } }
.splash-floor {
  position: absolute; left: 50%; bottom: -8%; width: 140%; height: 38%;
  transform: translateX(-50%) perspective(400px) rotateX(68deg);
  background:
    repeating-linear-gradient(90deg, rgba(255, 79, 163, 0.18) 0 2px, transparent 2px 42px),
    repeating-linear-gradient(0deg, rgba(58, 208, 255, 0.15) 0 2px, transparent 2px 42px);
  mask-image: linear-gradient(to top, #000 20%, transparent);
  animation: floorPulse 1.6s linear infinite;
}
@keyframes floorPulse { to { background-position: 42px 42px, 42px 42px; } }
.splash-crowd { position: absolute; left: 0; right: 0; bottom: 6%; height: 90px; display: flex; justify-content: center; gap: 10px; pointer-events: none; }
.splash-crowd span {
  display: block; width: 28px; height: 70px; background: #05030a;
  clip-path: polygon(50% 0, 78% 16%, 72% 28%, 92% 70%, 70% 70%, 70% 100%, 30% 100%, 30% 70%, 8% 70%, 28% 28%, 22% 16%);
  opacity: 0.85; transform-origin: 50% 100%;
  animation: danceSil 0.7s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(255, 79, 163, 0.4));
}
.splash-crowd span:nth-child(2) { animation-delay: -0.15s; height: 80px; width: 32px; }
.splash-crowd span:nth-child(3) { animation-delay: -0.3s; height: 92px; width: 36px; }
.splash-crowd span:nth-child(4) { animation-delay: -0.45s; height: 80px; width: 32px; }
.splash-crowd span:nth-child(5) { animation-delay: -0.2s; }
@keyframes danceSil {
  from { transform: rotate(-8deg) scaleY(0.96); }
  to { transform: rotate(8deg) scaleY(1.04) translateY(-6px); }
}
.splash-stage { position: relative; padding: 8px 0 0; }
.splash-brand {
  font-size: clamp(42px, 12vw, 72px); font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 0 18px rgba(255, 79, 163, 0.8), 0 0 42px rgba(58, 208, 255, 0.45);
  margin: 0;
}
.splash-brand span { color: var(--accent, #ff4fa3); }
.splash-tag { margin: 6px 0 22px; color: var(--dim, #c9b6ff); font-size: 15px; letter-spacing: 0.04em; }
#loading .loadbar { width: min(280px, 70vw); margin: 0 auto; box-shadow: 0 0 18px rgba(255, 79, 163, 0.35); }
#loading .loadbar i {
  width: var(--p, 0%);
  background: linear-gradient(90deg, #3ad0ff, #ff4fa3, #ffd36a);
  box-shadow: 0 0 12px #ff4fa3;
}
#loadText { margin-top: 12px; font-size: 14px; color: #efe6ff; text-shadow: 0 0 8px #000; }
#loadPct { margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Lobby first-impression polish */
#lobby.panel {
  background: linear-gradient(180deg, rgba(18, 8, 28, 0.88), rgba(10, 6, 16, 0.92));
  border: 1px solid rgba(255, 79, 163, 0.28);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(255, 79, 163, 0.08);
  backdrop-filter: blur(16px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#lobby.panel h1 { text-shadow: 0 0 16px rgba(255, 79, 163, 0.45); }

/* Stepped wardrobe */
.wardrobe { margin-top: 4px; }
.ward-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.ward-tabs button { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 13px; }
.ward-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ward-body { margin-top: 14px; display: flex; flex-direction: column; gap: 18px; }
.ward-lbl { color: var(--dim); font-size: 13px; margin-bottom: 8px; font-weight: 700; letter-spacing: 0.04em; }
.ward-block { padding-bottom: 4px; }
.ward-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ward-acts button { flex: 1 1 120px; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-weight: 700; }
.ward-acts button.hot { background: linear-gradient(90deg, #ffe08a, #ffb0c8); color: #1a0d10; border: 0; }
.fig-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fig-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 12px 14px; border-radius: 16px; text-align: left;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
}
.fig-pick b { font-size: 16px; font-weight: 800; letter-spacing: 0.02em; display: flex; align-items: baseline; gap: 6px; }
.fig-pick b small {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(255, 211, 106, 0.18); color: var(--gold, #ffd36a);
}
.fig-pick span { font-size: 12px; color: var(--dim); font-weight: 500; line-height: 1.35; }
.fig-pick.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(255, 211, 106, 0.12); }
.gender-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gender-picks button {
  padding: 22px 12px; border-radius: 18px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--line); font-size: 18px; font-weight: 800; letter-spacing: 0.04em;
}
.gender-picks button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(255, 211, 106, 0.12); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.style-grid button {
  padding: 12px 8px; border-radius: 14px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--line); text-align: center; font-size: 13px;
}
.style-grid button i { display: block; height: 8px; border-radius: 4px; margin-bottom: 8px; }
.style-grid button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(255, 211, 106, 0.1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid var(--line); font-size: 13px; }
.hallo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hallo-row button { padding: 10px 12px; border-radius: 14px; background: rgba(255, 140, 40, 0.1); border: 1px solid rgba(255, 140, 40, 0.4); font-weight: 700; }
#lobby .wardrobe { max-height: none; }
@media (max-width: 760px) {
  #lobby .wardrobe { max-height: none; }
  #lobby.panel { inset: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) auto max(10px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); transform: none; width: auto; max-height: calc(100dvh - 20px); }
}

/* Virtual joystick — above dock / safe area, portrait + landscape */
#joyWrap {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(168px + env(safe-area-inset-bottom));
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
#joyWrap:not([hidden]) { display: flex; }
#joyBase {
  pointer-events: auto;
  width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.10), rgba(0,0,0,0.35));
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  position: relative; touch-action: none;
}
#joyKnob {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; background: rgba(255, 211, 106, 0.9);
  box-shadow: 0 0 16px rgba(255, 211, 106, 0.55);
  pointer-events: none;
}
#runBtn {
  pointer-events: auto;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 79, 163, 0.85); border: 1px solid rgba(255,255,255,0.25);
  font-weight: 800; font-size: 13px; color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
#runBtn.on { background: #ffd36a; color: #1a0d10; }
@media (orientation: landscape) and (pointer: coarse) {
  #joyWrap { bottom: calc(118px + env(safe-area-inset-bottom)); }
  #joyBase { width: 96px; height: 96px; }
}
@media (max-height: 500px) {
  #joyWrap { bottom: calc(108px + env(safe-area-inset-bottom)); }
}

/* Auto-light toggle in venue sheet */
.auto-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.auto-row span { font-size: 13px; }
.auto-row button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff14; font-weight: 700; }
.auto-row button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.splash-privacy { max-width: 36rem; margin: 18px auto 0; font-size: 11px; line-height: 1.45; color: rgba(255,255,255,.62); text-align: center; }
.music-panel { position: absolute; left: 50%; bottom: calc(118px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); max-height: 56vh; overflow: auto; background: rgba(12,8,20,.94); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px; z-index: 40; color: #fff; }
.music-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.music-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.music-modes button, .music-list button, .music-share button, .music-req button, .music-in button { font: inherit; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #fff; padding: 6px 10px; cursor: pointer; }
.music-modes button.on, .music-list button.on { background: #ff4fa3; border-color: transparent; }
.music-hint { font-size: 12px; color: rgba(255,255,255,.7); margin: 0 0 8px; }
.music-list { display: flex; flex-direction: column; gap: 6px; }
.music-track { text-align: left; }
.music-share, .music-req, .music-in { margin-top: 10px; }
#trackPill { cursor: pointer; }

/* ===== Lobby layout fix (2026-11-17): panel always fully inside the viewport =====
   Root cause of the off-left bug: an earlier rule set "#lobby.panel { position: relative }",
   so "right: max(16px, 4vw)" pushed the panel LEFT out of the screen. No transforms / negative offsets here. */
#lobby.panel {
  position: fixed; transform: none; box-sizing: border-box;
  left: auto; right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top)); bottom: max(12px, env(safe-area-inset-bottom));
  width: min(400px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  height: fit-content; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  margin: auto 0; overflow-x: hidden; overflow-y: auto;
  z-index: 12; pointer-events: auto;
}
#lobby.panel > * { max-width: 100%; flex-shrink: 0; } /* scroll instead of squashing rows */
#lobbyFold { display: none; position: absolute; top: 14px; right: 66px; z-index: 3; min-width: 38px; min-height: 30px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass, rgba(10,6,16,.7)); color: var(--text); font-weight: 800; }
/* Narrow screens (phones portrait): bottom drawer across the width, character stays visible above it */
@media (max-width: 760px) {
  #lobby.panel {
    left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
    top: auto; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; margin: 0;
    max-height: 62vh; max-height: min(62dvh, calc(100dvh - 24px)); padding: 16px;
  }
  #lobbyFold { display: inline-flex; align-items: center; justify-content: center; }
}
/* Short screens (landscape phones, small laptop windows like 1024x436): compact right column, full height, scrolls */
@media (max-height: 520px) and (min-width: 761px) {
  #lobby.panel {
    top: max(8px, env(safe-area-inset-top)); bottom: max(8px, env(safe-area-inset-bottom)); margin: 0;
    width: min(380px, 46vw); height: auto; max-height: none; padding: 14px;
  }
  #lobby.panel h1 { font-size: 22px; }
  #lobbyFold { display: inline-flex; align-items: center; justify-content: center; }
}
/* Folded drawer: only title, fold button, language and Enter stay */
#lobby.panel.folded > :not(h1):not(#lobbyFold):not(.lobby-lang):not(#enterBtn) { display: none !important; }
#lobby.panel.folded { height: auto; max-height: none; }
@media (max-height: 520px) and (min-width: 761px) { #lobby.panel.folded { bottom: auto; } }
/* sticky Enter button must be opaque even while disabled (content scrolls under it) */
#lobby #enterBtn:disabled { opacity: 1; background: #2a2236; color: #bfb3d6; }

/* ===== Site links + crawlable intro (SEO 2026-11-17) ===== */
.splash-tag { margin-bottom: 8px; }
.splash-lead {
  margin: 0 auto 16px;
  max-width: 28em;
  font-size: 13px;
  line-height: 1.45;
  color: var(--dim, #aaa1c8);
  text-align: center;
}
.splash-links, .lobby-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 12px 0 0;
  font-size: 12px;
}
.lobby-links { justify-content: flex-start; margin: 10px 0 4px; }
.splash-links a, .lobby-links a {
  color: var(--dim, #aaa1c8);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.splash-links a:hover, .lobby-links a:hover,
.splash-links a:focus-visible, .lobby-links a:focus-visible {
  color: var(--text, #f6f2ff);
  border-bottom-color: var(--accent, #ff4fa3);
}
.noscript-seo {
  position: relative;
  z-index: 8;
  max-width: 36rem;
  margin: 16px auto;
  padding: 16px;
  color: var(--text, #f6f2ff);
  background: rgba(20, 14, 34, 0.88);
}
@media (max-height: 520px) {
  .splash-lead { font-size: 12px; margin-bottom: 8px; }
  .splash-links { margin-top: 8px; }
}

/* 大厅等进场：不用 3D 场景，用闪屏同款背景，避免黑画布 */
body.lobby-waiting {
  background:
    radial-gradient(80% 50% at 50% 110%, rgba(255, 79, 163, 0.28), transparent 60%),
    radial-gradient(40% 40% at 15% 20%, rgba(80, 40, 255, 0.35), transparent 55%),
    radial-gradient(40% 40% at 85% 10%, rgba(58, 208, 255, 0.22), transparent 50%),
    #07040c;
}
body.lobby-waiting #scene {
  opacity: 0;
  pointer-events: none !important;
  z-index: -1;
}

/* Lobby 3D VRM preview */
.look-preview {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: min(320px, calc(100vw - 440px));
  min-width: 180px;
  text-align: center;
  pointer-events: none;
  color: var(--text);
}
.look-preview[hidden] { display: none !important; }
.lp-stage {
  position: relative;
  width: 100%;
  height: min(54vh, 460px);
  margin: 0 auto 10px;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 70%, rgba(255,79,163,0.18), rgba(8,4,14,0.15) 70%);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.lp-canvas { display: block; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.look-preview.is-ready .lp-canvas { opacity: 1; }
.lp-spin {
  position: absolute; inset: 0; margin: auto; width: 36px; height: 36px;
  border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #ff7ac0;
  animation: lpSpin 0.8s linear infinite;
  z-index: 1; pointer-events: none;
}
.lp-retry {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  z-index: 2; pointer-events: auto;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  font-weight: 800; cursor: pointer; backdrop-filter: blur(12px);
}
@keyframes lpSpin { to { transform: rotate(360deg); } }
.lp-name { font-weight: 800; font-size: 18px; text-shadow: 0 0 16px rgba(255,79,163,.4); }
.lp-status { margin-top: 4px; font-size: 12px; color: var(--dim); }
.boot-fail {
  margin: 16px auto 0; max-width: 28rem; padding: 14px 16px;
  border-radius: 16px; background: rgba(20,8,24,.82);
  border: 1px solid rgba(255,79,163,.35); color: #efe6ff;
}
.boot-fail[hidden] { display: none !important; }
.boot-fail b { display: block; font-size: 16px; margin-bottom: 6px; }
.boot-fail p { margin: 0 0 12px; font-size: 13px; color: #d8c8f0; line-height: 1.45; }
.boot-fail button {
  min-height: 40px; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 0; font-weight: 800; color: #1a0d10;
  background: linear-gradient(90deg, #ffe08a, #ffb0c8);
}
@media (max-width: 760px) {
  .look-preview {
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: min(220px, 46vw);
  }
  .lp-stage { height: min(28vh, 220px); margin-bottom: 4px; border-radius: 16px; }
  .lp-name { font-size: 14px; }
}
#enterRetry {
  margin-top: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.1); font-weight: 700; cursor: pointer;
}
#lobby #enterBtn {
  min-height: 48px; font-size: 18px; font-weight: 800;
  letter-spacing: 0.02em; white-space: nowrap;
}
.sheet { z-index: 30; }
.sheet-head {
  position: sticky; top: 0; display: flex; justify-content: flex-end;
  z-index: 3; margin: -8px -8px 4px 0; pointer-events: none;
}
.sheet-close {
  pointer-events: auto;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(20,14,34,.92); border: 1px solid var(--line);
  font-size: 18px; line-height: 1; font-weight: 800;
  display: inline-grid; place-items: center; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.sheet-close:hover { background: rgba(255,79,163,.55); }
#lobby #enterBtn, #enterBtn.primary {
  min-height: 48px; font-size: 18px; font-weight: 800;
  letter-spacing: 0.02em; white-space: nowrap;
  background: linear-gradient(90deg, #ff4fa3, #ff7ac0);
  color: #fff !important; opacity: 1;
}
#lobby #enterBtn:disabled {
  background: #3a3148; color: #efe7ff !important;
}
