/* ==================== 全局 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: #333;
}

.page-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ff9a9e 100%);
  z-index: -2;
}

.page-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.25) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,182,193,0.3) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(255,255,255,0.15) 0%, transparent 35%);
}

/* ==================== 登录页 ==================== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px 20px 50px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: 50px 40px;
  box-shadow: 0 20px 60px rgba(255, 107, 107, 0.15);
  text-align: center;
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 40px;
}

.identity-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.identity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 120px;
}

.identity-card:hover {
  transform: translateY(-4px);
  border-color: #ff6b6b;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.2);
}

.identity-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
}

.identity-avatar svg { width: 100%; height: 100%; }

.identity-name {
  font-size: 18px;
  font-weight: 600;
  color: #ff6b6b;
}

.heart-divider {
  animation: heartbeat 1.5s ease-in-out infinite;
}

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

.selected-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.selected-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ff6b6b;
}

.selected-avatar svg { width: 100%; height: 100%; }

.selected-name {
  font-size: 20px;
  font-weight: 600;
  color: #ff6b6b;
}

.password-input-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.password-input-wrap input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid rgba(255, 107, 107, 0.2);
  border-radius: 14px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  transition: border-color 0.3s;
}

.password-input-wrap input:focus {
  border-color: #ff6b6b;
}

.btn-login {
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-login:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.back-link {
  font-size: 13px;
  color: #ff6b6b;
  cursor: pointer;
  margin-top: 8px;
}

.error-msg {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.error-msg.show { opacity: 1; }

/* ==================== 顶部栏 ==================== */
.top-bar {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-title {
  font-size: 20px;
  font-weight: 700;
  color: #ff6b6b;
  flex: 1;
  text-align: center;
}

.top-back {
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
}

.top-spacer { width: 60px; }

.user-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(255, 107, 107, 0.3);
  transition: border-color 0.3s;
}

.user-avatar-btn:hover { border-color: #ff6b6b; }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ==================== 用户下拉菜单 ==================== */
.user-dropdown {
  position: fixed;
  top: 68px;
  right: 24px;
  width: 220px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 16px;
  z-index: 200;
  display: none;
  animation: dropdownIn 0.2s ease;
}

.user-dropdown.show { display: block; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-nickname { font-size: 15px; font-weight: 600; color: #333; }
.dropdown-username { font-size: 12px; color: #999; margin-top: 2px; }

.dropdown-divider { height: 1px; background: rgba(0, 0, 0, 0.06); margin: 12px 0; }

.dropdown-item {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  transition: background 0.2s;
}

.dropdown-item:hover { background: rgba(255, 107, 107, 0.08); color: #ff6b6b; }
.dropdown-item.logout-item { color: #e74c3c; }
.dropdown-item.logout-item:hover { background: rgba(231, 76, 60, 0.08); }

/* ==================== 首页 ==================== */
.home-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.home-greeting {
  text-align: center;
  margin-bottom: 40px;
}

.greeting-text {
  font-size: 22px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

.highlight { color: #ff6b6b; }

.greeting-sub {
  font-size: 14px;
  color: #888;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.game-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.3);
}

.game-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.game-name {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.game-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}

.game-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: white;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 600;
}

/* ==================== ICP备案 ==================== */
.icp-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 10px 16px;
  font-size: 12px;
  color: rgba(255, 107, 107, 0.7);
  background: transparent;
  z-index: 50;
}

.icp-footer span {
  letter-spacing: 0.5px;
}

/* ==================== 游戏页头部 ==================== */
.game-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  flex-wrap: wrap;
}

.game-back {
  font-size: 18px;
  color: #666;
  cursor: pointer;
}

.game-title {
  font-size: 18px;
  font-weight: 700;
  color: #ff6b6b;
}

.game-players {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.player-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.pos-tag {
  font-size: 11px;
  color: #999;
  background: rgba(255, 255, 255, 0.5);
  padding: 2px 6px;
  border-radius: 6px;
}

.player-vs {
  font-size: 12px;
  font-weight: 700;
  color: #ff6b6b;
}

/* ==================== 玩法说明 ==================== */
.rules-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
}

.rules-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 36px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.rules-card h3 {
  font-size: 20px;
  color: #ff6b6b;
  margin-bottom: 20px;
}

.rules-list {
  text-align: left;
  margin-bottom: 24px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.rule-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #ff6b6b;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.btn-rules-ok {
  padding: 12px 36px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-rules-ok:hover { transform: translateY(-2px); }

/* ==================== 游戏棋盘 ==================== */
.game-board-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 12px;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 56px;
  gap: 6px;
  max-width: 640px;
  width: 100%;
  position: relative;
}

.board-cell {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 56px;
}

.cell-number {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 107, 107, 0.6);
}

.cell-start .cell-number,
.cell-end .cell-number {
  font-size: 14px;
  color: #ff6b6b;
  font-weight: 700;
}

.cell-markers {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.player-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
}

.player-marker img { width: 100%; height: 100%; object-fit: cover; }

.marker-p1 { border-color: #ff6b6b; }
.marker-p2 { border-color: #4ecdc4; }

.player-marker.jumping {
  animation: jump 0.25s ease;
}

@keyframes jump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4) translateY(-6px); }
}

.board-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255, 107, 107, 0.4);
  font-weight: 700;
}

/* ==================== 骰子区 ==================== */
.dice-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 50px;
  min-height: 100px;
}

.dice-prompt {
  font-size: 16px;
  font-weight: 600;
  color: #ff6b6b;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
}

.dice-big {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 40px;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
  transition: transform 0.2s;
}

.dice-big:hover { transform: scale(1.05); }

.dice-big.spinning {
  animation: diceSpin 0.3s linear infinite;
}

@keyframes diceSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.dice-result {
  font-size: 48px;
  font-weight: 700;
  color: #ff6b6b;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s;
}

/* ==================== 特殊效果提示 ==================== */
.effect-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 400;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.effect-icon { font-size: 28px; }
.effect-text { font-size: 18px; font-weight: 600; color: #ff6b6b; }
.effect-toast.error .effect-text { color: #e74c3c; }

/* ==================== 退出按钮 ==================== */
.exit-btn {
  position: fixed;
  bottom: 36px;
  right: 16px;
  padding: 8px 16px;
  background: rgba(231, 76, 60, 0.9);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
  transition: all 0.3s;
  z-index: 100;
}

.exit-btn:hover { transform: translateY(-2px); }

/* ==================== 弹窗通用 ==================== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: popupIn 0.3s ease;
}

@keyframes popupIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

.btn-popup-cancel,
.btn-popup-confirm {
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-popup-cancel {
  background: rgba(0, 0, 0, 0.06);
  color: #666;
}

.btn-popup-confirm {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
}

/* ==================== 等待弹窗 ==================== */
.waiting-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

.waiting-title,
.ready1-title,
.start-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.waiting-sub,
.ready1-sub,
.start-sub {
  font-size: 14px;
  color: #888;
  margin-bottom: 24px;
}

.btn-waiting-leave {
  padding: 12px 28px;
  background: rgba(231, 76, 60, 0.9);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-waiting-leave:hover { transform: translateY(-2px); }

/* ==================== 开始游戏弹窗 ==================== */
.start-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.btn-start-game {
  padding: 14px 36px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-start-game:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4); }
.btn-start-game.disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.ready1-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

/* ==================== 任务弹窗 ==================== */
.task-icon { font-size: 36px; margin-bottom: 12px; }
.task-title { font-size: 18px; font-weight: 700; color: #333; margin-bottom: 12px; }
.task-content { font-size: 14px; color: #555; line-height: 1.8; padding: 12px; background: rgba(255, 255, 255, 0.5); border-radius: 12px; margin-bottom: 16px; min-height: 60px; }

.btn-task-reject {
  padding: 10px 24px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-task-done {
  padding: 10px 24px;
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.task-partner .task-content { background: rgba(255, 236, 210, 0.5); }

/* ==================== 游戏结束 ==================== */
.gameover-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 600;
}

.gameover-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: popupIn 0.4s ease;
}

.gameover-title {
  font-size: 24px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 12px;
}

.gameover-msg {
  font-size: 15px;
  color: #555;
  margin-bottom: 16px;
}

.gameover-reward {
  font-size: 16px;
  font-weight: 600;
  color: #f39c12;
  padding: 12px;
  background: rgba(243, 156, 18, 0.1);
  border-radius: 12px;
  margin-bottom: 24px;
}

.btn-gameover-exit {
  padding: 14px 36px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-gameover-exit:hover { transform: translateY(-2px); }

/* ==================== 我的设置页 ==================== */
.profile-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 20px 50px;
}

.setting-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
}

.setting-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 107, 107, 0.15);
}

.avatar-setting {
  text-align: center;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 107, 107, 0.2);
  position: relative;
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 12px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.avatar-overlay:hover { background: rgba(0, 0, 0, 0.7); }

.nickname-row {
  display: flex;
  gap: 10px;
}

.nickname-row input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgba(255, 107, 107, 0.2);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
  transition: border-color 0.3s;
}

.nickname-row input:focus { border-color: #ff6b6b; }

.btn-save {
  padding: 12px 20px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.hint-text {
  font-size: 12px;
  margin-top: 6px;
  color: #4ecdc4;
}

.bg-preview-wrap {
  text-align: center;
}

.bg-preview {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.bg-preview img { width: 100%; height: 100%; object-fit: cover; }

.btn-upload-bg {
  padding: 10px 24px;
  background: linear-gradient(135deg, #a18cd1, #fbc2eb);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.password-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.password-row input {
  padding: 12px 16px;
  border: 2px solid rgba(255, 107, 107, 0.2);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
}

.password-row input:focus { border-color: #ff6b6b; }

/* ==================== 游戏配置页 ==================== */
.admin-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 20px 50px;
}

.admin-notice {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-controls select {
  padding: 10px 16px;
  border: 2px solid rgba(255, 107, 107, 0.2);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
}

.admin-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-admin-save,
.btn-admin-reset {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-save { background: #4ecdc4; color: white; }
.btn-admin-reset { background: rgba(0, 0, 0, 0.06); color: #666; }
.btn-admin-save:hover { transform: translateY(-1px); }

.admin-board-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
}

.admin-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 60px;
  gap: 6px;
  max-width: 640px;
  margin: 0 auto;
}

.admin-cell {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  padding: 4px;
}

.admin-cell:hover {
  border-color: #ff6b6b;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.admin-cell .cell-number {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 107, 107, 0.6);
}

.admin-cell .cell-preview {
  font-size: 9px;
  color: #888;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.admin-cell.cell-special {
  border-color: rgba(78, 205, 196, 0.5);
  background: rgba(78, 205, 196, 0.08);
}

.admin-cell.cell-task-filled {
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.05);
}

.cell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
}

/* ==================== 配置弹窗 ==================== */
.config-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
}

.config-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 28px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.config-title {
  font-size: 18px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 16px;
  text-align: center;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.config-row label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.config-row select,
.config-row textarea {
  padding: 10px 12px;
  border: 2px solid rgba(255, 107, 107, 0.2);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
  resize: vertical;
}

.config-row select:focus,
.config-row textarea:focus { border-color: #ff6b6b; }

.config-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-config-save,
.btn-config-cancel {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-config-save { background: linear-gradient(135deg, #ff6b6b, #ee5a5a); color: white; }
.btn-config-cancel { background: rgba(0, 0, 0, 0.06); color: #666; }

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
  .game-board { grid-auto-rows: 44px; gap: 4px; }
  .board-cell { min-height: 44px; border-radius: 8px; }
  .cell-number { font-size: 9px; }
  .player-marker { width: 18px; height: 18px; }
  .game-header { padding: 8px 12px; gap: 8px; }
  .game-title { font-size: 15px; }
  .player-info { font-size: 11px; }
  .player-mini-avatar { width: 22px; height: 22px; }
  .pos-tag { display: none; }
  .admin-board { grid-auto-rows: 48px; }
  .login-card { padding: 36px 24px; }
  .identity-cards { gap: 12px; }
  .identity-card { padding: 16px 12px; min-width: 90px; }
  .identity-avatar { width: 56px; height: 56px; }
  .home-greeting { margin-bottom: 24px; }
  .greeting-text { font-size: 18px; }
}
