/* === stream4.fun — Global theme (Kick-inspired) === */

/* Brand face for accents (already preloaded in HTML) */
@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;
}

/* Colors & tokens */
:root{
  /* Base */
  --bg: #0e0f10;
  --bg-2: #121315;
  --bg-3: #15171a;
  --panel: rgba(18,19,21, .88);

  /* Text */
  --text: #E7E9EC;
  --muted: #9aa1a9;

  /* Kick-style accent (neon green) */
  --accent: #42ff3b;
  --accent-2: #2de02a;
  --accent-3: #1bb81b;

  /* UI */
  --stroke: #1d2024;
  --live: #ff4747;
  --radius: 14px;

  /* Grid bg (subtle) */
  --grid-cell: 160px;
  --grid-h: calc(var(--grid-cell) * 0.5625);
  --grid-stroke: 1px;
  --grid-color: 200, 210, 220;
  --grid-alpha: .05;

  /* Shadows */
  --shadow-xs: 0 4px 12px rgba(0,0,0,.18);
  --shadow-sm: 0 6px 16px rgba(0,0,0,.22);
  --shadow-md: 0 10px 26px rgba(0,0,0,.28);
  --shadow-lg: 0 16px 42px rgba(0,0,0,.36);
}

/* Reset & base */
*{ box-sizing: border-box; }
html, body{ height:100%; margin:0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 600;
  line-height: 1.45;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(66,255,59,.06), rgba(0,0,0,0)),
    radial-gradient(1000px 500px at -10% 10%, rgba(66,255,59,.04), rgba(0,0,0,0)),
    repeating-linear-gradient(
      to right,
      rgba(var(--grid-color), var(--grid-alpha)) 0,
      rgba(var(--grid-color), var(--grid-alpha)) var(--grid-stroke),
      transparent var(--grid-stroke),
      transparent var(--grid-cell)
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(var(--grid-color), var(--grid-alpha)) 0,
      rgba(var(--grid-color), var(--grid-alpha)) var(--grid-stroke),
      transparent var(--grid-stroke),
      transparent var(--grid-h)
    );
  background-attachment: fixed;
}
a{ color: var(--accent); text-decoration: none; }
a:hover{ color: #eaffea; text-shadow: 0 0 8px rgba(66,255,59,.3); }
.container{ max-width: 1200px; margin: 0 auto; padding: 16px; }

/* Utility */
.visually-hidden{ position:absolute !important; clip:rect(1px,1px,1px,1px); padding:0; border:0; height:1px; width:1px; overflow:hidden; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(0deg, rgba(0,0,0,.0), rgba(0,0,0,.35)), rgba(18,19,21,.6);
  backdrop-filter: blur(8px) saturate(120%);
  border-bottom: 1px solid var(--stroke);
}
.topbar__inner { display:flex; align-items:center; gap:12px; padding:8px 0; }
.topbar__dot { width:8px; height:8px; border-radius:50%; background: var(--accent); box-shadow: 0 0 12px rgba(66,255,59,.7); }
.topbar__text { color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.topbar__link { margin-left: auto; font-weight: 800; }

/* Header */
.site-header{ padding-top: 10px; padding-bottom: 8px; }
.header-inner{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(18,19,21,.6);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.03);
  padding: 12px 16px;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-link{ display:inline-flex; align-items:center; gap:10px; }
.brand-logo{ height: 30px; width:auto; display:block; }
.brand-text{
  font-family: 'MonumentExtended', sans-serif;
  font-weight: 800;
  letter-spacing: .5px;
  font-size: 20px;
  color: var(--text);
}
.brand-accent{ color: var(--accent); text-shadow: 0 0 10px rgba(66,255,59,.55); }

.nav-center{ justify-self: center; display:flex; gap: 10px; }
.nav-link{
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #d9e6d9;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .06s ease;
}
.nav-link:hover{
  background: rgba(255,255,255,.04);
  transform: translateY(-1px);
}
.nav-link.is-active{
  background: var(--accent);
  color: #0f120f;
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(66,255,59,.18) inset, var(--shadow-xs);
}
.header-actions{ display:flex; align-items:center; gap:10px; }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #0f120f;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(66,255,59,.18);
}
.btn:hover{ background: var(--accent-2); transform: translateY(-1px); }
.btn:active{ background: var(--accent-3); transform: translateY(1px); }
.btn-ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
}
.btn-ghost:hover{ background: rgba(255,255,255,.04); }
.btn-primary{ background: var(--accent); color: #0f120f; border-color: var(--accent); }
.btn-wallet{
  text-transform: uppercase;
  background: #0f140f;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(66,255,59,.18) inset;
}
.btn-wallet:hover{ background: #0b0f0b; }
.btn-wallet.is-connected{
  background: #0b0f0b;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(66,255,59,.22) inset;
}

.btn-status { gap:8px; }
.btn-status__text{ font-weight: 800; }
.live-dot{
  width:10px; height:10px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(66,255,59,.9);
}

/* Hero */
.hero{ padding-top: 12px; padding-bottom: 8px; }
.hero--compact{ padding-top: 6px; }
.hero__badge{
  display:inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--bg-3);
  color: #dfffe0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  margin-bottom: 6px;
}
.hero-title{ margin: 6px 0 6px; font-size: 28px; font-weight: 800; letter-spacing: .2px; }
.hero-text{ margin: 0 0 12px; color: var(--muted); }
.hero-actions{ display:flex; gap:10px; flex-wrap: wrap; }

/* Sections & grid */
.section-title-row{ display:flex; align-items:center; gap:10px; margin: 18px 0 10px; }
.section-title{ margin:0; font-size:18px; font-weight: 800; color: #e9ffe9; letter-spacing: .3px; }

.grid{ display:grid; gap:14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width:1024px){ .grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width:640px){ .grid{ grid-template-columns: 1fr; } }

/* Stream cards (IDs/classes preserved for JS) */
.card{
  position: relative;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .2s ease;
  animation: cardFadeIn .4s ease forwards; will-change: opacity, transform;
}
.card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); filter: saturate(1.08); }

.card-media{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0c0e;
}
.card-img{
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.card-badge{
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: .6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--live); color: #fff;
  box-shadow: 0 0 0 2px rgba(255,80,80,.12), 0 6px 18px rgba(255,80,80,.25);
}
.card.is-offline .card-badge{
  background: #394048; color: #cbd3db; box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.card-body{
  padding: 10px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--stroke);
}
.card-title{
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}
.addr{
  margin: 0;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .3px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.3;
  cursor: copy;
}
.card-clickable { cursor: pointer; }
.card-clickable .js-watch { cursor: pointer; }

.no-streams{
  display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;
  padding: 60px 20px; min-height: 200px;
}
.no-streams p{ margin: 4px 0; font-size: 18px; color: var(--muted); }
.grid.empty{ display:flex; align-items:center; justify-content:center; min-height: 50vh; }
.no-streams strong{ color: var(--accent); font-weight: 800; }

.site-footer{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px; border-top: 1px solid var(--stroke); margin-top: 24px; padding-top: 12px;
}
.footer-link{ color: #cfe9cf; }
.footer-link:hover{ color: #eaffea; }

.muted{ color: var(--muted); }

/* Wallet modal (kept compatible with wallet.js) */
.modal{ position: fixed; inset: 0; z-index: 9999; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal__card{
  position:absolute; left:50%; top:50%; width: min(92vw, 420px);
  transform: translate(-50%, -50%);
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.03);
}
.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px 8px; border-bottom: 1px solid var(--stroke);
}
.modal__title{ margin:0; font-size:16px; font-weight: 800; letter-spacing:.3px; }
.modal__close{
  background: transparent; border:1px solid var(--stroke); color: var(--text);
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
}
.modal__close:hover{ background: rgba(255,255,255,.04); }
.modal__body{ padding: 14px 16px 16px; }

.wallet-list{ display: grid; gap: 10px; margin: 8px 0 10px; }
.wallet-item{
  display:flex; align-items:center; gap:10px; width:100%; padding: 12px 14px;
  background: var(--bg-3); border: 1px solid var(--stroke); border-radius: 12px; color: var(--text);
  cursor:pointer; font-weight: 700; transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.wallet-item:hover{ background: rgba(255,255,255,.04); box-shadow: var(--shadow-sm); }
.wallet-item:active{ transform: translateY(1px); }
.wallet-item__icon{ font-size: 18px; line-height: 1; }
.modal__hint{ margin: 8px 0 0; font-size:12px; color: var(--muted); }
.modal__error{ margin: 10px 0 0; font-size: 13px; color: #ff6b6b; }

/* Wallet pop */
.wallet-pop {
  position: absolute; z-index: 10000; min-width: 180px; padding: 10px;
  background: var(--bg-2); border: 1px solid var(--stroke); border-radius: 12px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.03);
  transform: translateY(6px); opacity: 0; pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.wallet-pop.is-open { opacity: 1; transform: translateY(10px); pointer-events: auto; }
.wallet-pop__row{
  display:flex; align-items:center; gap:8px; margin-bottom:8px; color: var(--muted);
  font-size: 12px; letter-spacing: .3px; word-break: break-all;
}
.wallet-pop__actions{ display:flex; gap:8px; }
.wallet-pop .btn-disconnect{
  appearance: none; background: none !important; border: none !important; box-shadow: none !important;
  padding:0 !important; margin:0; border-radius:0 !important; display:inline; cursor:pointer;
  font-weight: 800; font-size: 13px; letter-spacing: .3px; text-transform: none; color: var(--live); line-height: 1.2;
}
.wallet-pop .btn-disconnect:hover{ text-decoration: underline; opacity:.9; }
.wallet-pop .btn-disconnect:focus-visible{ outline: 2px dashed rgba(209,59,47,.7); outline-offset: 2px; }

/* Refresh icon */
.icon-refresh{
  width: 32px; height: 32px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--accent);
  -webkit-mask: url('../img/refresh.svg') center / 18px 18px no-repeat;
          mask: url('../img/refresh.svg') center / 18px 18px no-repeat;
  cursor: pointer;
  transition: background .2s ease, transform .18s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(66,255,59,.18);
}
.icon-refresh:hover{
  background: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(66,255,59,.22) inset;
  transform: rotate(90deg);
}
.icon-refresh:active{
  background: var(--accent-3);
  transform: rotate(120deg) translateY(1px);
}
@supports not (-webkit-mask: url('../img/refresh.svg')) {
  .icon-refresh{
    background: transparent;
    background-image: url('../img/refresh.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    filter: brightness(0) saturate(100%) sepia(72%) hue-rotate(65deg) saturate(600%) contrast(1.1);
  }
  .icon-refresh:hover{ filter: none; }
}
.icon-refresh.is-rotating { animation: spin-refresh .8s linear; }
@keyframes spin-refresh { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@keyframes cardFadeIn { 0% { opacity: 0; transform: translateY(10px);} 100% { opacity:1; transform: translateY(0);} }
/* === Skeleton grid & inline alert === */

.inline-alert{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}
.inline-alert.is-hidden{ display: none; }
.inline-alert__icon{ font-size: 16px; line-height: 1; }
.inline-alert__text{ color: var(--text); font-weight: 700; letter-spacing: .2px; }
.inline-alert__retry{
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: #0f140f;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.inline-alert__retry:hover{ background: #0b0f0b; }
.inline-alert__retry:active{ transform: translateY(1px); }

/* Скелетоны */
.card--skeleton{
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}
.skel{
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #1a1c1f;
}
.skel::after{
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%,
                                     rgba(255,255,255,0.06) 50%,
                                     rgba(255,255,255,0) 100%);
  animation: skel-shimmer 1.4s infinite;
}

.skel-media{
  height: 100%;
  width: 100%;
  border-radius: 0;
  aspect-ratio: 16/9;
  background: linear-gradient(0deg, #0c0d0f, #15171a);
}

.skel-badge{
  position: absolute;
  top: 10px; right: 10px;
  width: 76px; height: 22px;
  border-radius: 999px;
  background: #23262a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.card--skeleton .card-body{ background: var(--bg-2); border-bottom: 1px solid var(--stroke); }
.skel-title{ height: 16px; width: 70%; margin: 2px 0 8px; }
.skel-addr{ height: 12px; width: 55%; opacity: .7; }

@keyframes skel-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
/* === Pre-Live Soon Block === */
.soon-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  margin: 12px 0 18px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(30,30,31,0.4);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.03);
  animation: soon-fadein .6s ease forwards;
}
.soon-block.is-hidden { display: none; }

.soon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: soon-pulse 1.5s infinite;
}

.soon-text {
  font-family: 'MonumentExtended', sans-serif;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
  text-transform: lowercase;
  font-size: 14px;
}

.soon-sub {
  color: var(--accent);
}

@keyframes soon-pulse {
  0%,100% { opacity: .5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

@keyframes soon-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
