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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #fce4ec 0%, #fff3e0 50%, #f3e5f5 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
  color: #333;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  width: 100%;
  padding-bottom: 32px;
}

/* Header */
.header {
  text-align: center;
  margin: 24px 0 20px;
}

.title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #4a148c;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.95rem;
  color: #7b1fa2;
  margin-top: 4px;
  font-weight: 400;
}

/* Barometer card */
.barometer-card {
  background: white;
  border-radius: 24px;
  padding: 28px 20px 20px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(156, 39, 176, 0.10);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.barometer-score {
  font-size: 3.5rem;
  font-weight: 800;
  color: #4a148c;
  line-height: 1;
  letter-spacing: -2px;
}

.barometer-emoji {
  font-size: 3rem;
  margin: 8px 0 2px;
}

.barometer-label {
  font-size: 1rem;
  color: #7b1fa2;
  font-weight: 500;
  margin-bottom: 16px;
  min-height: 1.4em;
}

.barometer-meter {
  height: 10px;
  background: #f3e5f5;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

.barometer-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #e040fb, #7c4dff, #536dfe);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.barometer-waiting .barometer-score {
  color: #ce93d8;
}

.barometer-waiting .barometer-breakdown {
  opacity: 0.3;
}

.barometer-breakdown {
  display: flex;
  justify-content: space-around;
  font-size: 0.85rem;
  color: #666;
  gap: 8px;
}

.barometer-breakdown span {
  background: #faf0fc;
  padding: 4px 14px;
  border-radius: 99px;
  font-weight: 500;
}

/* Scale sections */
.scale-section {
  margin-bottom: 20px;
}

.scale-title {
  font-size: 1rem;
  font-weight: 600;
  color: #4a148c;
  margin-bottom: 10px;
  padding-left: 4px;
}

.scale-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.scale-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px 12px;
  border: 2px solid #e8d5f5;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.scale-btn:active {
  transform: scale(0.96);
}

.scale-btn .btn-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.scale-btn .btn-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #555;
  text-align: center;
  line-height: 1.2;
}

.scale-btn.selected {
  border-color: #7c4dff;
  background: #f3e5f5;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.scale-btn.selected .btn-label {
  color: #4a148c;
  font-weight: 600;
}

.scale-btn.saved {
  border-color: #7c4dff;
  background: #ede7f6;
}

.scale-btn.saved .btn-label {
  color: #4a148c;
  font-weight: 600;
}

/* Submit button */
.submit-btn {
  display: block;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  margin-top: 4px;
}

.submit-btn:not(:disabled) {
  background: linear-gradient(135deg, #7c4dff, #e040fb);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 77, 255, 0.3);
}

.submit-btn:not(:disabled):active {
  transform: scale(0.97);
}

.submit-btn:disabled {
  background: #e0e0e0;
  color: #aaa;
  cursor: not-allowed;
}

/* Footer note */
.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #b39ddb;
  margin-top: 16px;
}

/* Tablet/desktop: side by side scales */
@media (min-width: 600px) {
  body {
    padding: 32px 24px;
  }

  .container {
    max-width: 560px;
  }

  .scale-options {
    grid-template-columns: repeat(4, 1fr);
  }

  .scale-btn {
    padding: 18px 10px 14px;
  }

  .scale-btn .btn-emoji {
    font-size: 1.8rem;
  }

  .scale-btn .btn-label {
    font-size: 0.8rem;
  }

  .barometer-score {
    font-size: 4rem;
  }
}
