
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'MonumentExtended';
  src: url('/fonts/MonumentExtended-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'MonumentExtended';
  src: url('/fonts/MonumentExtended-Ultrabold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
}

:root {
  /* ── Ethereum Live palette ── */
  --bg-deep:    #050D2E;
  --bg-base:    #0A1845;
  --bg-card:    #0E1F5C;
  --brand:      #2D5BFF;
  --brand-2:    #1B3FB8;
  --brand-glow: #3D6EF8;
  --brand-soft: #A8B8FF;
  --brand-glow-rgba: rgba(61, 110, 248, 0.35);

  --text:       #FFFFFF;
  --muted:      #8B9BD9;

  --stroke:        rgba(168, 184, 255, 0.14);
  --stroke-strong: rgba(168, 184, 255, 0.28);

  --glass-bg:       rgba(168, 184, 255, 0.06);
  --glass-bg-hover: rgba(168, 184, 255, 0.12);

  --live: #FF4D6D;

  --blur-val: 20px;
  --radius: 24px;
  --radius-pill: 100px;

  --shadow-sm:    0 4px 20px -4px rgba(0, 0, 0, 0.35);
  --shadow-md:    0 12px 40px -8px rgba(45, 91, 255, 0.25);
  --shadow-hover: 0 20px 50px -12px rgba(61, 110, 248, 0.45);
  --shadow-modal: 0 40px 80px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. GLOBAL RESET & BASE
   ========================================= */

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;

  background:
    linear-gradient(180deg, #050D2E 0%, #0A1845 100%) fixed;
}

/* Все блоки контента поднимаем над звёздами */
.site-header,
main,
.site-footer { position: relative; z-index: 1; }

body::before { display: none; }

a {
  color: var(--brand-soft);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover { color: var(--brand-glow); text-shadow: 0 0 12px var(--brand-glow-rgba); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================
   3. HEADER (Floating Glass Capsule)
   ========================================= */

.site-header {
  padding-top: 24px;
  padding-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;

  background: rgba(14, 31, 92, 0.55);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);

  border: 1px solid var(--stroke);
  border-top: 1px solid var(--stroke-strong);

  border-radius: var(--radius-pill);
  padding: 8px 12px 8px 24px;
  box-shadow: var(--shadow-md);
}

.brand { display: flex; align-items: center; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--text); }

.brand-logo {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 18px var(--brand-glow-rgba));
}

.brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.3px;
  color: var(--text);
  text-shadow: 0 0 24px var(--brand-glow-rgba);
}
.brand-accent { color: var(--brand-glow); }

.nav-center {
  justify-self: center;
  display: flex;
  background: rgba(5, 13, 46, 0.5);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--stroke);
}

.nav-link {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-link:hover { color: var(--text); background: rgba(168, 184, 255, 0.08); }

.nav-link.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(45, 91, 255, 0.4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 8px 20px -6px var(--brand-glow-rgba),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn,
.btn:hover { color: #fff; }

.btn:hover {
  background: var(--brand-glow);
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px -8px var(--brand-glow-rgba),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: none;
}

.btn-wallet {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 14px 28px;
  box-shadow: 0 4px 16px rgba(45, 91, 255, 0.4);
  transition: all 0.2s ease;
}

.btn-wallet:hover {
  background: var(--brand-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(61, 110, 248, 0.55);
}

.btn-wallet.is-connected {
  background: rgba(168, 184, 255, 0.10);
  color: var(--brand-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--stroke-strong);
}

.btn-wallet.is-connected:hover {
  background: rgba(168, 184, 255, 0.16);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* =========================================
   4. MAIN CONTENT
   ========================================= */

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 24px;
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 32px;
  margin: 0;
  letter-spacing: -0.5px;

  background: linear-gradient(135deg, #FFFFFF 0%, var(--brand-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.icon-refresh {
  width: 44px; height: 44px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: rgba(168, 184, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-mask: url('/img/refresh.svg') center / 20px 20px no-repeat;
  mask: url('/img/refresh.svg') center / 20px 20px no-repeat;
  background-color: var(--brand-soft);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.icon-refresh:hover {
  background-color: var(--brand-glow);
  transform: rotate(90deg) scale(1.1);
}

/* =========================================
   5. GRID & CARDS (Glass on Dark)
   ========================================= */

.grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: 60px;
}

@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  border: 1px solid var(--stroke);
  border-top-color: var(--stroke-strong);

  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-sm);
  animation: cardFadeIn 0.6s ease forwards;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px);
  background: var(--glass-bg-hover);
  box-shadow: var(--shadow-hover);
  border-color: rgba(61, 110, 248, 0.4);
  z-index: 2;
}

.card-media {
  width: calc(100% - 20px);
  margin: 10px 10px 0 10px;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .card-img { transform: scale(1.08); }

.card-badge {
  position: absolute;
  top: 18px; right: 18px;
  background: rgba(14, 31, 92, 0.85);
  color: var(--brand-soft);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 100px;
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.addr {
  font-family: 'Poppins', monospace;
  font-size: 12px;
  color: var(--brand-soft);
  background: rgba(168, 184, 255, 0.08);
  border: 1px solid var(--stroke);
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
}

.no-streams {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  color: var(--muted);
}
.no-streams p { margin: 6px 0; font-size: 18px; }
.no-streams strong { color: var(--text); }

/* =========================================
   6. FOOTER
   ========================================= */

.site-footer {
  border-top: 1px solid var(--stroke);
  margin-top: auto;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(168, 184, 255, 0.08);
  border: 1px solid var(--stroke);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.footer-social:hover {
  background: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 91, 255, 0.5);
}

.footer-x-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.footer-social:hover .footer-x-icon {
  opacity: 1;
}

/* =========================================
   7. WALLET MODAL & POPOVER
   ========================================= */

.wallet-pop {
  position: absolute;
  top: 0; left: 0;
  width: 260px;

  background: rgba(14, 31, 92, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--stroke-strong);

  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  padding: 20px;
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.wallet-pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.wallet-pop__row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--brand-soft);
}

.wallet-pop__actions {
  display: flex;
  justify-content: flex-end;
}

.btn-disconnect {
  background: none;
  border: none;
  color: var(--live);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.btn-disconnect:hover { text-decoration: underline; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 13, 46, 0.7);
  backdrop-filter: blur(12px);
}

.modal__card {
  position: relative;
  width: 100%;
  max-width: 400px;

  background: rgba(14, 31, 92, 0.95);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--stroke-strong);

  border-radius: 32px;
  box-shadow: var(--shadow-modal);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.modal.is-open .modal__card {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--stroke);
}

.modal__title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.modal__close {
  background: rgba(168, 184, 255, 0.08);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--brand-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: 0.2s;
}
.modal__close:hover {
  background: var(--brand);
  color: #fff;
}

.modal__body {
  padding: 32px;
}

.wallet-list {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  background: rgba(168, 184, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-align: left;
}

.wallet-item:hover {
  background: rgba(168, 184, 255, 0.12);
  border-color: var(--brand-glow);
  box-shadow: 0 8px 20px -4px rgba(45, 91, 255, 0.35);
  transform: translateY(-2px);
}

.wallet-item:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.wallet-item.is-loading {
  justify-content: center;
  gap: 10px;
  color: var(--brand-soft);
}

.modal__hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.modal__error {
  color: var(--live);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.25);
  padding: 10px;
  border-radius: 12px;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin-refresh 0.8s linear infinite;
}

/* =========================================
   8. ANIMATIONS
   ========================================= */

@keyframes cardFadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================================
   9. STARS BACKGROUND (parallax + scroll)
   ========================================= */

.stars-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;

  /* Радиальные «облака» как на баннере Ethereum Live — внутри звёзд,
     чтобы стэкинг был общим */
  background:
    radial-gradient(at 8% 12%, rgba(168, 184, 255, 0.18) 0px, transparent 45%),
    radial-gradient(at 95% 78%, rgba(168, 184, 255, 0.16) 0px, transparent 50%),
    radial-gradient(at 50% 0%, rgba(45, 91, 255, 0.22) 0px, transparent 60%);
}

.stars-bg__inner {
  position: absolute;
  inset: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.stars-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2000px;
  animation-name: starsScroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.stars-dot {
  position: absolute;
  top: 0;
  left: 0;
  background: transparent;
  border-radius: 50%;
}

@keyframes starsScroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-2000px); }
}

/* =========================================
   10. PAGE TRANSITIONS (tab switching)
   ========================================= */

main, .site-header {
  animation: pageEnter 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

main { animation-delay: 0.08s; }

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

body.page-leaving main,
body.page-leaving .site-header {
  animation: pageLeave 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes pageLeave {
  to {
    opacity: 0;
    transform: translateY(-10px);
    filter: blur(6px);
  }
}

.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
              rgba(168, 184, 255, 0.35) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.4s ease, transform 0.5s ease;
  pointer-events: none;
}

.nav-link:hover::after {
  opacity: 1;
  transform: scale(1);
}
