/* ===== RPG 过场动画 & Demo 展示区样式 ===== */

/* ── 全屏过场遮罩 ── */
.rpg-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rpg-overlay.active {
  display: flex;
}

#rpg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── 对话框 ── */
.rpg-dialog {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  background: rgba(10, 4, 0, 0.92);
  border: 2px solid #ff6b00;
  box-shadow: 0 0 30px rgba(255, 107, 0, 0.50), inset 0 0 20px rgba(255, 107, 0, 0.05);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  opacity: 0;
  transition: opacity 0.4s;
}

.rpg-dialog.visible {
  opacity: 1;
}

.rpg-dialog-portrait {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 157, 0, 0.80));
  animation: portrait-pulse 1.8s ease-in-out infinite;
}

@keyframes portrait-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

.rpg-dialog-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ff9d00;
  margin-bottom: 6px;
}

.rpg-dialog-text {
  font-family: 'Exo 2', 'Rajdhani', sans-serif;
  font-size: 1rem;
  color: #fff5e6;
  line-height: 1.6;
  min-height: 2.4em;
}

/* 打字机光标 */
.rpg-dialog-text::after {
  content: '▌';
  animation: blink 0.8s step-end infinite;
  color: #ff6b00;
  margin-left: 2px;
}

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

/* ── 进度条 ── */
.rpg-progress-bar {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  height: 4px;
  background: rgba(255, 107, 0, 0.18);
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
}

#rpg-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6b00, #ff9d00, #ffcc00);
  box-shadow: 0 0 8px rgba(255, 157, 0, 0.80);
  transition: width 0.25s linear;
}

/* ── Demo 展示全屏 ── */
.demo-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #060200;
  display: none;
  flex-direction: column;
}

.demo-screen.active {
  display: flex;
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 107, 0, 0.35);
  background: rgba(10, 4, 0, 0.95);
  flex-shrink: 0;
}

.demo-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ff9d00;
  text-shadow: 0 0 12px rgba(255, 157, 0, 0.70);
}

.demo-close {
  padding: 8px 24px;
  font-size: 0.85rem;
  cursor: pointer;
}

.demo-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.demo-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  background: #000;
}

.demo-iframe.active {
  display: block;
}

/* 占位内容（嵌入实际 demo 后可删除） */
.demo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 2px dashed rgba(255, 107, 0, 0.30);
  margin: 32px;
  border-radius: 2px;
}

.demo-placeholder.hidden {
  display: none;
}

.demo-placeholder-icon {
  font-size: 5rem;
  filter: drop-shadow(0 0 16px rgba(255, 157, 0, 0.60));
  animation: float-demo 3s ease-in-out infinite;
}

@keyframes float-demo {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

.demo-placeholder-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 157, 0, 0.55);
  text-align: center;
  line-height: 1.4;
}

.demo-placeholder-hint {
  font-family: 'Exo 2', 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(160, 120, 80, 0.60);
  letter-spacing: 1px;
  text-align: center;
}
