/* =========================================================
   TWEAKS PANEL — styling
   ========================================================= */
.tweaks-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 320px;
  background: rgba(20, 24, 31, 0.96);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  padding: 16px 18px 18px;
  z-index: 220;
  color: #ECE7D8;
  font-family: var(--font-sans);
  display: none;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.tweaks-panel.is-visible { display: block; }

.tweaks-panel .tw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tweaks-panel .tw-title {
  font-family: var(--font-mono);
  font-size: var(--fs-fine-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ECE7D8;
  font-weight: 600;
}
.tweaks-panel .tw-close {
  background: transparent;
  border: none;
  color: #8B8675;
  cursor: pointer;
  font-size: var(--fs-fine);
  width: 24px; height: 24px;
  border-radius: 4px;
}
.tweaks-panel .tw-close:hover { background: rgba(255,255,255,0.08); color: white; }

.tweaks-panel .tw-section {
  margin-bottom: 16px;
}
.tweaks-panel .tw-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8B8675;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.tweaks-panel .tw-value {
  font-size: var(--fs-fine-xxs);
  color: #ECE7D8;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.tweaks-panel .tw-swatches {
  display: flex;
  gap: 8px;
}
.tweaks-panel .tw-swatches button {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}
.tweaks-panel .tw-swatches button:hover { transform: scale(1.08); }
.tweaks-panel .tw-swatches button.is-on {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}
.tweaks-panel .tw-bg-swatches button { width: 44px; height: 32px; }

.tweaks-panel input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  cursor: pointer;
}
.tweaks-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #14181F;
  cursor: pointer;
}
.tweaks-panel input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #14181F;
  cursor: pointer;
}

.tweaks-panel .tw-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 3px;
}
.tweaks-panel .tw-segmented button {
  background: transparent;
  border: none;
  color: #BDB7A8;
  cursor: pointer;
  padding: 7px 8px;
  font-family: var(--font-sans);
  font-size: var(--fs-fine-xxs);
  border-radius: 6px;
  transition: all var(--dur) var(--ease);
}
.tweaks-panel .tw-segmented button:hover { color: white; }
.tweaks-panel .tw-segmented button.is-on {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.tweaks-panel .tw-actions {
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.tweaks-panel .tw-reset {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ECE7D8;
  padding: 8px;
  font-family: var(--font-sans);
  font-size: var(--fs-fine-xs);
  cursor: pointer;
  border-radius: 6px;
}
.tweaks-panel .tw-reset:hover { background: rgba(255,255,255,0.12); }

/* Bilingual switching inside the panel mirrors the deck */
.tweaks-panel [lang="ru"] { display: inline; }
.tweaks-panel [lang="en"] { display: none; }
:root[data-lang="en"] .tweaks-panel [lang="ru"] { display: none; }
:root[data-lang="en"] .tweaks-panel [lang="en"] { display: inline; }
