dialog { color: var(--text); }
dialog::backdrop { background: rgba(3, 6, 14, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- Модал на сървър ---------- */
.modal {
  --accent: var(--blue-2);
  --badge-color: color-mix(in srgb, var(--accent) 78%, #000);
  --bar-fill: var(--accent);
  --bar-empty: rgba(148, 163, 184, 0.14);
  margin: auto;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  overflow: visible;
}
.modal[open] { animation: pop 180ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.modal-sm { width: min(440px, calc(100vw - 48px)); }
.modal-xs { width: min(370px, calc(100vw - 36px)); }

.m-shell {
  position: relative;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 140, 255, 0.28) transparent;
}
.m-shell::-webkit-scrollbar,
.m-main::-webkit-scrollbar { width: 6px; }
.m-shell::-webkit-scrollbar-track,
.m-main::-webkit-scrollbar-track { background: transparent; }
.m-shell::-webkit-scrollbar-thumb,
.m-main::-webkit-scrollbar-thumb {
  background: rgba(99, 140, 255, 0.24);
  border-radius: 999px;
}
.m-shell::-webkit-scrollbar-thumb:hover,
.m-main::-webkit-scrollbar-thumb:hover { background: rgba(99, 140, 255, 0.44); }
.modal.glow .m-shell {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 42px color-mix(in srgb, var(--accent) 28%, transparent), var(--shadow);
}
.modal.glow .m-banner {
  background:
    linear-gradient(transparent 40%, var(--panel)),
    radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--accent) 62%, transparent), transparent 65%),
    var(--panel-2);
}
.m-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(10, 15, 29, 0.7);
}

.m-banner {
  height: 150px;
  background:
    linear-gradient(transparent 40%, var(--panel)),
    radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%),
    var(--panel-2);
}
.m-banner img { width: 100%; height: 100%; object-fit: cover; mask-image: linear-gradient(#000 55%, transparent); -webkit-mask-image: linear-gradient(#000 55%, transparent); }

.m-head {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin-top: -56px;
  padding: 0 28px;
  position: relative;
}
.modal:not(.is-featured) .m-head { grid-template-columns: minmax(0, 1fr); }
.modal:not(.is-featured) .m-head-right { display: none; }
.m-head-left {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  min-width: 0;
}
.m-head-right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.m-icon .s-icon { width: 96px; height: 96px; border-radius: 18px; border: 3px solid var(--panel); font-size: 40px; box-shadow: var(--shadow); }
.m-titles { flex: 1 1 220px; min-width: 0; padding-bottom: 4px; }
.modal.has-banner .m-titles {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: linear-gradient(105deg, rgba(5, 9, 20, 0.96), rgba(7, 12, 25, 0.86));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
.modal.has-banner .m-titles h2 { overflow-wrap: anywhere; }
.m-titles h2 { font-family: var(--font-title); font-weight: 400; font-size: clamp(28px, 3vw, 36px); line-height: 1.08; }
.m-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.m-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.m-meta .on { color: var(--green); font-weight: 600; }

.m-editions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: -4px; }
.m-editions:empty { display: none; }
.ed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
  font-size: 12.5px;
  font-weight: 600;
}
.ed-pill svg { width: 13px; height: 13px; color: #4ade80; }

.m-addresses { display: flex; flex-wrap: wrap; gap: 8px; }
.addr {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 6px 0 14px;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}
.addr:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, var(--well));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 24%, transparent);
}
.addr.copied {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
}
.addr-label { color: var(--dim); font-size: 12px; font-weight: 600; }
.addr code { font-family: var(--font-mono); font-size: 15px; user-select: none; }

.m-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 18px 28px 26px;
}
.m-body.no-main { grid-template-columns: 1fr; }
.m-side { display: flex; flex-direction: column; gap: 14px; }

.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-stats > div { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.m-stats > div.m-stat-wide { grid-column: 1 / -1; }
.m-stats dt { color: var(--muted); font-size: 12px; }
.m-stats dd { margin-top: 2px; font-family: var(--font-title); font-size: 19px; }
.m-stats dd small { font-family: var(--font-ui); font-size: 12px; color: var(--muted); }
.m-stats dd.soon { font-family: var(--font-ui); font-size: 13px; color: var(--dim); font-weight: 500; }
.m-badges-card { display: flex; flex-direction: column; gap: 7px; }
.m-metric-row { display: flex; align-items: center; gap: 8px; }
.m-metric-row .bar-none { flex: 1; font-size: 12px; color: var(--dim); }
.badge-medal-wrap { display: inline-flex; align-items: center; justify-content: center; }

[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(13, 19, 35, 0.96);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.m-stats [data-tooltip]::after {
  right: 0;
  left: auto;
  transform: translateY(4px);
}
.m-stats [data-tooltip]:hover::after,
.m-stats [data-tooltip]:focus-visible::after {
  transform: translateY(0);
}

.m-links { display: flex; flex-wrap: wrap; gap: 8px; }
.m-links .btn { flex: 1 1 auto; }

.m-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 140, 255, 0.28) transparent;
}
.m-events { display: flex; flex-direction: column; gap: 12px; }
.m-event-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.m-event-badge {
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.m-event-badge svg { width: 13px; height: 13px; }
.label-unstable.m-event-badge { font-size: 11px; padding: 5px 11px; }
/* цвят на glow-а = собственият цвят на всяко езиче (само в модала) */
.m-event-badge.label-unstable { --ev: #a855f7; }
.m-event-badge.label-event    { --ev: #ef4444; }
.m-event-badge.label-new      { --ev: #22c55e; }
.m-event-badge.label-pvp      { --ev: #f97316; }
.m-event-badge.label-endgame  { --ev: #38bdf8; }
.m-event-badge.label-opening  { --ev: #f472b6; }
.m-event-badge.label-closing  { --ev: #eab308; }
.m-event-badge.label-closed   { --ev: #3b82f6; }
.m-event-badge.label-youtube  { --ev: #ef4444; }
.m-event-item.is-pulse .m-event-badge {
  animation: m-event-pulse 1.6s var(--ease);
  z-index: 1;
}
@keyframes m-event-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; filter: brightness(1); }
  30% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--ev, var(--accent)) 75%, transparent),
      0 0 20px 6px color-mix(in srgb, var(--ev, var(--accent)) 55%, transparent),
      0 0 48px 14px color-mix(in srgb, var(--ev, var(--accent)) 30%, transparent);
    filter: brightness(1.3) saturate(1.2);
  }
  60% {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--ev, var(--accent)) 85%, transparent),
      0 0 30px 10px color-mix(in srgb, var(--ev, var(--accent)) 65%, transparent),
      0 0 70px 22px color-mix(in srgb, var(--ev, var(--accent)) 38%, transparent);
    filter: brightness(1.45) saturate(1.3);
  }
}
.m-event-item.is-pulse .m-event-badge::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  background: repeating-conic-gradient(
    from 0deg,
    color-mix(in srgb, var(--ev, var(--accent)) 40%, transparent) 0deg 7deg,
    transparent 7deg 20deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  animation: m-event-rays 1.6s linear infinite;
  pointer-events: none;
}
@keyframes m-event-rays { to { transform: rotate(360deg); } }
.m-event-descr {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}
.m-main h3, .vote h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.m-tags { color: #cbd5e1; }

.prose { font-family: var(--font-body); font-size: 15px; line-height: 1.65; color: #dbe3ee; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.7em; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-ui); color: var(--text); line-height: 1.3; }
.prose h1 { font-size: 20px; } .prose h2 { font-size: 18px; } .prose h3, .prose h4 { font-size: 16px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose a { color: var(--blue-2); }
.prose code { font-family: var(--font-mono); font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--well); }
.prose pre { padding: 10px; border-radius: 8px; background: var(--well); overflow-x: auto; }
.prose blockquote { padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery button { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ease); }
.gallery button:hover img { transform: scale(1.04); }

/* ---------- Гласуване ---------- */
.vote {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
  border: 1px solid rgba(245, 158, 11, 0.28);
  transition: border-color 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}
.vote.voted-ok {
  border-color: #22c55e;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.04));
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.28);
}
.vote label { display: block; font-size: 12px; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; }
.vote-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.vote-row input {
  flex: 1 1 140px;
  min-width: 140px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--well);
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--t);
}
.vote-row input:focus { border-color: var(--gold); }
.vote-row input:disabled,
.qv-input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: #1a2030;
  color: #94a3b8;
  border-color: var(--line);
}
.vote-row input:disabled:focus,
.qv-input:disabled:focus {
  border-color: var(--line);
  box-shadow: none;
}
.vote-row .btn { height: 40px; }
.vote-row .btn.cooldown {
  flex: 1 1 100%;
  min-height: 40px;
  height: auto;
  padding: 0 12px;
  border-radius: 10px;
  white-space: normal;
  background: var(--well);
  color: #fcd34d;
  border-color: var(--line);
  opacity: 1;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  font-variant-numeric: tabular-nums;
}
.qv-submit.cooldown {
  min-height: 48px;
  height: auto;
  padding: 10px 14px;
  white-space: normal;
  background: transparent;
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
  opacity: 1;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  font-variant-numeric: tabular-nums;
}
.vote-row .btn.turnstile-charging,
.qv-submit.turnstile-charging {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.vote-row .btn.turnstile-charging::after,
.qv-submit.turnstile-charging::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 0;
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0.12), rgba(250, 204, 21, 0.82)),
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(255, 255, 255, 0.22) 9px 11px);
  box-shadow: 8px 0 18px rgba(250, 204, 21, 0.38);
  pointer-events: none;
  animation: turnstile-charge 5s linear forwards;
}
@keyframes turnstile-charge {
  from { width: 0; }
  to { width: 100%; }
}
/* изтичащ бар (отдясно наляво): ширината = оставащото време / целия cooldown */
.vote-row .btn.cooldown::before,
.qv-submit.cooldown::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--cd-pct, 0%);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.05));
  box-shadow: inset -1px 0 0 rgba(251, 191, 36, 0.24);
  transition: width 950ms linear;
  pointer-events: none;
}
.turnstile { margin-top: 10px; }
.turnstile:empty { display: none; }
.vote-msg { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 1em; }
.vote-msg:empty { display: none; }
.vote-msg.ok { color: #4ade80; }
.vote-msg.warn { color: #fcd34d; }
.vote-msg.err { color: #f87171; }

/* ---------- Бърз панел за гласуване ---------- */
.qv-shell {
  padding: 24px 22px 22px;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.qv-shell.voted-ok {
  border-color: #22c55e;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.35), var(--shadow);
}
.qv-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-right: 28px;
}
.qv-icon { flex: none; }
.qv-icon .s-icon { width: 48px; height: 48px; border-radius: 12px; font-size: 20px; }
.qv-name {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.qv-form { display: flex; flex-direction: column; }
.qv-label { font-size: 12.5px; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; }
.qv-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--well));
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.qv-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.qv-submit {
  width: 100%;
  min-height: 48px;
  height: auto;
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.25;
  white-space: normal;
}

/* ---------- Реклама ---------- */
.ad-shell { padding: 30px 26px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ad-trader { width: 140px; height: 140px; object-fit: contain; image-rendering: pixelated; }
.ad-shell h2 { font-family: var(--font-title); font-weight: 400; font-size: 21px; }
.ad-text { color: #cbd5e1; font-family: var(--font-body); font-size: 15px; }
.ad-shell .btn { width: 100%; }

/* Цветове на бутоните в ad-модала */
#ad-link,
#ad-ownerapi {
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

/* Горен бутон: наситен виолетово-лилав (Discord стил), ярък и напълно четим текст */
#ad-link {
  color: #ddd6fe;
  background: rgba(124, 92, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.58);
}
#ad-link:hover {
  color: #f5f3ff;
  background: rgba(124, 92, 250, 0.32);
  border-color: #a78bfa;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.25);
}

/* Долен бутон: балансирано синьо със същата яркост и тежест */
#ad-ownerapi {
  color: #bfdbfe; /* или var(--blue-2), ако предпочиташ леко по-синьо */
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.55);
}
#ad-ownerapi:hover {
  color: #eff6ff;
  background: rgba(59, 130, 246, 0.30);
  border-color: #60a5fa;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.24);
}

/* ---------- Lightbox ---------- */
.lightbox {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; object-fit: contain; }
.lb-btn { position: fixed; width: 44px; height: 44px; border-radius: 50%; background: rgba(15, 23, 42, 0.8); color: var(--text); }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 20px; top: 20px; }
.lb-count { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); color: var(--muted); font-size: 13px; }

/* ---------- Класация ---------- */
.drawer {
  margin: 0 0 0 auto;
  height: 100vh;
  max-height: 100vh;
  width: min(400px, 100vw);
  padding: 20px;
  border: 0;
  border-left: 1px solid var(--card-border);
  background: var(--panel);
  overflow-y: auto;
}
.drawer[open] { animation: slide 200ms var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head h2 { font-family: var(--font-title); font-weight: 400; font-size: 22px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 12px; }
.seg button { flex: 1; height: 32px; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button[aria-pressed='true'] { background: rgba(59, 130, 246, 0.2); color: var(--text); }
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rank-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  text-align: left;
  transition: background var(--t);
}
.rank-list button:hover { background: rgba(148, 163, 184, 0.08); }
.rank-n { width: 24px; text-align: center; color: var(--dim); font-family: var(--font-title); }
.rank-n.rank-1 { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.35); }
.rank-n.rank-2 { color: #e2e8f0; text-shadow: 0 0 8px rgba(226, 232, 240, 0.25); }
.rank-n.rank-3 { color: #d97706; text-shadow: 0 0 8px rgba(217, 119, 6, 0.25); }
.voter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
}
.voter-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  background: var(--well);
  border: 1px solid var(--line);
  object-fit: cover;
  image-rendering: pixelated;
}
.rank-name.voter-me { color: var(--green); }
.rank-list .s-icon { width: 34px; height: 34px; border-radius: 8px; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-main .status { margin-top: 1px; }
.rank-votes { text-align: right; font-family: var(--font-title); font-size: 16px; }
.rank-votes small { display: block; font-family: var(--font-ui); font-size: 11px; color: var(--muted); }

@media (max-width: 1100px) {
  .m-body { grid-template-columns: 1fr; }
  .m-main { max-height: none; overflow-y: visible; padding-right: 0; }
}

@media (max-width: 600px) {
  [data-tooltip]::after {
    max-width: min(240px, 72vw);
    white-space: normal;
    text-align: center;
  }
  .modal,
  .modal-sm,
  .modal-xs {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .m-shell {
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .m-banner { height: 120px; }
  .m-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: -36px;
    padding: 0 16px;
  }
  .m-head-left { align-items: center; gap: 12px; }
  .m-icon .s-icon { width: 72px; height: 72px; border-radius: 14px; font-size: 30px; }
  .m-titles h2 { font-size: clamp(22px, 6vw, 28px); }
  .m-head-right { justify-content: flex-start; }
  .m-featured-badge { height: 46px; margin: 0; }
  .m-body { gap: 16px; padding: 16px; }
  .m-addresses { flex-wrap: wrap; max-width: 100%; }
  .addr {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    padding: 6px 8px 6px 12px;
  }
  .addr code { font-size: 14px; overflow-wrap: anywhere; }
  .m-stats dd { font-size: 17px; }
  .vote-row input,
  .qv-input { font-size: 16px; }
  .m-main { min-width: 0; overflow-wrap: anywhere; }
  .m-main section { min-width: 0; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .m-close { top: 10px; right: 10px; width: 36px; height: 36px; }
  .qv-shell { padding: 22px 18px 18px; }
  .ad-shell { padding: 26px 18px 20px; }

  .drawer {
    height: 100dvh;
    max-height: 100dvh;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  .seg button {
    height: auto;
    min-height: 36px;
    padding: 6px 6px;
    font-size: 11.5px;
    line-height: 1.2;
  }
  .rank-list button { padding: 9px 8px; min-height: 50px; }

  .lightbox img { max-width: 96vw; max-height: 78dvh; }
  .lb-btn { width: 42px; height: 42px; border: 1px solid var(--card-border); }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
  .lb-count { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
