/* yuragi — UIは存在を消す。半透明の白文字のみ。 */

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

:root {
  --fg: rgba(255, 255, 255, 0.72);
  --fg-dim: rgba(255, 255, 255, 0.36);
  --bg: #05080f;
  --ui-fade: 1200ms;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: "Zen Kaku Gothic New", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  touch-action: none;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* オーバーレイ共通 */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: var(--bg);
  transition: opacity 1600ms ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-text {
  font-size: clamp(1rem, 4.2vw, 1.35rem);
  font-weight: 300;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--fg-dim);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.72; }
}

.quiet {
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 2.1;
  text-align: center;
  letter-spacing: 0.15em;
}

/* 最小UI（下部） */
.ui {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 0 max(1.4rem, env(safe-area-inset-bottom));
  opacity: 1;
  transition: opacity var(--ui-fade) ease;
  pointer-events: none;
}

.ui.hidden {
  opacity: 0;
}

.ui-inner {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 4vw, 2.2rem);
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  pointer-events: auto;
}

.scenes {
  display: flex;
  gap: clamp(0.6rem, 3vw, 1.4rem);
}

.scene-btn,
.icon-btn {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-family: inherit;
  font-weight: 300;
  font-size: 0.86rem;
  letter-spacing: 0.22em;
  cursor: pointer;
  padding: 0.3rem 0.2rem;
  transition: color 700ms ease;
  -webkit-tap-highlight-color: transparent;
}

.scene-btn:hover,
.icon-btn:hover,
.scene-btn:focus-visible,
.icon-btn:focus-visible {
  color: var(--fg);
  outline: none;
}

.scene-btn.is-active {
  color: var(--fg);
}

.controls {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 3vw, 1.1rem);
}

.icon-btn {
  font-size: 1.05rem;
  letter-spacing: 0;
  line-height: 1;
}

.icon-btn.is-muted {
  color: var(--fg-dim);
  opacity: 0.4;
}

/* 音量スライダ（極小・控えめ） */
.volume {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(70px, 22vw, 110px);
  height: 1px;
  background: var(--fg-dim);
  outline: none;
  cursor: pointer;
}

.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg);
  border: none;
}

.volume::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg);
  border: none;
}

.hidden {
  /* 個別 .overlay.hidden / .ui.hidden で扱うため、汎用は最後 */
}

/* ホームへ戻る（控えめ・左上） */
.backlink {
  position: fixed;
  top: max(0.9rem, env(safe-area-inset-top));
  left: 1.1rem;
  z-index: 30;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 600ms ease;
}
.backlink:hover,
.backlink:focus-visible {
  color: var(--fg);
  outline: none;
}
