:root {
  color-scheme: dark;
  --bg: #050508;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-2: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.1);
  --hot: #ff3366;
  --hot-glow: rgba(255, 51, 102, 0.3);
  --gold: #ffb800;
  --mint: #00f098;
  --blue: #00b4d8;
  --shadow-large: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 16px 48px -12px var(--hot-glow);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); overflow-x: hidden; }

body {
  min-height: 100%; margin: 0; color: var(--text);
  background: radial-gradient(circle at 50% -10%, rgba(255, 51, 102, 0.12), transparent 50%), var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.landing-shell, .admin-shell, .redirect-shell { width: min(100%, 1120px); margin: 0 auto; }
.landing-shell { padding: 0 16px 120px; }

/* --- Hero --- */
.hero-section {
  min-height: 100svh; display: grid; align-items: end;
  gap: 24px; padding: 24px 0 32px;
}

.hero-media {
  position: relative; min-height: 54svh; overflow: hidden;
  border: 1px solid var(--panel-border); border-radius: 24px;
  background: #000; box-shadow: var(--shadow-large), 0 0 0 1px rgba(255,255,255,0.02) inset;
  animation: mediaReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes mediaReveal {
  from { opacity: 0; transform: scale(0.96) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Background blur animation */
.blur-bg {
  position: absolute; inset: -30px; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(40px) saturate(1.8); opacity: 0.5;
  animation: blur-pulse 6s ease-in-out infinite alternate;
}

@keyframes blur-pulse {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0.6; transform: scale(1.1); }
}

.hero-media img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; transform: scale(1.02);
}

.media-shade {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
}

.media-label {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  max-width: calc(100% - 32px); padding: 8px 12px;
  border: 1px solid rgba(255, 184, 0, 0.2); border-radius: 12px;
  color: var(--gold); background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hero-copy { display: grid; gap: 14px; }
.hero-copy > * { animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-copy > :nth-child(1) { animation-delay: 0.1s; }
.hero-copy > :nth-child(2) { animation-delay: 0.2s; }
.hero-copy > :nth-child(3) { animation-delay: 0.3s; }
.hero-copy > :nth-child(4) { animation-delay: 0.4s; }
.hero-copy > :nth-child(5) { animation-delay: 0.5s; }
.hero-copy > :nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0; color: var(--gold);
  font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { 
  margin-bottom: 0; line-height: 1.05; letter-spacing: -0.03em; 
  background: linear-gradient(180deg, #FFFFFF 0%, #B8BBC7 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.landing-page h1 { font-size: clamp(2.5rem, 12vw, 5.5rem); }
.admin-page h1 { max-width: 10ch; font-size: clamp(2.25rem, 6vw, 4.2rem); }
.redirect-page h1 { font-size: clamp(2rem, 9vw, 3.2rem); }
h2 { margin-bottom: 0; font-size: 1.35rem; line-height: 1.1; letter-spacing: -0.02em; }

.hero-description { margin-bottom: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

/* --- Viewer Counter --- */
.viewer-counter {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 12px;
  background: rgba(255, 51, 102, 0.08); border: 1px solid rgba(255, 51, 102, 0.15);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 0.85rem; font-weight: 700; color: var(--hot);
  width: fit-content;
}

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 0 4px rgba(255, 51, 102, 0.2);
  animation: live-blink 1.5s ease-in-out infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* --- CTA Buttons --- */
.primary-cta, .secondary-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; width: 100%; padding: 0 24px; border: 0; border-radius: 16px;
  cursor: pointer; text-align: center; text-decoration: none; font-weight: 800;
  font-size: 1.05rem; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--hot) 0%, #ff6b33 100%);
  box-shadow: var(--shadow-glow), 0 1px 0 rgba(255,255,255,0.3) inset;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.primary-cta:hover, .primary-cta:focus-visible { 
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -12px var(--hot-glow), 0 1px 0 rgba(255,255,255,0.4) inset;
  filter: brightness(1.1); 
}
.primary-cta:active { transform: translateY(1px); }

.secondary-cta { 
  color: var(--text); background: var(--panel); 
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.secondary-cta:hover { background: var(--panel-2); border-color: rgba(255,255,255,0.15); }

/* Pulse animation for sticky CTA */
.pulse-cta { animation: cta-pulse 2.5s ease-in-out infinite; }

@keyframes cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow); }
  50% { transform: scale(1.02); box-shadow: 0 20px 60px -10px rgba(255, 51, 102, 0.5); }
}

/* --- Signal Row --- */
.signal-row { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.82rem; }

.signal-row span {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--panel-border); border-radius: 12px;
  background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.signal-row b {
  width: 6px; height: 6px; margin-right: 8px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 3px rgba(0, 240, 152, 0.15);
}

/* --- Preview Slideshow --- */
.preview-slideshow { 
  padding: 24px 0 32px; overflow: hidden; max-width: 100vw; 
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}
.preview-slideshow .eyebrow { margin-bottom: 12px; padding: 0 16px; }

.slideshow-track {
  display: flex; gap: 12px; padding: 8px 0 16px 16px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.slideshow-track::after { content: ''; flex: 0 0 16px; height: 1px; }
.slideshow-track::-webkit-scrollbar { display: none; }

.slide-item {
  flex: 0 0 220px; max-width: 70vw; scroll-snap-align: start;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--panel-border); background: rgba(0,0,0,0.3);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}
.slide-item:active { transform: scale(0.97); }

.slide-item img {
  width: 100%; height: auto; aspect-ratio: 3 / 4;
  object-fit: contain; object-position: center;
  display: block; background: #000;
  transition: transform 0.5s ease;
}

.slide-caption {
  padding: 10px 12px; font-size: 0.8rem; font-weight: 600;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--panel-border);
}

@media (min-width: 720px) {
  .slide-item { flex: 0 0 240px; max-width: 260px; cursor: pointer; }
  .slide-item:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.2); box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6); }
  .slide-item:hover img { transform: scale(1.05); }
  .slide-caption { padding: 12px 14px; font-size: 0.85rem; }
}

/* --- Sticky CTA --- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--panel-border);
  background: rgba(5, 5, 8, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.compact { width: min(100%, 720px); margin: 0 auto; }

/* --- Flow Dialog --- */
.flow-dialog {
  width: min(92vw, 430px); padding: 0; border: 0;
  border-radius: 20px; color: var(--text); background: transparent;
}
.flow-dialog::backdrop { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

.flow-panel {
  position: relative; display: grid; gap: 16px; padding: 28px;
  border: 1px solid var(--panel-border); border-radius: 20px;
  background: #0d0d12; box-shadow: var(--shadow-large), 0 0 0 1px rgba(255,255,255,0.02) inset;
}

.icon-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border: 1px solid var(--panel-border); border-radius: 50%;
  color: var(--muted); background: var(--panel); cursor: pointer;
  transition: all 0.2s; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem;
}
.icon-close:hover { background: var(--panel-2); color: var(--text); }

.progress-track {
  width: 100%; height: 8px; overflow: hidden;
  border-radius: 999px; background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3) inset;
}
.progress-track span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold), var(--hot));
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-track.loop span {
  width: 40%; animation: loading-loop 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.flow-status { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; text-align: center; }

/* Telegram CTA */
.telegram-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%) !important;
  color: #fff !important; box-shadow: 0 8px 24px rgba(42, 171, 238, 0.3) !important;
}
.telegram-cta:hover {
  box-shadow: 0 12px 32px rgba(42, 171, 238, 0.4) !important;
}

/* --- Admin --- */
.admin-page {
  background: radial-gradient(circle at 50% 0%, rgba(0, 240, 152, 0.08), transparent 40%), var(--bg);
}
.admin-shell { display: grid; gap: 24px; padding: 24px 16px 64px; }
.admin-workspace, .admin-list, .redirect-shell {
  border: 1px solid var(--panel-border); border-radius: 20px;
  background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.admin-workspace { padding: 24px; }
.admin-header { margin-bottom: 24px; }
.admin-header h1 { margin-bottom: 12px; font-size: 2rem; }
.admin-header p { color: var(--muted); line-height: 1.6; }
.admin-header code { color: var(--gold); background: rgba(255,184,0,0.1); padding: 2px 6px; border-radius: 6px; }

.admin-form { display: grid; gap: 16px; }
.admin-form label { display: grid; gap: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 700; }

.admin-form input, .admin-form textarea {
  width: 100%; border: 1px solid var(--panel-border); border-radius: 12px;
  color: var(--text); background: rgba(0, 0, 0, 0.3); outline: 0;
  transition: all 0.2s; font-size: 0.95rem;
}
.admin-form input { min-height: 52px; padding: 0 16px; }
.admin-form textarea { resize: vertical; padding: 16px; min-height: 100px; }
.admin-form input:focus, .admin-form textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 184, 0, 0.15);
  background: rgba(0,0,0,0.5);
}

/* Upload area */
.upload-zone {
  position: relative; padding: 24px; border: 2px dashed var(--panel-border); border-radius: 16px;
  text-align: center; cursor: pointer; transition: all 0.2s; background: rgba(0,0,0,0.2);
}
.upload-zone:hover { border-color: var(--gold); background: rgba(255, 184, 0, 0.05); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .upload-text { color: var(--muted); font-size: 0.95rem; }
.upload-zone .upload-text strong { color: var(--gold); }
.upload-preview { max-width: 140px; border-radius: 10px; margin-top: 12px; border: 1px solid var(--panel-border); }

.admin-list { display: grid; align-content: start; gap: 16px; padding: 24px; }
.admin-list h2 { margin: 0; font-size: 1.5rem; }

.notice {
  padding: 14px 16px; border: 1px solid rgba(255, 184, 0, 0.3); border-radius: 12px;
  color: var(--gold); background: rgba(255, 184, 0, 0.08); font-size: 0.95rem;
}

.page-list { display: grid; gap: 12px; }

.page-item {
  display: grid; gap: 8px; padding: 16px;
  border: 1px solid var(--panel-border); border-radius: 12px;
  background: rgba(0, 0, 0, 0.2); transition: all 0.2s;
}
.page-item:hover { border-color: rgba(255,255,255,0.2); background: rgba(0,0,0,0.4); }
.page-item strong { display: block; font-size: 1.05rem; }
.page-item a { color: var(--blue); word-break: break-word; font-weight: 500; }
.page-item small { color: var(--muted); font-size: 0.85rem; }

/* --- Redirect --- */
.redirect-page { display: grid; min-height: 100svh; place-items: center; padding: 24px; }
.redirect-shell { display: grid; gap: 16px; max-width: 480px; padding: 32px; text-align: center; }
.redirect-shell p { margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }

@keyframes loading-loop {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* --- Desktop --- */
@media (min-width: 720px) {
  .landing-shell { padding-inline: 32px; }
  .hero-section {
    grid-template-columns: minmax(360px, 0.9fr) minmax(380px, 1fr);
    align-items: center; min-height: 90svh; gap: 48px;
  }
  .hero-media { min-height: 72svh; border-radius: 32px; }
  .hero-copy { gap: 20px; }
  .hero-description { max-width: 38rem; font-size: 1.15rem; }
  .primary-cta, .secondary-cta { width: fit-content; min-width: 240px; font-size: 1.1rem; }
  .sticky-cta .primary-cta { width: min(100%, 720px); }
  .admin-shell {
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: start; padding: 40px 32px 80px; gap: 32px;
  }
  .admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form .full, .admin-form button { grid-column: 1 / -1; }
}

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