:root {
  --tibiu-alert-shell: 1170px;
  --tibiu-alert-primary: #2196F3;
  --tibiu-alert-primary-hover: #1e88e5;
  --tibiu-alert-primary-soft: #d8ecff;
  --tibiu-alert-primary-border: #64b5f6;
  --tibiu-alert-text: #171a1c;
  --tibiu-alert-muted: #636b74;
  --tibiu-alert-line: #cdd7e1;
  --tibiu-alert-soft: #f0f4f8;
  --tibiu-alert-shadow: 0 12px 32px rgba(21, 21, 21, 0.14), 0 2px 8px rgba(21, 21, 21, 0.08);
  --tibiu-layer-top-alert: 20000;
  --tibiu-layer-stack-alert: 20010;
}

/* Top alert: white notice card. Stack alert: compact dark toast (tb-toast spec).
   Theme glyphs and countdown bars are hidden; the title carries the message. */
.tibiu-top-alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--tibiu-layer-top-alert, 1200);
  display: none;
  pointer-events: none;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 0;
}

.tibiu-top-alert.is-mounted {
  display: block;
}

.tibiu-top-alert.is-active .tibiu-top-alert__inner {
  opacity: 1;
  transform: translateY(0);
}

.tibiu-top-alert.is-closing .tibiu-top-alert__inner {
  opacity: 0;
  transform: translateY(-12px);
}

.tibiu-top-alert__shell,
.tibiu-stack-alerts__shell {
  width: calc(100% - 32px);
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.tibiu-top-alert__inner {
  width: min(100%, 420px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px);
  transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1), opacity 0.2s ease;
}

.tibiu-top-alert__card {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--tb-radius-card, 12px);
  background: var(--tb-surface, #fff);
  box-shadow: var(--tb-shadow-pop, 0 4px 16px rgb(17 24 39 / 10%));
}

.tibiu-top-alert__card::before,
.tibiu-top-alert__icon,
.tibiu-top-alert__progress,
.tibiu-stack-alert__card::before,
.tibiu-stack-alert__icon,
.tibiu-stack-alert__progress {
  display: none;
}

.tibiu-top-alert__body {
  display: grid;
  gap: 4px;
  padding: 16px 16px 16px 20px;
}

.tibiu-top-alert__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tibiu-top-alert__title {
  margin: 0;
  color: var(--tb-ink, #14171a);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  text-align: left;
  word-break: break-word;
}

.tibiu-top-alert__close,
.tibiu-stack-alert__close {
  width: 44px;
  height: 44px;
  margin: -12px -10px -12px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tb-muted, #6b7279);
  box-shadow: none;
  cursor: pointer;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.tibiu-top-alert__close:hover {
  background: transparent;
  color: var(--tb-ink, #14171a);
}

.tibiu-top-alert__content {
  margin: 0;
  padding: 0 28px 0 0;
  color: var(--tb-ink-2, #4f555b);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  white-space: pre-line;
  word-break: break-word;
}

.tibiu-top-alert__content p,
.tibiu-stack-alert__content p {
  margin: 0;
}

.tibiu-top-alert__content p + p {
  margin-top: 6px;
}

.tibiu-stack-alerts {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--tibiu-layer-stack-alert, 1210);
  pointer-events: none;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.tibiu-stack-alerts__list {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(100%, 360px);
}

.tibiu-stack-alert {
  position: relative;
  max-width: 100%;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1), opacity 0.2s ease;
}

.tibiu-stack-alert.is-active {
  opacity: 1;
  transform: translateY(0);
}

.tibiu-stack-alert.is-closing {
  opacity: 0;
  transform: translateY(8px);
}

.tibiu-stack-alert__card {
  overflow: hidden;
  border: 0;
  /* Pill on one line (about 40px tall); a title + content alert stays a rounded block. */
  border-radius: 20px;
  background: rgb(15 20 25 / 92%);
  box-shadow: none;
}

.tibiu-stack-alert__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
}

.tibiu-stack-alert__copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tibiu-stack-alert__title {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
  word-break: break-word;
}

.tibiu-stack-alert__content {
  color: rgb(255 255 255 / 72%);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tibiu-stack-alert__content:empty {
  display: none;
}

.tibiu-stack-alert__close {
  width: 32px;
  height: 32px;
  margin: -6px -10px -6px 0;
  color: rgb(255 255 255 / 60%);
  font-size: 20px;
}

.tibiu-stack-alert__close:hover {
  background: transparent;
  color: #fff;
}

@keyframes tibiuAlertCountdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.tibiu-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  color: #8a8f98;
  text-align: center;
}

.tibiu-skeleton-line {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2f3f5 25%, #e7e9ee 37%, #f2f3f5 63%);
  background-size: 400% 100%;
  animation: tibiu-alert-skeleton 1.4s ease infinite;
}

.tibiu-skeleton-line + .tibiu-skeleton-line {
  margin-top: 10px;
}

.tibiu-skeleton-line.is-short {
  width: 62%;
}

.tibiu-loading-mask {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 120px;
  color: #8a8f98;
}

.tibiu-loading-mask.is-active {
  display: flex;
}

.tibiu-loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(33, 150, 243, 0.18);
  border-top-color: #2196F3;
  border-radius: 50%;
  animation: tibiu-alert-spin 0.9s linear infinite;
}

@keyframes tibiu-alert-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tibiu-alert-skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
