/* ── Gear button in header ── */
.btn-settings {
  margin-left: auto;
  background: transparent;
  border: 2px solid rgba(245, 230, 230, 0.4);
  border-radius: var(--btn-radius);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.1s;
}

/* Only apply hover styles on devices with a real pointer (mouse/trackpad).
   On touch screens :hover sticks after tap and transform would leave the
   button looking crooked, so we skip it entirely for touch devices. */
@media (hover: hover) and (pointer: fine) {
  .btn-settings:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(245, 230, 230, 0.7);
  }
}

.btn-settings:active {
  opacity: 0.6;
}

/* ── Settings overlay (mirrors win-overlay) ── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.settings-card {
  position: relative;
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  width: min(90vw, 380px);
  color: #1a1a1a;
}

.settings-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.2rem;
  color: #aaa;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: color 0.15s, background 0.15s;
}

.settings-close:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.06);
}

/* ── Section ── */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin: 0;
}

.settings-section-desc {
  font-size: 0.8rem;
  color: #777;
  margin: 0;
  line-height: 1.4;
}

/* ── Difficulty selector ── */
.difficulty-selector {
  display: flex;
  gap: 8px;
}

.difficulty-btn {
  flex: 1;
  padding: 10px 4px;
  border: 2px solid var(--btn-border);
  border-radius: var(--btn-radius);
  background: #fff;
  color: #333;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.1s;
}

.difficulty-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.difficulty-btn.active {
  background: var(--bg);
  color: var(--text);
  border-color: var(--bg-dark);
}
