:root {
  --bg: #03050d;
  --panel: #080d1b;
  --panel-2: #0d1227;
  --line: rgba(151, 96, 255, .26);
  --text: #f5f1ff;
  --muted: #9ca3c4;
  --violet: #8e42ff;
  --pink: #ff3fa8;
  --cyan: #3ae8ff;
  --green: #57f2ae;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: #050506;
}
body {
  display: grid;
  place-items: start center;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  touch-action: pan-y;
}

button, input { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.phone {
  position: relative;
  width: min(100vw, 607px);
  min-height: 100vh;
  max-width: 100%;
  overflow: hidden;
  padding: 18px 13px 95px;
  background:
    radial-gradient(circle at 80% 0%, rgba(105, 39, 246, .28), transparent 27%),
    radial-gradient(circle at 7% 38%, rgba(255, 36, 160, .12), transparent 20%),
    linear-gradient(180deg, #01020a 0%, #050813 58%, #040611 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 30px 80px rgba(0,0,0,.7);
}

.brand-row, .tabs { display: flex; align-items: center; }
.brand-row { gap: 12px; padding: 0 4px 4px; position: relative; }
.brand { display: flex; align-items: center; gap: 9px; width: 164px; flex: 0 0 auto; }
.brand-mark {
  width: 46px; height: 46px; display: block; flex: 0 0 auto; object-fit: contain;
}
.brand strong { display: block; color: #c06cff; font-size: 21px; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: #e0daf2; font-size: 11px; }

.search-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(92, 96, 160, .35);
  border-radius: 13px;
  background: rgba(13, 18, 42, .92);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.search-toggle:hover { border-color: rgba(142, 84, 255, .7); box-shadow: 0 0 14px rgba(110, 61, 255, .35); }
.brand-row.search-open .search-toggle { border-color: #8e54ff; background: rgba(38, 20, 78, .9); box-shadow: 0 0 14px rgba(110, 61, 255, .45); }
.search-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #c7cff2;
  stroke-width: 2.4;
}
.search {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  height: 44px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid rgba(92, 96, 160, .25);
  border-radius: 13px;
  background: rgba(13, 18, 42, .96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease;
}
.brand-row.search-open .search {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.search svg { width: 17px; height: 17px; fill: none; stroke: #95a0c7; stroke-width: 2.4; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 12px; }
.bell, .avatar { flex: 0 0 auto; width: 43px; height: 43px; background: transparent; position: relative; display: grid; place-items: center; }
.bell { border-radius: 13px; transition: background .16s ease; }
.bell:hover { background: rgba(38, 20, 78, .6); }
.bell svg { width: 22px; height: 22px; fill: none; stroke: #e6e3f7; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bell .dot { position: absolute; right: 9px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #f2144b; box-shadow: 0 0 0 2px #050712; }
.avatar { border-radius: 50%; overflow: hidden; border: 2px solid #7541ff; box-shadow: 0 0 17px rgba(92, 75, 255, .85); background: radial-gradient(circle at 35% 30%, #8a4dff, #2a1166 70%); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tabs { gap: 18px; overflow-x: auto; padding: 12px 3px 9px; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .video-row::-webkit-scrollbar, .channel-row::-webkit-scrollbar, .short-row::-webkit-scrollbar, .quick-grid::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; background: transparent; color: #c8c6d9; font-size: 13px; padding: 9px 0; position: relative; }
.tabs button.active { color: #fff; font-weight: 700; }
.tabs button.active:after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: -5px; background: linear-gradient(90deg, #8d49ff, #ff43bf); box-shadow: 0 0 12px #9346ff; }

.hero {
  height: 258px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  position: relative; background: #050716; box-shadow: 0 18px 35px rgba(0,0,0,.38);
}
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 56% center; display: block; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2,3,9,.92) 0%, rgba(5,7,16,.74) 34%, rgba(4,6,14,.05) 74%), linear-gradient(180deg, transparent 58%, rgba(0,0,0,.55)); }
.hero-copy { position: absolute; inset: 24px 16px; width: 330px; }
.hero-copy p { margin: 0 0 8px; letter-spacing: 6px; font-size: 13px; font-weight: 700; color: #fff; }
.hero h1 { margin: 0; font-size: 36px; line-height: .96; font-weight: 900; letter-spacing: 0; }
.hero h1 span { color: #c34bff; text-shadow: 0 0 18px rgba(195,75,255,.9); }
.hero h2 { margin: 13px 0 18px; color: #eeeaff; font-size: 13px; font-weight: 500; }
.badges { display: flex; gap: 15px; margin-bottom: 17px; }
.badges span { color: #fff; font-size: 9px; font-weight: 800; line-height: 1.15; }
.badges small { color: #b9bfd5; font-weight: 600; }
.badges b, .badges i { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 5px; border: 1px solid #824dff; border-radius: 5px; color: #fff; font-style: normal; box-shadow: inset 0 0 12px rgba(132,77,255,.35); }
.actions { display: flex; gap: 13px; align-items: center; }
.watch { height: 38px; padding: 0 14px; min-width: 108px; border-radius: 10px; background: linear-gradient(135deg, #762dff, #3511a7); box-shadow: 0 0 20px rgba(110,61,255,.6); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 14px; }
.watch span { width: 0; height: 0; border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.add { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.26); border-radius: 50%; background: rgba(10,14,30,.68); font-size: 22px; }

.quick-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 77px; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding: 10px 0 14px; }
.quick-grid .qcard, .channel-row .chcard, .balance, .wallet-panel button, .vip { background: linear-gradient(180deg, rgba(15,22,47,.94), rgba(8,12,28,.96)); border: 1px solid rgba(88,80,155,.22); border-radius: 8px; }
.quick-grid .qcard, .channel-row .chcard { background: #000; display: block; color: inherit; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.quick-grid .qcard:hover, .channel-row .chcard:hover { transform: translateY(-3px); border-color: rgba(142,84,255,.7); box-shadow: 0 8px 22px rgba(110,61,255,.35); }
.quick-grid .qcard:active, .channel-row .chcard:active { transform: translateY(-1px) scale(.99); }
.quick-grid .qcard { min-height: 85px; padding: 8px 7px; text-align: center; }
.quick-grid b, .quick-grid small { display: block; overflow-wrap: anywhere; }
.quick-grid b { margin-top: 7px; font-size: 10px; }
.quick-grid small { margin-top: 3px; color: #b9bdd2; font-size: 9px; }
.qicon-img {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  padding: 4px;
  background: #000;
}

.block { margin-top: 6px; }
.block-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 10px; }
.block-title h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .3px; }
.block-title a { color: #aeb4df; font-size: 11px; }
.flame, .star { width: 16px; height: 18px; display: inline-block; background: linear-gradient(#ff2f67, #ff7138); clip-path: polygon(50% 0,66% 30%,88% 24%,75% 54%,94% 78%,58% 72%,50% 100%,38% 72%,4% 78%,25% 54%,12% 24%,34% 30%); }
.star { background: linear-gradient(#7d37ff, #fc44d0); }

.video-row, .channel-row, .short-row { display: grid; grid-auto-flow: column; overflow-x: auto; overscroll-behavior-x: contain; gap: 8px; scrollbar-width: none; }
.video-row { grid-auto-columns: 139px; }
.video-card b { display: block; margin: 7px 2px 5px; min-height: 32px; font-size: 11px; line-height: 1.35; font-weight: 600; }
.video-card small { color: #9da4c4; font-size: 10px; }
.video-card small i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #8e54ff; box-shadow: 0 0 8px #8e54ff; }
.thumb { height: 83px; border-radius: 6px; border: 1px solid rgba(107,101,173,.35); position: relative; overflow: hidden; background-image: url("public/thumb-sheet.png"); background-size: 210% 210%; }
.p1 { background-position: 0 0; }.p2 { background-position: 100% 0; }.p3 { background-position: 0 100%; }.p4 { background-position: 100% 100%; }
.tag { position: absolute; top: 6px; left: 6px; padding: 3px 5px; border-radius: 3px; font-size: 8px; font-weight: 900; }
.tag.red { background: #f60e4f; }.tag.blue { background: #332bff; }
.thumb em, .short em { position: absolute; right: 6px; bottom: 5px; font-style: normal; font-size: 10px; color: #fff; text-shadow: 0 1px 4px #000; }
.thumb em:before, .short em:before { content: "▶ "; font-size: 9px; }

.channel-row { grid-auto-columns: 92px; }
.channel-row .chcard { padding: 10px 6px; text-align: center; }
.channel-img {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  display: block;
  object-fit: contain;
  padding: 4px;
  background: #000;
}
.channel-row b { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-row small { display: block; color: #aeb4cc; font-size: 8px; margin: 4px 0 8px; }
.channel-row button { height: 25px; min-width: 58px; border-radius: 4px; background: linear-gradient(135deg, #6224df, #3b1799); font-size: 10px; }

.short-row { grid-auto-columns: 94px; }
.short { height: 137px; border-radius: 6px; border: 1px solid rgba(104,96,165,.35); position: relative; overflow: hidden; background-image: url("public/thumb-sheet.png"); background-size: 260% 185%; }
.short.wolf { background-image: url("public/hero-quantum.png"); background-size: cover; background-position: 82% center; filter: hue-rotate(35deg) saturate(1.2); }

.wallet-panel { display: grid; grid-template-columns: 2.15fr 4fr; gap: 3px; margin-top: 9px; }
.wallet-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.balance { min-height: 93px; padding: 14px 12px; display: flex; justify-content: space-between; align-items: center; }
.balance small { color: #b7bdd6; font-size: 13px; letter-spacing: .6px; }
.balance small span { display: inline-block; width: 13px; height: 8px; border: 1px solid #8b91ad; border-radius: 50%; margin-left: 4px; }
.balance strong { display: block; margin: 8px 0 6px; font-size: 22px; }
.balance strong b { font-size: 11px; color: #b4abd4; }
.balance em { color: #a4abc1; font-size: 10px; font-style: normal; }
.token-ball { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; color: #d7b8ff; font-size: 35px; font-weight: 900; background: radial-gradient(circle at 35% 30%, #ffe4ff, #7c3eff 30%, #1a0b43 68%, transparent 70%); box-shadow: 0 0 22px #7d42ff; overflow: hidden; flex: 0 0 auto; }
.token-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.wallet-panel button { min-width: 0; padding: 12px 3px; text-align: center; }
.wallet-panel button span { width: 28px; height: 28px; margin: 0 auto 8px; display: grid; place-items: center; border: 2px solid #bc62ff; border-radius: 50%; position: relative; }
.wallet-panel button span:before { position: absolute; color: #da9cff; font-size: 20px; }
.down:before{content:"↓";}.up:before{content:"↑";}.clock:before{content:"◷";}.swap:before{content:"↔";}
.wallet-panel button b, .wallet-panel button small { display: block; }
.wallet-panel button b { font-size: 12px; }.wallet-panel button small { margin-top: 4px; color: #aeb5ca; font-size: 9px; }

.vip { height: 58px; margin: 9px 0; padding: 10px 12px; display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, rgba(31,14,62,.96), rgba(31,14,79,.88), rgba(14,19,42,.95)); }
.vip > span { color: #d75bff; font-size: 26px; }
.vip div { min-width: 0; flex: 1; }
.vip b { display: block; color: #ff65d0; font-size: 16px; }
.vip small { display: block; margin-top: 3px; color: #bcc1d3; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vip button { flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 8px; background: linear-gradient(135deg, #7332d9, #482098); font-size: 12px; font-weight: 700; }

.bottom {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100vw, 607px); height: 76px; display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center; padding: 5px 11px 7px; background: rgba(9,13,29,.96); border: 1px solid rgba(98,88,169,.26); border-radius: 16px 16px 0 0; backdrop-filter: blur(14px);
}
.bottom button { height: 62px; background: transparent; color: #9299b5; display: grid; place-items: center; align-content: center; gap: 4px; font-size: 10px; }
.bottom button.active { color: #a551ff; text-shadow: 0 0 14px #8c42ff; }
.bottom button:not(.plus) > span { width: 26px; height: 26px; display: grid; place-items: center; position: relative; }
.bottom button:not(.plus) > span svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bottom .plus span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; font-size: 39px; font-weight: 700; background: radial-gradient(circle, #7d28ff 0 35%, #210745 56%, transparent 70%); box-shadow: 0 0 24px #842dff, inset 0 0 13px #fb65ff; color: #fff; overflow: hidden; }
.bottom .plus .plus-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bottom .plus { transition: transform .16s ease; }
.bottom .plus:active { transform: scale(.94); }

@media (max-width: 420px) {
  .phone { padding-inline: 9px; }
  .brand-row { gap: 9px; }
  .brand { width: auto; min-width: 0; flex: 1 1 auto; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 10px; }
  .search-toggle { width: 38px; height: 38px; }
  .search input { font-size: 10px; }
  .bell, .avatar { width: 38px; height: 38px; }
  .hero { height: 238px; }
  .hero-copy { inset: 20px 14px; width: 300px; }
  .hero h1 { font-size: 31px; }
  .badges { gap: 8px; }
  .wallet-panel { display: block; }
  .balance { padding: 11px 8px; margin-bottom: 3px; }
  .balance strong { font-size: 17px; }
  .wallet-actions {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 88px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .wallet-actions::-webkit-scrollbar { display: none; }
  .vip button { padding-inline: 9px; font-size: 10px; }
}
