/* ============================================
   大富翁：奇幻冒险版图 — 全局样式
   ============================================ */

/* --- 重置与基础 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --board-size: min(80vh, 80vw);
  --cell-size: calc(var(--board-size) / 16);
  --gold-color: #ffd700;
  --fire-color: #e74c3c;
  --nature-color: #27ae60;
  --sky-color: #3498db;
  --water-color: #00bcd4;
  --earth-color: #795548;
  --dark-color: #9b59b6;
  --element-color: #f1c40f;
  --lucky-color: #e67e22;
  --bg-dark: #1a1a2e;
  --bg-medium: #16213e;
  --bg-light: #0f3460;
  --text-light: #e0e0e0;
  --text-highlight: #ffd700;
  --panel-bg: rgba(15, 52, 96, 0.92);
  --border-glow: rgba(255, 215, 0, 0.3);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
}

body {
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(15, 52, 96, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(100, 50, 150, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 100, 150, 0.3) 0%, transparent 50%),
    var(--bg-dark);
}

/* --- 主容器 --- */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ============================================
   顶部玩家面板
   ============================================ */
#player-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
  flex-shrink: 0;
  z-index: 10;
  align-items: center;
  position: relative;
}

/* 游戏说明链接 */
#top-buttons {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

#top-buttons a {
  display: inline-block;
  color: var(--text-highlight);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-glow);
  background: rgba(255, 215, 0, 0.08);
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

#top-buttons a:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--text-highlight);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
  transform: translateY(-1px);
}

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-radius: 12px;
  background: var(--panel-bg);
  border: 2px solid transparent;
  transition: all 0.3s;
  min-width: 280px;
}

.player-card.active {
  border-color: var(--text-highlight);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  animation: player-pulse 1.5s ease-in-out infinite;
}

@keyframes player-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.7); }
}

.player-card.eliminated {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.avatar-0 { background: rgba(100, 200, 255, 0.2); }
.avatar-1 { background: rgba(200, 100, 255, 0.2); }
.avatar-2 { background: rgba(100, 255, 200, 0.2); }

.player-card .info .name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.player-card .stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.player-card .stats span {
  opacity: 0.85;
}

/* ============================================
   主游戏区域
   ============================================ */
#game-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ============================================
   棋盘区域
   ============================================ */
#board-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  min-width: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(16, var(--cell-size));
  grid-template-rows: repeat(16, var(--cell-size));
  gap: 1px;
  width: var(--board-size);
  height: var(--board-size);
  position: relative;
  z-index: 1;
}

/* --- 单个格子 --- */
.cell {
  position: relative;
  border-radius: calc(var(--cell-size) * 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
  cursor: default;
  transition: all 0.2s;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(20, 30, 60, 0.9);
  color: var(--text-light);
  padding: 0;
  line-height: 1.1;
}

.cell:hover {
  transform: scale(1.05);
  z-index: 5;
  border-color: var(--text-highlight);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.cell.highlight {
  animation: cellPulse 1s ease-in-out infinite;
  border-color: #fff !important;
}

@keyframes cellPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.7); }
}

/* --- 格子内子元素 --- */
.cell .cell-icon {
  font-size: calc(var(--cell-size) * 0.34);
  line-height: 1;
  flex-shrink: 0;
}

.cell .cell-name {
  font-size: calc(var(--cell-size) * 0.155);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 95%;
  line-height: 1.15;
  flex-shrink: 1;
}

.cell .cell-price {
  font-size: calc(var(--cell-size) * 0.12);
  color: #ffd700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 95%;
  flex-shrink: 0;
}

/* 格子颜色分组 */
.cell.group-fire { border-color: rgba(231, 76, 60, 0.6); }
.cell.group-fire .color-bar { background: var(--fire-color); }
.cell.group-nature { border-color: rgba(39, 174, 96, 0.6); }
.cell.group-nature .color-bar { background: var(--nature-color); }
.cell.group-sky { border-color: rgba(52, 152, 219, 0.6); }
.cell.group-sky .color-bar { background: var(--sky-color); }
.cell.group-water { border-color: rgba(0, 188, 212, 0.6); }
.cell.group-water .color-bar { background: var(--water-color); }
.cell.group-earth { border-color: rgba(121, 85, 72, 0.6); }
.cell.group-earth .color-bar { background: var(--earth-color); }
.cell.group-dark { border-color: rgba(155, 89, 182, 0.6); }
.cell.group-dark .color-bar { background: var(--dark-color); }
.cell.group-element { border-color: rgba(241, 196, 15, 0.6); }
.cell.group-element .color-bar { background: var(--element-color); }
.cell.group-lucky { border-color: rgba(230, 126, 34, 0.6); }
.cell.group-lucky .color-bar { background: var(--lucky-color); }

/* 格子类型样式 */
.cell.type-start {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2));
  font-size: calc(var(--cell-size) * 0.25);
}

.cell.type-chance {
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.3), rgba(255, 200, 0, 0.2));
}

.cell.type-event {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(46, 204, 113, 0.2));
}

.cell.type-jail {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.5), rgba(50, 50, 50, 0.4));
}

.cell.type-special {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(100, 50, 150, 0.2));
}

.cell.type-portal {
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.3), rgba(100, 0, 255, 0.2));
  animation: portalGlow 2s ease-in-out infinite;
}

@keyframes portalGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 200, 255, 0.3); }
  50% { box-shadow: 0 0 15px rgba(0, 200, 255, 0.7); }
}

.cell.type-inner {
  background: linear-gradient(135deg, rgba(200, 150, 50, 0.3), rgba(150, 100, 200, 0.2));
}

/* 颜色条 */
.color-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 5px 5px 0 0;
}

/* 建筑指示器 */
.building-indicator {
  position: absolute;
  bottom: 2px;
  display: flex;
  gap: 1px;
}

.building-indicator .house {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.7);
}

/* 地产所有权标记 */
.owner-marker {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.3);
}

/* 抵押标记 */
.cell.mortgaged {
  opacity: 0.6;
  filter: grayscale(0.4);
}

.cell.mortgaged::after {
  content: '抵押中';
  position: absolute;
  bottom: 12px;
  font-size: 8px;
  color: #999;
  white-space: nowrap;
}

/* --- 棋子 --- */
.token {
  position: absolute;
  width: calc(var(--cell-size) * 0.55);
  height: calc(var(--cell-size) * 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cell-size) * 0.4);
  z-index: 10;
  transition: left 0.15s ease-out, top 0.15s ease-out;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.token-0 { background: rgba(100, 200, 255, 0.9); }
.token-1 { background: rgba(200, 100, 255, 0.9); }
.token-2 { background: rgba(100, 255, 200, 0.9); }

/* --- 内圈区域 --- */
/* 内圈格子直接放在#board的16x16网格中 */
.inner-ring {
  display: none;  /* 不再使用独立容器，格子直接放board */
}

/* --- 中心区域 --- */
#center-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
  width: calc(var(--cell-size) * 6);
  max-width: calc(var(--cell-size) * 6);
}

#center-area > * { pointer-events: auto; }

/* --- 3D 骰子 --- */
#dice-area {
  display: flex;
  gap: 12px;
  perspective: 600px;
  margin-bottom: 4px;
}

.dice {
  width: 52px;
  height: 52px;
  position: relative;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
  border: 2px solid #ccc;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
  transform-origin: center center;
}

.dice.rolling {
  animation: diceShake 0.6s ease-out;
}

@keyframes diceShake {
  0%   { transform: rotate(0deg) scale(1); }
  10%  { transform: rotate(15deg) scale(1.1); }
  20%  { transform: rotate(-15deg) scale(1.1); }
  30%  { transform: rotate(10deg) scale(1.05); }
  40%  { transform: rotate(-10deg) scale(1.05); }
  50%  { transform: rotate(5deg) scale(1.02); }
  60%  { transform: rotate(-5deg) scale(1.02); }
  100% { transform: rotate(0deg) scale(1); }
}

.dice .dice-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1;
  user-select: none;
}

/* 豹子特效 */
.doubles-sparkle {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 100;
}

.sparkle-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: sparkleFloat 1.5s ease-out forwards;
}

@keyframes sparkleFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-200px) scale(0); opacity: 0; }
}

/* --- 掷骰按钮 --- */
.btn-roll {
  padding: 12px 32px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
  transition: all 0.2s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-roll:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

.btn-roll:active:not(:disabled) {
  transform: translateY(0);
}

.btn-roll:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#turn-indicator {
  font-size: 14px;
  color: var(--text-highlight);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ============================================
   侧边栏
   ============================================ */
#sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
}

.panel {
  background: var(--panel-bg);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-highlight);
  flex-shrink: 0;
}

#game-log { flex: 1.2; min-height: 0; }
#hand-panel { flex: 0.8; min-height: 0; }
#properties-panel { flex: 1; min-height: 0; }

#log-content {
  flex: 1;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  padding-right: 4px;
  min-height: 0;
}

#log-content .log-entry {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

#log-content .log-entry.system { color: #888; }
#log-content .log-entry.player { color: #5dade2; }
#log-content .log-entry.ai { color: #bb8fce; }
#log-content .log-entry.event { color: #f39c12; }
#log-content .log-entry.combat { color: #e74c3c; }
#log-content .log-entry.skip {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 14px;
  animation: skip-flash 0.6s ease-in-out 3;
}
@keyframes skip-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#hand-content, #properties-content {
  overflow-y: auto;
  font-size: 12px;
  min-height: 0;
}

.hand-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.2s;
}

.hand-item:hover {
  background: rgba(255,255,255,0.12);
}

.hand-item .item-icon { font-size: 18px; }
.hand-item .item-name { font-size: 12px; }
.hand-item .item-desc { font-size: 10px; color: #999; }

.prop-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--prop-color, #888);
}

.prop-item .prop-name { font-size: 12px; flex: 1; }
.prop-item .prop-level { font-size: 10px; color: #f39c12; }

.empty-hint {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 10px;
}

/* ============================================
   弹窗（Modal）
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.modal-content {
  background: linear-gradient(135deg, var(--bg-medium), var(--bg-dark));
  border: 2px solid var(--border-glow);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}

.modal-close:hover { color: #fff; }

.modal-content h2 {
  font-size: 20px;
  color: var(--text-highlight);
  margin-bottom: 12px;
  text-align: center;
}

.modal-content h3 {
  font-size: 16px;
  color: var(--text-highlight);
  margin: 12px 0 8px;
}

.modal-content p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--text-light);
}

.modal-content .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* --- 按钮样式 --- */
.btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 0 12px rgba(52, 152, 219, 0.5); }

.btn-success {
  background: linear-gradient(135deg, #27ae60, #229954);
  color: #fff;
}
.btn-success:hover { box-shadow: 0 0 12px rgba(39, 174, 96, 0.5); }

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}
.btn-danger:hover { box-shadow: 0 0 12px rgba(231, 76, 60, 0.5); }

.btn-warning {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
}
.btn-warning:hover { box-shadow: 0 0 12px rgba(243, 156, 18, 0.5); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- 地产卡片样式 --- */
.property-card {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  margin: 8px 0;
  border-left: 4px solid var(--prop-color, #888);
}

.property-card .prop-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.property-card .prop-price {
  color: var(--text-highlight);
  font-weight: 600;
}

.property-card .prop-lore {
  font-size: 12px;
  font-style: italic;
  color: #aaa;
  margin-top: 8px;
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
}

.property-card .prop-rent {
  font-size: 13px;
  margin-top: 4px;
}

.property-card .prop-group {
  font-size: 13px;
  color: #bbb;
  margin-top: 2px;
}

/* --- 事件卡片样式 --- */
.event-card {
  text-align: center;
  padding: 16px;
  border-radius: 10px;
  margin: 8px 0;
}

.event-card.fortune {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(46, 204, 113, 0.1));
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.event-card.misfortune {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(192, 57, 43, 0.1));
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.event-card.chance {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.2), rgba(230, 126, 34, 0.1));
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.event-card .event-icon { font-size: 40px; margin-bottom: 8px; }
.event-card .event-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.event-card .event-desc { font-size: 14px; }

/* --- 交易面板 --- */
.trade-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
}

.trade-side {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
}

.trade-side h4 {
  font-size: 14px;
  margin-bottom: 8px;
  text-align: center;
}

.trade-items {
  min-height: 40px;
  margin-bottom: 8px;
}

.trade-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  font-size: 12px;
}

.trade-item .remove-btn {
  margin-left: auto;
  background: rgba(231, 76, 60, 0.6);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.trade-gold-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.trade-gold-input input {
  width: 100px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3);
  color: var(--text-light);
  font-size: 14px;
}

/* --- 回合间事件 --- */
.inter-turn-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.inter-turn-content {
  text-align: center;
  animation: interTurnAppear 0.5s ease-out;
}

@keyframes interTurnAppear {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.inter-turn-content h2 {
  font-size: 32px;
  color: var(--text-highlight);
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  margin-bottom: 16px;
}

.inter-turn-content p {
  font-size: 18px;
  margin-bottom: 20px;
  max-width: 400px;
}

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

.game-over-content {
  text-align: center;
  animation: interTurnAppear 0.8s ease-out;
}

.game-over-content h1 {
  font-size: 36px;
  color: var(--text-highlight);
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
  margin-bottom: 20px;
}

.game-over-content #game-over-stats {
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.8;
}

/* --- 滚动条美化 --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 1200px) {
  #sidebar { width: 250px; }
  .player-card { min-width: 240px; padding: 6px 14px; }
}

@media (max-width: 960px) {
  #sidebar { display: none; }
  .player-bar { gap: 10px; }
  .player-card { min-width: 200px; }
}

/* --- 过渡与动画辅助 --- */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* --- 地牢界面 --- */
.dungeon-panel {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 16px;
  margin: 10px 0;
}

.dungeon-panel h3 {
  color: #e74c3c;
  margin-bottom: 8px;
}

.dungeon-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.dungeon-choice {
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.dungeon-choice:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--text-highlight);
}

/* --- 加载/启动界面 --- */
#loading-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  gap: 20px;
}

#loading-screen h1 {
  font-size: 36px;
  color: var(--text-highlight);
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

#loading-screen .subtitle {
  font-size: 18px;
  color: #aaa;
}

.loading-bar {
  width: 300px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f39c12, #e74c3c, #9b59b6);
  border-radius: 3px;
  animation: loadingProgress 1.5s ease-out forwards;
}

@keyframes loadingProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}
