/* Layout of the machine page: header with gauge, six slots, finale overlay. */

.machine__header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.machine__title { font-size: clamp(2rem, 5vw, 3.4rem); }
.machine__sub { margin: 4px 0 12px; color: var(--cream); opacity: 0.85; max-width: 60ch; }
.machine__gauge { line-height: 0; }

.slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 1000px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .slots { grid-template-columns: 1fr; }
  .machine__header { grid-template-columns: 1fr auto; }
  .machine__gauge { grid-column: 1 / -1; justify-self: center; }
}

.slot__title { font-size: 1.5rem; margin-bottom: 4px; }
.slot__hint { margin: 0 0 14px; min-height: 2.6em; font-size: 0.95em; }
.slot__controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.slot__valve { margin-left: auto; }
.slot__answer {
  margin: 0;
  font-size: 1.4em;
  letter-spacing: 0.15em;
  color: var(--cream);
  background: #151515;
  border: 2px solid var(--brass-dark);
  border-radius: 4px;
  padding: 8px 12px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.9);
}
.slot--locked .slot__input, .slot--locked .slot__lever { display: none; }
.slot--locked .slot__controls { justify-content: flex-end; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.lamp.is-blinking { animation: blink 250ms 3; }

.modal__actions { margin-top: 16px; }

/* Finale overlay. */
.finale {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 10, 4, 0.92);
  display: grid; place-items: center;
  padding: 24px;
  overflow: hidden;
}
.finale[hidden] { display: none; }
.finale__gears { position: absolute; inset: 0; pointer-events: none; color: var(--brass-dark); }
.gear { position: absolute; opacity: 0.55; }
.gear--a { width: 42vmin; left: -10vmin; top: -8vmin; animation: spin 14s linear infinite; }
.gear--b { width: 28vmin; left: 24vmin; top: 10vmin; color: var(--copper); animation: spin 9s linear infinite reverse; }
.gear--c { width: 50vmin; right: -14vmin; bottom: -16vmin; animation: spin 20s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.finale__lamps { position: absolute; top: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 18px; }
.finale__plate { position: relative; max-width: 720px; width: 100%; text-align: center; padding: 36px; }
.finale__title { font-size: clamp(1.8rem, 5vw, 3rem); color: var(--cream); margin-bottom: 18px; }
.finale__text { font-size: 1.5em; line-height: 1.5; min-height: 3em; white-space: pre-wrap; margin: 0; }
.finale__text::after { content: "▌"; animation: blink 800ms infinite; }
.finale__text.is-done::after { content: ""; }

@media (prefers-reduced-motion: reduce) {
  .gear { animation: none; }
  .lamp.is-blinking { animation: none; opacity: 1; }
}
