:root{
  --hm-bg:#070a08;

  --hm-card:  rgba(18, 22, 18, .72);
  --hm-card2: rgba(14, 18, 14, .66);

  --hm-border: rgba(246,200,95,.22);
  --hm-text:  #FFFCF2;
  --hm-muted: rgba(255,252,242,.62);

  --hm-gold:#f6c85f;
  --hm-gold2:#ffdd84;

  --hm-green:#1f6f4a;
  --hm-green2:#2da86f;

  --hm-danger:#ff7b72;
  --hm-warn:#f0b25e;
  --hm-ok:#56d364;

  /* Parallax vars (set by JS) */
  --hm-px: 0;   /* -1..1 */
  --hm-py: 0;   /* -1..1 */
}

/* Prevent any white gaps when background moves */
html, body{
  height: 100%;
  background: var(--hm-bg);
}

body{
  position: relative;
  background: var(--hm-bg) !important;
  color: var(--hm-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  min-height:100vh;
  overflow-x: hidden;
}

/* UI above background */
.container-hm{
  max-width: 750px;
  position: relative;
  z-index: 10;
}

/* =========================================================
   ✅ BACKGROUND (FULLSCREEN, NO REPEAT, STRONG PARALLAX)
   - bg_8.png disconnected
   - bg_9.png connected
   - fast transition
   - blur -> focus on connect
   ========================================================= */
.hm-bg{
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  z-index: 0;
  pointer-events: none;
  overflow: hidden;

  /* never let anything bleed outside */
  background: var(--hm-bg);
}

/* Each layer is overscanned so parallax + blur never shows edges */
.hm-bg::before,
.hm-bg::after{
  content:"";
  position:absolute;

  /* Overscan for ALL screens + parallax + blur */
  top: -15%;
  left: -15%;
  width: 115%;
  height: 115%;

  /* IMPORTANT: never tile */
  background-repeat: no-repeat !important;
  background-position: center center !important;

  /* IMPORTANT: always fill */
  background-size: cover !important;

  /* Stronger parallax movement (feels alive) */
  transform: translate3d(
    calc(var(--hm-px) * -27px),
    calc(var(--hm-py) * -27px),
    0
  ) scale(1.06);

  will-change: opacity, filter, transform;

  /* faster transition */
  transition:
    opacity .55s ease,
    filter .90s ease,
    transform .5s linear;
}

/* Disconnected (bg_8.png) */
.hm-bg::before{
  background-image:
    radial-gradient(1600px 1100px at 50% 42%, rgba(0,0,0,0) 26%, rgba(0,0,0,.52) 100%),
    radial-gradient(980px 560px at 50% 18%, rgba(0,0,0,.14), rgba(0,0,0,.36) 55%, rgba(0,0,0,.54) 100%),
    url("./images/bg_9.png");
  opacity: 1;
  filter: saturate(1.02) contrast(1.02) blur(2px);
}

/* Connected (bg_9.png) starts blurred, then focuses */
.hm-bg::after{
  background-image:
    radial-gradient(1600px 1100px at 50% 42%, rgba(0,0,0,0) 26%, rgba(0,0,0,.12) 100%),
    radial-gradient(980px 560px at 50% 18%, rgba(0,0,0,.14), rgba(0,0,0,.36) 55%, rgba(0,0,0,.14) 100%),
    url("./images/bg7.png");
  opacity: 0;
  filter: saturate(1.05) contrast(1.05) blur(14px);
}

body.wallet-connected .hm-bg::before{ opacity: 0; }
body.wallet-connected .hm-bg::after{ opacity: 1; }

/* Blur -> focus kick */
body.wallet-connected .hm-bg.hm-bg-focus::after{
  filter: saturate(1.05) contrast(1.05) blur(0px);
}

/* Reduce motion: keep background static */
@media (prefers-reduced-motion: reduce){
  .hm-bg::before,
  .hm-bg::after{
    transform: none !important;
    transition: opacity .2s ease, filter .2s ease;
  }
}

/* ===== Logo ===== */
.hm-logo-header{
  margin-top: -24px;
  margin-bottom: -54px;
  padding: 0;
  text-align:center;
  position: relative;
  transform: translateY(-18px);
}
.hm-logo-header::after{
  content:"";
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top: -50px;
  width: min(920px, 92vw);
  height: 78px;
  background: radial-gradient(closest-side, rgba(246,200,95,.16), transparent 74%);
  filter: blur(2px);
  opacity: .70;
  pointer-events:none;
  z-index:0;
}
.hm-logo-big{
  width: min(460px, 90vw);
  height: auto;
  display:block;
  margin: 0 auto;
  position: relative;
  z-index:1;
  filter:
    drop-shadow(0 26px 60px rgba(0,0,0,.78))
    drop-shadow(0 10px 18px rgba(246,200,95,.10));
}

/* ===== Cards ===== */
.hm-card{
  background:
    radial-gradient(600px 220px at 50% 0%, rgba(246,200,95,.10), transparent 60%),
    linear-gradient(180deg, var(--hm-card) 0%, var(--hm-card2) 100%);
  border: 1px solid rgba(246,200,95,.22);
  border-radius:16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.30);
  backdrop-filter: blur(3px);
}

.hm-badge{
  border:1px solid rgba(246,200,95,.18);
  border-radius:999px;
  padding:.25rem .6rem;
  font-size:.78rem;
  color: rgba(255,252,242,.84);
  background: rgba(10, 12, 10, .50);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.hm-metric{
  border: 0px solid rgba(246,200,95,.18);
  border-radius:14px;
  background:
    radial-gradient(420px 160px at 50% 0%, rgba(246,200,95,.08), transparent 65%),
    rgba(12, 16, 12, .58);
}

.hm-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: rgba(255,252,242,.90);
}
.hm-muted{ color: var(--hm-muted); }
.hm-big{
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: .2px;
}

/* ===== Buttons ===== */
.btn-hm{
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: .2px;
  padding: .62rem 1.05rem;
}
.btn-hm-gold{
  border:1px solid rgba(246,200,95,.32);
  color: var(--hm-gold2);
  background: rgba(8, 12, 10, .45);
  border-radius: 14px;
  font-weight: 900;
  padding: .62rem 1.05rem;
}
.btn-hm-gold:hover{ background: rgba(246,200,95,.10); }
.btn-hm-gold:active{ transform: translateY(0); filter: brightness(1.02); }

.btn-hm-ghost{
  border:1px solid rgba(246,200,95,.32);
  color: var(--hm-gold2);
  background: rgba(8, 12, 10, .45);
  border-radius: 14px;
  font-weight: 900;
  padding: .62rem 1.05rem;
}
.btn-hm-ghost:hover{ background: rgba(246,200,95,.10); }

/* ===== Forms ===== */
.form-control{
  background: rgba(10, 12, 10, .50);
  border: 1px solid rgba(246,200,95,.16);
  color: var(--hm-text);
  border-radius: 12px;
}
.form-control::placeholder{ color: rgba(255,252,242,.45); }
.form-control:focus{
  border-color: rgba(246,200,95,.55);
  box-shadow: 0 0 0 .25rem rgba(246,200,95,.14);
  background: rgba(10, 12, 10, .58);
  color: var(--hm-text);
}

hr{ border-color: rgba(246,200,95,.14); opacity:1; }

/* ===== Mobile ===== */
@media (max-width: 576px){
  .hm-logo-header{ transform: translateY(-12px); }
  .btn-hm-gold{ width: 100%; }
}

/* === Refresh pulse for numbers === */
@keyframes hmPulseGold{
  0%   { color: rgba(255,252,242,.92); text-shadow: none; filter: brightness(1); }
  20%  { color: rgba(255,221,132,1);  text-shadow: 0 0 14px rgba(246,200,95,.28); filter: brightness(1.06); }
  100% { color: rgba(255,252,242,.92); text-shadow: none; filter: brightness(1); }
}
.hm-pulse{ animation: hmPulseGold 520ms ease-out 1; }

/* ===== Bees emphasis ===== */
.hm-metric-bees{
  background:
    radial-gradient(520px 200px at 85% 50%, rgba(246,200,95,.14), transparent 60%),
    rgba(12, 16, 12, .62);
}
.hm-bees-value{
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  gap: .35rem;
  color: rgba(255,252,242,.95);
}
@media (max-width: 576px){
  .hm-bees-value{ font-size: 1.8rem; }
}

/* ===== Jar anchors ===== */
.hm-hive-card{
  position: relative;
  overflow: visible;
}

/* Left jar */
.hm-jar{
  position: absolute;
  top: -65px;
  left: 18px;
  width: 78px;
  height: 78px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;

  background-image: url("./images/jar.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  filter:
    drop-shadow(0 18px 26px rgba(0,0,0,.58))
    drop-shadow(0 6px 10px rgba(246,200,95,.14));
  transform: rotate(0deg);
  transition: transform .14s ease, filter .14s ease;
}
.hm-jar:hover{
  transform: rotate(0deg) translateY(0px) scale(1);
}
.hm-jar:active{ transform: translateY(0) scale(1); }

/* Right jar */
.hm-jar-right{
  position: absolute;
  top: -96px;
  right: 18px;
  left: auto;
  width: 120px;
  height: 120px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;

  background-image: url("./images/think3.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  filter:
    drop-shadow(0 18px 26px rgba(0,0,0,.58))
    drop-shadow(0 6px 10px rgba(246,200,95,.14));
  transform: rotate(0deg);
  transition: transform .14s ease, filter .14s ease;
}
.hm-jar-right:hover{
  transform: rotate(0deg) translateY(0px) scale(1);
  filter:
    drop-shadow(0 22px 34px rgba(0,0,0,.62))
    drop-shadow(0 10px 16px rgba(246,200,95,.18));
}
.hm-jar-right:active{ transform: translateY(0) scale(1); }

/* Ensure jars are clickable above everything */
.hm-jar,
.hm-jar-right{
  z-index: 50;
  pointer-events: auto;
}

/* ===== POPUP (THIS WAS MISSING) ===== */
.hm-popup{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: block;
}
.hm-popup-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.60);
  backdrop-filter: blur(4px);
}
.hm-popup-card{
  position: relative;
  max-width: 560px;
  margin: 9vh auto;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(246,200,95,.30);
  box-shadow: 0 30px 90px rgba(0,0,0,.60);

  background:
    radial-gradient(600px 220px at 50% 0%, rgba(246,200,95,.12), transparent 60%),
    linear-gradient(180deg, var(--hm-card) 0%, var(--hm-card2) 100%);
}

/* Popup social icons row */
.hm-popup-social{
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.hm-social-link{
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(10, 12, 10, .50);
  border: 1px solid rgba(246,200,95,.22);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 10px 22px rgba(0,0,0,.25);

  transition: transform .14s ease, background .14s ease, border-color .14s ease, filter .14s ease;
}

.hm-social-link:hover{
  transform: translateY(-2px) scale(1.03);
  background: rgba(246,200,95,.08);
  border-color: rgba(246,200,95,.34);
  filter: brightness(1.03);
}

.hm-social-link:active{
  transform: translateY(0) scale(.99);
}

.hm-social-icon{
  width: 50px;
  height: 50px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
}

/* ===== Go Back clickable image ===== */
.hm-go-back{
  width: min(200px, 90vw);
  height: auto;
  cursor: pointer;
  user-select: none;
  margin-top:20px;
  filter:
    drop-shadow(0 14px 24px rgba(0,0,0,.6))
    drop-shadow(0 6px 10px rgba(246,200,95,.12));

  transition: transform .15s ease, filter .15s ease;
}

.hm-go-back:hover{
  transform: translateY(-2px) scale(1.02);
  filter:
    drop-shadow(0 18px 30px rgba(0,0,0,.65))
    drop-shadow(0 10px 16px rgba(246,200,95,.18));
}

.hm-go-back:active{
  transform: translateY(0) scale(.98);
}
