:root {
  --ink: #07122d;
  --blue: #0668c8;
  --orange: #ff6a00;
  --paper: #f8f5ed;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background: var(--ink);
  color: white;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  /* 中文以詞為單位換行，不在詞中間斷開 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

button, a, select { font: inherit; }

/* 天空顏色由 hero-scene.js 依台北時間與天氣更新 */
.voxel-hero {
  --sky-top: #1f74e0;
  --sky-mid: #2c80dd;
  --sky-bottom: #8fc7ff;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 72% 18%, color-mix(in srgb, var(--sky-bottom) 55%, transparent) 0, transparent 46%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 100%);
  transition: background .6s linear;
}

#voxel-canvas {
  display: block;
  height: 100svh;
  outline: none;
  position: absolute;
  inset: 0;
  width: 100%;
  cursor: grab;
  touch-action: none;
}

#voxel-canvas:active { cursor: grabbing; }
#voxel-canvas:focus-visible { box-shadow: inset 0 0 0 3px #ffb067; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scene-clock {
  position: absolute;
  top: 16px;
  left: clamp(14px, 3vw, 40px);
  z-index: 2;
  margin: 0;
  max-width: calc(100% - 28px);
  padding: 7px 12px;
  border-radius: 100px;
  background: rgba(3, 14, 40, .58);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #f3f7ff;
  font-size: 12px;
  letter-spacing: .03em;
  backdrop-filter: blur(6px);
}

.scene-hud {
  position: absolute;
  left: clamp(14px, 3vw, 40px);
  right: clamp(14px, 3vw, 40px);
  bottom: 54px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.hud-links, .hud-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-controls {
  justify-content: flex-end;
  padding: 6px;
  border-radius: 14px;
  background: rgba(3, 14, 40, .55);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
}

.hud-links a, .hud-controls button {
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 100px;
  color: white;
  cursor: pointer;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  background: rgba(4, 20, 55, .48);
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.hud-links .primary-link { background: var(--orange); border-color: var(--orange); font-weight: 750; }
.hud-controls button[aria-pressed="true"]#follow-toggle { background: #ffb067; border-color: #ffb067; color: var(--ink); }

.hud-links a:hover, .hud-links a:focus-visible,
.hud-controls button:hover, .hud-controls button:focus-visible {
  background: white;
  border-color: white;
  color: var(--ink);
  outline: none;
}

.hud-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cfe0ff;
  white-space: nowrap;
}

.hud-field select {
  min-height: 38px;
  max-width: 11em;
  padding: 6px 28px 6px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, .6);
  background: rgba(4, 20, 55, .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: white;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
}

.hud-field select:focus-visible { outline: 2px solid #ffb067; outline-offset: 2px; }
.hud-field select option, .hud-field select optgroup { color: #0b1530; background: #ffffff; }

.scene-note {
  align-items: center;
  bottom: 18px;
  color: #e3eeff;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  gap: 9px;
  letter-spacing: .08em;
  position: absolute;
  right: clamp(14px, 3vw, 40px);
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

.scene-note span { background: var(--orange); height: 1px; width: 36px; }

.scene-status {
  background: rgba(1, 11, 32, .64);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 3px;
  bottom: 14px;
  color: #ffffff;
  font-size: 11px;
  left: clamp(14px, 3vw, 40px);
  letter-spacing: .04em;
  max-width: min(520px, 60%);
  padding: 7px 10px;
  position: absolute;
  z-index: 2;
}

@media (max-width: 900px) {
  .scene-hud { bottom: 50px; }
  .hud-controls { justify-content: flex-start; }
  .scene-note { display: none; }
  .scene-status { max-width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  .voxel-hero, .hud-links a, .hud-controls button { transition: none; }
}

/* 嵌在首頁時，右側 52px 是首頁的捲動區，場景控制往內讓出位置。 */
.is-embedded .scene-hud { right: 68px; }
.is-embedded .scene-note { right: 68px; }
