:root {
  --hero-code: #7cff4d;
  --accent: #f98900;
  --bg: #05070a;
  --surface: #0b0f14;
  --surface-2: #121922;
  --border: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.6);
}

* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans, monospace);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 32px) 64px;
}

.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.back:hover {
  color: var(--hero-code);
}

.head {
  margin-bottom: 1.75rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--hero-code);
  margin: 0 0 0.6rem;
  line-height: 1.15;
}

.lede {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 28px);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 140px;
}

.field--sm {
  flex: 0 1 90px;
}

.field span,
.leg__name {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--hero-code);
}

#codeA,
#codeB,
#codeC {
  text-transform: uppercase;
}

.section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.legs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 1.5rem;
}

.leg {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.leg__name {
  font-weight: 600;
  color: var(--text);
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: var(--hero-code);
  color: #05210a;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 1rem 0 0;
  line-height: 1.6;
}

/* Result */
.result {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
}

.result__verdict {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result--profit {
  border-color: rgba(124, 255, 77, 0.5);
}

.result--profit .result__verdict {
  color: var(--hero-code);
}

.result--loss {
  border-color: var(--border);
}

.result--loss .result__verdict {
  color: var(--muted);
}

.result--error .result__verdict {
  color: var(--accent);
}

.steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.steps li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

.steps li:last-child {
  border-bottom: none;
}

.steps .step__label {
  color: var(--muted);
}

.steps .step__value {
  font-weight: 600;
  white-space: nowrap;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.summary div {
  display: flex;
  flex-direction: column;
}

.summary dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.summary dd {
  margin: 0.2rem 0 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.pos {
  color: var(--hero-code);
}

.neg {
  color: #ff6b6b;
}

@media (max-width: 520px) {
  .legs {
    grid-template-columns: 1fr;
  }
}
