/* ===================== 基础（yanamiannna 原样式）===================== */
body {
  background-color: #f0f4f8;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  font-family: sans-serif;
}

.card {
  position: relative;
  z-index: 2;
  background: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 { color: #2c3e50; margin-bottom: 12px; }
p  { color: #666; }

button {
  margin-top: 20px;
  padding: 10px 24px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}
button:hover { background-color: #2980b9; }

.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  z-index: -1;
}

/* 通用隐藏类 */
.hidden { display: none !important; }

.status { color: #2980b9; font-size: 14px; }

/* ===================== 界面二：对战 / 观战 ===================== */
.btn-record { margin-top: 12px; background-color: #6c5ce7; }
.btn-record:hover { background-color: #5b4bc4; }

.vs-view {
  position: relative;
  z-index: 2;
  width: min(900px, 90vw);
  padding: 24px;
}
.vs-cards { display: flex; gap: 32px; }
.vs-card {
  flex: 1;
  min-height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.vs-btn { margin: 0; padding: 14px 40px; font-size: 20px; }

.btn-back {
  position: absolute;
  top: -8px;
  left: 24px;
  margin: 0;
  padding: 6px 14px;
  font-size: 14px;
  background-color: #95a5a6;
}
.btn-back:hover { background-color: #7f8c8d; }

/* ===================== 界面三：房间列表 ===================== */
.room-view {
  position: relative;
  z-index: 2;
  width: min(720px, 90vw);
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}
.room-view h2 { margin: 0 0 20px; color: #2c3e50; font-size: 20px; }
.create-box { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.create-box input {
  flex: 1; min-width: 130px; padding: 10px 12px;
  border: 1px solid #dfe6e9; border-radius: 6px; font-size: 14px;
}
.create-box button { margin-top: 0; }

.media-box {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-bottom: 18px;
}
.media-box button { margin-top: 0; font-size: 14px; padding: 8px 16px; }
.hint { color: #8899a6; font-size: 13px; }

.room-list { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.room-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #f7f9fb; border-radius: 8px;
}
.room-item button { margin-top: 0; padding: 8px 16px; font-size: 14px; }
.empty-tip { color: #999; text-align: center; }

/* ===================== 界面四/五：对战 / 观战窗口 ===================== */
.battle-view, .spectate-view {
  position: relative;
  z-index: 2;
  width: 85vw;
  height: 78vh;
  box-sizing: border-box;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}
.battle-view h2, .spectate-view h2 {
  margin: 0 0 12px; color: #2c3e50; font-size: 20px; text-align: left;
}

.zoom-tip { margin: -6px 0 12px; color: #8899a6; font-size: 13px; text-align: left; }

.battle-stage {
  flex: 1;
  display: flex;
  gap: 16px;
  min-height: 0;
  justify-content: center;
  align-items: center;
}

.player-slot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  background: #1e272e;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.player-slot video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.slot-empty { color: #8899a6; font-size: 15px; padding: 0 12px; text-align: center; }
.slot-label {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(0, 0, 0, 0.55); color: white;
  padding: 4px 10px; border-radius: 6px; font-size: 13px;
}

/* 观战：双击放大 / 缩小 */
.spectate-view .player-slot { cursor: zoom-in; }
.battle-stage.zoom > .player-slot { display: none; }
.battle-stage.zoom > .player-slot.zoomed {
  display: flex;
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  aspect-ratio: 16 / 9;
  cursor: zoom-out;
}

/* 左下角按钮栏 */
.bottom-bar { display: flex; gap: 10px; align-items: center; padding-top: 14px; }
.bottom-bar button { margin-top: 0; }
.btn-leave { margin-left: auto !important; background-color: #95a5a6; }
.btn-leave:hover { background-color: #7f8c8d; }
button.on { background-color: #27ae60; }
button.on:hover { background-color: #219150; }
#recResult a { color: #2980b9; font-size: 14px; }

/* ===================== 密码弹窗 ===================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex; justify-content: center; align-items: center;
  z-index: 10;
}
.modal-box {
  width: 320px; background: white; border-radius: 12px; padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); text-align: center;
}
.modal-box h3 { margin: 0 0 16px; color: #2c3e50; font-size: 17px; }
.modal-box input {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid #dfe6e9; border-radius: 6px; font-size: 15px;
}
.modal-tip { color: #e74c3c; font-size: 13px; min-height: 18px; margin: 8px 0 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button { flex: 1; margin-top: 0; }
.btn-cancel { background-color: #b2bec3; }
.btn-cancel:hover { background-color: #95a5a6; }

/* 大窗口下观战画面再大一点（对战窗口保持原样） */
.spectate-view { width: 94vw; height: 90vh; }
.spectate-view .battle-stage { gap: 20px; }

