/* Chapter 2 variants — prototype styles on top of the site's own stylesheet. */

/* ───────── Switcher ───────── */
.lab-bar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: rgb(20 18 39 / 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.14), 0 12px 32px rgb(0 0 0 / 0.4);
  font: 500 0.875rem/1 var(--ui);
  white-space: nowrap;
}
.lab-title { color: var(--ink-faint); }
.lab-tabs { display: flex; gap: 4px; }
.lab-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.lab-tabs button:hover { color: var(--ink); }
.lab-tabs button:active { transform: scale(0.96); }
.lab-tabs button[aria-selected="true"] { background: var(--chalk); color: var(--navy); }
.lab-tabs kbd {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  font: 600 0.75rem/1 var(--ui);
}
.lab-tabs button[aria-selected="true"] kbd { background: rgb(29 27 51 / 0.16); }

.lab-context { padding-top: 22vh; padding-bottom: 6vh; }
.chapter-card.c2 { min-height: 70vh; padding-top: 12vh; padding-bottom: 6vh; }

/* Only the chosen variant shows */
.variant { display: none; }
body[data-variant="a"] .variant-a,
body[data-variant="b"] .variant-b,
body[data-variant="c"] .variant-c { display: block; }

/* ───────── A. The call that keeps ringing ───────── */
.variant-a {
  padding: 0 var(--gutter) clamp(96px, 18vh, 200px);
  background: linear-gradient(to bottom, var(--navy), var(--navy) 60%, var(--memory-navy));
}
.phone {
  position: relative;
  width: min(72vw, 19rem);
  aspect-ratio: 678 / 1333;
  margin: 0 auto;
}
.phone-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.phone-screen {
  position: absolute;
  inset: 2.2% 5.5% 2.4% 5.8%;
  overflow: hidden;
  display: grid;
  justify-items: center;
  align-content: center;
  border-radius: 13% / 6.5%;
  background: linear-gradient(to bottom, #0d2659, #1a4d73 55%, #266680);
  font-family: var(--ui);
  text-align: center;
}
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  margin-bottom: 9%;
  border-radius: 50%;
  background: #e6a6b3;
  color: #5a2c3a;
  font: 600 clamp(1.5rem, 6vw, 2.25rem)/1 var(--ui);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}
.rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -116%);
}
.rings i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.5);
  opacity: 0;
  animation: ring 3s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.rings i:nth-child(2) { animation-delay: 1s; }
.rings i:nth-child(3) { animation-delay: 2s; }
@keyframes ring {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.9); opacity: 0; }
}
.call-name { margin: 0; font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 700; color: #fff; }
.call-where { margin: 4px 0 0; font-size: 0.9375rem; color: rgb(255 255 255 / 0.72); }
.call-status { margin: 18px 0 0; font-size: 0.9375rem; color: rgb(255 255 255 / 0.9); }
.dots i { font-style: normal; opacity: 0.2; animation: dot 1.5s infinite; }
.dots i:nth-child(2) { animation-delay: 0.25s; }
.dots i:nth-child(3) { animation-delay: 0.5s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }

/* ───────── B. The distance line ───────── */
.variant-b { background: linear-gradient(to bottom, var(--navy), var(--navy) 70%, var(--memory-navy)); }
.line-track { height: 240vh; }
.line-stage {
  --p: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 0 var(--gutter);
}
.line-svg { width: min(100%, 68rem); height: auto; overflow: visible; }
.line-ghost { fill: none; stroke: rgb(243 240 230 / 0.1); stroke-width: 2; stroke-dasharray: 2 10; stroke-linecap: round; }
.line-draw {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--p));
}
.dot { fill: var(--chalk); }
.dot-to { opacity: calc((var(--p) - 0.94) * 20); }
.city { fill: var(--ink); font: 400 30px var(--serif); }
.time { fill: var(--ink-soft); font: 500 19px var(--ui); }
.place-to { opacity: calc((var(--p) - 0.85) * 8); }
.km {
  fill: var(--chalk);
  font: 400 44px var(--serif);
  opacity: calc((var(--p) - 0.35) * 4);
}

/* ───────── C. The blurred conversation ───────── */
.variant-c {
  padding: 0 var(--gutter) clamp(96px, 18vh, 200px);
  background: linear-gradient(to bottom, var(--navy) 0, #0d2659 22%, #1a4d73 60%, #266680 82%, var(--memory-navy) 100%);
}
.call-screen {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  padding-top: 4vh;
  font-family: var(--ui);
  text-align: center;
}
.call-timer { margin: 0 0 4px; font-size: 0.8125rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.blur-thread {
  display: grid;
  gap: 14px;
  margin: 36px 0 30px;
  filter: blur(7px);
  -webkit-user-select: none;
  user-select: none;
}
.blur-bubble {
  display: grid;
  gap: 9px;
  width: 68%;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgb(255 255 255 / 0.14);
}
.blur-bubble.them { justify-self: start; }
.blur-bubble.me { justify-self: end; width: 52%; background: rgb(255 255 255 / 0.22); }
.blur-bubble i { display: block; height: 11px; border-radius: 6px; background: rgb(255 255 255 / 0.75); }
.blur-bubble i:first-child { height: 8px; background: rgb(255 255 255 / 0.45); }
.blur-bubble.me i { margin-left: auto; }

.reaction {
  position: absolute;
  bottom: 64px;
  font-size: 2.4rem;
  line-height: 1;
  pointer-events: none;
  animation: float-up 1.8s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}
@keyframes float-up {
  0%   { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
  15%  { transform: translate(-50%, -20px) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -220px) scale(1); opacity: 0; }
}

@media (max-width: 760px) {
  .lab-title { display: none; }
  .lab-bar { padding-left: 6px; }
  .lab-tabs button { padding: 0 12px 0 6px; font-size: 0.8125rem; }
  .city { font-size: 44px; }
  .time { font-size: 36px; }
  .km { font-size: 60px; }
  .line-draw { stroke-width: 7; }
  .place-from text, .place-to text { text-anchor: middle; }
  .place-from { transform: translateX(40px); }
  .place-to { transform: translateX(-40px); }
}

@media (prefers-reduced-motion: reduce) {
  .line-track { height: auto; }
  .line-stage { position: relative; --p: 1; }
  .rings i { animation: none; opacity: 0.35; transform: scale(1.6); }
  .dots i { animation: none; opacity: 1; }
}

/* Call controls (from the game's call screen) */
.translating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.emoji-row { display: flex; justify-content: center; gap: clamp(14px, 3vw, 22px); }
.emoji-row button {
  width: 72px; height: 72px;
  border: 0;
  border-radius: 50%;
  font-size: 2.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.25);
  transition: transform 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.emoji-row button:active { transform: scale(0.96); }
.emoji-row button:nth-child(1) { background: #f2bfa6; }
.emoji-row button:nth-child(2) { background: #eba6b3; }
.emoji-row button:nth-child(3) { background: #facc99; }
