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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #000;
  color: #333;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* ========== 地图区域 ========== */
.map-area {
  flex: 1;
  position: relative;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 录制状态覆盖层 */
.recording-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}

.recording-badge {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.recording-badge.show {
  display: flex;
}

.recording-dot {
  width: 8px;
  height: 8px;
  background: #ff4d4f;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.stats-chip {
  display: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.stats-chip.show {
  display: block;
}

/* ========== 底部按钮栏 ========== */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  padding: 12px 24px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 1001;
  flex-shrink: 0;
}

.bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 16px;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bar-btn:active {
  transform: scale(0.92);
}

.bar-btn .btn-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

/* 录制按钮 - 红色圆形 */
#recordBtn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  gap: 0;
  background: #fff5f5;
}

#recordBtn .btn-label {
  font-size: 11px;
  margin-top: 2px;
  color: #ff4d4f;
}

#recordBtn svg {
  width: 36px;
  height: 36px;
}

#recordBtn.recording {
  background: #fff5f5;
}

/* 暂停状态 - 黄色 */
#recordBtn.paused {
  background: #fffbe6;
}

#recordBtn.paused svg rect {
  fill: #faad14;
}

#recordBtn.paused .btn-label {
  color: #faad14;
}

/* 骰子按钮 - 紫色圆形 */
#diceBtn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  gap: 0;
}

#diceBtn .btn-label {
  color: #667eea;
}

/* 更多按钮 */
#moreBtn .btn-label {
  color: #333;
}

/* ========== 更多菜单 ========== */
.more-menu {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1002;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.more-menu.show {
  transform: translateY(0);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 15px;
  color: #333;
}

.menu-item:active {
  background: #f5f5f5;
}

.menu-cancel {
  border-top: 1px solid #eee;
  color: #666;
}

.menu-cancel:active {
  background: #f0f0f0;
  color: #333;
}

.menu-item svg {
  flex-shrink: 0;
}

.menu-backdrop {
  display: none;
}

/* ========== 弹窗 ========== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  width: 280px;
  z-index: 1;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    transform: scale(0.85) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-content .dice-emoji {
  font-size: 56px;
  margin-bottom: 16px;
  animation: diceRoll 0.4s ease;
}

@keyframes diceRoll {
  0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.dice-direction {
  font-size: 26px;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 24px;
  min-height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-confirm {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal-confirm:active {
  opacity: 0.8;
}

/* ========== 分享弹窗 ========== */
.modal-content.share-content {
  width: 90%;
  max-width: 420px;
  padding: 24px 20px;
}

.modal-content.share-content h3 {
  text-align: center;
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #333;
}

.modal-content.share-content .share-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.modal-content.share-content .share-close:active {
  color: #333;
}

.modal-content.share-content .share-image-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.modal-content.share-content #shareCanvas {
  width: 100%;
  height: auto;
  display: block;
}

.modal-content.share-content .share-save-hint {
  text-align: center;
  color: #999;
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ========== Leaflet 覆盖 ========== */
.leaflet-control-attribution {
  display: none !important;
}
