:root {
  color-scheme: dark;
  font-family: "Aptos", "Segoe UI", sans-serif;
  background: #0f0d0a;
  color: #f8efe1;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 72% 20%, rgba(100, 56, 148, 0.14), transparent 36%),
    radial-gradient(circle at 18% 84%, rgba(20, 152, 177, 0.09), transparent 32%),
    #07050b;
}

.stage-shell {
  position: fixed;
  inset: 0;
}

#webgl-stage,
#tear-stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

#webgl-stage {
  z-index: 0;
}

#tear-stage {
  z-index: 1;
  touch-action: none;
  cursor: grab;
}

#tear-stage:active {
  cursor: grabbing;
}

.hud {
  position: fixed;
  top: 22px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.hud-copy {
  pointer-events: none;
  transition: opacity 0.18s ease;
  user-select: none;
}

.kicker,
.hint {
  margin: 0;
  color: rgba(248, 239, 225, 0.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.journey-panel {
  position: fixed;
  z-index: 4;
  left: 24px;
  top: 50%;
  width: min(290px, calc(100vw - 48px));
  transform: translateY(-50%) translateX(-12px);
  padding-left: 16px;
  border-left: 1px solid rgba(211, 187, 255, 0.58);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.88);
  transition: opacity 360ms ease, transform 700ms cubic-bezier(.2,.9,.2,1);
}

.journey-panel.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.journey-marker,
.journey-title,
.journey-detail {
  margin: 0;
}

.journey-marker {
  color: rgba(185, 223, 255, 0.86);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
}

.journey-title {
  margin-top: 8px;
  font: 500 clamp(21px, 2.1vw, 31px)/1.02 Georgia, "Times New Roman", serif;
}

.journey-detail {
  margin-top: 7px;
  color: rgba(248, 239, 225, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

.stage-shell.is-initiated .hud-copy,
.stage-shell.is-initiated .hint {
  opacity: 0;
}

.stage-shell.has-reached-core .journey-panel {
  border-left-color: rgba(144, 188, 255, 0.82);
}

h1 {
  margin: 4px 0 0;
  max-width: min(680px, 72vw);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 7vw, 96px);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.65);
}

button {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(248, 239, 225, 0.5);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(10, 10, 10, 0.46);
  color: #f8efe1;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(16px);
  white-space: nowrap;
}

button:hover,
button:focus-visible {
  background: rgba(248, 239, 225, 0.18);
  outline: none;
}

.actions {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(620px, 52vw);
  transition: opacity 0.18s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.hand-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
  transition: opacity 0.18s ease;
}

.hand-video {
  width: 180px;
  height: 112px;
  object-fit: cover;
  border: 1px solid rgba(248, 239, 225, 0.42);
  border-radius: 8px;
  opacity: 0;
  transform: scaleX(-1);
  transition: opacity 0.2s ease;
}

.hand-video.visible {
  opacity: 0.5;
}

.hand-status {
  margin: 0;
  max-width: 260px;
  color: rgba(248, 239, 225, 0.76);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
  text-shadow: 0 2px 12px #000;
}

.hint {
  position: fixed;
  left: 24px;
  bottom: 22px;
  z-index: 2;
  max-width: calc(100vw - 48px);
  text-shadow: 0 2px 12px #000;
  pointer-events: none;
  transition: opacity 0.18s ease;
  user-select: none;
}

.stage-shell.ui-hidden .hud-copy,
.stage-shell.ui-hidden .hint {
  opacity: 0;
}

.stage-shell.ui-hidden .actions,
.stage-shell.ui-hidden .hand-panel {
  opacity: 0;
}

.stage-shell.ui-hidden .actions:hover,
.stage-shell.ui-hidden .actions:focus-within,
.stage-shell.ui-hidden .hand-panel:hover,
.stage-shell.ui-hidden .hand-panel:focus-within {
  opacity: 1;
}

@media (max-width: 640px) {
  .hud {
    top: 14px;
    left: 14px;
    right: 14px;
  }

  .hint {
    left: 14px;
    bottom: 14px;
  }

  .journey-panel {
    left: 14px;
    width: min(255px, calc(100vw - 28px));
  }

  .actions {
    max-width: 48vw;
  }

  button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .hand-panel {
    right: 14px;
    bottom: 14px;
  }

  .hand-video {
    width: 120px;
    height: 76px;
  }

  .hand-status {
    max-width: 180px;
  }
}
