/* ─── Physical Health Domain — Custom Mechanic Styles ─── */
/* Design spec: KLIP Physical Health Interaction Design Specification */

:root {
  --ph-primary: #E8625C;
  --ph-dark: #C94843;
  --ph-accent: #FFD5C2;
  --ph-energy-high: #FF7043;
  --ph-energy-low: #B0BEC5;
  --ph-positive: #66BB6A;
  --ph-text: #37474F;
  --ph-text-muted: #90A4AE;
  --ph-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ph-physical: 300ms ease-out;
  --ph-weight: 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Wrapper */
.ph-mech {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md, 16px);
  padding: var(--space-sm, 8px) 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Scene */
.ph-scene {
  width: 100%;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  position: relative;
  background: #FAFAF8;
  box-shadow: 0 4px 16px rgba(232, 98, 92, 0.08);
}
.ph-scene svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Scene variants */
.ph-signal {
  background: #1A2030;
}
.ph-water {
  background: #37474F;
}

/* Slider */
.ph-slider-wrap {
  width: 100%;
  padding: 0 var(--space-sm, 8px);
}
.ph-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: linear-gradient(90deg, var(--ph-energy-low), var(--ph-accent), var(--ph-energy-high), var(--ph-primary));
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.ph-slider:focus-visible {
  box-shadow: 0 0 0 3px var(--ph-primary);
}
.ph-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ph-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(232, 98, 92, 0.3);
  cursor: grab;
  transition: transform 0.15s var(--ph-snap);
}
.ph-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.12);
}
.ph-slider::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ph-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(232, 98, 92, 0.3);
  cursor: grab;
}

/* Label Chips */
.ph-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  width: 100%;
}
.ph-chip {
  font-size: 11px;
  font-weight: 400;
  color: var(--ph-text-muted);
  padding: 3px 7px;
  border-radius: 16px;
  background: transparent;
  transition: all 0.25s ease-out;
  white-space: nowrap;
  line-height: 1.3;
}
.ph-chip.active {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--ph-primary);
  box-shadow: 0 1px 6px rgba(232, 98, 92, 0.25);
}

/* Toggle buttons (Yes/No for Q4-5, Q10-11) */
.ph-toggle-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
  padding: 0 var(--space-md, 16px);
}
.ph-toggle-btn {
  flex: 1;
  max-width: 140px;
  padding: 14px 20px;
  border-radius: var(--radius-lg, 16px);
  border: 2px solid #E0E0E0;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  color: var(--ph-text);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 52px;
}
.ph-toggle-btn:hover {
  border-color: var(--ph-primary);
}
.ph-toggle-btn.active {
  border-color: var(--ph-primary);
  background: rgba(232, 98, 92, 0.08);
  color: var(--ph-primary);
  box-shadow: 0 2px 8px rgba(232, 98, 92, 0.15);
}

/* Continue button */
.ph-continue {
  width: 100%;
  margin-top: var(--space-md, 16px);
}

/* Hint */
.ph-hint {
  font-size: 13px;
  color: var(--ph-text-muted);
  text-align: center;
  margin-top: 4px;
  opacity: 0.65;
  transition: opacity 0.3s;
  letter-spacing: 0.02em;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .ph-mech *,
  .ph-mech svg *,
  .ph-scene * {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .ph-slider::-webkit-slider-thumb {
    transition-duration: 0.01ms !important;
  }
}

.ph-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--ph-primary);
  outline-offset: 3px;
}
