/* The Vibe screen, to match VibeScreen.kt.

   Every number here is the app's: the gradient, the 270dp stage, the two ring
   radii, the core at 0.33 of the stage, the eight dots at 0.4686 with the
   seven-second turn, the 78dp control columns and the 68dp end circle. */

.vibe-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  background: linear-gradient(
    180deg,
    #070512 0%,
    #0e0920 50%,
    #080612 100%
  );
  color: #fff;
}

.vibe-screen[hidden] {
  display: none !important;
}

/* the split title, centred */
.vibe-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 12px;
}

.vibe-brand {
  display: inline-flex;
  align-items: baseline;
  color: #9a82ff;
}

.vibe-brand b {
  font-size: 25px;
  font-weight: 700;
}

.vibe-brand span {
  font-size: 17px;
}

.vibe-word {
  font-size: 24px;
  color: #fff;
}

/* the stage */
.vibe-stage {
  /* 1 unit = 1% of the stage, so the two gradients can carry the app's
     radii, which VibeScreen.kt gives in full. */
  --vibe-unit: 2.7px;
  position: relative;
  flex: none;
  width: 270px;
  height: 270px;
  margin-top: auto;
  margin-bottom: auto;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.vibe-stage > span {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

/* the outer glow, 0.48 of the stage across */
.vibe-glow {
  width: 96%;
  height: 96%;
  /* radius 0.48 of the stage, as the app draws it */
  background: radial-gradient(
    circle calc(var(--vibe-unit) * 48) at 50% 50%,
    rgba(232, 217, 255, .96) 0%,
    rgba(168, 108, 255, .72) 33%,
    rgba(108, 57, 255, .18) 67%,
    transparent 100%
  );
}

/* ring at 0.5016 of the stage, 3dp, breathing with the core */
.vibe-ring-pulse {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(183, 124, 255, .18);
  animation: vibeScreenPulse 1500ms cubic-bezier(.4, 0, .2, 1) infinite alternate;
}

/* ring at 0.396 of the stage, 1.5dp, still */
.vibe-ring-fixed {
  width: 79%;
  height: 79%;
  border: 1.5px solid rgba(127, 91, 255, .26);
}

/* the core, 0.33 of the stage across, breathing */
.vibe-core {
  width: 66%;
  height: 66%;
  /* radius 0.33 of the stage, as the app draws it */
  background: radial-gradient(
    circle calc(var(--vibe-unit) * 33) at 50% 50%,
    rgba(255, 255, 255, .98) 0%,
    rgba(225, 201, 255, .96) 33%,
    rgba(140, 77, 255, .62) 67%,
    transparent 100%
  );
  animation: vibeScreenPulse 1500ms cubic-bezier(.4, 0, .2, 1) infinite alternate;
}

/* eight dots on a 0.4686 ring, turning once in seven seconds */
.vibe-orbit {
  width: 100%;
  height: 100%;
  animation: vibeScreenTurn 7000ms linear infinite;
}

.vibe-orbit {
  /* the dots ride a ring at 0.4686 of the stage; the stage is 270px */
  --vibe-ring: 126.5px;
}

.vibe-orbit i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(216, 196, 255, .80);
  /* turn into place, then out along the ring */
  transform: rotate(var(--a)) translateY(calc(var(--vibe-ring) * -1));
}

.vibe-orbit i:nth-child(odd) {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: rgba(107, 201, 255, .60);
}

.vibe-orbit i:nth-child(1) { --a: 0deg; }
.vibe-orbit i:nth-child(2) { --a: 45deg; }
.vibe-orbit i:nth-child(3) { --a: 90deg; }
.vibe-orbit i:nth-child(4) { --a: 135deg; }
.vibe-orbit i:nth-child(5) { --a: 180deg; }
.vibe-orbit i:nth-child(6) { --a: 225deg; }
.vibe-orbit i:nth-child(7) { --a: 270deg; }
.vibe-orbit i:nth-child(8) { --a: 315deg; }

/* the words sit inside the orb, as the app puts them */
.vibe-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.vibe-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: #7c5cff;
}

.vibe-state {
  font-size: 22px;
  color: #fff;
}

.vibe-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, .56);
}

/* the transcript card */
.vibe-transcript-box {
  flex: none;
  width: 100%;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .10);
}

.vibe-transcript-label {
  display: block;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #a78bff;
}

.vibe-transcript {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, .62);
  min-height: 18px;
}

/* the three controls */
.vibe-controls {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding-top: 18px;
  padding-bottom: 18px;
}

.vibe-control {
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, .52);
}

.vibe-control-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .055);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .52);
}

.vibe-control.on .vibe-control-round {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.vibe-control > span:last-child {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, .52);
}

.vibe-icon {
  width: 21px;
  height: 21px;
}

/* the end button: a 68dp circle, not a bar of text */
.vibe-end {
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  /* VibeScreen.kt gives this brush no radius, so Compose uses the size
     itself: 68px. Measured against the app, that is what it does - the
     second colour lands exactly on the button's edge. */
  background: radial-gradient(
    circle 68px at 50% 50%,
    #9b5cff 0%,
    #6d3bdb 50%,
    #3c216e 100%
  );
}

.vibe-end-icon {
  width: 27px;
  height: 27px;
}

@keyframes vibeScreenPulse {
  from { transform: scale(.94); }
  to   { transform: scale(1.08); }
}

@keyframes vibeScreenTurn {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (max-height: 620px) {
  .vibe-stage {
    width: 200px;
    height: 200px;
    --vibe-unit: 2px;
  }

  .vibe-orbit {
    --vibe-ring: 93.7px;
  }
}
