/* =====================================================================
   牛马新天地 · 体验优化层（最后加载，覆盖前面各版样式）
   原则：
   - 色彩：coral 是唯一主操作色，sun 只做强调/高亮，其余颜色留给场景插画
   - 硬阴影只给"能点的主要元素"（按钮、场所卡片、弹窗），信息展示类一律去掉
   ===================================================================== */

:root { --coral-ink: #E04F2E; }

/* ---------- 按钮体系 ---------- */
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--coral-ink); }
.btn-ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn-ghost:hover { background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.btn-lg { padding: 12px 22px; font-size: 16px; border-radius: 14px; }
.btn-accent { background: var(--sun); }

/* 场所卡片的进入按钮统一成主色，场所个性交给封面图 */
.room-card .btn-enter { background: var(--coral); color: #fff; }
.room-card .btn-enter:hover { background: var(--coral-ink); }
.room-card.is-soon .btn-enter { background: #fff; color: var(--ink); }

/* ---------- 去掉信息类元素的硬阴影 ---------- */
.stat, .chip, .room-tags li, .hero-slim .goals-list li, .badge.got, .member-compact .badge.got,
.event-bar, .code-join input, .note-form input { box-shadow: none !important; }
.stat { border-width: 2px; }

/* ---------- 首屏 ---------- */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 4px; }
.hero-cta .btn-primary { box-shadow: 4px 4px 0 var(--ink); }
/* 「此刻同在」和顶栏的在线人数重复，留一处就够 */
.hero-stats .stat:nth-child(3) { display: none; }
.hero-slim .hero-stats { gap: 10px; }
.hero-slim .stat { min-width: 0; padding: 8px 14px; flex-direction: row; align-items: baseline; gap: 8px; }
.hero-slim .stat b { font-size: 20px; }

/* ---------- 工牌：折叠态只留头像、名字、金币、等级 ---------- */
.member-top { gap: 8px; }
.member-top .acct { margin-left: auto; }
.member-fold {
  padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; background: #fff;
  font-size: 12px; font-weight: 900; white-space: nowrap;
}
.member-fold:hover { background: var(--sun); }
.member.is-folded .swatches,
.member.is-folded .field:has(.swatches),
.member.is-folded .face-btn,
.member.is-folded .badge-wall,
.member.is-folded .field-salary { display: none; }
.member.is-folded .member-body { margin-top: 10px; }

/* 徽章墙：只展示已获得的 */
.member-compact .badges { display: flex; flex-wrap: wrap; gap: 4px; }
.member-compact .badge { width: 28px; flex: 0 0 auto; }
.badge.badge-more {
  width: auto !important; aspect-ratio: auto; padding: 0 10px; filter: none; opacity: 1;
  border-style: dashed; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800;
}

/* ---------- 房间码输入框：占位文字别用等宽大字距 ---------- */
.code-join input::placeholder { font-family: var(--font); letter-spacing: 0; text-transform: none; font-weight: 600; }
.code-join input { width: 150px; }

/* ---------- 场所卡片：封面 + 名字 + 一句话 + 人数 + 按钮 ---------- */
.room-desc { -webkit-line-clamp: 1; }
.room-card .room-tags, .room-card .meter { display: none; }
.room-count { font-size: 13px; font-weight: 800; color: var(--muted); }
.room-count.is-live { color: var(--ink); }
.room-count.is-live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
  background: #3CC86B; vertical-align: 1px;
}
.room-lines:empty { display: none; }
.sponsor-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.sponsor-note a { color: var(--ink); font-weight: 800; text-decoration: none; border-bottom: 1px dashed currentColor; }
.sponsor-note .demo-tag { margin-left: 6px; font-style: normal; font-size: 11px; opacity: 0.7; }

/* ---------- 招商：从主页面降级为一条横幅 ---------- */
.partner-strip {
  width: min(1200px, calc(100% - 48px)); margin: 36px auto 0; padding: 14px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  border: 2px dashed rgba(43, 42, 51, 0.35); border-radius: 16px; background: rgba(255, 255, 255, 0.6);
}
.partner-strip p { margin: 0; font-size: 14px; color: var(--muted); }
.partner-strip b { margin-right: 10px; color: var(--ink); font-weight: 900; }
.partner-strip span { margin-left: 10px; font-size: 12px; opacity: 0.8; }

/* ---------- 房间：镜头按钮和遥控器区分开 ---------- */
.zoom-btn { width: auto; padding: 0 10px; font-size: 13px; box-shadow: none; border-width: 1.5px; }

/* ---------- 新手引导 ---------- */
.coach {
  position: absolute; z-index: 70; left: 50%; bottom: 84px; translate: -50% 0;
  width: min(340px, calc(100% - 24px)); padding: 16px 18px 14px; animation: pop-in 0.3s ease;
}
.coach-step { font: 800 11px var(--mono); color: var(--coral); letter-spacing: 0.1em; }
.coach b { display: block; margin-top: 4px; font-size: 17px; font-weight: 900; }
.coach p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.coach-acts { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.coach .link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: underline; }

/* ---------- 「⋯」菜单：宽屏不出现 ---------- */
.hud-more { display: none; }
.hud > .btn-boss { flex: 0 0 auto; }

/* =====================================================================
   手机端房间：顶栏只留「返回 · 场所名 · ⋯ · 老板键」，状态只留计时和收入，
   操作面板改成底部抽屉
   ===================================================================== */
@media (max-width: 640px) {
  .hud { flex-wrap: wrap; align-items: center; gap: 6px; top: 8px; left: 8px; right: 8px; }
  .hud-back { padding: 6px 10px !important; }
  .hud-title { flex: 1 1 0; min-width: 0; padding: 4px 10px; box-shadow: 2px 2px 0 var(--ink); }
  .hud-title h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud-title p { display: none; }
  .hud-sponsor { display: none !important; }
  .hud-more { display: inline-flex; order: 2; padding: 4px 12px !important; font-size: 18px !important; line-height: 1; }
  .hud > .btn-boss { order: 3; }
  .hud-chips { order: 4; width: 100%; margin: 0; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .hud-chips::-webkit-scrollbar { display: none; }
  .hud-chips .chip { padding: 3px 9px; font-size: 12px; border-width: 2px; }
  .hud-chips .chip-coin, .hud-chips #hudCount { display: none; }

  /* 其余按钮收进下拉菜单 */
  .hud-right {
    display: none; position: absolute; top: 44px; right: 72px; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 6px; padding: 8px;
    border: var(--line) solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 4px 4px 0 var(--ink);
  }
  .hud.is-more .hud-right { display: flex; }
  .hud-right .btn { box-shadow: none; justify-content: center; }
  .hud-right #sound, .hud-right #pip { display: inline-flex !important; }

  /* 表情条贴着顶栏，一行横滑 */
  .room .emos { left: 8px; right: 8px; max-width: none; }

  /* 抗冻榜等排行面板：缩小 */
  .room .endure { width: 150px; padding: 8px 10px; }

  /* 操作面板 → 底部抽屉 */
  .dock {
    left: 8px !important; right: 8px !important; bottom: 8px !important; top: auto !important; transform: none !important;
    width: auto !important; max-height: 36vh !important;
    flex-direction: row !important; flex-wrap: wrap !important; align-items: flex-start !important; gap: 6px !important;
    padding: 8px 10px 10px !important; border-radius: 18px !important;
  }
  .dock .dock-collapse { order: -2; margin: 0 0 0 auto; }
  .dock .view-ctl { display: none !important; }
  .dock .dock-group { flex: 1 1 100%; justify-content: flex-start; }
  .dock .dock-group > .act { flex: 1 1 30%; }
  .dock .remote { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .dock .remote > * { flex: 0 0 auto; }
  .dock .remote .dock-label, .dock .remote > span:first-child { flex-basis: 100%; text-align: center; writing-mode: horizontal-tb; }
  .dock .drinks { flex: 1 1 100%; grid-template-columns: 1fr 1fr !important; }
  .pill-dock { top: auto !important; bottom: 12px !important; right: 12px !important; }
  .toast { bottom: calc(36vh + 24px); }
  .coach { bottom: calc(36vh + 20px); }
  .room.hide-dock .coach, .room.hide-dock .toast { bottom: 70px; }

  /* 大厅：工牌顶部这一行要留着（登录入口、编辑工牌都在这） */
  .member-compact .member-top { display: flex !important; }
  .member-compact .member-label, .member-compact .locker { display: none; }
  /* 顶栏已有老板键，首屏只留一个主按钮 */
  .hero-cta [data-boss-demo] { display: none; }
  .hero-cta .btn-lg { flex: 1 1 auto; justify-content: center; padding: 10px 14px; font-size: 15px; }
  .partner-strip { width: calc(100% - 32px); }
  .partner-strip span { display: block; margin: 4px 0 0; }
}

/* 最后一排只剩一张卡时，横向铺满，不留两个空格子 */
@media (min-width: 961px) {
  .room-grid > .room-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; flex-direction: row; }
  .room-grid > .room-card:last-child:nth-child(3n+1) .room-art { flex: 0 0 calc((100% - 52px) / 3); height: auto; min-height: 180px; }
  .room-grid > .room-card:last-child:nth-child(3n+1) .room-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .room-grid > .room-card:last-child:nth-child(3n+1) .room-desc { -webkit-line-clamp: 2; }
}
@media (min-width: 641px) and (max-width: 960px) {
  .room-grid > .room-card:last-child:nth-child(2n+1) { grid-column: 1 / -1; }
}

/* ---------- 工牌头像上的装扮：盒子很小，帽子和宠物收进框里 ---------- */
.member-avatar { overflow: visible; }
.member-avatar .av-hat { top: -22px; font-size: 22px; }
.member-avatar .av-pet { left: auto; right: -26px; top: -62px; font-size: 18px; animation: none; }
.member-avatar .av-pet::after { display: none; }

/* ---------- 场内「喊同事来」 ---------- */
.hud-share { gap: 6px; }
.hud-share span { font-size: 15px; line-height: 1; }

/* ---------- 场内广告牌：灯箱 + 跑马灯边框，远看也显眼 ---------- */
.scene .ad-board {
  width: 300px; margin-left: -150px; padding: 16px 14px 14px; border-width: 5px; border-radius: 14px;
  background: linear-gradient(#FFF6C9, #FFE07A); color: var(--ink);
  box-shadow: 0 0 0 6px #2B2A33, 0 0 0 9px #FFE14D, 0 0 36px rgba(255, 225, 77, 0.7), 8px 12px 0 9px rgba(0, 0, 0, 0.35);
  animation: ad-glow 2.4s ease-in-out infinite;
}
.scene .ad-board b { font-size: 28px; line-height: 1.2; }
.scene .ad-board span { font-size: 17px; color: #8A3B1A; }
.scene .ad-board::after { right: -14px; top: -14px; padding: 0 7px; font-size: 13px; line-height: 20px; background: var(--coral); color: #fff; }
.scene .ad-board::before {
  content: "点我 · 看看是啥"; position: absolute; left: 50%; bottom: -34px; translate: -50% 0; white-space: nowrap;
  padding: 2px 10px; border-radius: 999px; background: rgba(43, 42, 51, 0.85); color: #FFE14D; font-size: 13px; font-weight: 900;
}
.scene .ad-board.is-cta::before { content: "点我 · 联系平台"; }
@keyframes ad-glow { 50% { box-shadow: 0 0 0 6px #2B2A33, 0 0 0 9px #FF6B4A, 0 0 52px rgba(255, 107, 74, 0.8), 8px 12px 0 9px rgba(0, 0, 0, 0.35); } }

/* ---------- 屏幕角落的广告灯箱 ---------- */
.ad-box {
  position: absolute; z-index: 25; right: 14px; bottom: 14px; width: 216px; padding: 10px 12px 9px;
  display: grid; gap: 2px; text-align: left; cursor: pointer;
  border: var(--line) solid var(--ink); border-radius: 14px;
  background: linear-gradient(135deg, #FFF6C9, #FFE07A); box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s ease;
}
.ad-box:hover { transform: translate(-1px, -2px) rotate(-1deg); }
.ad-box em {
  position: absolute; right: -8px; top: -10px; padding: 0 7px; border: 2px solid var(--ink); border-radius: 6px;
  background: var(--coral); color: #fff; font: 900 11px/18px var(--font); font-style: normal;
}
.ad-box b { font-size: 15px; font-weight: 900; }
.ad-box span { font-size: 12px; font-weight: 700; color: #8A3B1A; }
.ad-box small { justify-self: end; font-size: 11px; font-weight: 900; color: var(--coral-ink); }
.ad-box.is-in { animation: ad-in 0.4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes ad-in { from { opacity: 0; transform: rotateX(80deg); } }
.room.is-zen .ad-box, .room.is-immerse .ad-box { opacity: 0; pointer-events: none; }
.room .ad-box { transition: opacity 0.4s ease, transform 0.15s ease; }
/* 桌面上 move-hint 在右下，让开 */
.room .move-hint { right: 244px; bottom: 16px; }

@media (max-width: 640px) {
  .hud-share { order: 2; padding: 4px 10px !important; }
  .hud-share b { display: none; }
  .ad-box.in-hud {
    position: relative; right: auto; bottom: auto; top: auto; flex: 0 0 auto; width: auto; max-width: 150px; margin-left: auto;
    display: flex; align-items: center; gap: 4px; padding: 3px 9px; border-width: 2px; border-radius: 999px; box-shadow: none;
  }
  .ad-box.in-hud em { position: static; padding: 0 4px; border-width: 1.5px; border-radius: 5px; font-size: 10px; line-height: 14px; }
  .ad-box.in-hud b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ad-box.in-hud span, .ad-box.in-hud small { display: none; }
  .member-avatar .av-pet { right: -24px; }
}
/* 桌面：右侧操作面板往上收，给右下角广告灯箱留位置 */
@media (min-width: 641px) {
  .room .dock { top: calc(50% - 46px); max-height: calc(100% - 300px); }
}

/* 缩到能看见整个房间时，房间外面是一圈深色"夜景"底，不再露出网页底色 */
.room .scene {
  background:
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(ellipse at 50% 40%, #3A3746, #1C1B22 75%);
}
/* 房间四周的延伸（.world-ext）：同一个房间的墙和地板镜像铺出去，和房间无缝连在一起 */
.world > .world-ext { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.world-ext-tile { position: absolute; overflow: hidden; }
.world-ext-art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 50% 0; }
.world-ext-art > * { animation: none !important; pointer-events: none; }

/* 绿皮车：车窗下沿到地板只有一条窄墙，广告做成扁长横幅 */
.scene .ad-board.ad-train {
  width: 620px; margin-left: -310px; padding: 8px 18px; display: flex; align-items: baseline; justify-content: center; gap: 14px;
  box-shadow: 0 0 0 4px #2B2A33, 0 0 0 7px #FFE14D, 0 0 26px rgba(255, 225, 77, 0.6);
}
.scene .ad-board.ad-train b { font-size: 24px; white-space: nowrap; }
.scene .ad-board.ad-train span { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .ad-board.ad-train::before { left: auto; right: -8px; bottom: auto; top: 50%; translate: 100% -50%; }
/* 海滩：天上的广告，加一根拖绳像飞机拉的横幅 */
.scene .ad-board.ad-beach { rotate: -2deg; }
.scene .ad-board.ad-beach::before { content: "✈︎ 点我 · 看看是啥"; }
/* 舞厅：广告牌挂右上角墙面，尺寸小一号；原来那块"严禁谈工作"标语挪到左边，和另一块错开 */
.scene .ad-board.ad-disco { width: 250px; margin-left: -125px; padding: 12px 10px 10px; }
.scene .ad-board.ad-disco b { font-size: 22px; }
.scene .ad-board.ad-disco span { font-size: 14px; }
.scene-disco .disco-wall-r { left: 4%; top: 41%; rotate: -3deg; }

/* ---------- 搞怪广告：大图标 + 动效 + 价格贴纸 + 小字免责 ---------- */
.billboard.has-art { background: var(--ad-bg, #fff8e4); }
.billboard .ad-art { display: block; font-style: normal; font-size: 26px; line-height: 1.1; letter-spacing: -4px; }
.billboard .ad-copy { min-width: 0; }
.billboard .ad-tag { position: absolute; right: -12px; top: -14px; z-index: 2; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 8px; background: #E5322D; color: #fff; font: 900 11px/16px var(--font); font-style: normal; white-space: nowrap; rotate: 8deg; box-shadow: 2px 2px 0 var(--ink); animation: ad-tag 1.4s ease-in-out infinite; }
.billboard .ad-fine { display: block; margin-top: 3px; font-size: 9px; font-weight: 700; color: rgba(43, 42, 51, 0.55); }
@keyframes ad-tag { 50% { scale: 1.1; rotate: 2deg; } }
.scene .ad-board.has-art { display: grid; grid-template-columns: 84px 1fr; align-items: center; column-gap: 10px; text-align: left; background: linear-gradient(160deg, #fff 0%, var(--ad-bg, #FFE07A) 55%); }
.scene .ad-board.has-art .ad-art { font-size: 52px; text-align: center; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.25)); }
.scene .ad-board.has-art .ad-copy b { font-size: 26px; }
.scene .ad-board.has-art .ad-copy span { font-size: 15px; }
.scene .ad-board.has-art .ad-fine { grid-column: 1 / -1; font-size: 11px; text-align: right; }
.scene .ad-board .ad-tag { right: -18px; top: -18px; padding: 3px 10px; font-size: 15px; line-height: 20px; }
.scene .ad-board.ad-train.has-art { display: flex; align-items: center; }
.scene .ad-board.ad-train .ad-art { font-size: 34px; }
.scene .ad-board.ad-train .ad-copy { display: flex; align-items: baseline; gap: 12px; }
.scene .ad-board.ad-train .ad-fine { display: none; }
.scene .ad-board.ad-disco.has-art { grid-template-columns: 64px 1fr; }
.scene .ad-board.ad-disco .ad-art { font-size: 40px; }
.scene .ad-board.ad-disco .ad-copy b { font-size: 20px; }
/* 图标动效 */
.ad-art.fx-bob { animation: ad-bob 1.6s ease-in-out infinite; }
.ad-art.fx-shake { animation: ad-shake 2.2s ease-in-out infinite; }
.ad-art.fx-spin { animation: ad-spin 3.2s ease-in-out infinite; }
.ad-art.fx-zoom { animation: ad-zoom 1.3s ease-in-out infinite; }
.ad-art.fx-swing { animation: ad-swing 2s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes ad-bob { 50% { translate: 0 -6px; } }
@keyframes ad-shake { 0%, 70%, 100% { rotate: 0deg; } 75% { rotate: -12deg; } 80% { rotate: 12deg; } 85% { rotate: -8deg; } 90% { rotate: 8deg; } }
@keyframes ad-spin { 0%, 60% { rotate: 0deg; } 100% { rotate: 360deg; } }
@keyframes ad-zoom { 50% { scale: 1.18; } }
@keyframes ad-swing { 50% { rotate: 10deg; } 0%, 100% { rotate: -10deg; } }
/* 屏幕角落的灯箱也带图 */
.ad-box { grid-template-columns: 40px 1fr; column-gap: 8px; background: linear-gradient(135deg, #fff, var(--ad-bg, #FFE07A)); }
.ad-box .ad-art { grid-row: span 3; align-self: center; font-style: normal; font-size: 28px; letter-spacing: -6px; }
.ad-box small { grid-column: 2; }
@media (max-width: 640px) { .ad-box.in-hud .ad-art { font-size: 15px; letter-spacing: -3px; } }
/* 假商品页 */
.ad-shop { text-align: center; }
.ad-shop-hero { position: relative; margin: -4px auto 10px; width: 150px; height: 120px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 22px; background: radial-gradient(circle, #fff, var(--ad-bg, #FFE07A)); box-shadow: 5px 5px 0 var(--ink); }
.ad-shop-hero .ad-art { font-style: normal; font-size: 62px; letter-spacing: -10px; }
.ad-shop-hero .ad-tag { position: absolute; right: -30px; top: -12px; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #E5322D; color: #fff; font: 900 13px/18px var(--font); font-style: normal; rotate: 10deg; }
.ad-shop-text { margin: 0 0 8px; font-weight: 800; }
.ad-shop-price { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.ad-shop-price s { color: var(--muted); font-weight: 800; }
.ad-shop-price b { color: #E5322D; font-size: 30px; }
.ad-shop-price span { width: 100%; font-size: 12px; color: var(--muted); font-weight: 800; }
.ad-shop-reviews { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; }
.ad-shop-reviews li { padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px; background: #FFFBEA; }
.ad-shop-reviews b { display: block; font-size: 12px; }
.ad-shop-reviews span { font-size: 13px; }
.ad-shop-buy { height: 52px; }
.ad-shop-buy .btn { transition: translate 0.25s cubic-bezier(.2, 1.6, .4, 1); }
.ad-shop .ad-fine { margin: 8px 0 0; font-size: 11px; color: var(--muted); }

/* ---------- 手机 / 平板：减轻合成层，避免 iOS Safari、微信 WebView 内存爆掉被系统杀掉 ----------
   迪厅的光斑层有 3780×2520，叠加 screen 混合模式还一直在转，3 倍屏下单层就要三百多 MB；
   触屏设备上改成不转、不混合的静态光斑，扫射灯和 KTV 光束也去掉混合模式，火车夜景不再给整张背景加滤镜 */
@media (hover: none), (pointer: coarse) {
  .disco-specks { inset: 0; mix-blend-mode: normal; animation: none !important; }
  .disco-specks i { box-shadow: none; opacity: 0.4; }
  .disco-beam { mix-blend-mode: normal; opacity: 0.32; }
  .ktv-beams { mix-blend-mode: normal; }
  .tr-night .bg, .tr-night .floor { filter: none; }
  .tr-night .bg::after, .tr-night .floor::after { content: ""; position: absolute; inset: 0; background: rgba(10, 16, 40, 0.18); pointer-events: none; }
}

/* 禁止双击放大：连点两下动作按钮时 iOS 会整页放大，场景按放大后的分辨率重绘，内存又会爆掉 */
html, body { touch-action: manipulation; }
