*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff9f0;
  touch-action: manipulation;
}

#sky {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

#settings-toggle {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0));
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 249, 240, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(107, 78, 139, 0.45);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 10;
}

body:hover #settings-toggle,
body:focus-within #settings-toggle,
#settings-toggle:focus {
  opacity: 1;
}

.settings {
  position: fixed;
  top: calc(4rem + env(safe-area-inset-top, 0));
  right: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 249, 240, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(107, 78, 139, 0.08);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 0.8rem;
  color: rgba(23, 44, 102, 0.75);
  z-index: 10;
  min-width: 12rem;
}

.settings label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.settings label:last-of-type {
  margin-bottom: 0.75rem;
}

.settings-footer {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(242, 167, 187, 0.25);
  text-align: center;
}

.settings-kofi {
  color: rgba(23, 44, 102, 0.55);
  text-decoration: none;
  transition: color 0.2s ease;
}

.settings-kofi:hover,
.settings-kofi:focus-visible {
  color: rgba(23, 44, 102, 0.85);
}

.settings input[type="range"] {
  width: 100%;
  accent-color: #f2a7bb;
}

.settings select {
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(242, 167, 187, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  #settings-toggle {
    opacity: 1;
  }
}
