:root {
  --forge-copper: #b8612a;
  --forge-ember: #ffca55;
  --forge-steel: #dce6e7;
}

.assembly-brief {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr);
  gap: 22px;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 18px;
  padding: 18px 20px;
  color: #17364b;
  background: #fffaf0;
  border: 1px solid #d8c49d;
  border-left: 6px solid var(--forge-ember);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(7, 29, 43, .1);
}

.assembly-brief span,
.assembly-brief h3 {
  display: block;
}

.assembly-brief > div > span {
  color: #9a571f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.assembly-brief h3 {
  margin: 5px 0 0;
  color: #062b55;
  font-size: 20px;
  line-height: 1.2;
}

.assembly-brief ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assembly-brief li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: start;
}

.assembly-brief li > b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #062b55;
  background: var(--forge-ember);
  border-radius: 50%;
}

.assembly-brief li strong {
  margin-bottom: 2px;
  color: #062b55;
  font-size: 13px;
}

.assembly-brief li span {
  color: #536473;
  font-size: 12px;
  line-height: 1.45;
}

.shell {
  background: #eadbbc;
  border-radius: 18px;
  overflow: hidden;
}

.stage {
  background:
    radial-gradient(circle at 82% 16%, rgba(244,178,34,.2), transparent 14rem),
    linear-gradient(135deg, #fffaf0, #eee0c4);
  border-radius: 14px;
  box-shadow: inset 0 0 42px rgba(72,43,19,.08);
}

.station-instruction {
  max-width: 680px;
  margin: 6px 0 0;
  color: #536473;
  font-size: 13px;
  line-height: 1.45;
}

.inspection-notes > p strong,
.gauge-stage > p strong,
.parts-tray > small strong {
  color: #7d431d;
}

.inspection-layout,
.assembly-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(260px, .95fr);
  gap: 22px;
  align-items: stretch;
}

.inspection-helmet,
.build-target {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid #31556b;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 40%, #214a60, #071d2b 75%);
  background-size: 22px 22px, 22px 22px, auto;
  box-shadow: inset 0 0 42px #0007, 0 14px 26px rgba(25,38,38,.13);
}

.inspection-helmet::after,
.build-target::after {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(244,178,34,.32);
  border-radius: 12px;
}

.blueprint-label,
.target-label,
.task-chip {
  position: absolute;
  z-index: 5;
  top: 20px;
  left: 22px;
  padding: 6px 9px;
  color: #ffdc82;
  background: #061824cc;
  border: 1px solid #f4b22288;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.3px;
}

.inspection-helmet > img {
  display: block;
  width: 100%;
  height: 390px;
  padding: 32px 55px 18px;
  object-fit: contain;
  filter: drop-shadow(0 20px 18px #0008);
}

.inspection-pins {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.inspection-pin {
  position: absolute;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #071d2b;
  background: var(--forge-ember);
  border: 3px solid #fff7e5;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(244,178,34,.24), 0 8px 16px #0007;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  animation: forgePulse 1.4s ease-in-out infinite alternate;
}

.inspection-pin.found {
  color: white;
  background: #568d57;
  animation: none;
}

.pin-cupula { top: 21%; left: 70%; }
.pin-faixa { top: 39%; left: 24%; }
.pin-ranhuras { top: 58%; left: 70%; }

.inspection-notes {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0;
}

.inspection-notes > p {
  margin: 0 0 12px;
  color: #52656b;
  font-size: 10px;
  font-weight: 800;
}

.inspection-notes > div {
  display: grid;
  gap: 9px;
}

.inspection-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: center;
  min-height: 76px;
  padding: 10px 12px;
  color: var(--navy);
  background: #fffdf7;
  border: 1px solid #d2c19f;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.inspection-card:hover,
.inspection-card:focus-visible {
  border-color: #b8780b;
  box-shadow: 0 8px 18px rgba(85,55,20,.12);
  transform: translateY(-2px);
}

.inspection-card > b {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 50%;
  font-size: 9px;
}

.inspection-card strong,
.inspection-card small { display: block; }
.inspection-card small { margin-top: 3px; color: #68777a; font-size: 9px; line-height: 1.35; }
.inspection-card.found { border-color: #6ea071; background: #eff8ea; }
.inspection-card.found > b { background: #568d57; }
.inspection-notes > small { margin-top: 13px; color: #647276; font-size: 9px; }
.inspection-notes > small b { color: #9a6910; }

.build-target {
  min-height: 430px;
  transition: box-shadow .2s, border-color .2s;
}

.build-target.dragover {
  border-color: var(--forge-ember);
  box-shadow: inset 0 0 48px rgba(255,202,85,.2), 0 0 0 4px rgba(244,178,34,.22);
}

.build-target > p {
  position: absolute;
  z-index: 6;
  right: 20px;
  bottom: 14px;
  left: 20px;
  margin: 0;
  color: #bbccd2;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.assembly-guide,
.assembly-piece {
  position: absolute;
  inset: 52px 18px 40px;
  width: calc(100% - 36px);
  height: calc(100% - 92px);
  object-fit: contain;
}

.assembly-guide {
  opacity: .13;
  filter: grayscale(1) contrast(1.3) drop-shadow(0 16px 14px #0008);
}

.assembly-layers { position: absolute; inset: 0; }
.assembly-piece { opacity: 0; filter: drop-shadow(0 15px 12px #0007); transform: translateY(-16px) scale(.98); }
.assembly-piece.installed { opacity: 1; transform: none; animation: partLand .45s cubic-bezier(.2,.8,.2,1); }
.piece-cupula { clip-path: polygon(0 0,100% 0,100% 43%,0 43%); }
.piece-faixa { clip-path: polygon(0 25%,100% 25%,100% 46%,0 46%); }
.piece-frontal { clip-path: polygon(26% 34%,74% 34%,74% 73%,26% 73%); }
.piece-laterais { clip-path: polygon(0 36%,31% 36%,43% 100%,0 100%,0 36%,100% 36%,100% 100%,57% 100%,69% 36%); }

.parts-tray {
  padding: 15px;
  background: #d9c7a3;
  border: 1px solid #c0aa80;
  border-radius: 16px;
  box-shadow: inset 0 0 24px rgba(76,50,22,.11);
}

.parts-tray > p {
  margin: 0 0 10px;
  color: #8e6110;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.parts-tray > div { display: grid; gap: 8px; }
.parts-tray > small { display: block; margin-top: 10px; color: #6e6557; font-size: 8px; text-align: center; }

.parts-tray button {
  display: grid;
  grid-template-columns: 58px 1fr 25px;
  gap: 10px;
  align-items: center;
  min-height: 77px;
  padding: 8px;
  color: var(--navy);
  background: #fffaf0;
  border: 1px solid #bca77f;
  border-radius: 11px;
  text-align: left;
  cursor: grab;
}

.parts-tray button:hover:not(:disabled),
.parts-tray button:focus-visible:not(:disabled) { border-color: #a66a06; box-shadow: 0 6px 16px #6f491d2b; }
.parts-tray button.installed { color: #416a43; background: #edf5e8; border-color: #81a781; cursor: default; }
.parts-tray button > span:nth-child(2) b { color: #a66d0b; font-size: 8px; }
.parts-tray button strong,
.parts-tray button small { display: block; }
.parts-tray button strong { margin: 2px 0; font-size: 10px; }
.parts-tray button small { color: #6d7777; font-size: 8px; line-height: 1.3; }
.parts-tray button > i { display: grid; width: 24px; height: 24px; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-style: normal; }
.parts-tray button.installed > i { background: #568d57; }

.part-preview {
  position: relative;
  display: block;
  width: 56px;
  height: 58px;
  overflow: hidden;
  background: radial-gradient(circle, #365b6d, #102b3b);
  border-radius: 10px;
}

.part-preview img { width: 100%; height: 100%; padding: 4px; object-fit: contain; filter: drop-shadow(0 5px 4px #0007); }

.helmet-visual {
  position: relative;
  display: grid;
  width: 210px;
  height: 260px;
  place-items: center;
  margin: 0 auto 14px;
  overflow: hidden;
  background: radial-gradient(circle, #f2e4c7, #c7b081);
  border: 1px solid #aa9161;
  border-radius: 46% 46% 20px 20px;
  box-shadow: inset 0 0 28px #7150262e;
}

.blueprint-ring { position: absolute; inset: 15px; border: 1px dashed #8f7241; border-radius: 50%; opacity: .5; }
.helmet-image { position: relative; z-index: 2; width: 88%; height: 90%; object-fit: contain; opacity: .12; filter: grayscale(1) contrast(.85); transition: opacity .5s, filter .5s, transform .5s; }
.progress-1 .helmet-image { opacity: .34; filter: grayscale(.75); }
.progress-2 .helmet-image { opacity: .57; filter: grayscale(.45); }
.progress-3 .helmet-image { opacity: .78; filter: grayscale(.18) brightness(1.05); }
.progress-4 .helmet-image { opacity: .94; filter: none; }
.progress-5 .helmet-image,
.helmet-visual.finished .helmet-image { opacity: 1; filter: drop-shadow(0 12px 9px #4c321c55); transform: scale(1.025); }
.forge-shine { position: absolute; z-index: 3; inset: -30% 45% -30% -45%; background: linear-gradient(105deg,transparent 35%,#fff8 49%,transparent 62%); transform: translateX(-150%) rotate(8deg); }
.progress-3 .forge-shine,
.progress-4 .forge-shine,
.progress-5 .forge-shine,
.helmet-visual.finished .forge-shine { animation: forgeShine 2.7s ease-in-out infinite; }

.groove-stage { grid-template-columns: minmax(270px,.92fr) 1fr; }
.memory-helmet {
  position: relative;
  width: min(320px,100%);
  aspect-ratio: .78;
  background: radial-gradient(circle at 50% 40%, #31566a, #071d2b 72%);
  border: 1px solid #a97820;
  border-radius: 18px;
  box-shadow: inset 0 0 38px #0008;
}
.memory-helmet::after { content: ""; position: absolute; inset: 12px; border: 1px solid #f4b22255; border-radius: 13px; pointer-events: none; }
.memory-helmet > img { width: 100%; height: 100%; padding: 24px 42px 14px; object-fit: contain; filter: drop-shadow(0 15px 12px #0009); }
.groove-points { position: absolute; inset: 0; z-index: 3; }
.groove-point { position: absolute; display: grid; width: 31px; height: 31px; place-items: center; color: #071d2b; background: #f8e9bf; border: 3px solid #a77926; border-radius: 50%; box-shadow: 0 4px 10px #0008; font-size: 9px; font-weight: 900; cursor: pointer; }
.point-1 { left: 28%; top: 36%; }.point-2 { right: 28%; top: 36%; }.point-3 { left: 24%; top: 48%; }.point-4 { right: 24%; top: 48%; }.point-5 { left: 22%; top: 60%; }.point-6 { right: 22%; top: 60%; }
.groove-point.flash { color: white; background: #f4b222; border-color: white; box-shadow: 0 0 0 7px #f4b22255,0 0 22px #ffd66d; transform: scale(1.18); }
.groove-point.selected { color: white; background: #568d57; border-color: white; }
.memory-info { align-self: center; }
.memory-info .task-chip { position: static; display: inline-block; }
.memory-info h3 { margin: 12px 0 4px; font-family: "Archivo Black",Impact,sans-serif; font-size: 24px; }

.gauge { position: relative; overflow: hidden; border-radius: 17px; background: radial-gradient(circle at 50% 0,#275268,#102b3b 70%); box-shadow: 0 18px 30px #071d2b33, inset 0 0 28px #0008; }
.gauge::after { content: "POLIMENTO DE PRECISÃO"; display: block; margin-top: 16px; color: #f4b222; font-size: 8px; font-weight: 900; letter-spacing: 1.5px; }

@keyframes forgePulse { from { transform: scale(.95); } to { transform: scale(1.06); } }
@keyframes partLand { from { opacity: 0; transform: translateY(-28px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes forgeShine { 0%,45% { transform: translateX(-150%) rotate(8deg); } 75%,100% { transform: translateX(270%) rotate(8deg); } }

@media (max-width: 840px) {
  .assembly-brief {
    grid-template-columns: 1fr;
  }

  .assembly-brief ol {
    grid-template-columns: 1fr;
  }

  .inspection-layout,
  .assembly-workbench { grid-template-columns: 1fr; }
  .inspection-helmet,
  .build-target { min-height: 360px; }
  .parts-tray button { min-height: 72px; }
}

@media (max-width: 520px) {
  .inspection-helmet > img { height: 340px; padding-inline: 38px; }
  .inspection-helmet { min-height: 340px; }
  .build-target { min-height: 370px; }
  .parts-tray { padding: 10px; }
  .parts-tray button { grid-template-columns: 50px 1fr 22px; gap: 8px; }
  .part-preview { width: 48px; height: 52px; }
  .memory-helmet { width: min(270px,90%); }
  .groove-stage { gap: 18px; }
}

@media (min-width: 1001px) and (max-height: 900px) {
  .main {
    padding: 12px;
  }

  .toolbar {
    min-height: 42px;
    margin-bottom: 8px;
  }

  .stations {
    margin-bottom: 8px;
  }

  .stations > div {
    min-height: 42px;
  }

  .stage {
    min-height: 440px;
    padding: 14px;
  }

  .stage-title {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .inspection-helmet,
  .build-target {
    min-height: 320px;
  }

  .inspection-helmet > img {
    height: 320px;
    padding-block: 26px 12px;
  }

  .build-target > .assembly-guide {
    height: calc(100% - 70px);
  }

  .parts-tray button {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inspection-pin,
  .assembly-piece.installed,
  .forge-shine { animation: none !important; }
}
