/* ============================================================
   VALEBAR 大屏端样式 - 霓虹赛博朋克风
   ============================================================ */

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --neon-purple: #B026FF;
  --neon-pink: #FF2A6D;
  --neon-cyan: #05D9E8;
  --neon-green: #00D9A3;
  --neon-yellow: #F7F800;
  --neon-orange: #FF6B35;
  --bg-dark: #0D0221;
  --bg-darker: #05010F;
  --bg-card: #1A0B2E;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0C0;
  --glow-purple: 0 0 10px #B026FF, 0 0 20px #B026FF, 0 0 40px #B026FF;
  --glow-cyan: 0 0 10px #05D9E8, 0 0 20px #05D9E8, 0 0 40px #05D9E8;
  --glow-pink: 0 0 10px #FF2A6D, 0 0 20px #FF2A6D, 0 0 40px #FF2A6D;
}

body {
  font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-darker);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* 背景网格效果 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(176, 38, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(176, 38, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* 背景渐变光晕 */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 40%, rgba(176, 38, 255, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 60%, rgba(5, 217, 232, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ============================================================
   顶部状态栏
   ============================================================ */

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(13, 2, 33, 0.8);
  border-bottom: 1px solid rgba(176, 38, 255, 0.3);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s, height 0.3s, padding 0.3s;
  overflow: hidden;
}

/* 游戏中隐藏顶栏 */
#topbar.topbar-hidden {
  opacity: 0;
  height: 0;
  padding: 0;
  border-bottom: none;
  pointer-events: none;
}

.logo {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: var(--glow-purple);
}

.player-count {
  font-size: 18px;
  color: var(--neon-green);
  font-weight: bold;
}

/* ============================================================
   主内容区
   ============================================================ */

#main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(5, 1, 15, 0.45), rgba(5, 1, 15, 0.65)),
    url('../assets/images/menu-bg.jpg') center center / cover no-repeat;
}

.view {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}

.view.active {
  display: flex;
}

/* 非菜单/二维码页面加深背景，突出主体 */
#view-countdown,
#view-playing,
#view-result {
  background: rgba(5, 1, 15, 0.88);
}

/* ============================================================
   游戏选择菜单
   ============================================================ */

.title {
  font-size: 48px;
  margin-bottom: 40px;
  text-shadow: var(--glow-purple);
  letter-spacing: 2px;
}

.game-grid {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-card {
  width: 300px;
  height: 380px;
  background: rgba(26, 11, 46, 0.55);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(176, 38, 255, 0.3);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 40%, rgba(176, 38, 255, 0.1) 100%);
  transition: opacity 0.3s;
}

.game-card:hover {
  border-color: var(--neon-purple);
  transform: translateY(-10px) scale(1.05);
  box-shadow: var(--glow-purple);
}

.game-card:hover::before {
  opacity: 2;
}

.game-icon {
  font-size: 80px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 15px rgba(176, 38, 255, 0.8));
}

.game-name {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.game-desc {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  padding: 0 20px;
}

.duration-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  z-index: 1;
}

.duration-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.duration-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.duration-btn:hover {
  background: rgba(176, 38, 255, 0.2);
  border-color: rgba(176, 38, 255, 0.5);
  color: var(--text-primary);
}

.duration-btn.active {
  background: rgba(176, 38, 255, 0.35);
  border-color: var(--neon-purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(176, 38, 255, 0.4);
}

/* ============================================================
   二维码展示
   ============================================================ */

.qr-container {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--glow-purple);
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#qrcode {
  display: flex;
  justify-content: center;
}

#qrcode img,
#qrcode canvas {
  display: block;
}

.qr-hint {
  margin-top: 15px;
  font-size: 18px;
  color: #333;
  font-weight: bold;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  max-width: 800px;
  margin-bottom: 30px;
  min-height: 60px;
}

.player-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--neon-cyan);
  border-radius: 30px;
  padding: 8px 20px;
  font-size: 18px;
  animation: playerJoinAnim 0.4s ease;
}

.player-tag .avatar {
  font-size: 24px;
}

.player-tag .name {
  color: var(--text-primary);
}

.player-tag.disconnected {
  opacity: 0.4;
  border-color: var(--text-secondary);
}

@keyframes playerJoinAnim {
  0% { transform: scale(0) rotate(180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ============================================================
   按钮
   ============================================================ */

.btn-primary {
  padding: 15px 60px;
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  background: transparent;
  border: 2px solid var(--neon-pink);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.btn-primary:hover {
  background: var(--neon-pink);
  box-shadow: var(--glow-pink);
  transform: scale(1.05);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ============================================================
   倒计时
   ============================================================ */

.countdown-number {
  font-size: 240px;
  font-weight: 900;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: var(--glow-pink);
  animation: countdownPulse 1s ease infinite;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ============================================================
   游戏进行中
   ============================================================ */

#view-playing {
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  padding: 0;
}

.game-timer {
  text-align: center;
  padding: 8px 0;
  font-size: 40px;
  font-weight: bold;
  color: var(--neon-yellow);
  text-shadow: 0 0 20px var(--neon-yellow);
  flex-shrink: 0;
}

.game-canvas {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.game-view {
  display: none;
  width: 100%;
}

.game-view.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --- 独角兽竞赛跑道（排名排序·横向位置反映距离） --- */
#horse-racing-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
  gap: 4px;
  position: relative;
  overflow: visible;
  overflow: hidden;
  position: relative;
  width: 100%;
  min-height: 0;
}

.racing-track {
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 0;
  background: rgba(176, 38, 255, 0.06);
  border: 1px solid rgba(176, 38, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* 前三名跑道高亮 */
.racing-track.track-top1 {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}
.racing-track.track-top2 {
  border-color: rgba(192, 192, 192, 0.4);
}
.racing-track.track-top3 {
  border-color: rgba(205, 127, 50, 0.4);
}

/* 跑道左侧信息区 */
.track-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 190px;
  padding: 0 10px;
  flex-shrink: 0;
  position: relative;
}

.track-rank-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.track-rank-badge.rank-gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.track-rank-badge.rank-silver {
  background: linear-gradient(135deg, #E8E8E8, #B0B0B0);
  color: #000;
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.track-rank-badge.rank-bronze {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: #fff;
  box-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}

.track-avatar {
  font-size: 22px;
  flex-shrink: 0;
}

.track-name {
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  max-width: 80px;
}

/* 赛道区域 */
.racing-track .lane {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-left: 1px solid rgba(176, 38, 255, 0.2);
  border-right: 1px solid rgba(176, 38, 255, 0.2);
}

/* 赛道条纹背景（滚动） */
.lane-stripes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 40px,
    rgba(176, 38, 255, 0.06) 40px,
    rgba(176, 38, 255, 0.06) 80px
  );
}

/* 里程碑标记层 */
.milestone-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.milestone-marker {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.milestone-line {
  width: 2px;
  height: 100%;
  background: rgba(5, 217, 232, 0.3);
  border-left: 1px solid rgba(5, 217, 232, 0.4);
  border-right: 1px solid rgba(5, 217, 232, 0.4);
}

.milestone-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: bold;
  color: rgba(5, 217, 232, 0.5);
  white-space: nowrap;
  background: rgba(13, 2, 33, 0.6);
  padding: 1px 4px;
  border-radius: 3px;
}

/* 独角兽容器（固定在跑道左侧 15%） */
.horse-wrapper {
  position: absolute;
  top: 50%;
  left: 15%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 5;
}

/* 独角兽 */
.horse {
  font-size: 30px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 6px rgba(255, 42, 109, 0.6));
}

.horse.running {
  animation: horseGallop 0.4s ease-in-out infinite;
}

@keyframes horseGallop {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

/* 独角兽拖尾 */
.horse-trail {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--neon-pink), var(--neon-cyan));
  transition: width 0.1s, opacity 0.1s;
  filter: blur(2px);
  opacity: 0;
}

/* 冲刺特效 */
.horse-sprinting {
  animation: horseSprint 0.2s ease-in-out infinite !important;
}

.horse-sprinting .horse-trail {
  background: linear-gradient(90deg, transparent, #FFD700, #FF2A6D, #05D9E8) !important;
  width: 60px !important;
  opacity: 0.9 !important;
  height: 8px !important;
  filter: blur(3px);
}

@keyframes horseSprint {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1.15); }
  50% { transform: translateY(-8px) rotate(5deg) scale(1.2); }
}

/* 距离标签 */
.distance-label {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  font-size: 13px;
  font-weight: bold;
  color: var(--neon-cyan);
  white-space: nowrap;
  text-shadow: 0 0 4px rgba(5, 217, 232, 0.5);
}

/* 连击徽章（赛道中独角兽右侧） */
.combo-badge-racing {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 6px;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  z-index: 6;
}

.combo-badge-racing.show {
  opacity: 1;
}

.combo-badge-racing.combo-5 {
  background: rgba(255, 165, 0, 0.3);
  color: var(--neon-orange);
  border: 1px solid var(--neon-orange);
}

.combo-badge-racing.combo-10 {
  background: rgba(255, 42, 109, 0.3);
  color: var(--neon-pink);
  border: 1px solid var(--neon-pink);
  animation: comboPulse 0.5s ease-in-out infinite;
}

@keyframes comboPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 超车提示（track-info 头像名字右侧） */
.overtake-flash {
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.overtake-flash.overtake-up {
  animation: overtakeUp 1s ease-out forwards;
}

.overtake-flash.overtake-down {
  animation: overtakeDown 1s ease-out forwards;
}

@keyframes overtakeUp {
  0% { opacity: 0; transform: translateY(8px) scale(0.8); }
  20% { opacity: 1; transform: translateY(-2px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-12px) scale(1); }
}

@keyframes overtakeDown {
  0% { opacity: 0; transform: translateY(-8px) scale(0.8); }
  20% { opacity: 1; transform: translateY(2px) scale(1.15); }
  100% { opacity: 0; transform: translateY(12px) scale(1); }
}

/* 里程碑达成闪光 */
.milestone-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(5, 217, 232, 0.3), transparent);
}

.milestone-flash.flash {
  animation: milestoneFlash 0.6s ease-out;
}

@keyframes milestoneFlash {
  0% { opacity: 0; transform: translateX(-30%); }
  30% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(30%); }
}

/* 能量条 */
.energy-meter {
  width: 70px;
  padding: 0 10px;
  flex-shrink: 0;
}

.energy-bar-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.energy-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-yellow));
  border-radius: 3px;
  transition: width 0.2s;
}

.energy-bar-fill.energy-high {
  background: linear-gradient(90deg, var(--neon-yellow), var(--neon-orange), var(--neon-pink));
  box-shadow: 0 0 6px var(--neon-orange);
}

.energy-bar-fill.energy-full {
  background: linear-gradient(90deg, var(--neon-pink), #FFD700, var(--neon-cyan));
  box-shadow: 0 0 8px var(--neon-pink);
  animation: energyFullPulse 0.5s ease-in-out infinite;
}

@keyframes energyFullPulse {
  0%, 100% { box-shadow: 0 0 6px var(--neon-pink); }
  50% { box-shadow: 0 0 12px var(--neon-pink); }
}

/* 最后10秒提示覆盖层 */
.racing-countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  background: rgba(13, 2, 33, 0.15);
}

.racing-countdown-number {
  font-size: 64px;
  font-weight: 900;
  color: var(--neon-pink);
  text-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-pink);
  animation: countdownBlast 1.5s ease-out;
}

@keyframes countdownBlast {
  0% { transform: scale(1.4); opacity: 0; }
  20% { transform: scale(1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* P3: 全跑道脉冲（倒数时） */
.racing-track.track-pulse {
  animation: trackPulse 0.5s ease-in-out;
}

@keyframes trackPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 42, 109, 0); }
  50% { box-shadow: 0 0 20px rgba(255, 42, 109, 0.5); border-color: rgba(255, 42, 109, 0.6); }
}

/* P1: 随机幸运事件横幅 */
.lucky-event-banner {
  display: none;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 200;
  padding: 10px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(176, 38, 255, 0.3), rgba(255, 42, 109, 0.3));
  border: 2px solid var(--neon-pink);
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

.lucky-event-banner.show {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: eventBannerIn 0.4s ease-out;
}

.lucky-event-icon {
  font-size: 32px;
  animation: eventIconSpin 1s ease-out;
}

.lucky-event-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lucky-event-name {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 8px var(--neon-pink);
}

.lucky-event-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

@keyframes eventBannerIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.8); }
  60% { opacity: 1; transform: translateX(-50%) translateY(5px) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes eventIconSpin {
  0% { transform: rotate(0deg) scale(0); }
  100% { transform: rotate(360deg) scale(1); }
}

/* P1: 事件特效颜色变体 */
.lucky-event-banner.event-precision_boost {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 30px rgba(5, 217, 232, 0.5);
}
.lucky-event-banner.event-energy_burst {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 30px rgba(247, 248, 0, 0.5);
}
.lucky-event-banner.event-leader_slow {
  border-color: var(--neon-orange);
  box-shadow: 0 0 30px rgba(255, 107, 0, 0.5);
}
.lucky-event-banner.event-all_sprint {
  border-color: var(--neon-green);
  box-shadow: 0 0 30px rgba(0, 217, 163, 0.5);
}
.lucky-event-banner.event-speed_swap {
  border-color: var(--neon-purple);
  box-shadow: 0 0 30px rgba(176, 38, 255, 0.5);
}
.lucky-event-banner.event-lucky_aura {
  border-color: var(--neon-pink);
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.6);
}

/* P1: 玩家事件视觉效果 */
.horse-wrapper.horse-boosted {
  filter: drop-shadow(0 0 8px var(--neon-cyan)) drop-shadow(0 0 16px var(--neon-cyan));
}

.horse-wrapper.horse-boosted .horse {
  animation: boostFlash 0.3s ease-in-out infinite alternate;
}

@keyframes boostFlash {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.5); }
}

.horse-wrapper.horse-slowed .horse {
  filter: grayscale(0.6) brightness(0.7);
  animation: slowShake 0.4s ease-in-out infinite;
}

@keyframes slowShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.horse-wrapper.horse-aura {
  filter: drop-shadow(0 0 12px var(--neon-pink)) drop-shadow(0 0 24px var(--neon-pink));
}

.horse-wrapper.horse-aura .horse {
  animation: auraPulse 0.5s ease-in-out infinite alternate;
}

@keyframes auraPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.3); }
}

.horse-wrapper.horse-swapped {
  filter: drop-shadow(0 0 8px var(--neon-purple)) drop-shadow(0 0 16px var(--neon-purple));
  animation: swapFlicker 0.6s ease-in-out infinite;
}

@keyframes swapFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- 数钱进度 --- */
#money-counting-view {
  flex-direction: column;
  justify-content: center;
  padding: 80px 40px 40px;
  gap: 15px;
  overflow-y: auto;
  position: relative;
}

/* 钞票雨容器 */
.money-rain-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.money-rain-piece {
  position: absolute;
  top: -40px;
  animation: moneyRainFall linear forwards;
  filter: drop-shadow(0 0 4px rgba(0, 217, 163, 0.3));
}

@keyframes moneyRainFall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(120vh) rotate(360deg);
  }
}

/* 玩家行 */
.money-row {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 70px;
  position: relative;
  transition: background 0.3s;
}

/* 排名编号徽章 */
.money-rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.money-rank-badge.rank-gold {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--neon-yellow);
  color: var(--neon-yellow);
  text-shadow: 0 0 8px var(--neon-yellow);
}

.money-rank-badge.rank-silver {
  background: rgba(192, 192, 192, 0.2);
  border-color: #C0C0C0;
  color: #E0E0E0;
}

.money-rank-badge.rank-bronze {
  background: rgba(205, 127, 50, 0.2);
  border-color: #CD7F32;
  color: #CD7F32;
}

.money-row .player-info {
  width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  flex-shrink: 0;
}

.money-row .progress-bar {
  flex: 1;
  height: 40px;
  background: rgba(0, 217, 163, 0.1);
  border: 1px solid rgba(0, 217, 163, 0.3);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.money-row .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  border-radius: 20px;
  transition: width 0.1s linear, background 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 15px var(--neon-green);
}

/* 连击/倍率徽章 */
.money-combo-badge {
  width: 50px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}

.money-combo-badge.combo-x1 {
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
}

.money-combo-badge.combo-x2 {
  color: var(--neon-orange);
  text-shadow: 0 0 8px var(--neon-orange);
  animation: comboPulseHost 0.3s ease;
}

.money-combo-badge.combo-x3 {
  color: var(--neon-pink);
  text-shadow: 0 0 10px var(--neon-pink);
  animation: comboPulseHost 0.3s ease;
}

@keyframes comboPulseHost {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.money-row .count {
  width: 100px;
  text-align: right;
  font-size: 28px;
  font-weight: bold;
  color: var(--neon-green);
  text-shadow: 0 0 10px var(--neon-green);
  flex-shrink: 0;
}

/* 排名上升动画 */
.money-row.rank-up {
  animation: rankUpBounce 0.6s ease;
}

@keyframes rankUpBounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-12px); background: rgba(0, 217, 163, 0.15); }
  60% { transform: translateY(0); background: rgba(0, 217, 163, 0.1); }
  100% { transform: translateY(0); background: transparent; }
}

/* 排名下降动画 */
.money-row.rank-down {
  animation: rankDownShake 0.5s ease;
}

@keyframes rankDownShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); background: rgba(255, 42, 109, 0.1); }
  40% { transform: translateX(6px); background: rgba(255, 42, 109, 0.08); }
  60% { transform: translateX(-4px); background: rgba(255, 42, 109, 0.06); }
  80% { transform: translateX(2px); }
}

/* ============================================================
   P3: Frenzy 横幅 / 面额指示器 / 假钞闪烁
   ============================================================ */

/* Frenzy 横幅 */
.host-frenzy-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-orange));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  padding: 12px 50px;
  border-radius: 40px;
  white-space: nowrap;
  opacity: 0;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(255, 42, 109, 0.6);
  transition: opacity 0.3s, transform 0.3s;
}

.host-frenzy-banner.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: hostFrenzyPulse 0.5s ease-in-out infinite alternate;
}

@keyframes hostFrenzyPulse {
  0% { box-shadow: 0 0 25px rgba(255, 42, 109, 0.5); }
  100% { box-shadow: 0 0 45px rgba(255, 107, 53, 0.8); }
}

/* 面额指示器 */
.host-denomination {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 40px;
  z-index: 15;
  filter: drop-shadow(0 0 8px rgba(0, 217, 163, 0.5));
  transition: all 0.3s;
}

.host-denomination.denom-phase-2 {
  font-size: 48px;
  filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.6));
}

.host-denomination.denom-phase-3 {
  font-size: 56px;
  filter: drop-shadow(0 0 12px rgba(255, 42, 109, 0.7));
  animation: denomPulse 0.8s ease-in-out infinite alternate;
}

@keyframes denomPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* 假钞闪烁 */
.money-row.fake-bill-hit {
  animation: fakeBillFlash 0.5s ease;
}

@keyframes fakeBillFlash {
  0% { background: transparent; }
  20% { background: rgba(255, 0, 0, 0.3); }
  40% { background: rgba(255, 0, 0, 0.15); }
  60% { background: rgba(255, 0, 0, 0.1); }
  100% { background: transparent; }
}

/* Frenzy 模式容器 */
#money-counting-view.frenzy-mode {
  animation: hostFrenzyBg 0.5s ease-in-out infinite alternate;
}

@keyframes hostFrenzyBg {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.2) hue-rotate(15deg); }
}

/* Frenzy 进度条脉冲 */
.progress-fill.frenzy-fill {
  animation: frenzyFillPulse 0.3s ease-in-out infinite alternate;
}

@keyframes frenzyFillPulse {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.5) saturate(1.5); }
}

/* --- 转盘 --- */
#lucky-wheel-view {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wheel-container {
  position: relative;
  width: 500px;
  height: 500px;
}

.wheel-pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 50px;
  z-index: 10;
  filter: drop-shadow(0 0 10px var(--neon-pink));
}

#wheel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(176, 38, 255, 0.6));
}

/* ============================================================
   排行榜
   ============================================================ */

.leaderboard {
  width: 350px;
  height: 100%;
  background: rgba(13, 2, 33, 0.8);
  border-left: 1px solid rgba(176, 38, 255, 0.3);
  padding: 20px 20px 20px;
  overflow-y: auto;
}

.leaderboard h3 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  display: flex;
  align-items: center;
}

.leaderboard-count {
  font-size: 24px;
  color: var(--neon-green);
  font-weight: bold;
  margin-left: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin-bottom: 3px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(176, 38, 255, 0.2);
  transition: all 0.2s;
}

.leaderboard-item.rank-1 {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 15px rgba(247, 248, 0, 0.4);
}

.leaderboard-item.rank-2 {
  border-color: #C0C0C0;
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.2);
}

.leaderboard-item.rank-3 {
  border-color: #CD7F32;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.2);
}

.leaderboard-item .rank {
  font-size: 16px;
  font-weight: bold;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.leaderboard-item .avatar {
  font-size: 18px;
  flex-shrink: 0;
}

.leaderboard-item .name {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-item .score {
  font-size: 16px;
  font-weight: bold;
  color: var(--neon-green);
  flex-shrink: 0;
}

/* 前三名排行榜卡片放大突出 */
.leaderboard-item.rank-1 {
  padding: 14px 18px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), var(--bg-card));
}
.leaderboard-item.rank-1 .rank { font-size: 34px; width: 44px; }
.leaderboard-item.rank-1 .avatar { font-size: 40px; }
.leaderboard-item.rank-1 .name { font-size: 22px; font-weight: bold; }
.leaderboard-item.rank-1 .score { font-size: 28px; }

.leaderboard-item.rank-2 {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), var(--bg-card));
}
.leaderboard-item.rank-2 .rank { font-size: 30px; width: 40px; }
.leaderboard-item.rank-2 .avatar { font-size: 36px; }
.leaderboard-item.rank-2 .name { font-size: 20px; font-weight: bold; }
.leaderboard-item.rank-2 .score { font-size: 24px; }

.leaderboard-item.rank-3 {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), var(--bg-card));
}
.leaderboard-item.rank-3 .rank { font-size: 30px; width: 40px; }
.leaderboard-item.rank-3 .avatar { font-size: 36px; }
.leaderboard-item.rank-3 .name { font-size: 20px; font-weight: bold; }
.leaderboard-item.rank-3 .score { font-size: 24px; }

/* ============================================================
   结果展示 - 领奖台
   ============================================================ */

.winner-display {
  text-align: center;
  margin-bottom: 30px;
}

.podium-empty {
  font-size: 36px;
  color: var(--text-secondary);
  padding: 40px 0;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: podiumRise 0.6s ease-out backwards;
}

.podium-1st { animation-delay: 0.3s; }
.podium-2nd { animation-delay: 0.1s; }
.podium-3rd { animation-delay: 0.2s; }

@keyframes podiumRise {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.podium-crown {
  font-size: 36px;
  animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.podium-medal {
  font-size: 24px;
  margin-bottom: 4px;
}

.podium-avatar {
  font-size: 48px;
  margin-bottom: 6px;
}

.podium-avatar-winner {
  font-size: 60px;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
}

.podium-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-name-winner {
  font-size: 22px;
  background: linear-gradient(90deg, var(--neon-yellow), var(--neon-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.podium-score {
  font-size: 16px;
  color: var(--neon-green);
  margin-bottom: 8px;
}

.podium-base {
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  border-radius: 8px 8px 0 0;
  color: var(--text-primary);
}

.podium-1st .podium-base {
  height: 100px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.05));
  border: 2px solid rgba(255, 215, 0, 0.6);
  border-bottom: none;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.podium-2nd .podium-base {
  height: 70px;
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.05));
  border: 2px solid rgba(192, 192, 192, 0.5);
  border-bottom: none;
}

.podium-3rd .podium-base {
  height: 55px;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.3), rgba(205, 127, 50, 0.05));
  border: 2px solid rgba(205, 127, 50, 0.5);
  border-bottom: none;
}

/* 纸屑动画 */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.result-rankings {
  width: 600px;
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 30px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 25px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid rgba(176, 38, 255, 0.2);
}

.result-row .rank {
  font-size: 28px;
  font-weight: bold;
  width: 50px;
  text-align: center;
}

.result-row .avatar {
  font-size: 32px;
}

.result-row .name {
  flex: 1;
  font-size: 22px;
}

.result-row .score {
  font-size: 24px;
  font-weight: bold;
  color: var(--neon-green);
}

.result-row .prize {
  font-size: 18px;
  color: var(--neon-yellow);
}

/* ============================================================
   滚动条样式
   ============================================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--neon-purple);
  border-radius: 4px;
}

/* ============================================================
   微信授权头像（圆形图片，尺寸跟随容器 emoji 字号）
   ============================================================ */

.avatar-url-img {
  font-size: inherit;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 8px rgba(5, 217, 232, 0.6);
}

/* ============================================================
   留言墙模式（#view-wall）
   视觉规格来源：preview/wall-host.html（已拍板基准）
   ============================================================ */

/* ---- 第 4 张主菜单卡片：便利贴图标（CSS 手绘） ---- */
.wall-note-icon {
  display: inline-block;
  width: 72px;
  height: 72px;
  background: rgba(24, 20, 6, 0.92);
  border: 3px solid #ffd000;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(255, 208, 0, 0.55), inset 0 0 12px rgba(255, 208, 0, 0.15);
  transform: rotate(-6deg);
  position: relative;
}
.wall-note-icon::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 40px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 208, 0, 0.75);
  box-shadow: 0 14px 0 rgba(255, 208, 0, 0.5), 0 28px 0 rgba(255, 208, 0, 0.3);
}
.wall-note-icon::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 20px;
  height: 20px;
  background: linear-gradient(315deg, transparent 49%, #ffd000 50%);
  border-radius: 0 0 6px 0;
}
#card-wall:hover {
  border-color: #ffd000;
  box-shadow: 0 0 22px rgba(255, 208, 0, 0.55);
}

/* ---- 吸引屏开关（菜单角落低存在感设置项） ---- */
.attract-toggle {
  margin-top: 34px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(160, 160, 192, 0.25);
  border-radius: 16px;
  padding: 5px 16px;
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.25s;
  font-family: inherit;
}
.attract-toggle:hover {
  opacity: 1;
  color: var(--text-primary);
  border-color: rgba(5, 217, 232, 0.6);
}

/* ---- 视图容器：全屏覆盖 ---- */
#view-wall {
  position: absolute;
  inset: 0;
  z-index: 50;
  padding: 0;
  display: none;
  flex-direction: column;
  /* 覆盖 .view 的 align-items:center —— 否则 #wall-board 会按内容收缩成宽度 0，
     导致布局回退到 1920 兜底宽度、便利贴铺到屏幕外 */
  align-items: stretch;
  justify-content: flex-start;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(176, 38, 255, 0.14), transparent 42%),
    radial-gradient(ellipse at 84% 78%, rgba(5, 217, 232, 0.10), transparent 45%),
    radial-gradient(ellipse at 60% 40%, rgba(255, 42, 109, 0.05), transparent 55%),
    linear-gradient(180deg, #0a0a12 0%, #101020 100%);
  overflow: hidden;
}
#view-wall.active {
  display: flex;
}

/* ---- 流星层（缓慢斜落，便利贴之下、页面背景之上；位移用视口单位随屏幕缩放） ---- */
#meteors {
  position: absolute;
  inset: 0;
  z-index: 1;                  /* 页面背景之上、拼贴区(z-5)之下 */
  pointer-events: none;
  overflow: hidden;
}
.meteor {
  position: absolute;
  top: -8%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f4ffff;
  box-shadow: 0 0 6px 2px rgba(190, 240, 255, 0.85);
  opacity: 0;
  will-change: transform, opacity;
  animation: meteorFall var(--dur, 6s) linear var(--delay, 0s) infinite;
}
.meteor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 210px;
  height: 1.6px;
  transform-origin: left center;
  transform: translateY(-50%) rotate(-45deg);
  background: linear-gradient(90deg, rgba(220, 246, 255, 0.9), rgba(220, 246, 255, 0));
  filter: blur(0.4px);
}
.meteor.tint-magenta::after { background: linear-gradient(90deg, rgba(255, 180, 235, 0.9), rgba(255, 180, 235, 0)); }
.meteor.tint-violet::after { background: linear-gradient(90deg, rgba(205, 180, 255, 0.9), rgba(205, 180, 255, 0)); }
/* --dx/--dy 由预览 1920×1080 的 px 换算为视口单位（-640px≈-33vw / 620px≈57vh …），保持约 45° 左下方向 */
.m1 { left: 63%; --dx: -33vw; --dy: 57vh; --dur: 6.0s; --delay: 0s; }
.m2 { left: 90%; --dx: -43vw; --dy: 70vh; --dur: 7.4s; --delay: 2.2s; }
.m3 { left: 44%; --dx: -36vw; --dy: 59vh; --dur: 6.6s; --delay: 4.0s; }
.m4 { left: 78%; --dx: -47vw; --dy: 76vh; --dur: 8.4s; --delay: 1.1s; }
.m5 { left: 98%; --dx: -52vw; --dy: 83vh; --dur: 9.6s; --delay: 5.4s; }
.m6 { left: 58%; --dx: -41vw; --dy: 65vh; --dur: 7.0s; --delay: 3.2s; }
@keyframes meteorFall {
  0%   { opacity: 0;    transform: translate3d(0, 0, 0); }
  6%   { opacity: 0.95; }
  72%  { opacity: 0.9;  }
  100% { opacity: 0;    transform: translate3d(var(--dx), var(--dy), 0); }
}

/* ---- 顶栏 60px ---- */
#wall-topbar {
  height: 60px;
  flex-shrink: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 40px;
  background: rgba(13, 2, 33, 0.82);
  border-bottom: 1px solid rgba(176, 38, 255, 0.35);
  backdrop-filter: blur(10px);
}
.wt-left {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}
.wt-title {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 2px;
  white-space: nowrap;
  color: #FF2A6D;
  text-shadow: 0 0 14px rgba(255, 42, 109, 0.9), 0 0 36px rgba(255, 42, 109, 0.45);
}
.wt-title em {
  font-style: normal;
  /* 与 VALEBAR 完全一致：同色 + 同发光 */
  color: inherit;
  text-shadow: inherit;
}
.wall-mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid rgba(0, 255, 136, 0.55);
  color: #00ff88;
  background: rgba(0, 255, 136, 0.07);
}
.wall-mode-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: wallDotPulse 1.6s ease-in-out infinite;
}
@keyframes wallDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}
/* 右上角控制区：功能按钮（原底栏按钮迁移至此） */
.wt-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tb-btn {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: inherit;
  color: rgba(224, 224, 240, 0.8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.22s;
}
.tb-btn:hover {
  color: #e8faff;
  border-color: rgba(0, 240, 255, 0.7);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  transform: scale(1.05);
}

/* ---- 顶部通栏公告条：半透明、无边框，仅一条公告（文字若隐若现） ---- */
#wall-notice-bar {
  display: none;
  flex-shrink: 0;
  z-index: 18;
  align-items: center;
  justify-content: center;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.055);
  border: none;
  border-radius: 10px;
}
#wall-notice-bar.show { display: flex; }
#wall-notice-bar .nt-text {
  font-size: calc(30px * var(--wall-ui-scale, 1));
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.32);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 拼贴区 ---- */
#wall-board {
  position: relative;
  flex: 1;
  min-height: 0;
  z-index: 5;
  background:
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(176, 38, 255, 0.055) 79px, rgba(176, 38, 255, 0.055) 80px),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(176, 38, 255, 0.055) 79px, rgba(176, 38, 255, 0.055) 80px);
}

/* ---- 便利贴 6 色变量（GDD §3.1） ---- */
.wallc-cyan    { --c:#00f0ff; --bg:rgba(10,16,24,0.92); --tc:#e8faff; --g:rgba(0,240,255,0.4);  --g2:rgba(0,240,255,0.9); }
.wallc-magenta { --c:#ff00e5; --bg:rgba(24,10,22,0.92); --tc:#ffe8fb; --g:rgba(255,0,229,0.4);  --g2:rgba(255,0,229,0.9); }
.wallc-purple  { --c:#8b2fff; --bg:rgba(16,10,26,0.92); --tc:#f0e8ff; --g:rgba(139,47,255,0.4); --g2:rgba(139,47,255,0.9); }
.wallc-green   { --c:#00ff88; --bg:rgba(8,20,16,0.92);  --tc:#e8fff2; --g:rgba(0,255,136,0.4);  --g2:rgba(0,255,136,0.9); }
.wallc-yellow  { --c:#ffd000; --bg:rgba(24,20,6,0.92);  --tc:#fff9e0; --g:rgba(255,208,0,0.4);  --g2:rgba(255,208,0,0.9); }
.wallc-orange  { --c:#ff6b00; --bg:rgba(24,12,4,0.92);  --tc:#fff0e0; --g:rgba(255,107,0,0.4);  --g2:rgba(255,107,0,0.9); }

.wall-note {
  position: absolute;
  cursor: pointer;
  transition: left 0.4s cubic-bezier(0.2, 0.8, 0.3, 1), top 0.4s cubic-bezier(0.2, 0.8, 0.3, 1),
              width 0.4s cubic-bezier(0.2, 0.8, 0.3, 1), height 0.4s cubic-bezier(0.2, 0.8, 0.3, 1),
              opacity 0.3s ease, transform 0.3s ease;
  will-change: transform, opacity;
}
.wall-note .inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border: 2px solid var(--c);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 12px var(--g);
  display: flex;
  flex-direction: column;
  padding: 12px 14px 8px;
  overflow: hidden;
  animation: cardBreathe 7.5s ease-in-out var(--bd, 0s) infinite;   /* 每张卡独立相位的呼吸辉光 */
}
/* 卡面内容置于流光之上，避免被高光洗淡 */
.wall-note .inner > * {
  position: relative;
  z-index: 1;
}
/* 流光扫过：每张卡各自相位的慢速高光（二维码卡排除；特异性低于 .enlarged/.flyin，不与其动画冲突） */
.wall-note:not(.qr-note) .inner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.13) 50%, transparent 68%);
  background-size: 260% 100%;
  background-position: 135% 0;
  mix-blend-mode: screen;
  animation: cardSheen 6.5s ease-in-out var(--sd, 0s) infinite;
}
@keyframes cardBreathe {
  0%, 100% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 11px var(--g); }
  50%      { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 22px var(--g), 0 0 34px var(--g); }
}
@keyframes cardSheen {
  0%   { background-position: 135% 0; opacity: 0; }
  14%  { opacity: 1; }
  52%  { background-position: -35% 0; opacity: 0.85; }
  70%  { background-position: -40% 0; opacity: 0; }
  100% { background-position: -40% 0; opacity: 0; }
}
.wall-note .body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  color: var(--tc);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px var(--g);
  overflow: hidden;
}
.wall-note .body span { max-width: 100%; word-break: break-all; }
.wall-note .sig {
  flex-shrink: 0;
  height: 36px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wall-avatar,
.wall-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  filter: drop-shadow(0 0 4px var(--g));
}
/* avatarUrl 为空：灰色面具占位（CSS 绘制） */
.wall-avatar-fallback {
  position: relative;
  background: rgba(160, 160, 184, 0.3);
  border: 1px solid rgba(200, 200, 220, 0.4);
}
.wall-avatar-fallback::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 9px;
  width: 4px;
  height: 5px;
  border-radius: 2px;
  background: rgba(230, 230, 245, 0.9);
  box-shadow: 10px 0 0 rgba(230, 230, 245, 0.9);
}
.wall-avatar-fallback::after {
  content: '';
  position: absolute;
  left: 9px;
  bottom: 6px;
  width: 10px;
  height: 4px;
  border-radius: 0 0 5px 5px;
  border-bottom: 1.6px solid rgba(230, 230, 245, 0.75);
}
.wall-nickname {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--tc);
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall-likes {
  font-size: 20px;
  font-weight: 700;
  color: var(--tc);
  opacity: 0.85;
  white-space: nowrap;
}
.wall-likes b { display: inline-block; font-weight: 800; }
.wall-likes.jump b { animation: wallLikeJump 0.4s ease-out; }
@keyframes wallLikeJump {
  0% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
/* 系统贴（开场贴 / 置顶系统公告）徽标 */
.wall-system-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(160, 160, 184, 0.9);
  border: 1px solid rgba(160, 160, 184, 0.35);
  border-radius: 8px;
  padding: 1px 7px;
}

/* ---- 放大贴（「赞最多」放右上 2×2 区）：脉冲描边 + ❤ 品红高亮 ---- */
.wall-note.enlarged .inner {
  border-width: 3px;
  animation: wallGlowPulse 2s ease-in-out infinite;
}
@keyframes wallGlowPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 12px var(--g), 0 0 22px var(--g); border-color: var(--c); }
  50% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 20px var(--g), 0 0 46px var(--g); border-color: var(--g2); }
}
.wall-note.enlarged .wall-likes {
  color: #ff00e5;
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 0, 229, 0.75);
}

/* ---- 二维码便利贴（左上 2×2 固定区）：复用便利贴卡面 + 轻微倾斜 ---- */
.wall-note.qr-note {
  cursor: default;
}
.wall-note.qr-note .inner {
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
}
.wall-note.qr-note img {
  flex: 0 0 auto;
  border-radius: 10px;
  background: #fff;                                  /* qr.svg 为黑色码点，需白底 */
  padding: 8px;
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.32), inset 0 0 8px rgba(0, 240, 255, 0.12);
}
.wall-note.qr-note .qr-cap {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1.5px;
  line-height: 1.3;
  color: var(--tc);
  text-shadow: 0 0 12px var(--g);
}

/* ---- 飞入动画（GDD §6.1） ---- */
.wall-note.flyin { animation: wallFlyIn 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes wallFlyIn {
  0% { transform: translate(var(--fx), var(--fy)) scale(0.3) rotate(-12deg); opacity: 0; }
  10% { opacity: 1; }
  60% { transform: translate(calc(var(--fx) * 0.05), calc(var(--fy) * 0.05)) scale(1.1) rotate(0deg); }
  100% { transform: translate(0, 0) scale(1) rotate(var(--rot)); }
}
.wall-note.flyin .inner,
.wall-note.pop .inner { animation: wallLandFlash 0.35s ease-out 0.5s forwards; }
.wall-note.pop { animation: wallPopIn 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes wallPopIn {
  0% { transform: scale(0.75) rotate(0deg); opacity: 0; }
  100% { transform: scale(1) rotate(var(--rot)); opacity: 1; }
}
.wall-note.pop .inner { animation: wallLandFlash 0.3s ease-out 0.15s forwards; }
@keyframes wallLandFlash {
  0% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 30px var(--g2), 0 0 80px var(--g); }
  100% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 12px var(--g); }
}

/* ---- 店长操作 / 公告浮层（风格统一：同 confirm 系） ---- */
#wall-note-popup,
#wall-announce-overlay,
#wall-song-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: rgba(5, 1, 15, 0.6);
  backdrop-filter: blur(6px);
}
#wall-note-popup.show,
#wall-announce-overlay.show,
#wall-song-overlay.show { display: flex; }
.wpopup-panel {
  width: 480px;
  padding: 26px 30px;
  background: rgba(26, 10, 18, 0.96);
  border: 1px solid rgba(255, 208, 0, 0.55);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(255, 208, 0, 0.25), 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: wallPanelIn 0.25s ease-out;
}
@keyframes wallPanelIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.wpopup-title {
  font-size: 20px;
  font-weight: 900;
  color: #ffd000;
  text-shadow: 0 0 12px rgba(255, 208, 0, 0.55);
  margin-bottom: 14px;
}
.wpopup-preview {
  font-size: 15.5px;
  color: #cfcfe4;
  line-height: 1.7;
  max-height: 88px;
  overflow: hidden;
  margin-bottom: 6px;
}
.wpopup-btns {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 20px;
}
.wpopup-confirm {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  font-size: 14.5px;
  color: #ff8a8a;
}
.wpopup-confirm.show { display: flex; }
.wbtn {
  font-size: 15px;
  font-weight: 800;
  border-radius: 8px;
  padding: 9px 22px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.wbtn-gold {
  color: #ffd000;
  background: rgba(255, 208, 0, 0.12);
  border: 1px solid #ffd000;
  box-shadow: 0 0 12px rgba(255, 208, 0, 0.3);
}
.wbtn-gold:hover { background: rgba(255, 208, 0, 0.3); box-shadow: 0 0 20px rgba(255, 208, 0, 0.5); }
.wbtn-danger {
  color: #fff;
  background: rgba(255, 77, 77, 0.18);
  border: 1px solid #ff4d4d;
  box-shadow: 0 0 14px rgba(255, 77, 77, 0.35);
}
.wbtn-danger:hover { background: rgba(255, 77, 77, 0.35); box-shadow: 0 0 22px rgba(255, 77, 77, 0.55); }
.wbtn-cancel {
  color: #cfcfe4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.wbtn-cancel:hover { border-color: rgba(255, 255, 255, 0.5); }
.announce-title { color: #00f0ff; text-shadow: 0 0 12px rgba(0, 240, 255, 0.55); }
.announce-panel { border-color: rgba(0, 240, 255, 0.55); box-shadow: 0 0 40px rgba(0, 240, 255, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6); }
.announce-input {
  width: 100%;
  font-size: 17px;
  font-family: inherit;
  color: #e8faff;
  background: rgba(5, 1, 15, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  letter-spacing: 0.5px;
}
.announce-input:focus {
  border-color: rgba(0, 240, 255, 0.85);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}
.announce-input::placeholder { color: rgba(160, 160, 184, 0.55); }

/* ---- Toast（歌词条之上） ---- */
#wall-toast {
  position: absolute;
  left: 50%;
  bottom: 150px;
  z-index: 110;
  transform: translateX(-50%) translateY(12px);
  padding: 12px 28px;
  border-radius: 24px;
  background: rgba(13, 2, 33, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
  color: #e8faff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

/* ============================================================
   底部歌词条（仅当前句 + 下一句，不显示歌名；高度/间距由 JS 按屏幕等比设置）
   ============================================================ */
.wall-nowplaying {
  position: relative;
  flex-shrink: 0;
  z-index: 15;                  /* 拼贴之上、浮层(100)之下 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 40px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.wall-nowplaying.show { opacity: 1; }
/* 歌名不上墙：只保留歌词 */
.wall-nowplaying .np-song { display: none; }
.wall-nowplaying .np-line {
  font-size: calc(56px * var(--wall-ui-scale, 1));
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.55), 0 0 44px rgba(0, 240, 255, 0.22);
}
.wall-nowplaying .np-line.np-line-in {
  animation: npLineIn 0.5s ease-out;
}
@keyframes npLineIn {
  0%   { opacity: 0; transform: translateY(12px); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.wall-nowplaying .np-next {
  font-size: calc(28px * var(--wall-ui-scale, 1));
  letter-spacing: 1px;
  color: rgba(180, 200, 225, 0.5);
}

/* 正在播放报歌浮层 */
.np-panel {
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6);
}
.np-title { color: #00f0ff; text-shadow: 0 0 12px rgba(0, 240, 255, 0.55); }
.np-hint {
  font-size: 13px;
  color: rgba(160, 160, 184, 0.8);
  line-height: 1.6;
  margin-bottom: 14px;
}
.np-artist-input { margin-top: 12px; }

/* 歌词同步微调 */
.np-offset-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 240, 255, 0.18);
}
.np-offset-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.np-offset-label {
  font-size: 13px;
  letter-spacing: 0.5px;
  color: rgba(200, 200, 220, 0.9);
}
.np-offset-value {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  min-width: 64px;
  text-align: right;
}
.np-offset-btns {
  display: flex;
  gap: 10px;
}
.np-offset-btn {
  flex: 1 1 0;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 700;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.np-offset-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}
.np-offset-btn:active { transform: scale(0.96); }
.np-offset-reset {
  color: rgba(180, 180, 200, 0.9);
  border-color: rgba(160, 160, 184, 0.45);
  background: rgba(160, 160, 184, 0.08);
}
.np-offset-reset:hover {
  background: rgba(160, 160, 184, 0.2);
  box-shadow: 0 0 14px rgba(160, 160, 184, 0.3);
}
.np-offset-tip {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(160, 160, 184, 0.72);
}
#wall-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
