:root {
  --yellow: #fddc00;
  --yellow-deep: #d4b600;
  --ink: #141516;
  --muted: #666b73;
  --line: #e5e7eb;
  --surface: #ffffff;
  --soft: #f6f7f8;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  background: transparent;
}

body {
  margin: 0;
  min-width: 320px;
  background: transparent;
  color: var(--ink);
  font-family: "Poppins", system-ui, sans-serif;
}

button, input { font: inherit; }

.simulator {
  width: 100%;
  margin: 0;
  padding: 32px;
  background: var(--surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.simulator__header {
  padding-top: 2px;
  margin-bottom: 14px;
}
h1 { margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1.05; letter-spacing: -.045em; }
.intro { margin: 8px 0 0; color: var(--muted); font-size: clamp(15px, 1.8vw, 21px); }

.simulator__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(350px, .85fr);
  gap: 26px;
  align-items: start;
}

.preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.preview__stage {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 48% 62%, #fff 0 46%, #f5f6f7 82%, #eceef0 100%);
  isolation: isolate;
}

.vehicle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vehicle { transition: opacity .2s ease; }
.vehicle.is-changing { opacity: .55; }

.preview__label {
  position: absolute;
  top: 7%;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(20,21,22,.86);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.preview__label--after { right: 5%; }

.controls {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, #f9fafb);
}

fieldset { margin: 0; padding: 0; border: 0; }
.control-group + .control-group { margin-top: 14px; }
legend { margin-bottom: 6px; padding: 0; font-size: 11px; font-weight: 700; letter-spacing: .04em; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f3f4;
}

.segmented button,
.tone-options button {
  border: 0;
  color: #222;
  background: transparent;
  cursor: pointer;
  transition: .2s ease;
}

.segmented button {
  min-height: 38px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.segmented button[aria-pressed="true"] {
  background: #17181a;
  color: #fff;
  box-shadow: 0 0 0 2px var(--yellow), 0 7px 15px rgba(0,0,0,.14);
}

.tone-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.tone-options button {
  min-height: 46px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.tone-options strong,
.tone-options small { display: block; }
.tone-options strong { font-size: 12px; }
.tone-options small { margin-top: 2px; color: #747981; font-size: 9px; }
.tone-options button[aria-pressed="true"] { border-color: #17181a; background: #17181a; color: #fff; box-shadow: 0 0 0 2px var(--yellow); }
.tone-options button[aria-pressed="true"] small { color: #e7e7e7; }

.color-options { display: flex; gap: 14px; align-items: center; }
.color {
  width: 36px;
  height: 36px;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px #d3d6da, 0 5px 12px rgba(0,0,0,.1);
  transition: .2s ease;
}
.color[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--yellow), 0 8px 17px rgba(0,0,0,.14); transform: scale(1.06); }
.color--black { background: #121416; }
.color--graphite { background: linear-gradient(145deg, #8b8f94, #34373b); }
.color--white { background: #f4f4f2; }
.color--blue { background: #173e79; }
.color--red { background: #d91c23; }

.film-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(224, 188, 0, .7);
  border-radius: 18px;
  background: linear-gradient(145deg, #fffdf1, #fff);
}
.film-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.film-card__badge { margin: 0 0 4px; color: #8c7400; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.film-card h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.film-card > p { margin: 6px 0 10px; color: #5f646b; font-size: 11px; line-height: 1.42; }
.film-card__dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 6px rgba(253,220,0,.18); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 60px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.9); }
.metric strong, .metric span, .metric small { display: block; }
.metric strong { font-size: 20px; line-height: 1.05; }
.metric small { margin-bottom: 1px; font-size: 8px; font-weight: 700; }
.metric span { margin-top: 4px; font-size: 9px; font-weight: 600; line-height: 1.15; }
.metric__icon { width: 24px; height: 24px; fill: none; stroke: var(--yellow-deep); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric__copy { min-width: 0; }

.precision-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(224, 188, 0, .55);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(253,220,0,.13), rgba(255,255,255,.96));
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}
.precision-feature__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--yellow);
  color: #111;
  font-size: 13px;
}

.simulator-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(350px, .85fr);
  gap: 26px;
  margin-top: 14px;
}
.simulator-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid #151515;
  border-radius: 13px;
  color: #111;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.simulator-action svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.simulator-action--primary { border-color: var(--yellow-deep); background: var(--yellow); }
.simulator-action--secondary { background: #fff; }
.simulator-action--secondary svg { color: #159447; }
.simulator-action:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.1); }
.simulator-action--primary:hover { background: #ffe53b; }
.simulator-action:focus-visible { outline: 3px solid rgba(253,220,0,.72); outline-offset: 3px; }

.information {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 24px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8f9fa;
}
.information__icon { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); font-weight: 800; }
.information p { margin: 0; color: #4f545b; font-size: 12px; line-height: 1.5; }
.disclaimer { margin: 8px 0 0; text-align: center; color: #8a8f95; font-size: 9px; }

button:focus-visible,
input:focus-visible { outline: 3px solid rgba(253,220,0,.72); outline-offset: 3px; }

@media (max-width: 900px) {
  .simulator { width: min(100% - 20px, 720px); margin: 10px auto; padding: 20px; border-radius: 22px; }
  .simulator__header { padding-top: 0; margin-bottom: 12px; }
  .simulator__grid { grid-template-columns: 1fr; gap: 16px; }
  .simulator-actions { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .controls { padding: 18px; }
  .preview__label { top: 5%; padding: 6px 9px; font-size: 9px; }
  .preview__label--before { left: 8%; }
  .preview__label--after { right: 7%; }
}

@media (max-width: 520px) {
  body { background: #fff; }
  .simulator { width: 100%; margin: 0; padding: 16px; border: 0; border-radius: 0; box-shadow: none; }
  h1 { font-size: 31px; }
  .intro { font-size: 14px; }
  .preview__stage { border-radius: 16px; }
  .preview__hint { font-size: 10px; }
  .controls { padding: 14px; border-radius: 18px; }
  .control-group + .control-group { margin-top: 18px; }
  .segmented button { min-height: 38px; font-size: 10px; }
  .tone-options { gap: 5px; }
  .tone-options button { min-height: 48px; border-radius: 11px; }
  .tone-options strong { font-size: 10px; }
  .tone-options small { font-size: 8px; }
  .color-options { gap: 12px; }
  .color { width: 37px; height: 37px; }
  .film-card { padding: 15px; }
  .film-card h2 { font-size: 17px; }
  .metric { grid-template-columns: 22px minmax(0, 1fr); min-height: 70px; padding: 10px; gap: 8px; }
  .metric__icon { width: 21px; height: 21px; }
  .metric strong { font-size: 19px; }
  .simulator-action { min-height: 47px; font-size: 11px; }
  .simulator-actions { grid-template-columns: 1fr; gap: 8px; }
  .information { align-items: flex-start; margin-top: 16px; padding: 12px; }
  .information__icon { width: 27px; height: 27px; }
  .information p { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
