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

body {
  background: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.tsg-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.tsg-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 2rem 0;
  text-align: center;
  letter-spacing: -0.025em;
}

.tsg-input-section {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 2rem;
}

.tsg-control-group {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.tsg-control {
  display: flex;
  flex-direction: column;
}

.tsg-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tsg-input-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tsg-slider {
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.tsg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.tsg-slider::-webkit-slider-thumb:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.tsg-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.tsg-slider::-moz-range-thumb:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.tsg-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.tsg-select:hover {
  border-color: #cbd5e1;
}

.tsg-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tsg-color-input {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.tsg-color-input:hover {
  transform: scale(1.05);
}

.tsg-text-input {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: 'Monaco', 'Courier New', monospace;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.tsg-text-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tsg-palette-section {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tsg-palette-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tsg-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.tsg-color-card {
  min-height: 120px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.tsg-color-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.tsg-color-card:active {
  transform: translateY(-2px);
}

.tsg-base-card {
  min-height: 140px;
  border: 3px solid #e5e7eb;
  margin-bottom: 2rem;
}

.tsg-color-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  gap: 1rem;
}

.tsg-color-display {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.tsg-format-label {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.625rem;
  font-weight: 700;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tsg-format-value {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  word-break: break-all;
}

.tsg-copy-icon {
  opacity: 0.7;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tsg-color-card:hover .tsg-copy-icon {
  opacity: 1;
}

.tsg-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

@media (max-width: 768px) {
  .tsg-container {
    padding: 1rem;
  }

  .tsg-heading {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .tsg-control-group {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tsg-input-section,
  .tsg-palette-section {
    padding: 1.5rem;
  }

  .tsg-color-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .tsg-color-card {
    min-height: 100px;
  }

  .tsg-base-card {
    min-height: 120px;
  }

  .tsg-color-input {
    width: 60px;
    height: 60px;
  }

  .tsg-text-input {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .tsg-format-value {
    font-size: 0.75rem;
  }

  .tsg-select {
    font-size: 0.9rem;
    padding: 0.625rem 0.875rem;
  }
}
