/* Stonk Family, component layer. */

/* ---- floating sprinkles ------------------------------------------------ */

.sprinkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.sprinkle {
  position: absolute;
  border-radius: var(--r-pill);
  opacity: 0.85;
  animation: floaty linear infinite;
}

/* ---- top bar ----------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.topbar.is-stuck {
  border-color: var(--line);
  box-shadow: 0 8px 26px rgba(20, 20, 40, 0.06);
}


.nav {
  display: flex;
  gap: 6px;
  margin-inline: auto;
  background: var(--cloud);
  padding: 5px;
  border-radius: var(--r-pill);
}
.nav__pill {
  padding: 9px 20px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--ink-soft);
  transition: all 0.22s var(--bounce);
}
.nav__pill:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.nav__pill.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--cloud-deep);
}

.btn--wallet {
  --btn: var(--ink);
  --btn-deep: #000;
  flex: none;
  padding: 11px 20px;
}
.btn--wallet.is-on {
  --btn: var(--green);
  --btn-deep: var(--green-deep);
}
.btn--wallet.is-wrong {
  --btn: var(--orange);
  --btn-deep: var(--orange-deep);
}
.btn__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  animation: pulse-dot 2s ease-in-out infinite;
}


.xlink {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 2px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 3px 0 var(--cloud-deep);
  transition: transform 0.18s var(--bounce), background 0.2s, color 0.2s;
}
.xlink:hover {
  transform: translateY(-2px);
  background: var(--ink);
  color: #fff;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.burger span {
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
}

/* ---- view -------------------------------------------------------------- */

.view {
  position: relative;
  z-index: 1;
  min-height: 70vh;
  padding-bottom: 90px;
}

.section {
  margin-top: clamp(48px, 7vw, 92px);
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.section__kicker {
  font-family: Fredoka, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

/* ---- hero -------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(18px, 3vw, 34px);
  text-align: center;
}
.hero__banner {
  width: min(100%, 1120px);
  margin: 0 auto;
  animation: pop-in 0.7s var(--bounce) both;
}
.hero__lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 620px;
  margin: 6px auto 0;
}
.hero__cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

.statstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 40px;
}
.stat {
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--lift-1);
  text-align: left;
  transition: transform 0.3s var(--bounce);
}
.stat:hover {
  transform: translateY(-5px) rotate(-1deg);
}
.stat__k {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.stat__v {
  font-family: Fredoka, sans-serif;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  margin-top: 3px;
}
.stat:nth-child(1) .stat__v {
  color: var(--orange);
}
.stat:nth-child(2) .stat__v {
  color: var(--green);
}
.stat:nth-child(3) .stat__v {
  color: var(--blue);
}
.stat:nth-child(4) .stat__v {
  color: var(--pink);
}
.stat:nth-child(5) .stat__v {
  color: var(--yellow-deep);
}

/* ---- ticker ------------------------------------------------------------ */

.ticker {
  margin-top: 46px;
  overflow: hidden;
  border-block: 2px solid var(--line);
  padding: 14px 0;
  background: var(--cloud);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker__rail {
  display: flex;
  gap: 34px;
  width: max-content;
  animation: slide 48s linear infinite;
}
.ticker:hover .ticker__rail {
  animation-play-state: paused;
}
@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
.ticker__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.ticker__item img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

/* ---- basket cards ------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.bcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}
.bcard__top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 18px;
  min-width: 0;
}
.bcard__logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--cloud);
  flex: none;
  box-shadow: 0 3px 0 var(--cloud-deep);
}
.bcard__name {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bcard__sym {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-faint);
}
.bcard__desc {
  padding: 0 18px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.bcard__figs {
  display: flex;
  gap: 8px;
  padding: 0 18px;
  flex-wrap: wrap;
}
.fig {
  background: var(--cloud);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  flex: 1 1 78px;
}
.fig__k {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.fig__v {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
}
.bcard__under {
  display: flex;
  align-items: center;
  gap: -6px;
  padding: 0 18px;
}
.bcard__under > * {
  margin-right: -6px;
  border: 2px solid var(--paper);
  background: var(--paper);
  box-sizing: content-box;
}
.bcard__foot {
  margin-top: auto;
  padding: 12px 18px 16px;
  border-top: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-faint);
}
/* The tags used to float over the top right corner, which worked until a coin
   had two of them and they sat across its name. They get their own row now, so
   any number of them can appear without hiding anything. */
.bcard__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 14px 14px 0;
  min-height: 14px;
}

.bar {
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--cloud-deep);
  overflow: hidden;
  margin: 0 18px;
}
.bar__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 0.8s var(--bounce);
}

/* ---- filters ----------------------------------------------------------- */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search {
  position: relative;
  flex: 1 1 260px;
}
.search .input {
  padding-left: 44px;
  border-radius: var(--r-pill);
}
.search__ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
}

/* ---- basket page ------------------------------------------------------- */

.bhead {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 22px;
  margin-top: 26px;
}
.bhead__logo {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  object-fit: cover;
  background: var(--cloud);
  box-shadow: 0 4px 0 var(--cloud-deep);
}
.bhead__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bhead__links {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.blayout {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.chartcard {
  padding: 20px;
}
.chartcard__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chartcard__price {
  font-family: Fredoka, sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
}
.chart {
  width: 100%;
  height: 300px;
  display: block;
  touch-action: none;
}
/* a price card with nothing to draw should stay a price card, not turn into a
   poster: same height, one quiet line of text */
.chart--empty {
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--cloud);
}
.chart--empty p {
  margin: 0;
  font-size: 0.92rem;
}
.chart__tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  transform: translate(-50%, -130%);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}

.tradecard__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--cloud);
  padding: 6px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}
.tradecard__tab {
  padding: 11px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s var(--bounce);
}
.tradecard__tab.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--cloud-deep);
}
.tradecard__tab.is-on[data-side="buy"] {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 0 var(--green-deep);
}
.tradecard__tab.is-on[data-side="sell"] {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 2px 0 var(--pink-deep);
}
.amountrow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cloud);
  border-radius: var(--r-md);
  padding: 6px 16px 6px 6px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.amountrow:focus-within {
  border-color: var(--blue);
}
.amountrow input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  padding: 13px 10px;
  font-family: Fredoka, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  min-width: 0;
}
.amountrow__unit {
  font-weight: 800;
  color: var(--ink-faint);
}
.quickrow {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.quickrow .chip {
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
}
.getrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0;
  font-weight: 800;
}
.getrow strong {
  font-family: Fredoka, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.rows {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.92rem;
}
.row:last-child {
  border-bottom: 0;
}
.row__k {
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.weights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.weight {
  display: flex;
  align-items: center;
  gap: 11px;
}
.weight img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
}
.weight__bar {
  flex: 1;
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--cloud-deep);
  overflow: hidden;
}
.weight__fill {
  height: 100%;
  border-radius: var(--r-pill);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}
.feed__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--cloud);
  font-weight: 700;
  font-size: 0.86rem;
  animation: pop-in 0.35s var(--bounce) both;
}
.feed__side {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  color: #fff;
  font-size: 0.75rem;
}

/* ---- create ------------------------------------------------------------ */

.createlayout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 26px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.formgrid .span2 {
  grid-column: span 2;
}
.picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.82rem;
  transition: all 0.2s var(--bounce);
}
.pick:hover {
  transform: translateY(-3px);
}
.pick img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.pick.is-on {
  border-color: var(--green);
  background: #f4ffe4;
  box-shadow: 0 3px 0 var(--green);
}
.preview {
  position: sticky;
  top: 96px;
}

/* ---- family page ------------------------------------------------------- */

.familyhero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: center;
  margin-top: 26px;
}
.familyhero img {
  animation: floaty 7s ease-in-out infinite;
}
.bigrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.step {
  padding: 24px;
  border-radius: var(--r-lg);
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--lift-1);
  position: relative;
  overflow: hidden;
}
.step__n {
  font-family: Fredoka, sans-serif;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.16;
  position: absolute;
  top: 8px;
  right: 16px;
}
.step h3 {
  margin-bottom: 6px;
}
.step p {
  color: var(--ink-soft);
  font-weight: 600;
}
.step:nth-child(1) {
  border-color: var(--orange);
}
.step:nth-child(2) {
  border-color: var(--green);
}
.step:nth-child(3) {
  border-color: var(--blue);
}
.step:nth-child(4) {
  border-color: var(--pink);
}

/* ---- footer ------------------------------------------------------------ */

.footer {
  position: relative;
  z-index: 1;
  margin-top: 70px;
  padding: 44px clamp(16px, 4vw, 40px) 34px;
  background: var(--cloud);
  border-top: 2px solid var(--line);
  text-align: center;
}
.footer__cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 26px;
  text-align: left;
  width: min(100% - 20px, var(--page));
  margin-inline: auto;
}
.footer__cols h4 {
  font-size: 1.05rem;
  margin-bottom: 9px;
}
.footer__cols p {
  color: var(--ink-soft);
  font-weight: 600;
  max-width: 44ch;
}
.footer__cols a {
  display: block;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 3px 0;
}
.footer__cols a:hover {
  color: var(--pink);
}
.footer__fine {
  margin-top: 28px;
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-weight: 600;
}

/* ---- toasts and confetti ---------------------------------------------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(94vw, 380px);
}
.toast {
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  animation: pop-in 0.35s var(--bounce) both;
  word-break: break-word;
}
.toast--bad {
  background: var(--down);
}
.toast--good {
  background: var(--green-deep);
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
}

/* ---- empty and error states ------------------------------------------- */

.blank {
  text-align: center;
  padding: 60px 20px;
}
.blank img {
  width: 190px;
  margin: 0 auto 14px;
  animation: wiggle 3s ease-in-out infinite;
}

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 1000px) {
  .blayout,
  .createlayout,
  .familyhero {
    grid-template-columns: 1fr;
  }
  .preview {
    position: static;
  }
}

@media (max-width: 820px) {
  .nav {
    position: fixed;
    top: 70px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--lift-2);
    padding: 10px;
    display: none;
  }
  .nav.is-open {
    display: flex;
    animation: pop-in 0.3s var(--bounce) both;
  }
  .nav__pill {
    text-align: center;
  }
  .burger {
    display: flex;
    order: 3;
  }
  .btn--wallet {
    margin-left: auto;
  }
  .footer__cols {
    grid-template-columns: 1fr;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .formgrid .span2 {
    grid-column: span 1;
  }
}

/* ---- sheet (wallet chooser) -------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 20, 40, 0.32);
  backdrop-filter: blur(3px);
  animation: pop-in 0.22s ease both;
}
.sheet__panel {
  width: min(100%, 380px);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-2);
  padding: 24px;
  animation: pop-in 0.3s var(--bounce) both;
}
.sheet__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px;
}
.sheet__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--paper);
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--bounce);
}
.sheet__item:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 3px 0 var(--green);
}
.sheet__icon {
  font-size: 1.2rem;
}

.sheet__art {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  object-fit: cover;
  background: var(--cloud);
}
.sheet__art--blank {
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.notice {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 2px dashed var(--line);
  background: var(--cloud);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.92rem;
  max-width: 56ch;
}

.pairrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.pair {
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  padding: 14px 16px;
}
.pair strong {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}
@media (max-width: 560px) {
  .pairrow {
    grid-template-columns: 1fr;
  }
}

.builton {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--cloud);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  white-space: nowrap;
}
.builton__brand {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--pink);
  letter-spacing: -0.01em;
}
@media (max-width: 1080px) {
  .builton {
    display: none;
  }
}

.logofield {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logothumb {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  flex: none;
  background-size: cover;
  background-position: center;
  background-color: var(--cloud);
  box-shadow: 0 3px 0 var(--cloud-deep);
}
