.theme-switcher-cluster {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 6px;
}
.theme-switcher {
  position: relative;
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
  color: var(--text);
}

.theme-switcher-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
  font-style: normal;
  cursor: pointer;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  transition: color 0.15s;
}

.theme-switcher-toggle:hover,
.theme-switcher-toggle:hover:not(:disabled) {
  background: transparent;
  color: var(--text-heading, var(--text));
  box-shadow: none;
}

.theme-switcher-toggle[aria-expanded="true"] {
  background: transparent;
  color: var(--text);
  border: none;
  box-shadow: none;
}

.theme-switcher-icon {
  font-size: var(--text-ui);
  line-height: 1;
}

.theme-switcher-label {
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-switcher-chevron {
  font-size: var(--text-ui);
  font-weight: 400;
  opacity: 0.75;
  margin-left: 1px;
}

.theme-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 4px;
  border-radius: var(--radius-modal);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.theme-switcher-menu[hidden] {
  display: none;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.theme-option:hover {
  background: var(--btn-ghost-hover-bg);
  color: var(--btn-ghost-hover-text);
}

.theme-option.active {
  background: var(--theme-btn-active-bg);
  color: var(--theme-btn-active-text);
}

.theme-option-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.theme-option-swatch--parchment { background: linear-gradient(135deg, #f4e8d0 50%, #8b4513 50%); }
.theme-option-swatch--dark { background: linear-gradient(135deg, #1a1a1c 50%, #a06038 50%); }
.theme-option-swatch--wap { background: linear-gradient(135deg, #ffffff 50%, #0000ee 50%); }

body.theme-military .theme-switcher,
body.theme-military .theme-switcher-toggle,
body.theme-military .theme-switcher-label {
  color: #ffffff;
}

body.theme-military .theme-switcher-toggle {
  border: none;
  background: transparent;
  box-shadow: none;
}

body.theme-military .theme-switcher-menu {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

body.theme-bw .theme-switcher {
  filter: none;
  z-index: 2001;
}

body.theme-bw .theme-switcher-toggle {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
}

@media (max-width: 900px) {
  .theme-switcher-cluster {
    top: max(6px, env(safe-area-inset-top, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
  }
  .theme-switcher {
    margin: 0;
    max-width: 100%;
  }
  .theme-switcher-label,
  .theme-switcher-chevron {
    display: none;
  }
  .theme-switcher-toggle {
    gap: 0;
    min-width: 36px;
    min-height: 32px;
    justify-content: center;
  }
  .theme-switcher-menu {
    right: 0;
    left: auto;
  }
  body.civ3-map-open .theme-switcher-cluster {
    z-index: 90;
  }
}
