:root {
  --bg: #100706;
  --rose: #e8a07a;
  --rose-soft: rgba(232, 160, 122, 0.22);
  --ivory: #faf5ef;
  --muted: rgba(255, 255, 255, 0.66);
  --glass: rgba(20, 8, 7, 0.72);
  --green: #34c759;
  --red: #ff3b30;
  --gold: #dfb94f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  align-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 160, 122, 0.14), transparent 36%),
    linear-gradient(145deg, #070404, #190807 45%, #070404);
  color: var(--ivory);
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

button,
input,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.stage {
  background: #000;
  border-radius: 44px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 50px 100px rgba(0, 0, 0, 0.9);
  height: min(812px, 100dvh);
  overflow: hidden;
  position: relative;
  width: min(375px, 100vw);
}

.screen {
  display: flex;
  flex-direction: column;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateY(14px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.call-bg,
.call-bg-blur,
.video-shade {
  inset: 0;
  position: absolute;
}

.call-bg {
  background: var(--bg);
  overflow: hidden;
}

.call-bg-blur {
  background: url("../assets/bottle-label.png") center / cover;
  filter: blur(26px) saturate(0.46) brightness(0.34);
  transform: scale(1.12);
}

.call-bg::after {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.52), transparent 34%),
    linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 46%);
  content: "";
  inset: 0;
  position: absolute;
}

.call-ring {
  animation: ring 2.4s ease-out infinite;
  border: 1.5px solid rgba(232, 160, 122, 0.28);
  border-radius: 50%;
  height: 240px;
  left: calc(50% - 120px);
  position: absolute;
  top: 74px;
  width: 240px;
}

.ring-two { animation-delay: 0.8s; }
.ring-three { animation-delay: 1.6s; }

@keyframes ring {
  from { opacity: 0.7; transform: scale(0.58); }
  to { opacity: 0; transform: scale(1.85); }
}

.status-bar {
  align-items: center;
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 15px;
  font-weight: 700;
  justify-content: space-between;
  padding: 14px 22px 0;
  position: relative;
  z-index: 3;
}

.status-icons {
  font-size: 12px;
  letter-spacing: 0.02em;
}

.caller {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding-top: 32px;
  position: relative;
  text-align: center;
  z-index: 2;
}

.avatar-ring-wrap {
  align-items: center;
  display: flex;
  height: 108px;
  justify-content: center;
  position: relative;
  width: 108px;
}

.avatar-pulse {
  animation: breathe 2.2s ease-out infinite;
  border: 1.5px solid rgba(232, 160, 122, 0.62);
  border-radius: 50%;
  height: 100px;
  position: absolute;
  width: 100px;
}

.pulse-two { animation-delay: 0.7s; }
.pulse-three { animation-delay: 1.4s; }

@keyframes breathe {
  0%, 100% { opacity: 0.54; transform: scale(1); }
  60% { opacity: 0; transform: scale(1.78); }
}

.avatar-img {
  border: 2.5px solid rgba(232, 160, 122, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 160, 122, 0.15), 0 8px 32px rgba(0, 0, 0, 0.5);
  height: 96px;
  object-fit: cover;
  object-position: center 20%;
  position: relative;
  width: 96px;
  z-index: 2;
}

.call-label,
.panel-kicker {
  color: rgba(232, 160, 122, 0.78);
  font-family: "Times New Roman", Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.call-label { margin-top: 28px; }

.call-name {
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-top: 8px;
}

.call-sub {
  color: rgba(255, 255, 255, 0.65);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 14px;
  margin-top: 8px;
}

.private-badge {
  align-items: center;
  background: var(--rose-soft);
  border: 1px solid rgba(232, 160, 122, 0.5);
  border-radius: 20px;
  color: rgba(232, 160, 122, 0.95);
  display: flex;
  font-size: 9px;
  gap: 7px;
  letter-spacing: 0.12em;
  margin-top: 12px;
  padding: 5px 14px;
}

.private-badge span {
  background: var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--rose);
  height: 6px;
  width: 6px;
}

.facetime-tools {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: auto;
  padding: 0 20px 28px;
  position: relative;
  z-index: 2;
}

.tool-btn {
  align-items: center;
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-btn span:last-child,
.call-action small {
  color: rgba(255, 255, 255, 0.76);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 11px;
}

.tool-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  color: white;
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 11px;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.tool-icon svg {
  fill: none;
  height: 27px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 27px;
}

.tool-btn.is-active .tool-icon {
  background: rgba(255, 255, 255, 0.9);
  color: #161616;
}

.call-actions {
  display: flex;
  justify-content: space-around;
  padding: 0 40px 52px;
  position: relative;
  z-index: 2;
}

.call-action {
  align-items: center;
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-action span {
  align-items: center;
  border-radius: 50%;
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 700;
  height: 74px;
  justify-content: center;
  width: 74px;
}

.phone-symbol {
  fill: currentColor;
  height: 30px;
  width: 30px;
}

.call-decline .phone-symbol {
  transform: rotate(134deg);
}

.call-accept .phone-symbol {
  transform: rotate(-46deg);
}

.call-action:active span { transform: scale(0.93); }
.call-decline span { background: var(--red); box-shadow: 0 6px 24px rgba(255, 59, 48, 0.55); }
.call-accept span { background: var(--green); box-shadow: 0 6px 24px rgba(52, 199, 89, 0.55); }

.screen-video {
  background: #000;
}

.arrival-video,
.departure-video,
.avatar-scene,
.avatar-scene video {
  inset: 0;
  position: absolute;
}

.arrival-video,
.departure-video,
.avatar-scene video {
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.arrival-video,
.departure-video {
  filter: brightness(0.56) saturate(0.82);
  transition: opacity 480ms ease, filter 480ms ease;
  z-index: 1;
}

.arrival-video {
  opacity: 1;
}

.departure-video {
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.screen-video.is-avatar .arrival-video {
  opacity: 0;
}

.screen-video.is-departing .avatar-scene {
  opacity: 0;
}

.screen-video.is-departing .departure-video {
  opacity: 1;
}

.avatar-scene {
  background: #060403;
  opacity: 0;
  overflow: hidden;
  transition: opacity 520ms ease;
  z-index: 1;
}

.avatar-scene::before {
  background: url("../assets/saint-bernard.webp") center / cover;
  content: "";
  filter: blur(22px) saturate(0.8) brightness(0.42);
  inset: -24px;
  opacity: 0.62;
  position: absolute;
  transform: scale(1.12);
  z-index: 0;
}

.avatar-scene::after {
  background:
    radial-gradient(circle at 50% 34%, transparent 0 28%, rgba(0, 0, 0, 0.18) 54%, rgba(0, 0, 0, 0.76) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 46%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.screen-video.is-avatar .avatar-scene {
  opacity: 1;
}

.avatar-scene video {
  filter: brightness(0.74) saturate(0.9);
  height: 76%;
  left: 50%;
  object-fit: contain;
  object-position: center 42%;
  top: 42%;
  transform: translate(-50%, -50%);
  transition: opacity 260ms ease;
  width: 76%;
  z-index: 1;
}

#vid-idle { opacity: 1; }
#vid-wink-l,
#vid-wink-r,
#vid-shy,
#vid-speak-a,
#vid-speak-b {
  opacity: 0;
}

#vid-idle { z-index: 1; }
#vid-wink-l,
#vid-wink-r,
#vid-shy { z-index: 2; }
#vid-speak-a { z-index: 3; }
#vid-speak-b { z-index: 4; }

.video-shade {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.22), transparent 22%),
    linear-gradient(to top, rgba(0, 0, 0, 0.18), transparent 34%);
  z-index: 2;
}

.screen-video.is-avatar .video-shade {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent 28%),
    linear-gradient(to top, rgba(0, 0, 0, 0.86), transparent 56%),
    rgba(44, 21, 32, 0.12);
}

.video-topbar {
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  justify-content: space-between;
  left: 0;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 22px 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 5;
}

.video-topbar strong,
.video-topbar span {
  display: block;
}

.video-time {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.video-topbar strong { font-size: 16px; }
.video-topbar span { color: rgba(255, 255, 255, 0.55); font-size: 12px; margin-top: 2px; }

.end-call-btn {
  align-items: center;
  background: var(--red);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.42);
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 31px;
  font-weight: 300;
  height: 48px;
  justify-content: center;
  line-height: 1;
  padding-bottom: 4px;
  width: 48px;
}

.conversation-panel,
.form-panel,
.confirm-panel,
.final-panel {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(232, 160, 122, 0.28);
  border-radius: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48);
  left: 14px;
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  padding: 18px;
  position: absolute;
  right: 14px;
  transition: opacity 300ms ease, transform 300ms ease;
  z-index: 7;
}

.question-text {
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-style: italic;
  line-height: 1.28;
  margin-top: 7px;
}

.choices {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.choice-btn,
.animal-grid button,
.submit-btn,
.sound-unlock {
  border: 0;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-weight: 800;
  min-height: 46px;
}

.choice-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ivory);
  padding: 11px 14px;
  text-align: left;
}

.choice-btn:disabled {
  opacity: 0.52;
}

.choice-btn.is-selected {
  background: rgba(223, 185, 79, 0.9);
  color: #1b0a06;
}

.sound-unlock {
  background: rgba(250, 245, 239, 0.94);
  bottom: calc(42px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: #1b0a06;
  left: 50%;
  min-width: 168px;
  opacity: 1;
  padding: 0 22px;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 240ms ease, transform 240ms ease;
  z-index: 8;
}

.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
}

.sound-unlock.is-hidden {
  transform: translate(-50%, 8px) !important;
}

.form-panel h2,
.confirm-panel h2,
.final-panel h2 {
  color: white;
  font-size: 27px;
  line-height: 1.05;
  margin: 8px 0 8px;
}

.form-intro,
.confirm-panel p,
.final-panel p {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.final-panel {
  text-align: center;
}

.final-panel h2 {
  font-size: 30px;
}

.ar-btn {
  margin-top: 16px;
}

.shop-link {
  align-items: center;
  border: 1px solid rgba(223, 185, 79, 0.46);
  border-radius: 999px;
  color: var(--ivory);
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  margin-top: 10px;
  min-height: 46px;
  text-decoration: none;
}

.shop-link:active {
  transform: scale(0.98);
}

.animal-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.animal-grid button {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--ivory);
  padding: 10px 14px;
  text-align: left;
}

.animal-grid button.is-selected {
  background: rgba(223, 185, 79, 0.92);
  color: #1b0a06;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

label span {
  color: rgba(232, 160, 122, 0.9);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  min-height: 48px;
  outline: 0;
  padding: 0 14px;
}

.submit-btn {
  background: linear-gradient(135deg, var(--rose), #d4856a);
  color: #1a1008;
  margin-top: 12px;
  width: 100%;
}

.submit-btn:disabled {
  filter: grayscale(1);
  opacity: 0.45;
}

@media (max-width: 430px), (max-height: 840px) {
  body {
    align-items: stretch;
    justify-content: stretch;
  }

  .stage {
    border-radius: 0;
    box-shadow: none;
    height: 100dvh;
    width: 100vw;
  }
}

@media (max-height: 700px) {
  .conversation-panel,
  .form-panel,
  .confirm-panel,
  .final-panel {
    border-radius: 20px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 14px;
  }

  .question-text {
    font-size: 18px;
    line-height: 1.22;
  }

  .choice-btn,
  .animal-grid button {
    padding: 9px 12px;
  }

  .form-panel h2,
  .confirm-panel h2,
  .final-panel h2 {
    font-size: 23px;
  }
}
