:root {
  --fmge-lb-bg: linear-gradient(180deg, #08111f 0%, #101f34 100%);
  --fmge-lb-panel: rgba(7, 16, 29, 0.82);
  --fmge-lb-panel-strong: rgba(10, 22, 37, 0.95);
  --fmge-lb-border: rgba(148, 163, 184, 0.18);
  --fmge-lb-text: #e5eefb;
  --fmge-lb-muted: #93a6bf;
  --fmge-lb-accent: #f59e0b;
  --fmge-lb-accent-2: #22c55e;
  --fmge-lb-danger: #ef4444;
  --fmge-lb-shadow: 0 20px 45px rgba(2, 8, 23, 0.28);
}

.fmge-lb-shell,
.fmge-lb-overview-card,
.fmge-telegram-dialog,
.fmge-lb-gate,
.fmge-telegram-existing {
  color: var(--fmge-lb-text);
  background: var(--fmge-lb-bg);
  border: 1px solid var(--fmge-lb-border);
  border-radius: 24px;
  box-shadow: var(--fmge-lb-shadow);
}

.fmge-lb-shell {
  padding: 28px;
  overflow: hidden;
  position: relative;
}

.fmge-lb-shell::before,
.fmge-telegram-dialog::before,
.fmge-lb-overview-card::before {
  content: "";
  position: absolute;
  inset: auto auto -80px -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.26) 0%, rgba(245, 158, 11, 0) 70%);
  pointer-events: none;
}

.fmge-lb-header,
.fmge-lb-overview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.fmge-lb-kicker {
  margin: 0 0 8px;
  color: #fcd34d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.fmge-lb-title {
  color: #fcd34d !important;
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
  
}

.fmge-lb-subtitle,
.fmge-telegram-copy,
.fmge-lb-footer-note,
.fmge-lb-overview-meta,
.fmge-lb-gate,
.fmge-telegram-existing {
  color: var(--fmge-lb-muted);
}

.fmge-lb-leader-chip {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.28);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fmge-lb-leader-chip-label {
  color: #fcd34d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.fmge-lb-empty,
.fmge-lb-gate,
.fmge-telegram-existing {
  margin-top: 18px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
  border-radius: 18px;
  border: 1px solid var(--fmge-lb-border);
}

.fmge-lb-table {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.fmge-lb-row {
  display: grid;
  grid-template-columns: 80px minmax(190px, 1.8fr) repeat(5, minmax(80px, 1fr));
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.fmge-lb-row--head {
  background: rgba(245, 158, 11, 0.12);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fmge-lb-row.is-current-user {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.22);
}

.fmge-lb-rank {
  font-weight: 700;
  color: #fcd34d;
}

.fmge-lb-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fmge-lb-user img,
.fmge-lb-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
}

.fmge-lb-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #fff;
  font-weight: 700;
}

.fmge-lb-user strong,
.fmge-lb-overview-top strong {
  display: block;
  color: #fff;
}

.fmge-lb-user small {
  display: block;
  margin-top: 3px;
  color: var(--fmge-lb-muted);
}

.fmge-lb-footer-note {
  margin-top: 18px;
}

.fmge-lb-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.fmge-lb-overview-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.fmge-lb-overview-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.fmge-telegram-access {
  position: relative;
}

.fmge-telegram-open-btn,
.fmge-telegram-submit-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.fmge-telegram-open-btn {
  color: #08111f;
  background: linear-gradient(135deg, #facc15, #f59e0b);
}

.fmge-telegram-submit-btn {
  color: #fff;
  background: linear-gradient(135deg, #0891b2, #2563eb);
}

.fmge-telegram-open-btn:hover,
.fmge-telegram-submit-btn:hover {
  transform: translateY(-1px);
}

.fmge-telegram-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fmge-telegram-modal[hidden] {
  display: none;
}

.fmge-telegram-modal.is-inline {
  position: static;
  inset: auto;
  display: block;
  background: transparent;
  padding: 0;
  margin-top: 18px;
}

.fmge-telegram-dialog {
  width: min(760px, 100%);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.fmge-telegram-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--fmge-lb-border);
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.fmge-telegram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.fmge-telegram-grid label {
  display: grid;
  gap: 8px;
}

.fmge-telegram-grid label.is-wide {
  grid-column: 1 / -1;
}

.fmge-telegram-grid span {
  font-size: 14px;
  color: #dbe7f5;
}

.fmge-telegram-grid input,
.fmge-telegram-grid textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  padding: 14px 16px;
}

.fmge-telegram-grid input:focus,
.fmge-telegram-grid textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.4);
  border-color: rgba(56, 189, 248, 0.75);
}

.fmge-telegram-response {
  min-height: 24px;
  margin-top: 14px;
  color: #cbd5e1;
}

.fmge-telegram-response.is-error {
  color: #fca5a5;
}

.fmge-telegram-response.is-success {
  color: #86efac;
}

@media (max-width: 960px) {
  .fmge-lb-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fmge-lb-row {
    grid-template-columns: 70px minmax(180px, 1.4fr) repeat(5, minmax(72px, 1fr));
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .fmge-lb-shell,
  .fmge-telegram-dialog {
    padding: 20px;
    border-radius: 20px;
  }

  .fmge-lb-header {
    flex-direction: column;
  }

  .fmge-lb-table {
    overflow-x: auto;
  }

  .fmge-lb-row {
    min-width: 860px;
  }

  .fmge-lb-overview {
    grid-template-columns: 1fr;
  }

  .fmge-telegram-grid {
    grid-template-columns: 1fr;
  }
}
