/* Title Bar */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  height: 48px;
  min-height: calc(48px + env(safe-area-inset-top));
  z-index: 10;
}

.title-bar h1 {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(14px, 2.5vw, 20px);
  font-weight: 700;
  background: linear-gradient(90deg, #48dbfb, #9b59b6, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-bar .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.title-bar .actions button {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s;
}

.title-bar .actions button:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

#switchCameraBtn,
#leaderboardBtn {
  font-size: 16px;
  padding: 6px 10px;
}

/* Tracking Status */
.tracking-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #889;
  margin-right: 8px;
}

.tracking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  transition: background 0.3s;
}

.tracking-dot.active { background: #48dbfb; box-shadow: 0 0 8px #48dbfb; }
.tracking-dot.warning { background: #9b59b6; box-shadow: 0 0 8px #9b59b6; }
.tracking-dot.error { background: #f44336; box-shadow: 0 0 6px #f44336; }

/* Collection Bar */
.collection-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  height: 64px;
  min-height: calc(64px + env(safe-area-inset-top));
  z-index: 10;
}

.collection-label {
  font-size: 13px;
  font-weight: 600;
  color: #8899aa;
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.collection-slot {
  flex: 1;
  min-width: 0;
  max-width: 44px;
  aspect-ratio: 1;
  height: auto;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #556;
  transition: all 0.3s ease;
  overflow: hidden;
  flex-shrink: 1;
}

.collection-slot.filled {
  border-color: #48dbfb;
  box-shadow: 0 0 12px rgba(72, 219, 251, 0.4);
}

.collection-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  height: clamp(36px, 5vh, 48px);
  min-height: calc(clamp(36px, 5vh, 48px) + env(safe-area-inset-bottom));
  z-index: 10;
}

.status-text {
  font-size: clamp(13px, 2.5vw, 16px);
  color: #aabbcc;
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 28px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 700;
  max-width: min(80vw, 480px);
  text-align: center;
  z-index: 4000; /* V12.3.1: 高于不透明覆盖视图(.view 2500)与胜利浮层(3000)——V12 后视图不透明，2000 会被盖住导致登录提示等不可见 */
  pointer-events: none;
  animation: toast-in 0.3s ease-out;
}

.toast.success {
  background: rgba(72, 219, 251, 0.95);
  color: #1a1a2e;
  box-shadow: 0 0 20px rgba(72, 219, 251, 0.5);
}

.toast.fail {
  background: rgba(255, 107, 107, 0.95);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

.toast.info {
  background: rgba(155, 89, 182, 0.95);
  color: #fff;
  box-shadow: 0 0 20px rgba(155, 89, 182, 0.4);
}

/* V12.3.1: error 别名——views 曾用 'error' 类型但无对应样式（无背景不可见），统一归到 fail 观感 */
.toast.error {
  background: rgba(255, 107, 107, 0.95);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

.toast.fade-out {
  animation: toast-out 0.4s ease-in forwards;
}

/* Victory Overlay */
.victory-overlay {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  animation: victory-bg 0.5s ease-out;
}

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

.victory-text {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  background: linear-gradient(90deg, #48dbfb, #9b59b6, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: victory-bounce 0.6s ease-out;
}

.victory-sub {
  margin-top: 16px;
  font-size: 18px;
  color: #aabbcc;
}

/* Face Preview Overlay */
.face-preview-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  animation: fadeIn 0.2s ease;
}

.face-preview-overlay.active {
  display: flex;
}

.face-preview-img {
  width: min(60vw, 200px);
  height: min(60vw, 200px);
  max-width: 200px;
  max-height: 200px;
  border-radius: 50%;
  border: 4px solid #48dbfb;
  box-shadow: 0 0 40px rgba(72, 219, 251, 0.6);
  object-fit: cover;
}

.face-preview-label {
  font-size: 18px;
  color: #ccc;
  font-weight: 600;
}

.face-preview-hint {
  font-size: 13px;
  color: #666;
}

/* Hit Flash Effect - Ghost version */
.hit-flash {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: flash-expand 0.6s ease-out forwards;
  z-index: 15;
}

.ghost-flash {
  background: radial-gradient(circle, rgba(72,219,251,0.9) 0%, rgba(155,89,182,0.4) 50%, rgba(72,219,251,0) 70%);
  box-shadow: 0 0 30px rgba(72, 219, 251, 0.5);
}

/* Camera Error */
.camera-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff6b6b;
  font-size: 16px;
  text-align: center;
  z-index: 20;
  display: none;
}

/* ===== V8 W2: HUD / 结算视图 / 排行榜视图 ===== */

/* V12.2.1: 变焦±按钮（游戏区右缘竖排；仅设备支持 zoom 时显示，显隐由 camera.js 切换） */
.zoom-controls {
  position: absolute;
  right: 10px;
  top: 35%;
  transform: translateY(-50%);
  /* V12.4: 软件变焦不依赖设备能力，按钮常显 */
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 30;
}

.zoom-controls button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: none;        /* 防触发页面手势 */
  user-select: none;
  -webkit-user-select: none;
}

.zoom-controls button:active {
  transform: scale(0.92);
  background: rgba(72, 219, 251, 0.35);
}

/* 顶栏 HUD（剩余时间 + 捕获数） */
.hud {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.hud #hudTime { color: #feca57; min-width: 44px; text-align: right; }
.hud #hudCount { color: #48dbfb; }
.hud-sep { opacity: 0.4; }

/* 宝可梦盒：计数制 + 可滚动缩略图列表 */
.collection-count {
  font-size: 15px;
  font-weight: 800;
  color: #48dbfb;
  margin-right: 6px;
  flex-shrink: 0;
}

.collection-thumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: thin;
}

.collection-thumb {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(72, 219, 251, 0.5);
  overflow: hidden;
  cursor: pointer;
}

.collection-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 全屏覆盖视图（登录 / 说明 / 排行榜；V12: 背景不透明） */
.view {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #0f0f23;
  z-index: 2500;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.view.active { display: flex; }

.view-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  background: rgba(20, 28, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.view-panel h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(20px, 4.5vw, 26px);
  background: linear-gradient(90deg, #48dbfb, #9b59b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* V14: 签到后首次进入说明页的顶部横幅 */
.intro-next-banner {
  display: none;
  text-align: center;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(72, 219, 251, 0.18), rgba(155, 89, 182, 0.18));
  border: 1px solid rgba(72, 219, 251, 0.45);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #48dbfb;
}

.intro-next-banner.show { display: block; }

/* V14/V14.1: 倒数数字——面板内、横幅正下方（流式布局居中，非屏幕底部浮层）；
心跳抖动：双脉冲放大 + 轻微抖动位移 */
.intro-countdown {
  display: none;
  text-align: center;
  font-size: clamp(44px, 11vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 0 24px rgba(72, 219, 251, 0.5);
  background: linear-gradient(180deg, #48dbfb, #9b59b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heartbeat-shake 0.9s ease-in-out infinite;
  pointer-events: none;
}

.intro-countdown.show { display: block; }

/* V14: 排行榜返回按钮（独立一行，强调样式同'进入游戏'） */
.form-actions button#lbBackBtn {
  background: linear-gradient(90deg, #48dbfb, #48a9fb);
  border-color: transparent;
  color: #04121e;
  font-weight: 800;
}

/* 入口页玩法介绍 */
.entry-desc {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: #aabbcc;
}

/* 表单 */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 15px;
}

.form-row input:focus {
  outline: none;
  border-color: #48dbfb;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-actions button {
  flex: 1;
  padding: 11px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.form-actions button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.form-actions button#enterGameBtn {
  background: linear-gradient(90deg, #48dbfb, #48a9fb);
  border-color: transparent;
  color: #04121e;
}

.form-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* V8.2: 引擎加载中——门禁按钮置灰（不用 disabled，保留点击提示）
   V15: 放宽选择器覆盖登录按钮（登录与进入游戏共用同一门禁形态） */
.form-actions button.engine-loading {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  opacity: 0.6;
  cursor: not-allowed;
}

.form-actions button.engine-loading:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

/* 说明页登录信息回显（V12：直接展示姓名与学号，无需输入） */
.player-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 15px;
  font-weight: 600;
}

.player-info .player-id {
  color: #48dbfb;
}

/* 排行榜列表 */
/* V12.3: 分页信息（第 x / y 页；原"共 X 位玩家"一并移除） */
.lb-page-info {
  text-align: center;
  font-size: 13px;
  color: #8899aa;
  min-height: 16px;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  flex-wrap: wrap;        /* V12.3: 头像条换行到第二行整行展示 */
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  /* V12.5: 行可点击，弹出玩家详情 */
  cursor: pointer;
  transition: background 0.15s;
}

.lb-row:active {
  background: rgba(72, 219, 251, 0.15);
}

.lb-row.lb-empty {
  justify-content: center;
  color: #8899aa;
  font-size: 13px;
  cursor: default;   /* 空榜占位行不可点 */
}

.lb-rank {
  flex-shrink: 0;
  min-width: 34px;
  font-weight: 900;
  color: #feca57;
}

/* V13: 玩家签到头像（行内圆形；未上传/加载失败回退幽灵球占位图） */
.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(72, 219, 251, 0.45);
  background: rgba(72, 219, 251, 0.08);
}

.lb-avatar.avatar-missing {
  border-style: dashed;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 82, 82, 0.45) 0 32%, transparent 33%),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.35) 0 32%, transparent 33%);
}

.lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #dde5ee;
}

.lb-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: #8899aa;
}

/* V11: 宝可梦盒头像条（排行榜行内，独立接口懒加载） */
.lb-thumbs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  /* V12.3: 换行后整行展示；V13: 缩进与姓名对齐（排名 34 + gap 10 + 头像 36 + gap 10）。
     basis 用 calc 扣除缩进，margin + basis 精确占满容器，不再横向溢出出拖动条 */
  flex-basis: calc(100% - 90px);
  max-width: none;
  overflow-x: visible;
  flex-wrap: wrap;   /* 极窄屏兑底：球条放不下时换行，绝不横向溢出 */
  margin-left: 90px;
  box-sizing: border-box;
}

.lb-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(72, 219, 251, 0.35);
  background: rgba(72, 219, 251, 0.08);
  cursor: pointer;   /* V14.3: 点击放大预览 */
}

/* 加载失败兑底：幽灵球风格占位 */
.lb-thumb.thumb-missing {
  border: 1px dashed rgba(72, 219, 251, 0.5);
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 82, 82, 0.45) 0 32%, transparent 33%),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.35) 0 32%, transparent 33%);
}

/* ===== V12.5: 玩家详情浮层（环形宝可梦图） ===== */

/* 层级：排行榜 .view(2500) 之上、victory(3000) 之下 */
.player-detail-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  z-index: 2600;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.player-detail-overlay.active { display: flex; }

.player-detail-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  background: rgba(20, 28, 40, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* V13: 顶部玩家名称已移除（与 ✕ 重叠且中心徽章已有姓名），信息条为首行 */

/* 信息条：排名 / 分数 / 捕捉数 / 用时 */
.player-detail-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pd-stat {
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
  color: #dde5ee;
  white-space: nowrap;
}

.pd-stat.pd-rank {
  color: #feca57;
  border-color: rgba(254, 202, 87, 0.4);
  font-weight: 800;
}

/* 环形舞台：正方形，球/线/中心全部用百分比定位等比缩放 */
.player-detail-stage {
  position: relative;
  width: min(320px, 76vw);
  aspect-ratio: 1;
  flex-shrink: 0;
}

/* 实线连接层：SVG 铺满舞台，线从中心到每个球心 */
.pd-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pd-lines line {
  stroke: rgba(72, 219, 251, 0.55);  /* 实线 */
  stroke-width: 1;
}

/* 中心玩家徽章：人像占位图 + 姓名框进圆形，直径 40% */
.pd-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid #48dbfb;
  box-shadow: 0 0 24px rgba(72, 219, 251, 0.45);
  background: rgba(10, 18, 30, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4%;
  overflow: hidden;
  z-index: 2;   /* 盖住汇聚到中心的线头 */
}

/* 人像：幽灵球风格占位（无签到头像）；V13 有真实头像时渲染 img（solid 边框 + cover 裁剪） */
.pd-center-avatar {
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed rgba(72, 219, 251, 0.5);
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 82, 82, 0.45) 0 32%, transparent 33%),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.35) 0 32%, transparent 33%);
  flex-shrink: 0;
}

.pd-center-avatar.pd-avatar-real {
  border-style: solid;
  border-color: rgba(72, 219, 251, 0.65);
  object-fit: cover;
}

.pd-center-name {
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
  color: #dde5ee;
  text-align: center;
}

/* 宝可梦球：直径 21%（远大于排行榜行内 30px 小图），圆形裁剪 */
.pd-ball {
  position: absolute;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(72, 219, 251, 0.65);
  background: rgba(72, 219, 251, 0.08);
  z-index: 1;
  box-shadow: 0 0 12px rgba(72, 219, 251, 0.3);
  cursor: pointer;   /* V14.3: 点击放大预览 */
}

/* 加载失败兑底：与排行榜行内 thumb-missing 同视觉语言 */
.pd-ball.thumb-missing {
  border: 2px dashed rgba(72, 219, 251, 0.5);
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 82, 82, 0.45) 0 32%, transparent 33%),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.35) 0 32%, transparent 33%);
}

/* 无球玩家空态 */
.pd-empty {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #8899aa;
  white-space: nowrap;
}

/* ===== V13: 视频签到模式（复用游戏画面，隐藏全部游戏 UI） ===== */

/* 签到覆盖层默认隐藏，gameScreen.checkin-mode 时显示 */
.checkin-banner {
  display: none;
}

#gameScreen.checkin-mode .title-bar,
#gameScreen.checkin-mode .collection-bar,
#gameScreen.checkin-mode .status-bar,
#gameScreen.checkin-mode #threeCanvas,
#gameScreen.checkin-mode .zoom-controls {
  display: none;
}

#gameScreen.checkin-mode .checkin-banner {
  display: flex;
}

.checkin-banner {
  position: absolute;
  inset: 0;
  z-index: 20;   /* 盖住 videoCanvas/overlay(5)，低于 view(2500) */
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;   /* 不挡摄像头画面；按钮单独开启 */
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.checkin-title {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(72, 219, 251, 0.6);
  background: linear-gradient(90deg, #48dbfb, #9b59b6, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.checkin-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 92vw;
  text-align: center;
}

.checkin-status {
  padding: 6px 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(72, 219, 251, 0.35);
  font-size: 14px;
  font-weight: 600;
  color: #48dbfb;
}

.checkin-status.checkin-found {
  color: #5eff9d;
  border-color: rgba(94, 255, 157, 0.45);
}

.checkin-confirm {
  display: none;
  pointer-events: auto;
  padding: 12px 36px;
  border-radius: 26px;
  border: none;
  background: linear-gradient(90deg, #48dbfb, #5eff9d);
  color: #062033;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(72, 219, 251, 0.5);
  animation: pulse 1.2s ease infinite;
}

.checkin-confirm.show { display: block; }

.checkin-hint {
  font-size: 13px;
  color: rgba(221, 229, 238, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 关闭按钮 */
.player-detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.player-detail-close:hover {
  background: rgba(255, 107, 107, 0.35);
  color: #fff;
}

/* ===== V16: 摄像头错误内联诊断 + 环境引导覆盖层 ===== */

/* 错误条内联诊断小字（真机截图取证用：环境标签 + 错误名 + 能力探测结果） */
.camera-error-detail {
  margin-top: 8px;
  font-size: 11px;
  color: #9aa5b1;
  word-break: break-all;
}

/* 错误条重试按钮（用户手势入口：微信内静默拒绝场景靠它救回） */
.camera-retry-btn {
  padding: 8px 26px;
  border-radius: 20px;
  border: 1px solid #ff6b6b;
  background: transparent;
  color: #ff6b6b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.camera-retry-btn:active {
  background: rgba(255, 107, 107, 0.15);
}

/* V16.1: 错误条复制链接按钮——摄像头不可用时的第二条出路（与重试并排） */
.camera-error-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.camera-copy-btn {
  padding: 8px 22px;
  border-radius: 20px;
  border: 1px solid #48dbfb;
  background: transparent;
  color: #48dbfb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.camera-copy-btn:active {
  background: rgba(72, 219, 251, 0.15);
}

/* V16.2: 登录页复制链接按钮（登录按钮下方；样式与错误条复制按钮同风格） */
.entry-copy-btn {
  background: transparent !important;
  border: 1px solid #48dbfb;
  color: #48dbfb;
}

.entry-copy-btn:active {
  background: rgba(72, 219, 251, 0.15);
}

/* 环境引导覆盖层（微信内置浏览器摄像头不可用 → Safari 跳出指引；不阻断可关闭） */
.env-guide-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  z-index: 2700;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.env-guide-overlay.active { display: flex; }

.env-guide-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  background: rgba(20, 28, 40, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.env-guide-panel h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 4vw, 24px);
  background: linear-gradient(90deg, #48dbfb, #9b59b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.env-guide-desc {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: #ccc;
}

.env-guide-step {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(72, 219, 251, 0.45);
  background: rgba(72, 219, 251, 0.08);
  color: #48dbfb;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.env-guide-actions {
  display: flex;
  /* V16.2: 纵向排列——重试在上，复制链接用浏览器打开在下 */
  flex-direction: column;
  gap: 10px;
}

.env-guide-actions button {
  flex: 1;
  padding: 11px 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(90deg, #48dbfb, #48a9fb);
  color: #04121e;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.env-guide-actions button#envGuideRetryBtn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ccc;
  font-weight: 600;
}

.env-guide-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: #9aa5b1;
  text-align: center;
}

.env-guide-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.env-guide-close:hover {
  background: rgba(255, 107, 107, 0.35);
  color: #fff;
}
