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

:root {
  --bg-space: radial-gradient(circle at 20% 20%, rgba(88, 125, 255, 0.08), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(255, 140, 255, 0.06), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(92, 255, 214, 0.05), transparent 65%);
  --card-bg: rgba(16, 22, 35, 0.72);
  --card-border: rgba(102, 219, 255, 0.4);
  --text-primary: #f5faff;
  --text-secondary: rgba(216, 229, 255, 0.75);
  --accent: #6fe4ff;
  --accent-deep: #b995ff;
  --tooltip-bg: rgba(6, 12, 22, 0.9);
  font-family: "Titillium Web", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  background: #050912;
  overflow-x: hidden;
  overflow-y: auto;
}

.starfield-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: radial-gradient(circle at 20% 35%, rgba(65, 116, 255, 0.06), transparent 55%);
}

.galactic-fog {
  position: fixed;
  inset: 0;
  background: var(--bg-space);
  filter: blur(20px);
  opacity: 0.85;
  z-index: -2;
}

.landing-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(18px);
  transition: opacity 0.7s ease, visibility 0.7s ease;
  z-index: 10;
}

.landing-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.landing-content {
  max-width: min(520px, 80vw);
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 1px solid rgba(111, 228, 255, 0.25);
  border-radius: 24px;
  background: rgba(5, 12, 22, 0.55);
  box-shadow: 0 0 60px rgba(68, 149, 255, 0.15);
}

.landing-content h1 {
  font-family: "Orbitron", "Titillium Web", sans-serif;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  letter-spacing: 0.2rem;
  margin: 0 0 1.5rem;
}

.landing-content p {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  margin: 0 0 2.5rem;
  color: var(--text-secondary);
}

.begin-button {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  font-size: clamp(1rem, 2vw, 1.3rem);
  padding: 1rem 3rem;
  border: 1px solid rgba(111, 228, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(111, 228, 255, 0.85), rgba(185, 149, 255, 0.85));
  color: #031018;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.begin-button:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(111, 228, 255, 0.4);
}

.experience {
  position: relative;
  min-height: 100vh;
  padding: clamp(2.2rem, 5vw, 3.6rem) clamp(1.8rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2.4rem, 5vw, 4.2rem);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}

.experience.revealed {
  opacity: 1;
  transform: translateY(0);
}

.headline h2 {
  font-family: "Orbitron", "Titillium Web", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0.22rem;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.headline p {
  margin: 0;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.clock-card {
  position: relative;
  padding: clamp(2rem, 3vw, 2.8rem);
  border-radius: 28px;
  background: var(--card-bg);
  border: 1px solid rgba(111, 228, 255, 0.25);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: transform 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.clock-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(111, 228, 255, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.clock-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(111, 228, 255, 0.6);
  box-shadow: 0 30px 90px rgba(31, 108, 255, 0.35);
}

.clock-card:hover::after {
  opacity: 1;
}

.clock-card h3 {
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  letter-spacing: 0.18rem;
  text-transform: uppercase;
  margin: 0 0 1.8rem;
  color: var(--accent);
}

.clock-display {
  font-family: "Orbitron", monospace;
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: 0.35rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(9, 19, 32, 0.9), rgba(5, 14, 26, 0.6));
  border: 1px solid rgba(111, 228, 255, 0.3);
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 18px rgba(111, 228, 255, 0.5);
  position: relative;
  z-index: 1;
}

.clock-caption {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
  line-height: 1.6;
}

.gravity-control {
  margin-top: clamp(1.4rem, 2.6vw, 2rem);
  display: grid;
  gap: 0.6rem;
  align-items: center;
}

.gravity-control label {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  letter-spacing: 0.16rem;
  text-transform: uppercase;
  color: var(--accent);
}

.gravity-control input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(111, 228, 255, 0.85), rgba(185, 149, 255, 0.85));
  outline: none;
  cursor: pointer;
}

.gravity-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #061022;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(111, 228, 255, 0.65);
}

.gravity-control input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #061022;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(111, 228, 255, 0.65);
}

.gravity-control .gravity-value {
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: var(--text-secondary);
}

.gravity-control .gravity-value strong {
  color: var(--accent);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08rem;
}

.differential-card {
  margin-top: clamp(0.6rem, 1.8vw, 1.6rem);
  padding: clamp(2rem, 4vw, 2.6rem);
  border-radius: 28px;
  background: rgba(14, 20, 36, 0.72);
  border: 1px solid rgba(111, 228, 255, 0.25);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
  display: grid;
  gap: clamp(1.4rem, 2.5vw, 2rem);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.differential-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.differential-card header h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  color: var(--accent);
}

.differential-card header p {
  margin: 0.6rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

.differential-display {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
}

.differential-caption {
  font-size: clamp(0.95rem, 1.7vw, 1.15rem);
  color: var(--text-secondary);
  letter-spacing: 0.05rem;
}

.differential-caption.secondary {
  opacity: 0.75;
}

.differential-value {
  font-family: "Orbitron", monospace;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: 0.18rem;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(111, 228, 255, 0.45);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.differential-value.updating {
  opacity: 0;
  transform: translateY(-8px);
}
.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 3vw, 2.8rem);
  justify-content: space-between;
  align-items: flex-start;
  margin-top: clamp(1.4rem, 2.6vw, 2.8rem);
}

.quote-stream {
  flex: 1 1 clamp(300px, 38vw, 520px);
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.quote-stream {
  padding: 0 clamp(0.8rem, 2vw, 1.5rem);
  flex-direction: column;
  gap: 0.4rem;
  min-height: 96px;
  align-items: flex-start;
  text-align: left;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.quote-stream.visible {
  opacity: 1;
  transform: translateY(0);
}

.quote-stream .quote-text {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  color: var(--text-primary);
}

.quote-stream .quote-author {
  margin: 0;
  font-size: clamp(0.92rem, 1.7vw, 1.1rem);
  color: var(--accent-deep);
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.quote-stream.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.clock-card.singularity {
  border-color: rgba(185, 149, 255, 0.4);
  padding-top: clamp(3rem, 5vw, 3.8rem);
  padding-bottom: clamp(2.8rem, 4vw, 3.6rem);
  overflow: visible;
}

.lensing-wrapper {
  position: absolute;
  top: clamp(32%, 20vw, 44%);
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, 70%);
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 24px 60px rgba(96, 173, 255, 0.35));
  z-index: -1;
  pointer-events: none;
}

.lensing-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.observer-column {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.6rem);
}

.observer-column .tooltip-container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.clock-tooltip {
  width: min(480px, 100%);
  padding: 1.4rem 1.6rem;
  border-radius: 18px;
  background: var(--tooltip-bg);
  border: 1px solid rgba(185, 149, 255, 0.35);
  opacity: 0;
  transform: translateY(25px);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.tooltip-title {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.16rem;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 0.6rem;
}

.clock-tooltip p {
  margin: 0.25rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hidden {
  pointer-events: none;
}

.experience-link {
  position: fixed;
  bottom: clamp(1rem, 4vw, 1.8rem);
  right: clamp(1rem, 4vw, 1.8rem);
  z-index: 6;
}

.experience-link__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 228, 255, 0.5);
  background: rgba(8, 16, 28, 0.7);
  color: #e7eef9;
  text-decoration: none;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(111, 228, 255, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.experience-link__btn:hover {
  transform: translateY(-2px);
  border-color: rgba(185, 149, 255, 0.7);
  box-shadow: 0 16px 40px rgba(111, 228, 255, 0.3);
}

.game-toggle {
  position: fixed;
  top: clamp(1rem, 3vw, 1.6rem);
  right: clamp(1rem, 3vw, 1.6rem);
  display: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 228, 255, 0.5);
  background: linear-gradient(135deg, rgba(111, 228, 255, 0.9), rgba(185, 149, 255, 0.9));
  color: #031018;
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(111, 228, 255, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  z-index: 5;
}

.game-toggle.visible {
  display: inline-flex;
}

.game-toggle:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 50px rgba(111, 228, 255, 0.45);
}

.experience.game-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.game-mode {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  background: radial-gradient(circle at 40% 30%, rgba(14, 30, 50, 0.22), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(8, 14, 26, 0.2), transparent 60%),
    rgba(5, 12, 22, 0.15);
}

.game-mode.hidden {
  display: none;
}

.game-mode.visible {
  display: block;
}

.game-mode-header {
  position: absolute;
  top: clamp(0.8rem, 3vw, 1.2rem);
  right: clamp(0.8rem, 3vw, 1.2rem);
  display: flex;
  gap: 0.6rem;
  z-index: 2;
}

.play-again-button,
.back-button {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 228, 255, 0.5);
  background: linear-gradient(135deg, rgba(111, 228, 255, 0.9), rgba(185, 149, 255, 0.9));
  color: #031018;
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(111, 228, 255, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.play-again-button:hover,
.back-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(111, 228, 255, 0.4);
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: transparent;
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
  }

  .experience {
    padding: clamp(2rem, 8vw, 3rem) clamp(1.4rem, 6vw, 2rem);
  }

  .clock-grid {
    grid-template-columns: 1fr;
  }

  .clock-card.singularity::before,
  .clock-card.singularity::after {
    opacity: 0.65;
  }

  .info-row {
    flex-direction: column;
    align-items: center;
  }

  .quote-stream {
    align-items: center;
    text-align: center;
  }

  .observer-column {
    align-items: center;
  }

  .observer-column .tooltip-container {
    justify-content: center;
  }

  .gravity-control {
    text-align: center;
  }

  .gravity-control label {
    justify-self: center;
  }

  .differential-card {
    text-align: center;
  }

  .differential-display {
    justify-items: center;
  }

  .game-toggle {
    top: auto;
    bottom: clamp(1rem, 6vw, 1.6rem);
  }

  .game-canvas {
    height: 100vh;
  }
}

@media (min-width: 2200px) {
  .clock-display {
    font-size: 4.4rem;
    padding: 2.2rem;
  }

  .clock-card {
    padding: 3.2rem;
  }
}
