:root {
  color-scheme: dark;
  --bg: #101313;
  --panel: #181c1c;
  --panel-strong: #202728;
  --text: #f3f0e8;
  --muted: #a9b0ad;
  --line: #374042;
  --accent: #f0c05a;
  --accent-2: #62c6a4;
  --danger: #ef7d66;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(16, 19, 19, 0.62), rgba(16, 19, 19, 0.84)),
    url("https://images.unsplash.com/photo-1542751371-adc38448a05e?auto=format&fit=crop&w=1800&q=85") center/cover fixed;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1480px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(270px, 0.82fr) minmax(620px, 1.65fr) minmax(270px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.panel,
.test-zone {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(24, 28, 28, 0.92);
  backdrop-filter: blur(18px);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.simulator {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #0f1414;
  background-size: 42px 42px;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: crosshair;
}

.simHud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.simHud span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.34);
  font-size: 0.82rem;
  font-weight: 800;
}

.simActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.simControls {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.simControls label {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.simControls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: var(--panel-strong);
  outline: none;
}

.setup-panel,
.result-panel {
  padding: 24px;
}

.setup-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.title-block h1,
h2 {
  margin: 4px 0 0;
  line-height: 1.05;
}

.title-block h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

h2 {
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.subtitle,
.advice {
  color: var(--muted);
  line-height: 1.65;
}

.update-date {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="number"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-strong);
  outline: none;
}

input[type="number"]:focus {
  border-color: var(--accent);
}

.readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.readouts article {
  padding: 14px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.readouts span,
.recommendation span,
.next-test span,
.console-line span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.readouts strong {
  display: block;
  margin-top: 7px;
  font-size: 1.45rem;
}

.test-zone {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
  cursor: pointer;
}

.round-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.round-card {
  min-height: 106px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151919;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.round-card.active {
  border-color: var(--accent);
}

.round-card.selected {
  border-color: var(--accent-2);
  background: rgba(98, 198, 164, 0.11);
}

.round-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.round-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.round-card button {
  all: unset;
}

.round-evaluation {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  line-height: 1.55;
  font-size: 0.88rem;
}

.round-evaluation strong {
  color: var(--text);
}

.round-evaluation span {
  display: inline-block;
  margin: 3px 6px 3px 0;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(240, 192, 90, 0.12);
}

.sliders {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.sliders label {
  grid-template-columns: 132px 1fr 28px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-2);
}

output {
  color: var(--text);
  font-weight: 800;
  text-align: right;
}

.primary-action {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #16120a;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.secondary-action {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
  font-weight: 800;
  cursor: pointer;
}

.compact-action {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.recommendation,
.next-test,
.console-line {
  padding: 14px;
  border-left: 4px solid var(--accent-2);
  background: rgba(98, 198, 164, 0.11);
}

.next-test {
  border-left-color: var(--accent);
  background: rgba(240, 192, 90, 0.1);
}

.console-line {
  border-left-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.console-line code {
  display: block;
  margin-top: 8px;
  padding: 10px;
  border-radius: 6px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.94rem;
  white-space: normal;
  word-break: break-all;
}

.recommendation strong,
.next-test strong {
  display: block;
  margin: 6px 0;
  font-size: 2.2rem;
  line-height: 1.15;
  word-break: break-all;
  letter-spacing: -0.01em;
}

.recommendation small,
.next-test small,
.console-line small {
  color: var(--muted);
}

.scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.scale div {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--danger));
  position: relative;
}

.scale i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35);
}

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

  .test-zone {
    order: -1;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .controls,
  .readouts,
  .simControls,
  .simActions {
    grid-template-columns: 1fr;
  }

  .round-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simControls label {
    grid-template-columns: 1fr 52px;
  }

  .simControls select,
  .simControls input {
    grid-column: 1 / -1;
  }

  .sliders label {
    grid-template-columns: 1fr 34px;
  }

  .sliders label input {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ── Radar Chart ── */
.radar-container {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.radar-container canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.radar-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Verdict buttons ── */
.verdict-bar {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.verdict-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  padding: 2px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.verdict-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: #f3f0e8;
}

.verdict-btn.active {
  background: rgba(98, 198, 164, 0.18);
  border-color: var(--accent);
  color: var(--accent);
}
