.stage-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: url('/assets/bg.png') center center / cover no-repeat;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
  text-align: center;
  padding: 4vh 4vw;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
}

/* 待机封面 */
.screen-idle {
  background: transparent;
}

.idle-title {
  margin: 0 0 2vh;
  font-size: 6vh;
  color: #fff;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}

.idle-subtitle {
  font-size: 3vh;
  color: #bcd4ee;
  letter-spacing: 0.3em;
}

/* === 待机封面动效 === */

/* 粒子画布：绝对铺满，z-index:1，.screen 用 z-index:2 浮在上方 */
.idle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.screen {
  z-index: 2;
}

/* 主标题金光从左扫过，每 6 秒一次 */
.idle-title::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(255, 248, 200, 0) 20%,
    rgba(255, 248, 200, 0.75) 50%,
    rgba(255, 248, 200, 0) 80%
  );
  transform: translateX(-150%);
  animation: title-shine 6s ease-in-out 1s infinite;
}

@keyframes title-shine {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(250%); }
}

/* 请学生上台 —— 聚光灯卡片（方案 A） */
.screen-stage {
  background: transparent;
}

.stage-card {
  position: relative;
  width: min(78vw, 124vh);
  padding: 6vh 6vw 5.5vh;
  border-radius: 3vh;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(180, 210, 245, 0.22);
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.45), inset 0 0 60px rgba(102, 153, 204, 0.08);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.stage-card.is-revealed {
  border-color: rgba(255, 211, 77, 0.55);
  box-shadow: 0 10px 80px rgba(255, 200, 80, 0.25), inset 0 0 80px rgba(255, 200, 80, 0.12);
  animation: cardGlow 1.6s ease;
}

@keyframes cardGlow {
  0% { transform: scale(0.99); }
  40% { box-shadow: 0 10px 130px rgba(255, 200, 80, 0.5), inset 0 0 120px rgba(255, 200, 80, 0.22); }
  100% { transform: scale(1); }
}

/* 校徽水印 */
.stage-emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46vh;
  height: 46vh;
  transform: translate(-50%, -50%);
  opacity: 0.06;
  border-radius: 50%;
  pointer-events: none;
}

.stage-top {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6vh;
  margin-bottom: 3.5vh;
}

.stage-seq-badge {
  font-size: 2.4vh;
  color: #06203f;
  background: linear-gradient(180deg, #ffe08a, #f5c243);
  padding: 0.5vh 2.6vh;
  border-radius: 999px;
  letter-spacing: 0.15em;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(245, 194, 67, 0.35);
}

.stage-seq-badge:empty {
  display: none;
}

.stage-label {
  font-size: 3vh;
  color: #cfe0f4;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
}

.stage-divider {
  width: 16vh;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 77, 0.85), transparent);
}

.roll-name {
  position: relative;
  font-size: 15vh;
  font-weight: 700;
  color: #fff;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
  line-height: 1.1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  min-height: 17vh;
  display: flex;
  align-items: center;
}

.roll-name.rolling {
  color: #ffe08a;
  filter: blur(1px);
}

.roll-name.revealed {
  color: #ffd34d;
  text-shadow: 0 0 44px rgba(255, 211, 77, 0.5);
  animation: pop 0.6s ease;
}

@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

/* 班级胶囊徽章 */
.reveal-class {
  position: relative;
  margin-top: 3vh;
  font-size: 3vh;
  color: #ffe9b0;
  letter-spacing: 0.12em;
  padding: 1vh 3vh;
  border: 1px solid rgba(255, 211, 77, 0.45);
  border-radius: 999px;
  background: rgba(255, 211, 77, 0.08);
}

.reveal-class:empty {
  display: none;
}

/* 寄语墙：顶部二维码 + 下方弹幕同屏 */
.screen-wall {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
}

.wall-header {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4vw;
  padding: 3vh 5vw;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.12) 100%);
  border-top: 1px solid rgba(255, 211, 77, 0.30);
}

.wall-title-group {
  text-align: left;
}

.wall-title {
  font-size: 5vh;
  color: #fff;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
  letter-spacing: 0.06em;
}

.wall-tip {
  margin-top: 1.4vh;
  font-size: 2.6vh;
  color: #bcd4ee;
  letter-spacing: 0.08em;
}

.wall-qr {
  flex: 0 0 auto;
}

.qr-box {
  width: 20vh;
  height: 20vh;
  background: #fff;
  border-radius: 1.4vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2vh;
  box-shadow: 0 0 30px rgba(102, 153, 204, 0.35);
}

.qr-box img,
.qr-box canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 弹幕滚动区（占据头部下方剩余空间） */
.wall-stream {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  overflow: hidden;
}

.danmaku-bg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0.10;
}

.danmaku-logo {
  width: 24vh;
  height: 24vh;
  border-radius: 50%;
  background: #fff;
  padding: 1vh;
}

.danmaku-tip {
  font-size: 5vh;
  color: #fff;
  letter-spacing: 0.4em;
}

/* 公用弹幕层：纯弹幕态与互动墙态共用，铺满全屏并可控显隐 */
.danmaku-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.danmaku-layer.dm-visible {
  opacity: 1;
  visibility: visible;
}

.danmaku-item {
  position: absolute;
  white-space: nowrap;
  font-size: 2.6vh;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  will-change: transform;
}

.danmaku-item .dm-name {
  color: #ffd34d;
  margin-right: 0.6em;
}

.conn-status {
  position: fixed;
  right: 14px;
  bottom: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  border-radius: 8px;
}

.conn-status.ok {
  color: rgba(170, 255, 190, 0.6);
}

.conn-status.bad {
  color: rgba(255, 170, 170, 0.8);
}
