.lottery-switcher {
  position: relative;
  min-width: 280px;
}

.menu-btn {
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 14px;
}

.lottery-trigger {
  width: 100%;
  height: 28px;
  border: 1px solid var(--ext-primary, #a3b8d0);
  background: linear-gradient(180deg, #f9fcff 0%, #e9f1f8 100%);
  color: var(--ext-text-color, #333);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 0 4px;
  cursor: pointer;
}

.lottery-trigger:hover {
  border-color: var(--ext-primary-dark, #2a72b5);
}

.lottery-name {
  width: 40px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ext-primary-dark, #2a72b5);
  white-space: nowrap;
}

.lottery-inline-meta {
  font-size: 12px;
  color: var(--ext-text-muted, #666);
  white-space: nowrap;
  width: 74px;
  text-align: left;
}

.lottery-balls,
.option-balls {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ball {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: var(--ext-primary, #2a72b5);
  font-weight: 700;
}

.ball.small {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.lottery-status,
.option-status {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}

.lottery-countdown,
.option-countdown {
  font-size: 11px;
  color: var(--ext-text-muted, #666);
  white-space: nowrap;
  width: 70px;
  text-align: center;
}

.lottery-countdown.urgent,
.option-countdown.urgent {
  color: #bf6f00;
  font-weight: 600;
}

.lottery-countdown.expired,
.option-countdown.expired {
  color: #2e7d32;
  font-weight: 600;
}

.lottery-status.done,
.option-status.done {
  background: rgba(67, 160, 71, 0.12);
  color: #2e7d32;
  border-color: rgba(67, 160, 71, 0.35);
}

.lottery-status.closing,
.option-status.closing {
  background: rgba(245, 124, 0, 0.12);
  color: #bf6f00;
  border-color: rgba(245, 124, 0, 0.35);
}

.lottery-status.pending,
.option-status.pending {
  background: rgba(120, 144, 156, 0.12);
  color: #546e7a;
  border-color: rgba(120, 144, 156, 0.35);
}

.lottery-arrow {
  /* margin-left: auto; */
  font-size: 10px;
  color: var(--ext-text-muted, #666);
}

.lottery-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--ext-panel-bg, #fff);
  border: 1px solid var(--ext-panel-border, #a3b8d0);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  z-index: 5200;
  overflow: hidden;
}

.lottery-option {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 0 4px;
  cursor: pointer;
  border-bottom: 1px solid var(--ext-toolbar-border, #d5dce5);
  white-space: nowrap;
}

.lottery-option:last-child {
  border-bottom: none;
}

.lottery-option:hover,
.lottery-option.active {
  background: var(--ext-grid-row-hover, #d9eaf7);
}

.option-name {
  width: 40px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ext-text-color, #333);
  flex-shrink: 0;
  text-align: center;
}

.option-period {
  width: 82px;
  font-size: 12px;
  color: var(--ext-text-muted, #666);
  flex-shrink: 0;
}


.header-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  height: 28px;
  margin-right: 4px;
  border: 1px solid var(--ext-primary, #a3b8d0);
  border-radius: 3px;
  background: linear-gradient(180deg, #f8fbff 0%, #e5eef8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.header-pending {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--ext-primary, #a3b8d0);
  border-radius: 3px;
  color: #7d5b06;
  background: linear-gradient(180deg, #f8fbff 0%, #e5eef8 100%);
}

/* .header-pending.active {
  border-color: #cf9f2f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
} */

.header-pending-label {
  font-size: 11px;
  color: #8e6a0d;
  letter-spacing: 0.2px;
}

.header-pending-value {
  font-size: 13px;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
  color: #7d5b06;
}

.header-balance {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--ext-primary, #a3b8d0);
  border-radius: 3px;
  color: #5b6a39;
  background: linear-gradient(180deg, #f8fbff 0%, #e5eef8 100%);
}

.header-balance-label {
  font-size: 11px;
  color: #6f7f49;
  letter-spacing: 0.2px;
}

.header-balance-value {
  font-size: 13px;
  font-weight: 700;
  color: #4e5d2f;
  min-width: 28px;
  text-align: right;
}

.header-user:hover {
  border-color: #7ea0c0;
  background: linear-gradient(180deg, #fbfdff 0%, #edf4fb 100%);
}

.header-user.open {
  border-color: #6d95bc;
  background: linear-gradient(180deg, #eff6fd 0%, #dce8f5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.header-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ext-primary, #2a72b5);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-user-name {
  font-size: 12px;
  color: var(--ext-text-color, #333);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-user-arrow {
  font-size: 9px;
  color: var(--ext-text-color, #666);
  transition: transform 0.16s ease;
}

.header-user.open .header-user-arrow {
  transform: rotate(180deg);
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 136px;
  background: var(--ext-panel-bg, #fff);
  border: 1px solid #9db4cb;
  border-radius: 2px;
  box-shadow: 2px 2px 8px rgba(37, 63, 92, 0.2);
  z-index: 5000;
  padding: 2px 0;
}

.dropdown-item {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ext-text-color, #333);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-item:hover {
  background: #e7eff8;
}

.item-icon {
  width: 12px;
  text-align: center;
  opacity: 0.8;
}

.dropdown-item.danger {
  color: #e5534b;
}

.dropdown-item.danger:hover {
  background: #fff0ee;
}

.dropdown-divider {
  height: 1px;
  background: #c8d6e4;
  margin: 2px 0;
}

@media (max-width: 1280px) {
  .lottery-switcher {
    min-width: 280px;
  }

  .option-name {
    width: 40px;
  }

  .option-period {
    width: 74px;
  }
}

@media (max-width: 1140px) {

  .lottery-inline-meta,
  .option-period,
  .option-status,
  .option-countdown {
    display: none;
  }

  .lottery-switcher {
    min-width: 180px;
  }

  .header-user-name {
    max-width: 62px;
  }

  .header-balance-label {
    display: none;
  }

  .header-pending-label {
    display: none;
  }

  .header-balance {
    padding: 0 8px;
  }

  .header-pending {
    padding: 0 8px;
  }
}
