/* ==========================================================================
   CHRONO BREACH // 时空裂隙：环带方舟 — Base Tokens, Reset & Shared Components
   Author: 星星恐龙
   ========================================================================== */

:root {
  --gold: #e4bc70;
  --amber: #e4bc70;
  --gold-bright: #f6d58e;
  --gold-soft: rgba(228, 188, 112, 0.18);
  --cyan: #5ee4ff;
  --cyan-soft: rgba(94, 228, 255, 0.18);
  --crimson: #ff4757;
  --ivory: #f3f5f8;
  --muted: rgba(235, 240, 248, 0.64);
  --obsidian: rgba(10, 13, 19, 0.86);
  --obsidian-hud: rgba(9, 12, 18, 0.56);
  --border-subtle: rgba(255, 255, 255, 0.14);
  --accent: var(--gold);
  --accent-soft: var(--gold-soft);
  --accent-border: rgba(228, 188, 112, 0.42);
  --font-ui: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Inter', system-ui, -apple-system, sans-serif;
  --font-cond: 'Barlow Condensed', 'Bahnschrift', 'PingFang SC', 'Microsoft YaHei', 'Arial Narrow', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;
  --hud-shadow: 0 1px 3px rgba(0, 0, 0, 0.92), 0 0 1px rgba(0, 0, 0, 0.95);
}

body[data-timeline="present"] {
  --accent: var(--cyan);
  --accent-soft: var(--cyan-soft);
  --accent-border: rgba(94, 228, 255, 0.46);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070b;
  color: var(--ivory);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* HUD Root Layer */
.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: none;
}

.hud-layer.visible {
  display: block;
}

/* Shared StarDino / Author Seal & Emblem */
.stardino-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.stardino-icon.large {
  width: 32px;
  height: 32px;
}

.stardino-icon .dino-shape {
  fill: var(--gold);
}

.stardino-icon .dino-star {
  fill: var(--cyan);
}

.author-seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(243, 245, 248, 0.78);
}

.author-seal strong {
  color: var(--gold-bright);
  font-weight: 700;
}

/* Shared Chamfered Tactical Buttons & Inputs */
.btn-primary,
.btn-secondary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 12px 24px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, #ecc579 0%, #cfa04b 100%);
  color: #0b0d12;
  border: none;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: 0 6px 20px rgba(228, 188, 112, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f8d892 0%, #dfb25d 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(228, 188, 112, 0.34);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ivory);
  border: 1px solid rgba(255, 255, 255, 0.18);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.btn-secondary:hover {
  border-color: var(--gold);
  background: rgba(228, 188, 112, 0.12);
  color: #ffffff;
}

select {
  background: rgba(12, 16, 23, 0.94);
  color: var(--ivory);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 11px;
  font-family: var(--font-ui);
  font-size: 12px;
  outline: none;
  transition: border-color 0.14s ease;
}

select:focus,
select:hover {
  border-color: var(--gold);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(228, 188, 112, 0.12);
  border: 1px solid rgba(228, 188, 112, 0.38);
  margin-right: 4px;
}

/* Studio & FPS Telemetry Overlays */
.studio-overlay {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 6px 12px;
  background: rgba(8, 10, 15, 0.78);
  border-left: 2px solid var(--gold);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: rgba(246, 245, 242, 0.90);
  pointer-events: none;
}

.fps-overlay {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 35;
  padding: 7px 11px;
  background: rgba(8, 10, 15, 0.80);
  border-left: 2px solid var(--gold);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.45;
  color: rgba(246, 245, 242, 0.92);
  pointer-events: none;
  white-space: pre;
}

.rec-indicator {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 42;
  padding: 5px 11px;
  background: rgba(18, 8, 12, 0.86);
  border: 1px solid rgba(255, 71, 87, 0.72);
  border-left: 3px solid #ff4757;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffccd2;
  pointer-events: none;
}

body.has-fps-overlay .rec-indicator {
  top: 96px;
}
