/* Archive counters: On the website (green, left) · Total visitors + forum (gold, right) */

:root {
  --tmf-counter-w: 136px;
  --tmf-counter-top: calc(var(--tmf-ribbon-h, 38px) + 10px);
  --tmf-counter-inset: 14px;
  --tmf-counter-gold: #c9a227;
  --tmf-counter-green: #6ecf9a;
  --tmf-counter-green-dim: rgba(110, 207, 154, 0.55);
}

.tmf-visitor-widget,
.tmf-presence-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
  pointer-events: none;
  user-select: none;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.tmf-visitor-widget {
  border: 1px solid rgba(201, 162, 39, 0.38);
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.12) 0%, transparent 42%),
    linear-gradient(168deg, rgba(28, 24, 18, 0.97) 0%, rgba(10, 9, 7, 0.98) 55%, rgba(16, 13, 10, 0.97) 100%);
}

.tmf-presence-widget {
  border: 1px solid rgba(110, 207, 154, 0.36);
  background:
    linear-gradient(180deg, rgba(110, 207, 154, 0.14) 0%, transparent 42%),
    linear-gradient(168deg, rgba(12, 22, 18, 0.97) 0%, rgba(7, 11, 10, 0.98) 55%, rgba(10, 18, 15, 0.97) 100%);
}

.tmf-visitor-widget::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--tmf-counter-gold), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.tmf-presence-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--tmf-counter-green), transparent);
  opacity: 0.6;
  pointer-events: none;
}

.tmf-counter-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 8px 10px 7px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  flex-wrap: nowrap;
  min-width: 0;
}

.tmf-presence-widget .tmf-counter-head {
  border-bottom-color: rgba(110, 207, 154, 0.2);
}

.tmf-visitor-widget .tmf-counter-head {
  border-bottom-color: rgba(201, 162, 39, 0.18);
}

.tmf-counter-live {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tmf-counter-green-dim);
}

.tmf-presence-widget.is-ready .tmf-counter-live {
  background: var(--tmf-counter-green);
  box-shadow: 0 0 8px rgba(110, 207, 154, 0.45);
}

.tmf-presence-widget.is-live.is-ready .tmf-counter-live {
  animation: tmf-live-pulse 2.4s ease-in-out infinite;
}

@keyframes tmf-live-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 6px rgba(110, 207, 154, 0.45);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(110, 207, 154, 0.8);
  }
}

.tmf-visitor-widget.is-loading .tmf-visitor-widget-value,
.tmf-presence-widget.is-loading .tmf-presence-widget-value {
  opacity: 0.48;
}

.tmf-visitor-widget-label,
.tmf-presence-widget-label {
  margin: 0;
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tmf-visitor-widget-label {
  color: rgba(201, 162, 39, 0.78);
}

.tmf-presence-widget-label {
  color: rgba(160, 230, 190, 0.88);
  flex: 1;
  min-width: 0;
}

.tmf-visitor-widget-value,
.tmf-presence-widget-value {
  margin: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px 12px;
  box-sizing: border-box;
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.tmf-visitor-widget-value {
  color: #efe6d2;
}

.tmf-presence-widget-value {
  color: rgba(175, 245, 205, 0.98);
}

.tmf-visitor-widget[hidden],
.tmf-presence-widget[hidden] {
  display: none !important;
}

/* ── Archive: two columns, no overlap ── */
.tmf-counter-pair--archive {
  position: fixed;
  top: var(--tmf-counter-top);
  left: var(--tmf-counter-inset);
  right: var(--tmf-counter-inset);
  z-index: 170;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.tmf-counter-pair--archive.tmf-counter-pair--off {
  display: none !important;
  visibility: hidden;
}

.tmf-counter-col {
  width: var(--tmf-counter-w);
  flex: 0 0 var(--tmf-counter-w);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.tmf-counter-col > * {
  pointer-events: auto;
}

.tmf-counter-col--live {
  align-self: flex-start;
}

.tmf-counter-col--visitors {
  align-self: flex-start;
}

.tmf-counter-col--visitors .tmf-visitor-widget {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.tmf-counter-pair--archive .tmf-visitor-widget-label,
.tmf-counter-pair--archive .tmf-presence-widget-label {
  font-size: 6.5px;
}

.tmf-counter-pair--archive .tmf-visitor-widget-value,
.tmf-counter-pair--archive .tmf-presence-widget-value {
  font-size: 19px;
  min-height: 38px;
}

/* ── Seal: top telemetry (countdown page chrome) ── */
.tmf-seal-chrome .tmf-presence-widget--seal,
.tmf-seal-chrome .tmf-visitor-widget--seal {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  transform-origin: unset;
  width: var(--tmf-counter-w);
  min-width: var(--tmf-counter-w);
  max-width: var(--tmf-counter-w);
  flex-shrink: 0;
}

.tmf-seal-chrome .tmf-presence-widget--seal .tmf-presence-widget-value,
.tmf-seal-chrome .tmf-visitor-widget--seal .tmf-visitor-widget-value {
  font-size: 18px;
  min-height: 36px;
  padding: 8px 6px 10px;
}

.tmf-seal-chrome .tmf-counter-head {
  min-height: 28px;
  padding: 6px 8px 5px;
}

body:not(.tmf-locked) .tmf-presence-widget--seal,
body:not(.tmf-locked) .tmf-visitor-widget--seal {
  display: none !important;
}

@media (max-width: 520px) {
  :root {
    --tmf-counter-w: 112px;
    --tmf-counter-inset: 8px;
    --tmf-counter-top: calc(var(--tmf-ribbon-h, 38px) + 8px);
  }

  .tmf-counter-pair--archive {
    gap: 8px;
  }

  .tmf-seal-chrome .tmf-presence-widget--seal,
  .tmf-seal-chrome .tmf-visitor-widget--seal {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
  }

  .tmf-counter-pair--archive .tmf-visitor-widget-value,
  .tmf-counter-pair--archive .tmf-presence-widget-value {
    font-size: 17px;
    min-height: 34px;
  }
}

:root {
  --tmf-kv-banner-h: 0px;
}

html[data-tmf-kv-readonly='1'] {
  --tmf-kv-banner-h: 36px;
}

html[data-tmf-kv-readonly='1'] .tmf-counter-pair--archive {
  top: calc(var(--tmf-counter-top) + var(--tmf-kv-banner-h));
}

.tmf-kv-readonly-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  margin: 0;
  padding: 8px 12px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #1a1208;
  background: linear-gradient(90deg, #ffb347, #ff9f5a);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.tmf-kv-readonly-banner.is-dismissed {
  display: none;
}

html[data-tmf-kv-readonly='1']:has(.tmf-kv-readonly-banner.is-dismissed) {
  --tmf-kv-banner-h: 0px;
}

.tmf-kv-readonly-banner-text {
  flex: 1 1 auto;
  text-align: center;
  max-width: 52rem;
}

.tmf-kv-readonly-dismiss {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid rgba(26, 18, 8, 0.35);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  color: #1a1208;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.tmf-kv-readonly-dismiss:hover {
  background: rgba(255, 255, 255, 0.55);
}

html[data-tmf-kv-readonly='1'] body.tmf-locked .tmf-seal {
  padding-top: var(--tmf-kv-banner-h);
}
