/**
 * Sticky Top Timer Alarm Bar styles (Figma 2050:23648 / 2050:23748 / 2050:23902 / 2050:23999).
 */

.hbl-header {
  z-index: 1000;
}

@media screen and (min-width: 783px) {
  body.admin-bar {
    --hbl-admin-bar-offset: 32px;
  }

  body.admin-bar.reading-manga .hbl-header {
    top: 32px;
  }
}

@media screen and (min-width: 601px) and (max-width: 782px) {
  body.admin-bar {
    --hbl-admin-bar-offset: 46px;
  }

  body.admin-bar.reading-manga .hbl-header {
    top: 46px;
  }
}

@media screen and (max-width: 1023px) {
  body.admin-bar:not(.reading-manga) .hbl-header {
    top: var(--hbl-admin-bar-offset, 0px);
  }
}

.hbl-top-timer-bar {
  position: sticky;
  top: var(--hbl-top-timer-offset, var(--hbl-admin-bar-offset, 0px));
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 6px 20px;
  box-sizing: border-box;
  border-top: 1px solid #fecdd3;
  border-bottom: 1px solid #fecdd3;
  background: #fff5f4;
  font-family: "Inter", sans-serif;
  transition: top 200ms ease-in-out, background-color 240ms ease, border-color 240ms ease;
}

body.reading-manga .hbl-top-timer-bar {
  --hbl-top-timer-offset: calc(var(--hbl-admin-bar-offset, 0px) + 106px);
}

.hbl-top-timer-bar.is-dismissed {
  display: none !important;
}

.hbl-top-timer-bar__spacer {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.hbl-top-timer-bar__center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  text-decoration: none !important;
  cursor: pointer;
}

.hbl-top-timer-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hbl-top-timer-bar__character {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 26px;
  flex-shrink: 0;
}

.hbl-top-timer-bar__character svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hbl-top-timer-bar__label {
  color: #9f1239;
  font-size: 11px;
  font-weight: 700;
  line-height: 13px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hbl-top-timer-bar__clock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.hbl-top-timer-bar__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 19px;
  padding: 2px 5px;
  box-sizing: border-box;
  border-radius: 4px;
  background: #ff6e63;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  transition: background-color 240ms ease;
}

.hbl-top-timer-bar__sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
}

.hbl-top-timer-bar__close {
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e11d48;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.hbl-top-timer-bar__close:hover {
  background: rgba(225, 29, 72, 0.1);
}

/* 2-Color Urgency Stage (< 30m: Crimson color) + Final Pulse (< 5m) */
.hbl-top-timer-bar.is-ending-soon,
.hbl-top-timer-bar.is-stage-critical {
  border-top-color: #ff6e63;
  border-bottom-color: #ff6e63;
  background: #ffeded;
}

.hbl-top-timer-bar.is-ending-soon .hbl-top-timer-bar__box,
.hbl-top-timer-bar.is-stage-critical .hbl-top-timer-bar__box {
  background: #ff3b30;
}

.hbl-top-timer-bar.is-stage-critical .hbl-top-timer-bar__box {
  animation: hblTopBarBoxPulse 0.9s ease-in-out infinite;
}

@keyframes hblTopBarBoxPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

/* Dark mode (2050:23748 & 2050:23999) */
body.text-ui-light .hbl-top-timer-bar {
  border-top-color: #7f2d2d;
  border-bottom-color: #7f2d2d;
  background: #1f161b;
}

body.text-ui-light .hbl-top-timer-bar.is-ending-soon,
body.text-ui-light .hbl-top-timer-bar.is-stage-critical {
  border-top-color: #ff6e63;
  border-bottom-color: #ff6e63;
  background: #3b1219;
}

body.text-ui-light .hbl-top-timer-bar__label {
  color: #ffe4e6;
}

body.text-ui-light .hbl-top-timer-bar__sep {
  color: #ffffff;
}

body.text-ui-light .hbl-top-timer-bar__close {
  background: #372027;
  color: #fca5a5;
}

body.text-ui-light .hbl-top-timer-bar__close:hover {
  background: #4c2933;
}

/* Mobile (2050:23902 & 2050:23999) */
@media (max-width: 767px) {
  .hbl-top-timer-bar {
    min-height: 42px;
    padding: 6px 12px;
  }

  .hbl-top-timer-bar__spacer {
    flex: 0 0 22px;
    width: 22px;
  }

  .hbl-top-timer-bar__center {
    gap: 6px;
  }

  .hbl-top-timer-bar__brand {
    gap: 6px;
  }

  .hbl-top-timer-bar__character {
    width: 18px;
    height: 22px;
  }
}

/**
 * Time Sale Entry Modal Popup styles (Figma 2045:21930 & 2045:21931).
 */

.hbl-entry-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(2px);
  overflow-y: auto;
  font-family: "Inter", sans-serif;
}

.hbl-entry-modal-backdrop[hidden] {
  display: none !important;
}

.hbl-entry-modal-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 460px;
}

.hbl-entry-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 76px);
  padding: 22px 24px;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
  overflow-y: auto;
  font-family: "Inter", sans-serif;
}

.hbl-entry-modal__topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hbl-entry-modal__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffe8e5;
  color: #ff6e63;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hbl-entry-modal__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hbl-entry-modal__char {
  display: block;
  height: 76px;
  width: auto;
  object-fit: contain;
}

.hbl-entry-modal__hero-pkg {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.hbl-entry-modal__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.hbl-entry-modal__title {
  margin: 0 !important;
  color: #111827;
  font-family: "Inter", sans-serif !important;
  font-size: 21px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.hbl-entry-modal__subtitle {
  margin: 0 !important;
  color: #4b5563;
  font-family: "Inter", sans-serif !important;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  text-wrap: balance;
}

.hbl-entry-modal__countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 14px 20px;
  box-sizing: border-box;
  border: 1.5px solid #ff6e63;
  border-radius: 16px;
  background: #fff5f4;
  text-align: center;
  transition: background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.hbl-entry-modal__countdown-eyebrow {
  color: #ff6e63;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hbl-entry-modal__countdown-clock {
  color: #111827;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: color 240ms ease;
}

.hbl-entry-modal__countdown-note {
  color: #e11d48;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

body.text-ui-light .hbl-entry-modal__countdown-note {
  color: #fca5a5;
}

/* 2-Color Urgency Stage inside modal (< 30m: Crimson color) + Final Pulse (< 5m) */
.hbl-entry-modal-backdrop.is-ending-soon .hbl-entry-modal__countdown,
.hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown {
  border-width: 2px;
  border-color: #ff3b30;
  background: #ffeded;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.2);
}

.hbl-entry-modal-backdrop.is-ending-soon .hbl-entry-modal__countdown-eyebrow,
.hbl-entry-modal-backdrop.is-ending-soon .hbl-entry-modal__countdown-clock,
.hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown-eyebrow,
.hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown-clock {
  color: #e51f1f;
}

.hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown {
  animation: hblModalCountdownPulse 1.2s ease-in-out infinite;
}

@keyframes hblModalCountdownPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

.hbl-entry-modal__bundles-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.hbl-entry-modal__bundles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hbl-entry-modal__bundles-eyebrow {
  color: #d97706;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hbl-entry-modal__bundles-note {
  margin: 0 !important;
  color: #4b5563;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
}

.hbl-entry-modal__bundles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.hbl-entry-modal__bundle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 76px;
  padding: 8px 12px;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  font-family: "Inter", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.hbl-entry-modal__bundle:hover {
  border-color: #fca5a5;
}

.hbl-entry-modal__bundle.is-selected {
  border-color: #ff6e63;
  background: #fff5f4;
  box-shadow: 0 0 0 1px #ff6e63;
}

.hbl-entry-modal__bundle-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.hbl-entry-modal__bundle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.hbl-entry-modal__bundle-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hbl-entry-modal__bundle-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.hbl-entry-modal__bundle-name {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hbl-entry-modal__bundle-zings {
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.hbl-entry-modal__bundle-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hbl-entry-modal__bundle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 3px 8px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #f05a50;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.hbl-entry-modal__bundle-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  flex-shrink: 0;
}

.hbl-entry-modal__bundle-chapter {
  color: #00be23;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hbl-entry-modal__bundle-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hbl-entry-modal__bundle-orig {
  color: #7c7c7c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: line-through;
}

.hbl-entry-modal__bundle-sale {
  color: #e11d48;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.hbl-entry-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #f05a50;
  color: #ffffff !important;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}

.hbl-entry-modal__cta:hover {
  background: #e0483e;
  color: #ffffff !important;
}

.hbl-entry-modal__footer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.hbl-entry-modal__footer-link {
  color: #6b7280 !important;
  text-decoration: none !important;
  transition: color 160ms ease;
}

.hbl-entry-modal__footer-link:hover {
  color: #111827 !important;
}

.hbl-entry-modal__footer-dismiss {
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 160ms ease;
}

.hbl-entry-modal__footer-dismiss:hover {
  color: #111827;
}

/* Dark mode (Figma 2045:21931) */
body.text-ui-light .hbl-entry-modal {
  border-color: #2a3042;
  background: #12151e;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
}

body.text-ui-light .hbl-entry-modal__tag {
  background: #3a2024;
  color: #ff6e63;
}

body.text-ui-light .hbl-entry-modal__title {
  color: #ffffff;
}

body.text-ui-light .hbl-entry-modal__subtitle {
  color: #9ca3af;
}

body.text-ui-light .hbl-entry-modal__countdown {
  border-color: #ff6e63;
  background: #23171b;
}

body.text-ui-light .hbl-entry-modal__countdown-clock {
  color: #ffffff;
}

body.text-ui-light .hbl-entry-modal-backdrop.is-ending-soon .hbl-entry-modal__countdown,
body.text-ui-light .hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown {
  background: #2b1419;
}

body.text-ui-light .hbl-entry-modal-backdrop.is-ending-soon .hbl-entry-modal__countdown-eyebrow,
body.text-ui-light .hbl-entry-modal-backdrop.is-ending-soon .hbl-entry-modal__countdown-clock,
body.text-ui-light .hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown-eyebrow,
body.text-ui-light .hbl-entry-modal-backdrop.is-stage-critical .hbl-entry-modal__countdown-clock {
  color: #ff6e63;
}

body.text-ui-light .hbl-entry-modal__bundles-eyebrow {
  color: #fbbf24;
}

body.text-ui-light .hbl-entry-modal__bundles-note {
  color: #d1d5db;
}

body.text-ui-light .hbl-entry-modal__bundle {
  border-color: #262d40;
  background: #151924;
}

body.text-ui-light .hbl-entry-modal__bundle:hover {
  border-color: #fb746e;
}

body.text-ui-light .hbl-entry-modal__bundle.is-selected {
  border-color: #ff6e63;
  background: #261b22;
  box-shadow: 0 0 0 1px #ff6e63;
}

body.text-ui-light .hbl-entry-modal__bundle-name {
  color: #ffffff;
}

body.text-ui-light .hbl-entry-modal__bundle-zings {
  color: #9ca3af;
}

body.text-ui-light .hbl-entry-modal__bundle-sale {
  color: #fbbf24;
}

body.text-ui-light .hbl-entry-modal__footer-link:hover,
body.text-ui-light .hbl-entry-modal__footer-dismiss:hover {
  color: #ffffff !important;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .hbl-entry-modal-backdrop {
    padding: 10px;
  }

  .hbl-entry-modal {
    padding: 16px 12px;
    border-radius: 20px;
    gap: 12px;
  }

  .hbl-entry-modal__title {
    font-size: 18px;
    line-height: 24px;
  }

  .hbl-entry-modal__countdown {
    padding: 12px 14px;
  }

  .hbl-entry-modal__countdown-clock {
    font-size: 30px;
    line-height: 36px;
  }

  .hbl-entry-modal__bundle {
    padding: 8px 8px;
    min-height: 64px;
    gap: 6px;
  }

  .hbl-entry-modal__bundle-left {
    gap: 6px;
    overflow: hidden;
  }

  .hbl-entry-modal__bundle-icon {
    width: 28px;
    height: 28px;
  }

  .hbl-entry-modal__bundle-name {
    font-size: 12px;
    line-height: 1.2;
  }

  .hbl-entry-modal__bundle-zings {
    font-size: 10px;
  }

  .hbl-entry-modal__bundle-right {
    gap: 5px;
  }

  .hbl-entry-modal__bundle-badge {
    min-width: 0;
    padding: 2px 5px;
    font-size: 9.5px;
  }

  .hbl-entry-modal__bundle-chapter {
    font-size: 10px;
    letter-spacing: -0.02em;
  }

  .hbl-entry-modal__bundle-orig {
    font-size: 9.5px;
  }

  .hbl-entry-modal__bundle-sale {
    font-size: 11px;
  }
}

