/* Hype meter — the on-stream goal ladder. Shared by the watch page (chat
   mode) and the OBS overlay (overlay mode). Colours are the site's brand gold
   over the navy; the overlay variant is self-coloured because it draws on a
   transparent browser source with no page theme behind it. */

.hype-meter {
  --hype-gold: #D4AF37;
  --hype-gold-hi: #F5D76E;
  --hype-gold-lo: #8a6f1a;
  --hype-ink: #F8F4E3;
  --hype-bg: #1A2332;
  position: relative;
  isolation: isolate;
  padding: 0.6rem 0.75rem 0.5rem;
  border-radius: 12px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(212, 175, 55, 0.18), transparent 55%),
    linear-gradient(160deg, #1f2b3f 0%, var(--hype-bg) 60%, #121a27 100%);
  color: var(--hype-ink);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 4px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.hype-meter[hidden] { display: none; }

/* Norse knotwork edge, drawn with gradients so there is no image to cache. */
.hype-meter::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(212, 175, 55, 0.12) 14px 16px) top / 100% 3px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(212, 175, 55, 0.12) 14px 16px) bottom / 100% 3px no-repeat;
  opacity: 0.9;
}

.hype-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.hype-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  font-size: 0.85rem; color: var(--hype-gold-hi);
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}
.hype-title-rune {
  display: inline-block; font-size: 1.05rem; line-height: 1;
  color: var(--hype-gold);
  animation: hype-rune-breathe 3s ease-in-out infinite;
}
.hype-raised {
  font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 1.05rem; color: #fff;
  text-shadow: 0 0 12px rgba(245, 215, 110, 0.45);
  transition: transform 250ms ease;
}
.hype-hit .hype-raised { transform: scale(1.18); }
.hype-unit { color: var(--hype-gold); font-weight: 700; }

/* ---- the bar ---- */
.hype-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0c121c, #16202e);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(212, 175, 55, 0.25);
  margin: 0 0 1.9rem;
}
.hype-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hype-gold-lo) 0%, var(--hype-gold) 55%, var(--hype-gold-hi) 100%);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.55), 0 0 30px rgba(212, 175, 55, 0.25);
  transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.hype-fill.full { animation: hype-full-glow 1.6s ease-in-out infinite; }
.hype-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: hype-shimmer 2.6s linear infinite;
}
.hype-fill-tip {
  position: absolute; right: -6px; top: -4px; bottom: -4px; width: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff9dc 0%, rgba(245, 215, 110, 0.6) 45%, transparent 70%);
  animation: hype-tip-pulse 1.2s ease-in-out infinite;
}
.hype-fx {
  position: absolute; left: 0; right: 0; top: -22px; height: 62px; width: 100%;
  pointer-events: none; z-index: 3;
}

/* ---- rungs (goal markers) ---- */
.hype-rungs { position: absolute; inset: 0; pointer-events: none; }
.hype-rung {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  pointer-events: auto;
  z-index: 2;
}
.hype-rung-icon {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 0.85rem; line-height: 1;
  background: #0f1622;
  border: 2px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 3px #1A2332, 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 300ms, box-shadow 300ms, background 300ms;
  filter: grayscale(0.6) brightness(0.8);
}
.hype-rung.reached .hype-rung-icon {
  filter: none;
  background: radial-gradient(circle at 30% 30%, #fff3bf, var(--hype-gold) 60%, var(--hype-gold-lo));
  border-color: #fff3bf;
  box-shadow: 0 0 0 3px #1A2332, 0 0 16px rgba(245, 215, 110, 0.8);
}
.hype-rung.just .hype-rung-icon { animation: hype-rung-pop 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hype-rung-amt {
  position: absolute; top: 100%; margin-top: 4px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  color: rgba(248, 244, 227, 0.75); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hype-rung.reached .hype-rung-amt { color: var(--hype-gold-hi); }
.hype-rung-name {
  position: absolute; top: 100%; margin-top: 17px;
  font-size: 0.6rem; max-width: 84px; text-align: center; line-height: 1.1;
  color: rgba(248, 244, 227, 0.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hype-rung:hover .hype-rung-name { white-space: normal; overflow: visible; z-index: 5; background: rgba(12, 18, 28, 0.95); padding: 2px 4px; border-radius: 4px; }
.hype-rung:last-child { transform: translate(-100%, -50%); }
.hype-rung:last-child .hype-rung-amt, .hype-rung:last-child .hype-rung-name { right: 0; }

/* ---- under the bar ---- */
.hype-next {
  font-size: 0.78rem; margin-top: 0.15rem;
  color: rgba(248, 244, 227, 0.85);
}
.hype-next b { color: var(--hype-gold-hi); }
.hype-next-label { color: rgba(248, 244, 227, 0.55); text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.08em; }
.hype-next-remaining { color: rgba(248, 244, 227, 0.6); font-variant-numeric: tabular-nums; }
.hype-next-done { color: var(--hype-gold-hi); font-weight: 700; }
.hype-contribs {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem;
  margin-top: 0.3rem; font-size: 0.72rem; color: rgba(248, 244, 227, 0.75);
}
.hype-contribs:empty { display: none; }
.hype-contrib b { color: var(--hype-gold-hi); font-variant-numeric: tabular-nums; }
.hype-contrib-rank { margin-right: 0.2rem; }

/* ---- flyups ---- */
.hype-flyups { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.hype-flyup {
  position: absolute; bottom: 30%;
  transform: translate(-50%, 0);
  font-size: 0.9rem; font-weight: 700; color: #fff;
  text-shadow: 0 0 8px rgba(245, 215, 110, 0.9), 0 2px 4px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  animation: hype-flyup 2.3s ease-out forwards;
}
.hype-flyup b { color: var(--hype-gold-hi); }

/* ---- unlock banner ---- */
.hype-unlock {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-content: center; text-align: center;
  background: rgba(10, 14, 22, 0.82);
  opacity: 0; pointer-events: none;
  transition: opacity 350ms ease;
}
.hype-unlock.show { opacity: 1; }
.hype-unlock[hidden] { display: none; }
.hype-unlock-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 247, 214, 0.95), rgba(212, 175, 55, 0.4) 35%, transparent 70%);
  opacity: 0;
}
.hype-unlock.show .hype-unlock-flash { animation: hype-flash 900ms ease-out; }
.hype-unlock-word {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem; font-weight: 900; letter-spacing: 0.12em;
  color: var(--hype-gold-hi);
  text-shadow: 0 0 18px rgba(245, 215, 110, 0.9), 0 0 40px rgba(212, 175, 55, 0.6);
  transform: scale(0.6); opacity: 0;
}
.hype-unlock.show .hype-unlock-word { animation: hype-word 700ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms forwards; }
.hype-unlock-goal { font-size: 0.95rem; font-weight: 700; color: #fff; margin-top: 0.2rem; opacity: 0; }
.hype-unlock-reward { font-size: 0.78rem; color: rgba(248, 244, 227, 0.8); margin-top: 0.15rem; opacity: 0; }
.hype-unlock.show .hype-unlock-goal { animation: hype-rise 500ms ease-out 350ms forwards; }
.hype-unlock.show .hype-unlock-reward { animation: hype-rise 500ms ease-out 500ms forwards; }
.hype-unlock-reward[hidden] { display: none; }

.hype-quake { animation: hype-quake 600ms ease-in-out; }
.hype-frozen { filter: saturate(0.6); }
.hype-frozen .hype-shimmer, .hype-frozen .hype-fill-tip, .hype-frozen .hype-title-rune { animation: none; }

/* ---- overlay mode (OBS browser source) ---- */
.hype-overlay {
  width: min(520px, 100%);
  padding: 0.9rem 1.1rem 0.8rem;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(212, 175, 55, 0.22), transparent 55%),
    linear-gradient(160deg, rgba(31, 43, 63, 0.92) 0%, rgba(26, 35, 50, 0.92) 60%, rgba(18, 26, 39, 0.94) 100%);
  border-width: 2px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 175, 55, 0.15);
}
.hype-overlay .hype-title { font-size: 1.1rem; }
.hype-overlay .hype-title-rune { font-size: 1.4rem; }
.hype-overlay .hype-raised { font-size: 1.5rem; }
.hype-overlay .hype-track { height: 26px; margin-bottom: 2.4rem; }
.hype-overlay .hype-rung-icon { width: 36px; height: 36px; font-size: 1.15rem; }
.hype-overlay .hype-rung-amt { font-size: 0.8rem; margin-top: 6px; }
.hype-overlay .hype-rung-name { font-size: 0.72rem; margin-top: 22px; max-width: 120px; }
.hype-overlay .hype-next { font-size: 1rem; }
.hype-overlay .hype-contribs { font-size: 0.85rem; }
.hype-overlay .hype-flyup { font-size: 1.3rem; }
.hype-overlay .hype-unlock-word { font-size: 2.4rem; }
.hype-overlay .hype-unlock-goal { font-size: 1.3rem; }
.hype-overlay .hype-unlock-reward { font-size: 1rem; }
.hype-overlay .hype-fx { top: -30px; height: 86px; }

/* ---- chat mode on phones: keep it to one compact bar ---- */
@media (max-width: 768px) {
  .hype-chat { padding: 0.45rem 0.6rem 0.4rem; border-radius: 10px; }
  .hype-chat .hype-track { height: 14px; margin-bottom: 1.2rem; }
  .hype-chat .hype-rung-icon { width: 22px; height: 22px; font-size: 0.7rem; }
  .hype-chat .hype-rung-name { display: none; }
  .hype-chat .hype-contribs { display: none; }
  .hype-chat .hype-next { font-size: 0.72rem; }
}

/* ---- keyframes ---- */
@keyframes hype-shimmer { to { transform: translateX(100%); } }
@keyframes hype-tip-pulse { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.35); } }
@keyframes hype-rune-breathe { 0%, 100% { transform: translateY(0); opacity: 0.85; } 50% { transform: translateY(-1px); opacity: 1; } }
@keyframes hype-full-glow { 0%, 100% { box-shadow: 0 0 14px rgba(212, 175, 55, 0.55); } 50% { box-shadow: 0 0 26px rgba(245, 215, 110, 0.95), 0 0 50px rgba(212, 175, 55, 0.5); } }
@keyframes hype-rung-pop { 0% { transform: scale(1); } 30% { transform: scale(1.7) rotate(-8deg); } 60% { transform: scale(1.2) rotate(6deg); } 100% { transform: scale(1); } }
@keyframes hype-flyup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -48px) scale(1); } }
@keyframes hype-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hype-word { to { transform: scale(1); opacity: 1; } }
@keyframes hype-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hype-quake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); } 40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 2px); } 80% { transform: translate(1px, -2px); }
}

@media (prefers-reduced-motion: reduce) {
  .hype-shimmer, .hype-fill-tip, .hype-title-rune, .hype-fill.full { animation: none; }
  .hype-fill { transition: none; }
  .hype-quake { animation: none; }
  .hype-flyup { animation-duration: 1ms; }
}

/* ---- the creator's ladder editor (dashboard go-live form + live page) ---- */
.hype-editor { font-size: 0.9rem; }
.hype-ed-head { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin-bottom: 0.4rem; }
.hype-ed-enabled { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; font-weight: 600; }
.hype-ed-metertitle { flex: 1 1 220px; min-width: 0; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid rgba(128, 128, 128, 0.35); background: transparent; color: inherit; font: inherit; }
.hype-ed-hint { margin: 0 0 0.6rem; font-size: 0.78rem; opacity: 0.75; line-height: 1.35; }
.hype-ed-rows { display: flex; flex-direction: column; gap: 0.45rem; }
.hype-ed-row {
  display: grid; grid-template-columns: 26px 26px 112px 96px minmax(140px, 1.2fr) minmax(140px, 1fr) 30px;
  gap: 0.4rem; align-items: center;
  padding: 0.45rem 0.5rem; border-radius: 10px;
  background: rgba(212, 175, 55, 0.07); border: 1px solid rgba(212, 175, 55, 0.25);
}
.hype-ed-row input, .hype-ed-row select {
  width: 100%; min-width: 0; padding: 0.38rem 0.5rem; border-radius: 7px;
  border: 1px solid rgba(128, 128, 128, 0.35); background: transparent; color: inherit; font: inherit; font-size: 0.85rem;
}
.hype-ed-row input:focus, .hype-ed-row select:focus, .hype-ed-metertitle:focus { outline: 2px solid rgba(212, 175, 55, 0.6); outline-offset: 1px; }
.hype-ed-grip { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.7rem; font-weight: 800; color: #1A2332; background: #D4AF37; }
.hype-ed-amount { font-variant-numeric: tabular-nums; }
.hype-ed-del { border: 0; background: transparent; color: inherit; opacity: 0.55; font-size: 1.2rem; line-height: 1; cursor: pointer; border-radius: 6px; }
.hype-ed-del:hover { opacity: 1; color: #dc2626; }
.hype-ed-empty { padding: 0.8rem; text-align: center; opacity: 0.7; border: 1px dashed rgba(128, 128, 128, 0.4); border-radius: 10px; font-size: 0.85rem; }
.hype-ed-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-top: 0.7rem; }
.hype-ed-spacer { flex: 1; }
.hype-ed-status { margin-top: 0.45rem; font-size: 0.8rem; opacity: 0.85; min-height: 1.1em; }
@media (max-width: 700px) {
  .hype-ed-row { grid-template-columns: 26px 26px 1fr 1fr 30px; }
  .hype-ed-title, .hype-ed-reward { grid-column: 2 / 5; }
}

.hype-ed-iconprev { display: grid; place-items: center; width: 24px; height: 24px; color: #D4AF37; font-size: 0.95rem; }
.hype-rung-icon i { font-size: 0.8em; color: #F8F4E3; }
.hype-rung.reached .hype-rung-icon i { color: #1A2332; }
.hype-next b i, .hype-unlock-goal i { color: #D4AF37; margin-right: 0.15em; }
.hype-contrib-rank {
  display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%;
  font-size: 0.7em; font-weight: 800; color: #1A2332; background: #cd7f32; margin-right: 0.3em;
}
.hype-contrib-rank.rank-1 { background: #F5D76E; }
.hype-contrib-rank.rank-2 { background: #d1d5db; }
