/*
 * WR71 Shared Account Counter
 * Display-only module. It does not count or authorize downloads.
 */

.wr71-account-counter {
  --wr71-account-accent: #71ffb1;
  --wr71-account-accent-soft: rgba(113, 255, 177, .14);

  position: relative;
  display: grid;
  gap: 5px;
  min-width: 178px;
  padding: 9px 13px;
  overflow: hidden;
  border: 1px solid rgba(113, 255, 177, .24);
  border-radius: 16px;
  background:
    linear-gradient(
      145deg,
      rgba(113, 255, 177, .08),
      rgba(85, 215, 255, .045),
      rgba(182, 124, 255, .05)
    ),
    rgba(7, 13, 18, .62);
  color: #f5fff9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 10px 28px rgba(0, 0, 0, .18);
}

.wr71-account-counter[hidden] {
  display: none;
}

.wr71-account-counter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.wr71-account-counter-label {
  overflow: hidden;
  color: rgba(255, 255, 255, .57);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .15em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.wr71-account-counter-value {
  color: var(--wr71-account-accent);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
  white-space: nowrap;
}

.wr71-account-counter-message {
  overflow: hidden;
  color: rgba(255, 255, 255, .72);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wr71-account-counter-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
}

.wr71-account-counter-track[hidden] {
  display: none;
}

.wr71-account-counter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--wr71-account-accent),
    #55d7ff
  );
  box-shadow: 0 0 12px var(--wr71-account-accent-soft);
  transition:
    width .45s ease,
    background .25s ease;
}

.wr71-account-counter.is-warning {
  --wr71-account-accent: #ffb347;
  --wr71-account-accent-soft: rgba(255, 179, 71, .22);

  border-color: rgba(255, 179, 71, .48);
  background:
    linear-gradient(
      145deg,
      rgba(255, 179, 71, .13),
      rgba(255, 119, 74, .055)
    ),
    rgba(12, 12, 15, .72);
}

.wr71-account-counter.is-warning .wr71-account-counter-fill {
  background: linear-gradient(90deg, #ffb347, #ff8a4c);
}

.wr71-account-counter.is-critical {
  --wr71-account-accent: #ff626b;
  --wr71-account-accent-soft: rgba(255, 98, 107, .25);

  border-color: rgba(255, 98, 107, .58);
  background:
    linear-gradient(
      145deg,
      rgba(255, 81, 94, .16),
      rgba(150, 41, 62, .075)
    ),
    rgba(15, 9, 13, .76);
  animation: wr71AccountCounterPulse 2.2s ease-in-out infinite;
}

.wr71-account-counter.is-critical .wr71-account-counter-fill {
  background: linear-gradient(90deg, #ff626b, #ff3f61);
}

.wr71-account-counter.is-unlimited {
  --wr71-account-accent: #55d7ff;
  --wr71-account-accent-soft: rgba(85, 215, 255, .2);

  border-color: rgba(85, 215, 255, .28);
}

@keyframes wr71AccountCounterPulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .06),
      0 10px 28px rgba(0, 0, 0, .18),
      0 0 0 rgba(255, 98, 107, 0);
  }

  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .06),
      0 10px 28px rgba(0, 0, 0, .18),
      0 0 25px rgba(255, 98, 107, .22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wr71-account-counter,
  .wr71-account-counter-fill {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 850px) {
  .wr71-account-counter {
    min-width: 165px;
  }
}

@media (max-width: 620px) {
  .wr71-account-counter {
    width: 100%;
    min-width: 0;
  }
}

/* WR71 RC2.2 compact left-header placement */
.wr71-header-account {
  display: flex;
  align-items: center;
  margin-left: 18px;
  margin-right: auto;
}

.wr71-header-account .wr71-account-counter {
  min-width: 92px;
  width: 92px;
  transform: scaleX(1.22);
  transform-origin: left center;
  gap: 3px;
  padding: 7px 10px;
  border-radius: 13px;
}

.wr71-header-account .wr71-account-counter-head {
  display: grid;
  gap: 1px;
}

.wr71-header-account .wr71-account-counter-label {
  font-size: 7px;
  letter-spacing: .13em;
}

.wr71-header-account .wr71-account-counter-value {
  font-size: 11px;
}

.wr71-header-account .wr71-account-counter-message {
  display: none;
}

.wr71-header-account .wr71-account-counter-track {
  height: 3px;
}

@media (max-width: 850px) {
  .wr71-header-account {
    order: 2;
    margin-left: auto;
    margin-right: 12px;
  }

  .wr71-header-account .wr71-account-counter {
    width: 98px;
    min-width: 98px;
  }
}

@media (max-width: 620px) {
  .wr71-header-account {
    margin-left: 8px;
    margin-right: 8px;
  }

  .wr71-header-account .wr71-account-counter {
    width: 92px;
    min-width: 92px;
    padding: 6px 8px;
  }
}

/* WR71 RC2.2 final logo-account placement */
.brand-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-cluster .wr71-header-account {
  display: block;
  width: 100%;
  margin: 6px 0 0;
}

.brand-cluster .wr71-account-counter {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  gap: 3px;
  padding: 6px 9px;
  border-color: rgba(105, 226, 255, .36);
  border-radius: 11px;

  background:
    linear-gradient(
      115deg,
      rgba(116, 255, 92, .11) 0%,
      rgba(75, 225, 214, .10) 48%,
      rgba(151, 104, 255, .13) 100%
    ),
    rgba(7, 13, 18, .68);

  transform: none;
  transform-origin: initial;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 7px 18px rgba(0, 0, 0, .16);
}

.brand-cluster .wr71-account-counter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.brand-cluster .wr71-account-counter-label {
  font-size: 6.5px;
  letter-spacing: .12em;
}

.brand-cluster .wr71-account-counter-value {
  font-size: 9px;
  background: linear-gradient(
    90deg,
    #83ff5f 0%,
    #56e4d7 50%,
    #a675ff 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-cluster .wr71-account-counter-track {
  height: 3px;
  background: rgba(255, 255, 255, .10);
}

.brand-cluster .wr71-account-counter-fill {
  background: linear-gradient(
    90deg,
    #83ff5f 0%,
    #56e4d7 52%,
    #a675ff 100%
  );
  box-shadow: 0 0 9px rgba(86, 228, 215, .34);
}

.brand-cluster .wr71-account-counter-message {
  display: none;
}

/* Warnfarben behalten Priorität */
.brand-cluster .wr71-account-counter.is-warning {
  border-color: rgba(255, 179, 71, .52);
  background:
    linear-gradient(
      115deg,
      rgba(255, 190, 76, .15),
      rgba(255, 113, 73, .10)
    ),
    rgba(12, 12, 15, .72);
}

.brand-cluster .wr71-account-counter.is-warning
.wr71-account-counter-value {
  background: none;
  color: #ffb347;
}

.brand-cluster .wr71-account-counter.is-warning
.wr71-account-counter-fill {
  background: linear-gradient(90deg, #ffbf55, #ff814d);
}

.brand-cluster .wr71-account-counter.is-critical {
  border-color: rgba(255, 98, 107, .62);
}

.brand-cluster .wr71-account-counter.is-critical
.wr71-account-counter-value {
  background: none;
  color: #ff626b;
}

.brand-cluster .wr71-account-counter.is-critical
.wr71-account-counter-fill {
  background: linear-gradient(90deg, #ff626b, #ff3f61);
}

@media (max-width: 850px) {
  .brand-cluster .wr71-header-account {
    width: 100%;
    margin: 5px 0 0;
  }

  .brand-cluster .wr71-account-counter {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .brand-cluster .wr71-account-counter {
    padding: 5px 7px;
  }
}

/* WR71 RC2.2 final centered header account position */
.site-header {
  position: relative;
}

.site-header > .wr71-header-account {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: block;
  width: 104px;
  margin: 0;
  transform: translate(-50%, -50%);
}

.site-header > .wr71-header-account .wr71-account-counter {
  width: 104px;
  min-width: 104px;
  box-sizing: border-box;
  gap: 3px;
  padding: 6px 9px;
  border-color: rgba(105, 226, 255, .36);
  border-radius: 11px;

  background:
    linear-gradient(
      115deg,
      rgba(116, 255, 92, .11) 0%,
      rgba(75, 225, 214, .10) 48%,
      rgba(151, 104, 255, .13) 100%
    ),
    rgba(7, 13, 18, .68);

  transform: none;
  transform-origin: initial;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 7px 18px rgba(0, 0, 0, .16);
}

.site-header > .wr71-header-account
.wr71-account-counter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.site-header > .wr71-header-account
.wr71-account-counter-label {
  font-size: 6.5px;
  letter-spacing: .12em;
}

.site-header > .wr71-header-account
.wr71-account-counter-value {
  font-size: 9px;
  background: linear-gradient(
    90deg,
    #83ff5f 0%,
    #56e4d7 50%,
    #a675ff 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header > .wr71-header-account
.wr71-account-counter-track {
  height: 3px;
  background: rgba(255, 255, 255, .10);
}

.site-header > .wr71-header-account
.wr71-account-counter-fill {
  background: linear-gradient(
    90deg,
    #83ff5f 0%,
    #56e4d7 52%,
    #a675ff 100%
  );
  box-shadow: 0 0 9px rgba(86, 228, 215, .34);
}

.site-header > .wr71-header-account
.wr71-account-counter-message {
  display: none;
}

/* Orange Warnung bei 11 von 12 */
.site-header > .wr71-header-account
.wr71-account-counter.is-warning {
  border-color: rgba(255, 179, 71, .52);
  background:
    linear-gradient(
      115deg,
      rgba(255, 190, 76, .15),
      rgba(255, 113, 73, .10)
    ),
    rgba(12, 12, 15, .72);
}

.site-header > .wr71-header-account
.wr71-account-counter.is-warning
.wr71-account-counter-value {
  background: none;
  color: #ffb347;
}

.site-header > .wr71-header-account
.wr71-account-counter.is-warning
.wr71-account-counter-fill {
  background: linear-gradient(90deg, #ffbf55, #ff814d);
}

/* Rote pulsierende Grenze bei 12 von 12 */
.site-header > .wr71-header-account
.wr71-account-counter.is-critical {
  border-color: rgba(255, 98, 107, .62);
}

.site-header > .wr71-header-account
.wr71-account-counter.is-critical
.wr71-account-counter-value {
  background: none;
  color: #ff626b;
}

.site-header > .wr71-header-account
.wr71-account-counter.is-critical
.wr71-account-counter-fill {
  background: linear-gradient(90deg, #ff626b, #ff3f61);
}

/* Auf kleineren Displays zurück in den normalen Headerfluss */
@media (max-width: 850px) {
  .site-header > .wr71-header-account {
    position: static;
    order: 2;
    width: 104px;
    margin: 0 auto;
    transform: none;
  }

  .site-header > .wr71-header-account
  .wr71-account-counter {
    width: 104px;
    min-width: 104px;
  }
}

@media (max-width: 620px) {
  .site-header > .wr71-header-account {
    width: 98px;
  }

  .site-header > .wr71-header-account
  .wr71-account-counter {
    width: 98px;
    min-width: 98px;
    padding: 5px 7px;
  }
}
