/* ==========================================================================
   Pelican on a Bicycle 3D - 现代磨砂玻璃质感设计系统 (Modern Glassmorphism UI)
   ========================================================================== */

:root {
  --primary: #f59e0b;
  --primary-glow: rgba(245, 158, 11, 0.4);
  --accent: #38bdf8;
  --bg-glass: rgba(15, 23, 42, 0.65);
  --bg-glass-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-panel: 0 12px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b1120;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
}

/* 3D Canvas 视口 */
#webgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* UI 图层容器 */
.ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.interactive {
  pointer-events: auto;
}

/* 磨砂玻璃通用基底 */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

/* 顶部布局 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

/* 品牌与仪表盘 */
.dashboard-panel {
  padding: 16px 20px;
  min-width: 250px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.brand-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.metrics-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.speed-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.speed-number {
  font-size: 34px;
  font-weight: 800;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 2px 10px var(--primary-glow);
}

.speed-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
}

.gauge-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gauge-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.gauge-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.gauge-bar-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #38bdf8 0%, #f59e0b 100%);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.boost-bar-fill {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
  width: 100%;
}

/* 顶部右侧控制胶囊组 */
.top-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.control-group {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
  margin-right: 4px;
}

/* 选项按钮 */
.pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.pill-btn.active {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

/* 底部交互操作栏 */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.action-dock {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn.boost-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.action-btn.boost-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #ea580c 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.key-badge {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.boost-btn .key-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #000000;
  border-color: rgba(0, 0, 0, 0.3);
}

/* 音频控制与快捷键提示 */
.audio-panel {
  padding: 8px 12px;
  display: flex;
  gap: 8px;
}

.quick-tips {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.quick-tips span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 移动端与小屏自适应 */
@media (max-width: 900px) {
  .ui-overlay {
    padding: 12px;
  }
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .top-controls {
    align-items: flex-start;
  }
  .bottom-bar {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .action-dock {
    justify-content: center;
  }
  .quick-tips {
    display: none;
  }
}
