/* CENC Royale v000034c — Public Voting Status & Badge Semantics
   Status is semantic; presentation remains theme-aware. Premium PNG badges are
   used only when the effective theme exposes them. Every other theme receives
   a token-driven CSS badge instead of losing public-state information. */

/* Token fallback used when an effective theme has no authored badge image. */
.royale-status-badge{
  display:inline-flex;
  align-items:center;
  gap:9px;
  width:max-content;
  max-width:100%;
  min-height:34px;
  padding:8px 13px;
  border:1px solid color-mix(in srgb,var(--theme-primary) 58%,var(--theme-border));
  border-radius:999px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--theme-surface-elevated) 94%,transparent),color-mix(in srgb,var(--theme-bg) 90%,var(--theme-primary) 10%));
  color:var(--theme-accent);
  box-shadow:0 10px 26px color-mix(in srgb,var(--theme-bg) 76%,transparent),inset 0 1px 0 color-mix(in srgb,var(--theme-primary) 25%,transparent);
  font-family:var(--theme-font-body);
  font-size:11px;
  font-weight:850;
  line-height:1;
  letter-spacing:.075em;
  white-space:nowrap;
}
.royale-status-badge-mark{
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-radius:999px;
  background:var(--theme-primary);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--theme-primary) 13%,transparent),0 0 14px color-mix(in srgb,var(--theme-primary) 45%,transparent);
}
.royale-status-badge.is-upcoming .royale-status-badge-mark{background:var(--theme-secondary)}
.royale-status-badge.is-closed{opacity:.9;background:color-mix(in srgb,var(--theme-surface) 94%,var(--theme-bg))}
.royale-status-badge.is-closed .royale-status-badge-mark{background:var(--theme-muted);box-shadow:0 0 0 4px color-mix(in srgb,var(--theme-muted) 12%,transparent)}
.royale-status-badge.is-ranking-official{border-color:color-mix(in srgb,var(--theme-secondary) 70%,var(--theme-border));color:var(--theme-secondary)}
.royale-status-badge.is-ranking-official .royale-status-badge-mark{border-radius:2px;transform:rotate(45deg);background:var(--theme-secondary)}
.royale-status-badge.is-top-candidate{color:var(--theme-secondary)}

/* Same semantic placements for authored PNG badges and CSS fallbacks. */
.royale-premium-badge.is-card-status{width:min(190px,72%);margin:0 0 12px}
.royale-status-badge.is-card-status{margin:0 0 12px}
.royale-premium-badge.is-hero-status{width:min(230px,66%);margin-top:18px}
.royale-status-badge.is-hero-status{margin-top:18px}
.royale-hero-status-row{margin-top:18px}
.royale-hero-status-row .is-hero-status{margin-top:0}

.royale-entry-status-row{margin:14px 0 4px}
.royale-premium-badge.is-entry-card-status{width:min(180px,74%)}
.royale-status-badge.is-entry-card-status{font-size:10px;padding:7px 11px}

.royale-entry-top-badge{
  position:absolute;
  z-index:7;
  top:14px;
  right:14px;
  width:min(175px,58%);
  pointer-events:none;
}
.royale-entry-top-badge .royale-premium-badge.is-entry-top{width:100%;margin:0}
.royale-entry-top-badge .royale-status-badge.is-entry-top{margin-left:auto}

.royale-profile-top-row{display:flex;align-items:center;margin:8px 0 4px}
.royale-premium-badge.is-profile-top{width:min(225px,62%)}
.royale-status-badge.is-profile-top{margin:0}
.royale-profile-voting-state .royale-premium-badge.is-profile-status{width:min(230px,72%);margin:0 0 10px}
.royale-profile-voting-state .royale-status-badge.is-profile-status{margin:0 0 10px}

.royale-premium-badge.is-ranking-card-status{width:min(185px,72%);margin:12px 0 2px}
.royale-status-badge.is-ranking-card-status{margin:12px 0 2px}

.royale-ranking-badges{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:16px}
.royale-ranking-badges .royale-premium-badge.is-ranking-status{width:min(245px,36vw);margin:0}
.royale-ranking-badges .royale-status-badge.is-ranking-status{margin:0}
.royale-ranking-badges .royale-status-badge.is-ranking-official{margin:0}

/* Existing live card can now align both image and token fallback badges. */
.royale-voting-live-premium .royale-status-badge.is-voting-status{margin:0 0 10px auto}

/* The status should read as metadata, not turn entity cards into banners. */
.royale-entity-card>.royale-premium-badge.is-card-status,
.royale-entity-card>.royale-status-badge.is-card-status{align-self:flex-start}

@media(max-width:900px){
  .royale-premium-badge.is-card-status{width:min(180px,68%)}
  .royale-premium-badge.is-hero-status{width:min(220px,72%)}
  .royale-entry-top-badge{width:min(165px,56%);top:12px;right:12px}
  .royale-ranking-badges .royale-premium-badge.is-ranking-status{width:min(230px,62vw)}
}

@media(max-width:760px){
  .royale-status-badge{min-height:31px;padding:7px 11px;font-size:10px;letter-spacing:.06em}
  .royale-premium-badge.is-card-status{width:min(170px,62vw)}
  .royale-premium-badge.is-hero-status{width:min(210px,68vw)}
  .royale-entry-top-badge{width:min(160px,54%);top:10px;right:10px}
  .royale-premium-badge.is-profile-top{width:min(210px,68vw)}
  .royale-ranking-badges{gap:9px;margin-top:14px}
  .royale-ranking-badges .royale-premium-badge.is-ranking-status{width:min(210px,64vw)}
}

@media(prefers-reduced-motion:reduce){
  .royale-status-badge{box-shadow:none}
}
