:root {
  --color-page: #080a0d;
  --color-surface: #111820;
  --color-surface-soft: #0b1118;
  --color-text: #f5f7fa;
  --color-muted: #cbd5e1;
  --color-accent: #2474cf;
  --color-accent-hover: #2289ff;
  --color-red-shadow: #972e31;
  --color-border: rgba(255, 255, 255, 0.12);
  --font-main: Arial, Helvetica, sans-serif;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--color-text);
  font-family: var(--font-main);
  background: var(--color-page);
}

main {
  display: flex;
  flex-direction: row;
  flex: 1;
  justify-content: center;
  align-items: stretch;
  gap: 1vw;
  padding: 24px 0;
}

.card {
  width: 30vw;
  min-height: 340px;
  height: auto;
  background-color: var(--color-surface);
  border: 2px solid #080b1f;
  border-radius: var(--radius);
  box-shadow: 0 0 10px 0.5px var(--color-red-shadow);
  padding: 15px;
  gap: 5px;
}

.card h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.2rem, 5.2vw, 3rem);
  line-height: 0.95;
}

.card h2 {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.tool-field,
.tool-options,
.tool-actions,
.tool-grid {
  display: flex;
  gap: 12px;
}

.tool-field {
  flex-direction: column;
}

.tool-options,
.tool-actions {
  flex-wrap: wrap;
  align-items: center;
}

.tool-grid {
  flex-direction: column;
}

.tool-label {
  font-family: Rajdhani, system-ui, sans-serif;
  color: #ffffff;
  font-weight: 700;
}

.tool-input,
.tool-textarea,
.tool-select {
  width: 100%;
  max-width: 100%;
  background: var(--color-surface-soft);
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 9px 12px;
  outline: none;
  font-size: 15px;
  appearance: none;
  -webkit-appearance: none;
}

.tool-textarea {
  min-height: 260px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.5;
}

.tool-select {
  cursor: pointer;
}

.tool-input::placeholder,
.tool-textarea::placeholder {
  color: #7c8797;
}

.tool-input:focus,
.tool-textarea:focus,
.tool-select:focus {
  border-color: black;
  box-shadow: 0 0 8px rgba(84, 152, 255, 0.3);
}

.tool-input:-webkit-autofill,
.tool-input:-webkit-autofill:hover,
.tool-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface-soft) inset !important;
  box-shadow: 0 0 0 1000px var(--color-surface-soft) inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  border: 1px solid #334155;
  border-radius: 6px;
  transition: background-color 9999s ease-in-out 0s;
}

.tool-input:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px var(--color-surface-soft) inset,
    0 0 8px rgba(84, 152, 255, 0.3) !important;
  box-shadow:
    0 0 0 1000px var(--color-surface-soft) inset,
    0 0 8px rgba(84, 152, 255, 0.3) !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  border-color: black;
}

.tool-check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-family: Rajdhani, system-ui, sans-serif;
  font-weight: 700;
}

.tool-check {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.tool-button,
.tool-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s ease;
}

.tool-button {
  margin: 6px 0 0;
  background: var(--color-accent);
  color: #06100a;
  border: 2px solid rgb(41, 93, 206);
  padding: 8px 28px;
  font-size: clamp(18px, 2.2vw, 32px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.tool-button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.tool-button:active {
  transform: translateY(1px);
}

.tool-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tool-button-secondary {
  background: transparent;
  color: #ffffff;
  border-color: #334155;
  font-size: clamp(14px, 1.2vw, 18px);
  padding: 8px 14px;
}

.tool-output {
  display: flex;
  overflow: auto;
}

.tool-output.is-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 50px;
}

.tool-output.is-result {
  align-items: flex-start;
  justify-content: flex-start;
}

.tool-loading-icon {
  width: 6vw;
  max-width: 96px;
  min-width: 54px;
  height: auto;
}

.tool-loading-icon-secondary {
  margin-top: 38px;
}

.is-spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tool-result {
  width: 100%;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: left;
}

.tool-result-title {
  display: block;
  margin-bottom: 10px;
  color: #ffffff;
  font-weight: 900;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.tool-result-text {
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.85rem, 1vw, 1rem);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  max-height: 420px;
  overflow: auto;
}

.tool-result-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-result-label {
  color: #ffffff;
  font-weight: 900;
  white-space: nowrap;
}

.tool-result-value {
  color: #cbd5e1;
  word-break: break-word;
}

.tool-copy-button {
  align-self: flex-start;
  margin: 8px 0 0;
  padding: 0;
  border: none;
  background: transparent;
}

.tool-copy-icon {
  width: clamp(22px, 4vw, 34px);
  height: auto;
  display: block;
}

.tool-copy-message {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 8px;
  color: #cbd5e1;
  font-weight: 900;
  letter-spacing: 0.04em;
}


.tool-color-control {
  min-height: 58px;
  padding: 4px;
  cursor: pointer;
}

.tool-control-surface {
  position: relative;
  width: 100%;
  height: clamp(180px, 28vw, 300px);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background:
    linear-gradient(to top, #000000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #ffffff, hsl(var(--tool-hue, 358), 100%, 50%));
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}

.tool-control-cursor {
  position: absolute;
  left: calc(var(--tool-saturation, 78) * 1%);
  top: calc((100 - var(--tool-value, 93)) * 1%);
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tool-range {
  width: 100%;
  accent-color: var(--color-accent-hover);
}

.tool-preview {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: linear-gradient(135deg, #ee343a, #2474cf);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.tool-input-featured {
  min-height: 62px;
  padding: 4px;
  cursor: pointer;
}

.tool-note {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 1368px) {
  .tool-field,
  .tool-grid {
    gap: 10px;
  }
}

@media (max-width: 920px) {
  main {
    margin-top: 30px;
    flex-direction: column;
    align-items: center;
    gap: 3vw;
  }

  .card {
    width: 90vw;
    min-height: auto;
    padding: 12px;
    gap: 15px;
  }

  .card h1 {
    max-width: 780px;
    margin: 4px;
    font-size: clamp(2.4rem, 8vw, 4rem);
    line-height: 0.95;
  }

  .tool-loading-icon {
    width: 25vw;
  }

  .tool-result-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tool-copy-button {
    margin-top: 4px;
  }
}

.tool-picker {
  position: relative;
  width: 100%;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #ffffff, hsl(var(--tool-hue, 358), 100%, 50%));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.tool-picker:focus {
  border-color: black;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.35),
    0 0 8px rgba(84, 152, 255, 0.3);
}

.tool-picker-cursor {
  position: absolute;
  left: 78%;
  top: 7%;
  width: 18px;
  height: 18px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.68);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tool-range {
  width: 100%;
  accent-color: var(--color-accent);
  cursor: pointer;
}

@media (max-width: 920px) {
  .tool-picker {
    min-height: 220px;
  }
}

