:root {
  --bg: #030304;
  --panel: #070708;
  --panel-2: #0d0d10;
  --ink: #f2eeee;
  --muted: #887c7f;
  --line: rgba(255, 43, 64, .18);
  --red: #ff2438;
  --red-dark: #65000b;
  --red-soft: rgba(255, 36, 56, .15);
  --shadow: 0 30px 110px rgba(0, 0, 0, .82);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Consolas, Monaco, "Courier New", monospace;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 36, 56, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 36, 56, .035) 1px, transparent 1px),
    radial-gradient(circle at 50% -18%, rgba(255, 36, 56, .22), transparent 26rem),
    radial-gradient(circle at 10% 90%, rgba(101, 0, 11, .36), transparent 22rem),
    linear-gradient(180deg, #050506 0%, #010101 100%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, .025) 0,
      rgba(255, 255, 255, .025) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: overlay;
}

.app-shell {
  width: min(980px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.player-panel {
  width: min(820px, 100%);
  padding: 12px;
  border: 1px solid rgba(255, 36, 56, .28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 36, 56, .055), transparent 26%),
    var(--panel);
  box-shadow: var(--shadow);
  position: relative;
}

.player-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border: 1px solid rgba(255, 36, 56, .08);
  border-radius: 6px;
}

.brand-banner {
  width: 100%;
  min-height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 36, 56, .24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 36, 56, .12), transparent),
    radial-gradient(circle at center, rgba(255, 255, 255, .08), transparent 44%),
    #030304;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  text-align: center;
  text-shadow:
    0 2px 0 #000,
    0 0 18px rgba(255, 36, 56, .55),
    0 0 30px rgba(255, 230, 90, .18);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .72),
    0 0 34px rgba(255, 36, 56, .11);
}

.site-title {
  margin: 0;
  min-height: 48px;
  padding: 0 18px 0 11px;
  border: 1px solid rgba(35, 168, 232, .42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 19px 50%, rgba(35, 168, 232, .34), transparent 38px),
    linear-gradient(180deg, rgba(35, 168, 232, .12), rgba(255, 36, 56, .07)),
    #08080b;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-shadow:
    0 0 12px rgba(35, 168, 232, .42),
    0 0 24px rgba(255, 36, 56, .26);
  box-shadow:
    inset 0 0 24px rgba(35, 168, 232, .06),
    0 0 22px rgba(35, 168, 232, .1),
    0 0 28px rgba(255, 36, 56, .08);
}

.bot-open-button:hover {
  border-color: rgba(35, 168, 232, .78);
  box-shadow:
    inset 0 0 24px rgba(35, 168, 232, .1),
    0 0 30px rgba(35, 168, 232, .22),
    0 0 26px rgba(255, 36, 56, .1);
}

.bot-open-button {
  position: relative;
  overflow: hidden;
  animation: telegramPulse 2.8s ease-in-out infinite;
}

.bot-open-button::after,
.primary-action::after,
.topup-option::after {
  content: "";
  position: absolute;
  inset: -45% auto -45% -40%;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  transform: skewX(-18deg);
  opacity: 0;
}

.bot-open-button:hover::after,
.primary-action:hover::after,
.topup-option:hover::after {
  animation: buttonSheen .75s ease;
}

.telegram-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #2fb7ff, #168ace);
  box-shadow:
    0 0 18px rgba(35, 168, 232, .55),
    inset 0 -3px 8px rgba(0, 0, 0, .2);
  transform: rotate(-18deg);
  transition: transform .18s ease, box-shadow .2s ease;
}

.bot-open-button:hover .telegram-logo {
  transform: rotate(-18deg) scale(1.08);
  box-shadow:
    0 0 24px rgba(35, 168, 232, .72),
    inset 0 -3px 8px rgba(0, 0, 0, .2);
}

.bot-button-text {
  white-space: nowrap;
}

.direct-mode .app-shell {
  align-items: center;
}

.direct-mode .player-panel {
  width: min(560px, calc(100% - 28px));
  min-height: 260px;
  display: grid;
  place-items: center;
}

.direct-mode .topbar {
  margin: 0;
  justify-content: center;
}

.direct-mode .balance,
.direct-mode .viewer,
.direct-mode .controls,
.direct-mode .notice,
.direct-mode .brand-banner {
  display: none;
}

.direct-mode .site-title {
  min-height: 64px;
  padding: 0 26px 0 16px;
  font-size: 24px;
}

.direct-mode .telegram-logo {
  width: 42px;
  height: 42px;
  font-size: 27px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.balance {
  min-width: 190px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 36, 56, .25);
  border-radius: 8px;
  background: #09090b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.balance span {
  display: inline;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.balance strong {
  font-size: 18px;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 36, 56, .42);
}

.balance-plus {
  width: 30px;
  min-height: 30px;
  height: 30px;
  border: 1px solid rgba(255, 36, 56, .35);
  border-radius: 8px;
  background: linear-gradient(180deg, #ff2438, #85000d);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 0 18px rgba(255, 36, 56, .18);
}

.viewer {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 36, 56, .42);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(255, 36, 56, .13), transparent 20rem),
    linear-gradient(135deg, #0b0b0e, #010101);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 42px rgba(255, 36, 56, .12);
}

.viewer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 36, 56, .04), transparent 16%, transparent 84%, rgba(255, 36, 56, .04));
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .82);
}

video {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #000;
}

.video-watermark {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  pointer-events: none;
  overflow: hidden;
}

.video-watermark span {
  position: absolute;
  color: rgba(255, 255, 255, .36);
  font-size: clamp(22px, 5.5vw, 54px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .72),
    0 0 14px rgba(255, 36, 56, .2);
  transform: translate(-50%, -50%) rotate(-18deg);
  mix-blend-mode: screen;
  opacity: .72;
  white-space: nowrap;
}

.video-watermark span:nth-child(1) {
  left: 27%;
  top: 24%;
}

.video-watermark span:nth-child(2) {
  left: 72%;
  top: 51%;
}

.video-watermark span:nth-child(3) {
  left: 33%;
  top: 80%;
}

.empty-state,
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 22px;
}

.pulse-ring {
  position: relative;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(255, 36, 56, .72);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 36, 56, .74) 0 10px, transparent 11px),
    radial-gradient(circle at center, rgba(0, 0, 0, .5) 0 38px, rgba(255, 36, 56, .2) 39px 58px, transparent 59px);
  box-shadow:
    0 0 42px rgba(255, 36, 56, .36),
    inset 0 0 34px rgba(255, 36, 56, .14);
}

.pulse-ring::before,
.pulse-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.pulse-ring::before {
  inset: -1px;
  background:
    conic-gradient(
      from 0deg,
      transparent 0 8%,
      rgba(255, 36, 56, .12) 16%,
      rgba(255, 36, 56, 1) 27%,
      rgba(255, 36, 56, .42) 38%,
      transparent 52% 100%
    );
  mix-blend-mode: screen;
  animation: spin 720ms linear infinite;
}

.pulse-ring::after {
  inset: 31px;
  background:
    conic-gradient(from 180deg, rgba(0, 0, 0, .72), rgba(255, 36, 56, .2), rgba(0, 0, 0, .72) 62%),
    radial-gradient(circle at center, rgba(0, 0, 0, .58), rgba(0, 0, 0, .92));
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, .65),
    0 0 18px rgba(255, 36, 56, .18);
  animation: spin 1.45s linear infinite reverse;
}

.orbit-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  background: #ffebef;
  box-shadow:
    0 0 14px rgba(255, 235, 239, .9),
    0 0 28px rgba(255, 36, 56, .8),
    0 0 42px rgba(255, 36, 56, .45);
  transform: rotate(0deg) translateX(58px);
  animation: orbitDot 720ms linear infinite;
  z-index: 2;
}

.loading {
  display: none;
  z-index: 2;
  background: rgba(0, 0, 0, .78);
  font-size: 19px;
  font-weight: 700;
  color: var(--red);
  text-shadow: 0 0 18px rgba(255, 36, 56, .7);
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    transform .16s ease,
    box-shadow .2s ease,
    border-color .2s ease,
    filter .2s ease;
  will-change: transform;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px) scale(.99);
}

.primary-action {
  position: relative;
  overflow: hidden;
  width: min(360px, 100%);
  color: #fff;
  background: linear-gradient(180deg, #ff2438, #85000d);
  border: 1px solid rgba(255, 118, 128, .2);
  box-shadow: 0 16px 36px rgba(255, 36, 56, .2);
  text-transform: uppercase;
}

.primary-action:hover {
  filter: brightness(1.08);
  box-shadow:
    0 18px 42px rgba(255, 36, 56, .28),
    0 0 24px rgba(255, 36, 56, .2);
}

.primary-action:disabled {
  color: rgba(255,255,255,.72);
  background: linear-gradient(180deg, #62212a, #351016);
  cursor: wait;
}

.notice {
  min-height: 20px;
  margin: 10px 2px 0;
  color: #ff5263;
  font-size: 14px;
}

.shop-mode .viewer,
.shop-mode .controls {
  display: none;
}

.shop-view {
  display: grid;
  gap: 12px;
  min-height: 420px;
}

.shop-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.shop-head h1 {
  grid-column: 2;
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-style: italic;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 36, 56, .35);
}

.ghost-action {
  position: static;
  transform: none;
  min-height: 38px;
  padding: 0 14px;
  color: #fff;
  background: #111116;
  border: 1px solid rgba(255, 36, 56, .26);
}

.shop-head .ghost-action {
  grid-column: 3;
  justify-self: end;
  min-width: 132px;
}

.shop-grid {
  width: min(560px, 100%);
  margin: 8px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.shop-grid[hidden] {
  display: none;
}

.product-mode .shop-grid {
  display: none;
}

.product-mode .topbar,
.product-mode .shop-head {
  display: none;
}

.shop-item {
  min-height: 62px;
  padding: 12px 16px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 40%, rgba(255, 36, 56, .18), transparent 46%),
    linear-gradient(180deg, rgba(255, 36, 56, .16), rgba(15, 15, 18, .96)),
    #101013;
  border: 1px solid rgba(255, 36, 56, .25);
  box-shadow:
    inset 0 0 18px rgba(255, 36, 56, .04),
    0 14px 28px rgba(0, 0, 0, .28);
  text-align: center;
  overflow-wrap: anywhere;
}

.shop-item:hover,
.ghost-action:hover {
  border-color: rgba(255, 36, 56, .62);
  filter: brightness(1.08);
  box-shadow:
    inset 0 0 20px rgba(255, 36, 56, .08),
    0 18px 34px rgba(0, 0, 0, .34),
    0 0 18px rgba(255, 36, 56, .16);
}

.shop-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: #ff5263;
  border: 1px solid rgba(255, 36, 56, .18);
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
}

.product-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 36, 56, .28);
  border-radius: 8px;
  background: #08080a;
}

.product-card[hidden],
.shop-view[hidden] {
  display: none;
}

.product-card img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
  background: #020203;
  border: 1px solid rgba(255, 36, 56, .18);
}

.product-card h2 {
  margin: 0;
  color: #fff;
  font-size: 21px;
}

.product-card p {
  margin: 0;
  color: #d8ced1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.product-buy {
  width: 100%;
}

.product-back {
  position: static;
  transform: none;
  width: 100%;
  min-height: 48px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(8px);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  padding: 14px;
  border: 1px solid rgba(255, 36, 56, .36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 36, 56, .08), transparent 30%),
    #08080a;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .82);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-head strong {
  font-size: 17px;
}

.modal-close {
  width: 34px;
  min-height: 34px;
  height: 34px;
  color: #fff;
  background: #111116;
  border: 1px solid rgba(255, 36, 56, .26);
  font-size: 24px;
  line-height: 1;
}

.stars-label {
  margin-bottom: 12px;
  color: var(--muted);
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.topup-option,
#customPay {
  position: relative;
  overflow: hidden;
  min-height: 44px;
  color: #fff;
  background: #111116;
  border: 1px solid rgba(255, 36, 56, .22);
}

.topup-option:hover,
#customPay:hover,
.modal-close:hover,
.balance-plus:hover {
  border-color: rgba(255, 36, 56, .58);
  filter: brightness(1.08);
}

.topup-option.wide {
  grid-column: 1 / -1;
}

.custom-row {
  display: none;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 8px;
  margin-top: 10px;
}

.custom-row.is-open {
  display: grid;
}

.custom-row input {
  min-height: 44px;
  border: 1px solid rgba(255, 36, 56, .24);
  border-radius: 8px;
  background: #050506;
  color: #fff;
  padding: 0 12px;
  font: inherit;
}

.stars-help {
  display: none;
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 36, 56, .2);
  border-radius: 8px;
  background: #050506;
  color: var(--muted);
}

.stars-help.is-open {
  display: grid;
}

.stars-help a {
  color: #c9bfc2;
  text-decoration: none;
}

.stars-help a:hover {
  color: #fff;
  text-decoration: underline;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitDot {
  to {
    transform: rotate(360deg) translateX(58px);
  }
}

@keyframes telegramPulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 24px rgba(35, 168, 232, .06),
      0 0 22px rgba(35, 168, 232, .1),
      0 0 28px rgba(255, 36, 56, .08);
  }
  50% {
    box-shadow:
      inset 0 0 28px rgba(35, 168, 232, .1),
      0 0 30px rgba(35, 168, 232, .2),
      0 0 34px rgba(255, 36, 56, .12);
  }
}

@keyframes buttonSheen {
  0% {
    left: -40%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    left: 112%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    min-height: 100dvh;
    align-items: flex-start;
    padding: 10px;
  }

  .player-panel {
    width: 100%;
    padding: 9px;
    border-radius: 8px;
    overflow: hidden;
  }

  .brand-banner {
    min-height: 58px;
    margin-bottom: 9px;
    font-size: 24px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
  }

  .site-title {
    min-height: 42px;
    padding: 0 12px 0 9px;
    gap: 8px;
    font-size: 14px;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }

  .telegram-logo {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .bot-button-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .balance {
    min-width: 0;
    flex: 0 0 auto;
    padding: 7px 8px;
    gap: 5px;
    white-space: nowrap;
  }

  .balance span {
    display: none;
  }

  .balance strong {
    font-size: 15px;
  }

  .balance-plus {
    width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 18px;
  }

  .viewer {
    aspect-ratio: 9 / 14;
    max-height: calc(100dvh - 170px);
    min-height: 360px;
  }

  .pulse-ring {
    width: 96px;
    height: 96px;
  }

  .pulse-ring::after {
    inset: 25px;
  }

  .orbit-dot {
    transform: rotate(0deg) translateX(47px);
    animation-name: orbitDotMobile;
  }

  .primary-action {
    width: 100%;
    min-height: 52px;
    font-size: 15px;
  }

  .controls {
    display: block;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

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

  .custom-row {
    grid-template-columns: 1fr;
  }

  .stars-help {
    overflow-wrap: anywhere;
  }

  .shop-view {
    min-height: 0;
    gap: 10px;
  }

  .shop-head {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 9px;
  }

  .shop-head h1 {
    grid-column: auto;
    font-size: 19px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .ghost-action {
    position: static;
    transform: none;
    width: 100%;
  }

  .shop-head .ghost-action {
    grid-column: auto;
    justify-self: stretch;
    min-width: 0;
    min-height: 46px;
  }

  .shop-grid {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .shop-item {
    min-height: 56px;
    font-size: 15px;
    padding: 12px 10px;
  }

  .product-card {
    width: 100%;
    min-width: 0;
    padding: 10px;
    gap: 10px;
  }

  .product-card img {
    max-height: 260px;
  }

  .product-card h2 {
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .product-card p {
    font-size: 14px;
    line-height: 1.4;
  }

  .product-buy,
  .product-back {
    min-height: 50px;
    font-size: 14px;
  }

  .direct-mode .app-shell {
    align-items: center;
    justify-content: center;
    padding: 14px;
  }

  .direct-mode .player-panel {
    width: 100%;
    min-height: 220px;
  }

  .direct-mode .site-title {
    min-height: 58px;
    flex: 0 1 auto;
    padding: 0 20px 0 13px;
    font-size: 20px;
  }

  .direct-mode .telegram-logo {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}

@keyframes orbitDotMobile {
  to {
    transform: rotate(360deg) translateX(47px);
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding: 7px;
  }

  .site-title {
    font-size: 13px;
    padding-inline: 8px;
  }

  .brand-banner {
    min-height: 52px;
    font-size: 21px;
  }

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

  .balance {
    width: 100%;
    justify-content: center;
  }

  .shop-head h1 {
    font-size: 17px;
  }

  .viewer {
    min-height: 310px;
  }

  .primary-action {
    font-size: 13px;
  }

  .direct-mode .site-title {
    font-size: 18px;
  }
}
