/* ========================================
   织网 (WebWeave) - 2.5D关卡地图样式
   ======================================== */

/* === 地图容器 === */
.level-map-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.map-header {
  text-align: center;
  padding: 20px 0;
}

.map-header h2 {
  font-size: 2rem;
  margin: 0;
}

/* === 羊皮纸地图背景 === */
.parchment-map {
  flex: 1;
  position: relative;
  background: 
    linear-gradient(135deg, #f5e3b8 0%, #e6d3a7 50%, #d4c4a0 100%),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L100 0 L100 100 L0 100 Z' fill='none' stroke='%238B4513' stroke-width='0.5' opacity='0.1'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  border: 15px solid #8B4513;
  border-radius: var(--radius-lg);
  box-shadow: 
    inset 0 0 50px rgba(139, 69, 19, 0.3),
    0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

/* 羊皮纸边缘装饰 */
.parchment-map::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(139, 69, 19, 0.3) 50%, 
    transparent 70%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 1;
}

/* 烧焦效果 */
.parchment-map::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: 
    radial-gradient(ellipse at top left, rgba(139, 69, 19, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 69, 19, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* === SVG地图 === */
.level-map-svg {
  position: relative;
  z-index: 2;
  cursor: grab;
}

.level-map-svg:active {
  cursor: grabbing;
}

/* === 关卡路径 === */
.level-path {
  transition: all 0.3s ease-out;
}

.level-path.completed {
  stroke: url(#gold-gradient);
  stroke-width: 10;
  filter: url(#level-glow);
}

.level-path.in_progress {
  stroke: #FFD700;
  stroke-width: 8;
  filter: url(#level-glow);
}

.level-path.unlocked {
  stroke: #B8860B;
  stroke-width: 6;
}

.level-path.locked {
  stroke: #666;
  stroke-width: 4;
  opacity: 0.3;
}

/* === 关卡节点 === */
.level-node {
  transition: transform 0.3s ease-out;
}

.level-node:hover {
  filter: url(#level-glow) !important;
}

/* === 当前关卡信息面板 === */
.current-level-panel {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 350px;
  max-height: 80vh;
  background: linear-gradient(to bottom, #f5e3b8, #e6d3a7);
  border: 3px solid var(--sacred-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--holy-glow-medium), var(--shadow-elevated);
  z-index: var(--z-modal);
  overflow-y: auto;
}

.level-detail-scroll {
  padding: 30px;
  color: #5D4037;
}

.level-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--sacred-gold);
}

.level-detail-header h3 {
  margin: 0;
  color: var(--sacred-gold);
  font-family: var(--font-display);
}

.level-status-badge {
  padding: 6px 15px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
}

.level-status-badge.completed {
  background: var(--success-green);
  color: var(--holy-white);
}

.level-status-badge.in_progress {
  background: var(--level-in-progress);
  color: var(--holy-black);
}

.level-status-badge.unlocked {
  background: var(--level-unlocked);
  color: var(--holy-white);
}

.level-status-badge.locked {
  background: var(--level-locked);
  color: var(--holy-white);
}

.level-detail-content {
  margin-bottom: 20px;
}

.narrative-section {
  padding: 15px;
  background: rgba(139, 69, 19, 0.1);
  border-left: 4px solid var(--sacred-gold);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.progress-section {
  margin-bottom: 20px;
}

.rewards-section {
  padding: 15px;
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid var(--divine-gold);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.level-detail-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* === 地图控制面板 === */
.map-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  background: linear-gradient(145deg, rgba(10, 10, 10, 0.9), rgba(26, 26, 46, 0.8));
  border: 2px solid var(--sacred-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--holy-glow-soft);
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .current-level-panel {
    position: fixed;
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
    width: auto;
    transform: none;
    max-height: 50vh;
  }
  
  .parchment-map {
    min-height: 500px;
  }
}
