:root {
  --bg: #f7f5ef;
  --card: #fffdf8;
  --text: #1f2a2e;
  --accent: #d0682c;
  --accent-2: #245e6d;
  --border: #ded9cc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, #e8f2f5 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.container {
  width: min(92vw, 580px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 28px rgba(26, 31, 34, 0.08);
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.subtitle {
  margin: 0 0 1.4rem;
  color: #4a5a5f;
}

form {
  display: grid;
  gap: 0.65rem;
}

label {
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
  padding: 0.72rem 0.8rem;
  border-radius: 10px;
}

input,
select {
  border: 1px solid #b9c2c4;
}

button {
  border: 0;
  background: linear-gradient(120deg, var(--accent), #e28131);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.95);
}

.result {
  margin-top: 1.2rem;
  padding: 0.95rem;
  border-radius: 10px;
  background: #f0f7f9;
  border: 1px solid #d2e7ec;
  min-height: 3.2rem;
}

.result strong {
  color: var(--accent-2);
}

.result-text {
  margin: 0 0 0.8rem;
}

.resistor-graphic {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0.3rem 0 0.45rem;
}

.resistor-lead {
  display: inline-block;
  height: 4px;
  width: clamp(28px, 10vw, 64px);
  background: #9aa7ae;
}

.resistor-body {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid #b39f6e;
  background: linear-gradient(180deg, #efdca8 0%, #e0c88a 100%);
}

.resistor-band {
  display: inline-block;
  width: 10px;
  height: 100%;
  border-radius: 2px;
  background: var(--band-color, #1d1d1f);
}

.band-legend {
  margin: 0;
  font-size: 0.92rem;
  color: #405056;
}
