:root {
  color-scheme: dark;
  --paper: #16130f;
  --ink: #f6f1e6;
  --muted: #b7ad9c;
  --signal: #ffe14a;
  --hot: #ff4545;
  --ink-strong: #1a1404;
  --line: rgba(246, 241, 230, 0.14);
  --sans: "Manrope", "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", "Segoe UI", sans-serif;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: clip;
}

.screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.glow {
  pointer-events: none;
  position: fixed;
  top: -18px;
  right: -25px;
  z-index: 20;
  width: 112px;
  height: 112px;
  background: radial-gradient(circle, rgba(255, 225, 74, 0.32), transparent 70%);
  animation: glow 1.5s ease-in-out infinite;
}

.corner {
  pointer-events: none;
  position: fixed;
  top: 2px;
  right: 1px;
  z-index: 30;
  width: 58px;
}

.bracket {
  position: relative;
  width: 58px;
  height: 54px;
  animation: nudge 1.05s ease-in-out infinite;
}

.bracket::before,
.bracket::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 7px;
  height: 46px;
  margin-left: -3.5px;
  border-radius: 4px;
  background: var(--signal);
  transform-origin: top center;
}

/* ∨ без нижней линии: раскрытие ~80° вниз на меню «⋯» */
.bracket::before {
  transform: rotate(-40deg);
}

.bracket::after {
  transform: rotate(40deg);
}

.bracket span {
  position: absolute;
  top: 38px;
  left: 50%;
  color: var(--hot);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.sheet {
  box-sizing: border-box;
  width: min(100%, 440px);
  max-width: 100%;
  margin: 0 auto;
  padding: 6.5rem 1.25rem 2.75rem;
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-bottom: max(2.75rem, env(safe-area-inset-bottom));
}

h1 {
  margin: 0;
  max-width: 18em;
  font-family: var(--display);
  font-size: clamp(1.45rem, 6.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 .hot {
  color: var(--hot);
}

.hint {
  margin: 1rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.stage {
  margin: 1.35rem 0 0;
}

.stage figcaption {
  position: relative;
  height: 1.4rem;
  margin-bottom: 0.7rem;
  overflow: hidden;
  color: var(--signal);
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
}

.phase {
  position: absolute;
  inset: 0 auto auto 0;
}

.phone {
  border: 1px solid rgba(255, 225, 74, 0.28);
  border-radius: 18px;
  background: #070708;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.bar {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 10px 0 12px;
  border-radius: 18px 18px 0 0;
  background: #000;
}

.x {
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.addr {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dots {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--signal);
}

.dots i {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: #fff;
}

.dots b,
.item b {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 99px;
  background: var(--ink-strong);
  color: var(--signal);
  font-family: var(--display);
  font-size: 11px;
}

.dots b {
  position: absolute;
  top: -9px;
  right: -9px;
  background: var(--signal);
  color: var(--ink-strong);
}

.ring {
  position: absolute;
  inset: -7px;
  border: 2px solid var(--signal);
  border-radius: 999px;
  animation: ring 4.8s ease-in-out infinite;
}

.menu {
  position: relative;
  display: grid;
  width: min(100% - 28px, 268px);
  margin: 8px 12px 14px auto;
  border-radius: 14px;
  background: #1c1c22;
}

.menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 16px;
  border-width: 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--signal);
}

.item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(246, 241, 230, 0.78);
  font-size: 0.98rem;
  font-weight: 700;
}

.item:first-child {
  border-top: 0;
  border-radius: 12px 12px 0 0;
}

.item:last-child {
  border-radius: 0 0 12px 12px;
}

.item-hot {
  background: var(--signal);
  color: var(--ink-strong);
  animation: row 4.8s ease-in-out infinite;
}

.item-hot b {
  background: var(--ink-strong);
  color: var(--signal);
}

.ripple {
  position: absolute;
  right: 34px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-strong);
  border-radius: 99px;
  animation: tap 4.8s ease-out infinite;
}

.fallback {
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.fallback h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.fallback p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.copy,
.ghost {
  width: 100%;
  margin-top: 0.85rem;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.copy {
  min-height: 54px;
  background: var(--signal);
  color: var(--ink-strong);
  font-family: var(--display);
  font-size: 1rem;
}

.copy:focus-visible,
.ghost:focus-visible,
.link-field:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.copy-status {
  margin-top: 0.65rem;
}

.copy-status:empty {
  display: none;
}

.link-field {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.85rem 0.9rem;
  border: 1px dashed rgba(255, 225, 74, 0.55);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem/1.3 var(--sans);
}

.ghost {
  min-height: 48px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(0.8rem, 3.7vw, 1rem);
  white-space: normal;
}

.phase-a {
  animation: show-a 4.8s ease-in-out infinite;
}

.phase-b {
  animation: show-b 4.8s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, 7px, 0);
  }
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes ring {
  0%,
  46%,
  100% {
    opacity: 0;
    transform: scale(0.92);
  }
  8%,
  34% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes row {
  0%,
  42%,
  100% {
    box-shadow: none;
  }
  55%,
  88% {
    box-shadow: 0 0 0 3px rgba(255, 225, 74, 0.55);
  }
}

@keyframes tap {
  0%,
  48% {
    opacity: 0;
    transform: scale(0.4);
  }
  58% {
    opacity: 1;
    transform: scale(1);
  }
  76% {
    opacity: 0;
    transform: scale(1.7);
  }
  100% {
    opacity: 0;
  }
}

@keyframes show-a {
  0%,
  40% {
    opacity: 1;
  }
  50%,
  92% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes show-b {
  0%,
  40% {
    opacity: 0;
  }
  50%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (min-width: 760px) {
  .corner,
  .glow {
    display: none;
  }

  .sheet {
    padding-top: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bracket,
  .glow,
  .ring,
  .item-hot,
  .ripple,
  .phase-a,
  .phase-b {
    animation: none;
  }

  .phase-b {
    opacity: 0;
  }

  .ring {
    opacity: 1;
  }
}
