/* ==========================================================================
   《不要叫我家长！》AI 卡牌闯关 H5 游戏 全局核心样式
   视觉设计：2D 夸张幽默校园卡通 Flash 风格 + 现代超清响应式舞台
   ========================================================================== */

:root {
  --board-bg: #1e392a;
  --board-frame: #854d0e;
  --board-inner-frame: #b45309;
  --chalk-white: #f8fafc;
  --chalk-yellow: #fde047;
  --chalk-green: #4ade80;
  --chalk-pink: #f472b6;
  --desk-wood: #78350f;
  --card-gold: #f59e0b;
  --danger-red: #ef4444;
  --success-green: #22c55e;
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at 50% 30%, #334155 0%, #0f172a 100%);
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

/* ================= 游戏舞台容器 ================= */
#game-stage {
  position: relative;
  width: 100%;
  max-width: 1024px;
  height: 94vh;
  max-height: 720px;
  background: #f1f5f9;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 6px #475569;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

/* ================= 顶部 HUD 状态栏 ================= */
.game-hud {
  height: 52px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 3px solid #334155;
  z-index: 20;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

.teacher-indicator {
  font-size: 14px;
  font-weight: bold;
  color: #93c5fd;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hud-center {
  flex: 1;
  max-width: 240px;
  margin: 0 15px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #334155;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #475569;
}

.progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #10b981, #facc15);
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.score-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-label {
  font-size: 12px;
  color: #94a3b8;
}

.score-value {
  font-size: 20px;
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.hud-btn {
  background: #334155;
  color: #f8fafc;
  border: 2px solid #64748b;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

.hud-btn:hover {
  background: #475569;
  transform: scale(1.04);
}

.hud-btn.muted {
  background: #64748b;
  color: #cbd5e1;
}

.hud-btn.mode-btn {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-color: #60a5fa;
  color: #dbeafe;
}

.hud-btn.mode-btn.local-mode {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-color: #34d399;
  color: #ecfdf5;
}

/* ================= 主屏容器体系 ================= */
.screen-layer {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100% - 52px);
  display: flex;
  flex-direction: column;
}

/* ================= 1. 标题与开始界面 ================= */
#screen-title {
  background: radial-gradient(circle at 50% 35%, #1e3a5f 0%, #091322 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-align: center;
  color: #fff;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.title-banner {
  background: #dc2626;
  color: #fef08a;
  font-size: 13px;
  font-weight: 900;
  padding: 5px 18px;
  border-radius: 20px;
  margin-bottom: 4px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
  letter-spacing: 2px;
  border: 2px dashed #fef08a;
}

.title-hero-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 880px;
  min-height: 0;
  margin: 6px 0;
}

.title-hero-img {
  max-width: 100%;
  max-height: 480px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  border: 4px solid #facc15;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(250, 204, 21, 0.35);
  animation: heroFloat 3s ease-in-out infinite alternate;
}

@keyframes heroFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.title-action-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.title-hint-text {
  font-size: 13px;
  color: #fef08a;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 1px;
}

.pulse-btn {
  animation: pulseBtnAnim 1.6s infinite ease-in-out;
}

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

.btn-game-primary {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: clamp(17px, 2.8vw, 22px);
  font-weight: 900;
  padding: 12px 42px;
  border-radius: 36px;
  border: 4px solid #fef08a;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.6), 0 4px 0 #92400e;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.15s ease;
}

.btn-game-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 26px rgba(217, 119, 6, 0.7), 0 5px 0 #92400e;
}

.btn-game-primary:active {
  transform: translateY(2px);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.5), 0 1px 0 #92400e;
}

/* ================= 2. 规则介绍与对话界面 ================= */
#screen-intro {
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.comic-intro-card {
  background: #fff;
  border-radius: 20px;
  border: 6px solid #b45309;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  max-width: 600px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
}

.comic-intro-header {
  font-size: 24px;
  font-weight: 900;
  color: #b91c1c;
  margin-bottom: 12px;
}

.intro-teachers-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.intro-teacher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 76px;
}

.intro-teacher-pic {
  width: 68px;
  height: 84px;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  border: 2px solid #ca8a04;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}

.intro-teacher-item:hover .intro-teacher-pic {
  transform: translateY(-3px) scale(1.05);
}

.intro-teacher-tag {
  font-size: 11px;
  font-weight: 900;
  color: #451a03;
  text-align: center;
  white-space: nowrap;
}

.comic-intro-body {
  font-size: 16px;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 24px;
  text-align: left;
  background: #fef2f2;
  padding: 16px;
  border-radius: 12px;
  border-left: 5px solid #ef4444;
}

.comic-intro-body p {
  margin-bottom: 10px;
}

/* ================= 3. 战斗闯关主舞台 ================= */
#screen-battle {
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* 黑板与讲台主体 */
.classroom-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 16px;
  position: relative;
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  overflow: hidden;
}

/* 教室横幅标语 */
.stage-banner {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: #b91c1c;
  color: #fef08a;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 14px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  letter-spacing: 2px;
  z-index: 10;
}

/* 老师立绘与气泡区域 */
.teacher-podium-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  padding-bottom: 8px;
}

/* 漫画对话气泡 */
.speech-bubble {
  position: relative;
  background: #ffffff;
  border: 3px solid #1e293b;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #1e293b;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  margin-bottom: 10px;
  width: 90%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 12px 12px 0;
  border-style: solid;
  border-color: #1e293b transparent;
  display: block;
  width: 0;
}

.bounce-in {
  animation: bubbleBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bubbleBounce {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 教师立绘容器与高质量卡牌插图 */
.teacher-avatar-box {
  width: 220px;
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.teacher-portrait-wrapper {
  position: relative;
  width: 175px;
  height: 250px;
  border-radius: 16px;
  overflow: hidden;
  border: 4px solid #facc15;
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.teacher-photo-card {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.correct-glow {
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.85), 0 0 0 4px #22c55e !important;
  border-color: #22c55e !important;
  transform: scale(1.03);
}

.portrait-status-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 10;
}

.portrait-status-badge.angry {
  background: #dc2626;
  color: #ffffff;
  animation: badgePulse 0.4s infinite alternate;
}

.portrait-status-badge.correct {
  background: #16a34a;
  color: #ffffff;
}

@keyframes badgePulse {
  0% { transform: translateX(-50%) scale(0.95); }
  100% { transform: translateX(-50%) scale(1.05); }
}

.teacher-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.25));
}

.angry-shake {
  animation: angryShake 0.4s infinite ease-in-out;
}

@keyframes angryShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3px, 2px) rotate(-1.5deg); }
  75% { transform: translate(3px, -2px) rotate(1.5deg); }
}

.prop-bounce {
  transform-origin: center bottom;
  animation: propBounce 2s infinite ease-in-out;
}

@keyframes propBounce {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

/* 讲台名牌 */
.podium-stand {
  background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
  color: #fef08a;
  border: 2px solid #b45309;
  border-radius: 8px;
  padding: 4px 18px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  margin-top: -6px;
  z-index: 5;
  letter-spacing: 1px;
}

/* 黑板答题区 (占据视觉核心) */
.blackboard-area {
  background: var(--board-bg);
  border: 10px solid var(--board-frame);
  border-radius: 16px;
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

/* 黑板顶部粉笔槽装饰 */
.blackboard-area::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: #ca8a04;
  opacity: 0.6;
}

/* 题目头部与倒计时 */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.header-left-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-badge {
  background: #047857;
  color: #ecfdf5;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #10b981;
}

.source-tag {
  font-size: 11px;
  color: #a7f3d0;
  font-weight: bold;
}

.header-timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-badge {
  background: #0f172a;
  color: #facc15;
  font-size: 13px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 12px;
  border: 2px solid #ca8a04;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.timer-badge.urgent {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #fca5a5 !important;
  animation: urgentPulse 0.4s infinite alternate;
}

@keyframes urgentPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

.question-timer-bar {
  width: 110px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.timer-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #facc15 60%, #ef4444 100%);
  border-radius: 6px;
  transition: width 0.1s linear;
}

.timer-fill.urgent {
  background: #ef4444 !important;
}

/* 黑板题目加载中的旋转进度条遮罩 */
.question-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(22, 44, 32, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 40;
  border-radius: 12px;
  padding: 20px;
}

.chalk-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(250, 204, 21, 0.2);
  border-top-color: #facc15;
  border-right-color: #38bdf8;
  border-radius: 50%;
  animation: chalkSpin 0.75s linear infinite;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.4);
  margin-bottom: 14px;
}

@keyframes chalkSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-tip-text {
  font-size: 16px;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  margin-bottom: 6px;
  text-align: center;
}

.loading-sub-text {
  font-size: 12px;
  color: #a7f3d0;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-align: center;
}

/* 题目文本 (清晰醒目大字) */
.question-body {
  flex: 1;
  display: flex;
  align-items: center;
}

.question-text {
  color: var(--chalk-white);
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: bold;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  letter-spacing: 0.5px;
}

/* 四选一选项网格 (大按钮，适合触屏与鼠标) */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2), 0 2px 0 #94a3b8;
  transition: all 0.12s ease;
  min-height: 52px;
  text-align: left;
}

.option-btn:hover:not(.disabled):not(.hidden-by-card) {
  background: #ffffff;
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3), 0 3px 0 #2563eb;
}

.option-btn:active:not(.disabled):not(.hidden-by-card) {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 1px 0 #94a3b8;
}

.opt-badge {
  background: #0284c7;
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
}

.opt-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #1e293b;
  flex: 1;
}

/* 答对高亮反馈 */
.option-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.6), 0 3px 0 #16a34a !important;
  animation: correctPop 0.4s ease-out;
}

.option-btn.correct .opt-badge {
  background: #16a34a;
}

@keyframes correctPop {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 答错高亮反馈 */
.option-btn.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6), 0 3px 0 #dc2626 !important;
  animation: wrongShake 0.4s ease-out;
}

.option-btn.wrong .opt-badge {
  background: #dc2626;
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* 卡牌 A 划掉隐藏的效果 */
.option-btn.hidden-by-card {
  opacity: 0.15;
  pointer-events: none;
  filter: grayscale(1);
  text-decoration: line-through;
}

/* 禁用状态 */
.option-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ================= 底部卡牌栏 ================= */
.cards-bar {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-top: 3px solid #475569;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cards-title {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cards-container {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

/* 单张卡牌设计 */
.game-card {
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
  border: 3px solid #f59e0b;
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 2px 0 #b45309;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  max-width: 220px;
}

.game-card:hover:not(.disabled) {
  transform: translateY(-4px) scale(1.02);
  border-color: #fbbf24;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.4), 0 3px 0 #b45309;
}

.game-card:active:not(.disabled) {
  transform: translateY(1px);
}

.card-icon {
  font-size: 20px;
}

.card-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.card-name {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.card-desc {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

.card-count-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.game-card.disabled {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
  border-color: #94a3b8;
  box-shadow: none;
}

/* ================= 弹窗遮罩与手机来电体系 ================= */
.game-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

/* 同桌救我小纸条 */
.paper-note {
  background: #fef08a;
  border: 3px solid #ca8a04;
  border-radius: 16px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  text-align: center;
  transform: rotate(-1.5deg);
  animation: noteFloat 0.3s ease-out;
}

@keyframes noteFloat {
  0% { transform: scale(0.8) rotate(-5deg); opacity: 0; }
  100% { transform: scale(1) rotate(-1.5deg); opacity: 1; }
}

.paper-note-header {
  font-size: 18px;
  font-weight: 900;
  color: #854d0e;
  margin-bottom: 12px;
}

.paper-note-text {
  font-size: 16px;
  color: #451a03;
  line-height: 1.6;
  font-weight: bold;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.6);
  padding: 12px;
  border-radius: 8px;
}

.btn-modal-close {
  background: #854d0e;
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 24px;
  border-radius: 20px;
  cursor: pointer;
}

/* 呼叫家长！仿真实体手机来电弹窗 */
.phone-modal-body {
  width: 320px;
  height: 520px;
  background: #09090b;
  border: 10px solid #27272a;
  border-radius: 40px;
  box-shadow: 0 25px 50px rgba(220, 38, 38, 0.6), 0 0 0 2px #dc2626;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 20px;
  text-align: center;
  color: #ffffff;
  animation: phoneRingShake 0.6s infinite alternate;
}

@keyframes phoneRingShake {
  0% { transform: rotate(-2deg) scale(0.99); }
  100% { transform: rotate(2deg) scale(1.01); }
}

.phone-screen-top {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-siren-icon {
  font-size: 42px;
  animation: sirenPulse 0.5s infinite alternate;
}

@keyframes sirenPulse {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.2); }
}

.phone-calling-label {
  font-size: 14px;
  color: #f87171;
  font-weight: bold;
  margin-top: 8px;
  letter-spacing: 1px;
}

.phone-target-name {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  margin-top: 6px;
}

.phone-quote-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #fecdd3;
  margin: 16px 0;
}

.phone-screen-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-card-c-rescue {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #000;
  border: 2px solid #fef08a;
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.5);
  animation: rescueGlow 1s infinite alternate;
}

@keyframes rescueGlow {
  0% { box-shadow: 0 0 10px rgba(250, 204, 21, 0.5); }
  100% { box-shadow: 0 0 25px rgba(250, 204, 21, 1); }
}

.btn-accept-defeat {
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

/* ================= 4. 胜利与失败结算画面 ================= */
#screen-victory, #screen-defeat {
  background: radial-gradient(circle at 50% 40%, #1e293b 0%, #09090b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* 胜利免死金牌大奖状 */
.certificate-card {
  background: #fefce8;
  border: 10px double #ca8a04;
  border-radius: 20px;
  padding: 30px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(250, 204, 21, 0.4);
  text-align: center;
  position: relative;
  animation: certSlide 0.5s ease-out;
}

@keyframes certSlide {
  0% { transform: translateY(40px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.cert-header {
  font-size: 28px;
  font-weight: 900;
  color: #854d0e;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.cert-title-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  padding: 6px 20px;
  border-radius: 30px;
  display: inline-block;
  margin-bottom: 16px;
  border: 2px solid #fef08a;
}

.cert-score-wrap {
  font-size: 18px;
  color: #713f12;
  font-weight: bold;
  margin-bottom: 14px;
}

.cert-score-wrap span {
  font-size: 32px;
  color: #dc2626;
  font-weight: 900;
}

.cert-desc {
  font-size: 15px;
  color: #451a03;
  line-height: 1.6;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
  border-radius: 10px;
}

/* 失败检讨书 */
.defeat-notice-card {
  background: #fdf2f8;
  border: 8px solid #991b1b;
  border-radius: 20px;
  padding: 30px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  text-align: center;
  position: relative;
}

.defeat-stamp {
  position: absolute;
  top: 15px;
  right: 20px;
  border: 4px solid #dc2626;
  color: #dc2626;
  font-size: 20px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 8px;
  transform: rotate(18deg);
  letter-spacing: 2px;
  opacity: 0.85;
}

.defeat-header {
  font-size: 26px;
  font-weight: 900;
  color: #991b1b;
  margin-bottom: 16px;
}

.defeat-level {
  font-size: 16px;
  font-weight: bold;
  color: #7f1d1d;
  margin-bottom: 12px;
}

.defeat-quote {
  font-size: 15px;
  color: #374151;
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  border-left: 5px solid #dc2626;
  margin-bottom: 24px;
  text-align: left;
  line-height: 1.6;
}

.defeat-teacher-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}

.defeat-teacher-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  border: 3px solid #dc2626;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.defeat-teacher-quote-text {
  flex: 1;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
}

.defeat-sub-note {
  font-size: 12px;
  color: #991b1b;
  margin-top: 6px;
  font-style: italic;
}

/* ================= 移动端与小屏自适应重排 ================= */
@media (max-width: 768px) {
  #game-stage {
    height: 98vh;
    max-height: none;
    border-radius: 12px;
    box-shadow: none;
    border: none;
  }

  .game-hud {
    height: 46px;
    padding: 0 10px;
  }

  .hud-teacher-name {
    display: none;
  }

  .title-hero-img {
    max-height: 52vh;
    border-width: 2px;
  }

  .intro-teacher-item {
    width: 54px;
  }

  .intro-teacher-pic {
    width: 48px;
    height: 60px;
    border-radius: 6px;
  }

  .intro-teacher-tag {
    font-size: 9px;
  }

  .classroom-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 8px;
    padding: 8px;
  }

  .teacher-podium-area {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding-bottom: 0;
  }

  .teacher-avatar-box {
    width: 85px;
    height: 120px;
  }

  .teacher-portrait-wrapper {
    width: 80px;
    height: 120px;
    border-width: 2px;
    border-radius: 10px;
  }

  .portrait-status-badge {
    font-size: 8px;
    padding: 2px 6px;
    bottom: 4px;
  }

  .speech-bubble {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 42px;
    width: auto;
    flex: 1;
    margin-bottom: 0;
  }

  .speech-bubble::after, .speech-bubble::before {
    display: none; /* 移动端去掉尖角提升排版紧凑感 */
  }

  .podium-stand {
    display: none;
  }

  .blackboard-area {
    padding: 12px;
    border-width: 6px;
  }

  .question-text {
    font-size: 15px;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
  }

  .option-btn {
    padding: 8px 10px;
    min-height: 44px;
  }

  .opt-text {
    font-size: 13px;
  }

  .cards-bar {
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .cards-title {
    display: none;
  }

  .cards-container {
    justify-content: space-between;
  }

  .game-card {
    flex: 1;
    padding: 6px 4px;
    gap: 4px;
    justify-content: center;
  }

  .card-desc {
    display: none;
  }

  .card-name {
    font-size: 11px;
  }
}
