/* ═══════════════════════════════════════════════════════
   Cenote — CSS
   自己探求のためのインターフェース
   ═══════════════════════════════════════════════════════ */

/* ─── Reset & Base ──────────────────────────────────── */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #020308;
  color: #e0e0e8;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* ─── Canvas (Background) ──────────────────────────── */

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#protoform-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

#protoform-canvas.visible {
  opacity: 1;
}

/* ─── Trajectory Radar Canvas ──────────────────────── */

#trajectory-canvas {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 160px;
  height: 160px;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#trajectory-canvas.visible {
  opacity: 1;
}

@media (max-width: 768px) {
  #trajectory-canvas {
    width: 120px;
    height: 120px;
    bottom: 50px;
    left: 10px;
  }
}

/* ─── Intro Screen ─────────────────────────────────── */

#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(2,3,8,0.7) 0%, rgba(2,3,8,0.95) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  cursor: pointer;
}

#intro-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

#intro-screen.fading {
  opacity: 0;
  pointer-events: none;
}

.intro-title {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 100;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: rgba(200, 210, 240, 0.8);
  text-shadow: 0 0 40px rgba(100, 140, 255, 0.3);
  animation: intro-breathe 4s ease-in-out infinite;
  margin-bottom: 2rem;
}

.intro-subtitle {
  font-size: clamp(0.7rem, 2vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  color: rgba(160, 170, 200, 0.5);
  animation: intro-fade-in 3s ease-out 1s both;
}

.intro-prompt {
  position: absolute;
  bottom: 15%;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(140, 150, 180, 0.4);
  animation: intro-pulse 2s ease-in-out infinite 3s;
}

@keyframes intro-breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.02); }
}

@keyframes intro-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes intro-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.7; }
}

/* ─── Birth Input Screen ───────────────────────────── */

#birth-input-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(2,3,8,0.75) 0%, rgba(2,3,8,0.97) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

#birth-input-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.birth-title {
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 100;
  letter-spacing: 0.4em;
  color: rgba(200, 210, 240, 0.8);
  margin-bottom: 0.8rem;
}

.birth-subtitle {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(160, 170, 200, 0.45);
  margin-bottom: 3rem;
}

#birth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: min(340px, 85vw);
}

.birth-field {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.4rem;
}

.birth-field label {
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(140, 160, 220, 0.5);
}

.birth-field input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(140,160,220,0.15);
  border-radius: 8px;
  padding: 0.7em 1em;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 300;
  color: rgba(200, 210, 240, 0.9);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.birth-field input:focus {
  border-color: rgba(100, 140, 255, 0.4);
  box-shadow: 0 0 20px rgba(100, 140, 255, 0.08);
}

.birth-submit {
  margin-top: 1rem;
  background: rgba(100, 140, 255, 0.08);
  border: 1px solid rgba(100, 140, 255, 0.25);
  border-radius: 100px;
  padding: 0.7em 2.5em;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(180, 200, 240, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
}

.birth-submit:hover {
  background: rgba(100, 140, 255, 0.15);
  border-color: rgba(100, 140, 255, 0.5);
  box-shadow: 0 0 30px rgba(100, 140, 255, 0.15);
}

.birth-skip {
  margin-top: 2rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(140, 150, 180, 0.3);
  cursor: pointer;
  transition: color 0.3s ease;
}

.birth-skip:hover {
  color: rgba(140, 150, 180, 0.6);
}

/* ─── Loading Screen ───────────────────────────────── */

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(2,3,8,0.8) 0%, rgba(2,3,8,0.98) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#loading-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(100,140,255,0.3), rgba(60,80,180,0.05));
  box-shadow: 0 0 40px rgba(100,140,255,0.15), 0 0 80px rgba(100,140,255,0.05);
  animation: loading-pulse 2s ease-in-out infinite;
  margin-bottom: 2rem;
}

@keyframes loading-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.loading-text {
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  color: rgba(180, 200, 240, 0.6);
  animation: loading-fade 2.5s ease-in-out infinite;
}

.loading-sub {
  margin-top: 0.8rem;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(140, 160, 220, 0.3);
  min-height: 1.2em;
}

@keyframes loading-fade {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ─── API Config Panel ─────────────────────────────── */

#api-config {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,3,8,0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#api-config.visible {
  opacity: 1;
  pointer-events: auto;
}

.api-config-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 3rem;
  border: 1px solid rgba(140,160,220,0.1);
  border-radius: 16px;
  background: rgba(10,12,24,0.9);
  min-width: 320px;
}

.api-config-label {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(160, 170, 200, 0.6);
}

#api-key-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(140,160,220,0.15);
  border-radius: 8px;
  padding: 0.6em 1em;
  font-family: monospace;
  font-size: 0.85rem;
  color: rgba(200, 210, 240, 0.8);
  outline: none;
  transition: border-color 0.3s ease;
}

#api-key-input:focus {
  border-color: rgba(100, 140, 255, 0.4);
}

.api-config-actions {
  display: flex;
  gap: 1rem;
}

.api-config-actions button {
  background: none;
  border: 1px solid rgba(140,160,220,0.2);
  border-radius: 100px;
  padding: 0.5em 1.5em;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(180, 200, 240, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.api-config-actions button:hover {
  border-color: rgba(140,160,220,0.5);
  color: rgba(200, 220, 250, 0.9);
}

.api-config-note {
  font-size: 0.6rem;
  color: rgba(140,150,180,0.3);
  letter-spacing: 0.1em;
}

#api-config-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 250;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: rgba(140,160,220,0.55);
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  padding: 6px;
}

#api-config-toggle:hover {
  color: rgba(180,200,255,0.9);
}

/* ─── Revelation Container ─────────────────────────── */

#revelation-container {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 10vw;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  overflow-y: auto;
}

#revelation-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.revelation-section {
  max-width: 600px;
  width: 100%;
  text-align: center;
  animation: rev-appear 1s ease-out forwards;
}

.revelation-title {
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(140, 160, 220, 0.4);
  margin-bottom: 1.5rem;
}

.revelation-body {
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  font-weight: 300;
  line-height: 2.2;
  letter-spacing: 0.08em;
  color: rgba(200, 210, 240, 0.85);
}

.revelation-body .typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: rgba(100, 140, 255, 0.6);
  margin-left: 2px;
  animation: cursor-blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

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

.revelation-continue {
  margin-top: 2.5rem;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: rgba(140, 160, 220, 0.3);
  animation: rev-pulse 2s ease-in-out infinite;
  cursor: pointer;
}

@keyframes rev-appear {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rev-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.7; }
}

/* Revelation sub-elements */

.revelation-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.revelation-icon {
  font-size: 1.2rem;
  color: hsla(var(--section-hue, 200), 50%, 60%, 0.6);
}

.revelation-label-text {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(140, 160, 220, 0.4);
}

.revelation-sublabel {
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(140, 160, 220, 0.25);
}

.revelation-sub {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: hsla(var(--section-hue, 200), 40%, 60%, 0.6);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.revelation-extra {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: rgba(160, 180, 220, 0.4);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.revelation-extra.visible {
  opacity: 1;
}

.revelation-extra-icon {
  color: hsla(var(--section-hue, 200), 50%, 60%, 0.5);
  margin-right: 0.3em;
}

.revelation-section.fading-out {
  animation: rev-fade-out 0.6s ease-in forwards;
}

@keyframes rev-fade-out {
  to { opacity: 0; transform: translateY(-15px); }
}

.revelation-section.revealing {
  animation: rev-appear 1s ease-out forwards;
}

.revelation-continue.visible {
  opacity: 1;
}

/* ─── Revelation System Notes ──────────────────────── */

.revelation-system-notes {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.revelation-system-note {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: rgba(160, 180, 220, 0.45);
  display: flex;
  align-items: center;
  gap: 0.4em;
  opacity: 0;
  animation: rev-appear 0.6s ease-out forwards;
}

.system-note-icon {
  font-size: 0.8rem;
  color: hsla(var(--sys-hue, 200), 50%, 65%, 0.6);
}

.system-note-text {
  color: rgba(180, 190, 220, 0.5);
}

/* ─── Trajectory Intro (in Revelation) ─────────────── */

.trajectory-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trajectory-radar-wrap {
  width: 240px;
  height: 240px;
  margin: 1.5rem auto;
  opacity: 0;
  animation: radar-appear 1.5s ease-out 0.5s forwards;
}

.trajectory-radar-canvas {
  width: 100%;
  height: 100%;
}

.trajectory-summary {
  text-align: center;
  max-width: 400px;
  margin-top: 0.5rem;
}

@keyframes radar-appear {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Selected Keyword System Icon ─────────────────── */

.selected-keyword-sys {
  font-size: 0.7em;
  margin-right: 0.2em;
  opacity: 0.6;
  color: hsla(var(--sys-hue, 200), 50%, 70%, 0.7);
}

/* ─── Keyword Container ────────────────────────────── */

#keyword-container {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#keyword-container.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Keyword Items ────────────────────────────────── */

.keyword-item {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);

  background: none;
  border: 1px solid hsla(var(--hue, 200), 50%, 60%, 0.25);
  border-radius: 100px;
  padding: 0.6em 1.5em;

  font-family: inherit;
  font-size: clamp(0.85rem, 2.5vw, 1.2rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  color: hsla(var(--hue, 200), 60%, 75%, 0.85);
  text-shadow: 0 0 12px hsla(var(--hue, 200), 60%, 50%, 0.3);

  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4em;

  /* 登場アニメーション */
  opacity: 0;
  animation: kw-appear 0.8s ease-out var(--delay, 0s) forwards;

  transition:
    border-color 0.3s ease,
    color 0.3s ease,
    text-shadow 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

/* ─── System Badge on Keyword ──────────────────────── */

.keyword-system-badge {
  font-size: 0.65em;
  opacity: 0.5;
  color: hsla(var(--sys-hue, 200), 50%, 70%, 0.7);
  transition: opacity 0.3s ease;
}

.keyword-item:hover .keyword-system-badge {
  opacity: 1;
}

.keyword-text {
  pointer-events: none;
}

.keyword-item:hover {
  border-color: hsla(var(--hue, 200), 60%, 70%, 0.6);
  color: hsla(var(--hue, 200), 70%, 85%, 1);
  text-shadow: 0 0 20px hsla(var(--hue, 200), 70%, 60%, 0.5);
  box-shadow: 0 0 25px hsla(var(--hue, 200), 50%, 50%, 0.15);
  transform: translate(-50%, -50%) scale(1.08);
}

.keyword-item:active {
  transform: translate(-50%, -50%) scale(0.96);
}

@keyframes kw-appear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) translateZ(-50px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateZ(0);
    filter: blur(0);
  }
}

/* ─── Keyword States ───────────────────────────────── */

.keyword-item.selected {
  animation: kw-select 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes kw-select {
  0%   { transform: translate(-50%, -50%) scale(1); border-color: hsla(var(--hue), 60%, 70%, 0.8); }
  50%  { transform: translate(-50%, -50%) scale(1.3); border-color: hsla(var(--hue), 80%, 90%, 1); color: #fff; text-shadow: 0 0 30px hsla(var(--hue), 80%, 70%, 0.8); }
  100% { transform: translate(-50%, -50%) scale(1.1); border-color: hsla(var(--hue), 80%, 90%, 1); color: #fff; }
}

.keyword-item.absorbed {
  animation: kw-absorb 0.6s ease-in forwards;
  pointer-events: none;
}

@keyframes kw-absorb {
  to {
    left: 50%;
    top: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
    filter: blur(10px);
  }
}

.keyword-item.dismissed {
  animation: kw-dismiss 0.7s ease-in forwards;
  pointer-events: none;
}

@keyframes kw-dismiss {
  to {
    transform: translate(
      calc(-50% + var(--dismiss-x, 0vw)),
      calc(-50% + var(--dismiss-y, 0vh))
    );
    opacity: 0;
    filter: blur(6px);
  }
}

/* ─── Transition Overlay ───────────────────────────── */

.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.transition-overlay.fade-to-dark {
  animation: trans-fade-dark 0.8s ease-in-out;
}

@keyframes trans-fade-dark {
  0%   { background: rgba(2,3,8,0); }
  50%  { background: rgba(2,3,8,0.8); }
  100% { background: rgba(2,3,8,0); }
}

.transition-overlay.warp-flash {
  animation: trans-warp 0.6s ease-out;
}

@keyframes trans-warp {
  0%   { background: radial-gradient(ellipse at center, rgba(120,160,255,0.3) 0%, transparent 70%); }
  100% { background: radial-gradient(ellipse at center, rgba(120,160,255,0) 0%, transparent 70%); }
}

/* ─── Catharsis Phases ─────────────────────────────── */

.transition-overlay.catharsis-contract {
  animation: cat-contract 0.8s ease-in forwards;
}

@keyframes cat-contract {
  0%   { background: rgba(2,3,8,0); backdrop-filter: none; }
  100% {
    background: rgba(2,3,8,0.9);
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 200px rgba(0,0,0,0.8);
  }
}

.transition-overlay.catharsis-flash {
  animation: cat-flash 0.6s ease-out forwards;
}

@keyframes cat-flash {
  0%   { background: rgba(220,230,255,0.95); }
  30%  { background: rgba(220,230,255,0.9); filter: invert(1); }
  100% { background: rgba(2,3,8,0.7); filter: none; }
}

.transition-overlay.catharsis-expand {
  animation: cat-expand 1s ease-out forwards;
}

@keyframes cat-expand {
  0%   { background: radial-gradient(circle at center, rgba(100,140,255,0.4) 0%, rgba(2,3,8,0.9) 30%); }
  60%  { background: radial-gradient(circle at center, rgba(100,140,255,0.1) 0%, rgba(2,3,8,0.5) 60%); }
  100% { background: rgba(2,3,8,0.3); }
}

.transition-overlay.catharsis-settle {
  animation: cat-settle 0.6s ease-out forwards;
}

@keyframes cat-settle {
  from { background: rgba(2,3,8,0.3); }
  to   { background: rgba(2,3,8,0); }
}

.transition-overlay.protoform-reveal {
  animation: proto-reveal 1.5s ease-out;
}

@keyframes proto-reveal {
  0%   { background: rgba(2,3,8,0.4); }
  30%  { background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, rgba(2,3,8,0.2) 50%); }
  100% { background: rgba(2,3,8,0); }
}

.transition-overlay.fade-to-black {
  animation: trans-fade-black 1.2s ease-in-out;
}

@keyframes trans-fade-black {
  0%   { background: rgba(2,3,8,0); }
  50%  { background: rgba(2,3,8,1); }
  100% { background: rgba(2,3,8,0); }
}

/* ─── Depth Indicator ──────────────────────────────── */

#depth-indicator {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 3px;
  height: 40vh;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#depth-indicator.visible {
  opacity: 1;
}

#depth-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, rgba(100,140,255,0.6), rgba(100,140,255,0.15));
  border-radius: 2px;
  transition: height 0.6s ease;
}

#depth-text {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(140,160,220,0.5);
  white-space: nowrap;
}

/* ─── Round Indicator ──────────────────────────────── */

#round-indicator {
  position: fixed;
  left: 24px;
  bottom: 190px;
  z-index: 20;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(140,160,220,0.35);
  opacity: 0;
  transition: opacity 0.8s ease;
}

#round-indicator.visible {
  opacity: 1;
}

/* ─── Protoform UI ─────────────────────────────────── */

#protoform-ui {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

#protoform-ui.visible {
  opacity: 1;
  pointer-events: auto;
}

.protoform-label {
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(180,190,220,0.45);
  margin-bottom: 1.5rem;
  animation: proto-label-in 2s ease-out 1s both;
}

@keyframes proto-label-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Selected Keywords Tags ───────────────────────── */

#selected-keywords {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
  max-width: 80vw;
}

.selected-keyword-tag {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  padding: 0.4em 1em;
  border: 1px solid hsla(var(--hue, 200), 40%, 50%, 0.3);
  border-radius: 100px;
  color: hsla(var(--hue, 200), 50%, 70%, 0.7);
  opacity: 0;
  animation: tag-appear 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes tag-appear {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Restart Button ───────────────────────────────── */

#restart-btn {
  background: none;
  border: 1px solid rgba(140,160,220,0.2);
  border-radius: 100px;
  padding: 0.6em 2em;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(140,160,220,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  animation: proto-label-in 2s ease-out 2s both;
}

#restart-btn:hover {
  border-color: rgba(140,160,220,0.5);
  color: rgba(180,200,240,0.8);
  box-shadow: 0 0 20px rgba(100,140,255,0.1);
}

/* ─── Mobile adjustments ───────────────────────────── */

@media (max-width: 768px) {
  .intro-title {
    letter-spacing: 0.3em;
  }

  .keyword-item {
    font-size: clamp(0.8rem, 3.5vw, 1rem);
    padding: 0.5em 1.2em;
  }

  #depth-indicator {
    right: 12px;
    height: 30vh;
  }

  #round-indicator {
    left: 12px;
    bottom: 12px;
  }

  #protoform-ui {
    padding-bottom: 5vh;
  }
}
