:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #191b21;
  --panel-2: #22252d;
  --ink: #f4f1e8;
  --muted: #a9b0ba;
  --line: #363a45;
  --green: #4fd07b;
  --amber: #f3bc4b;
  --red: #f45f5f;
  --cyan: #4fbfe8;
  --magenta: #d779e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 191, 232, 0.18), transparent 26rem),
    linear-gradient(135deg, #101114 0%, #171a1d 52%, #12141a 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding: 18px 0 22px;
}

.intro h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.intro p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow,
.label {
  display: block;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.target-panel,
.city-panel,
.console,
.alerts {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
}

.target-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr)) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
}

.target-panel strong {
  display: block;
  margin-top: 5px;
  font-size: 1.55rem;
}

#reset {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #2a2d35;
  color: var(--ink);
  cursor: pointer;
}

.simulator {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(500px, 1.42fr) minmax(280px, 0.82fr);
  gap: 18px;
  align-items: stretch;
}

.city-panel,
.console,
.alerts {
  border-radius: 8px;
  padding: 18px;
}

.city-header,
.console-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

h2 {
  margin: 6px 0 0;
  font-size: 1.1rem;
  line-height: 1.15;
}

.system-light {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 28px var(--green);
  flex: 0 0 auto;
}

.city {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  margin: 20px 0;
  border: 1px solid #303540;
  border-radius: 8px;
  background: #071016;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.32);
}

.city::before,
.city::after {
  position: absolute;
  inset: 0;
  background-image: url("cidade.jpg");
  background-repeat: no-repeat;
  background-size: 200% 100%;
  content: "";
}

.city::before {
  background-position: left center;
}

.city::after {
  background-position: right center;
  opacity: 0;
  transition: opacity 420ms ease;
}

.city.warning::after {
  animation: city-fade 1.15s infinite ease-in-out;
}

.city.critical::after {
  opacity: 1;
  animation: none;
}

.city.critical {
  filter: saturate(0.82) brightness(0.88);
}

@keyframes city-fade {
  0%,
  100% {
    opacity: 0.18;
  }

  45% {
    opacity: 0.88;
  }

  62% {
    opacity: 0.34;
  }
}

.meters {
  display: grid;
  gap: 14px;
}

.meters > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.bar {
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #30343d;
}

.bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 160ms ease, background-color 160ms ease;
}

#verdict {
  max-width: 240px;
  color: var(--amber);
  font-weight: 800;
  text-align: right;
}

.sliders {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 14px;
  min-height: 462px;
  margin-top: 20px;
}

.channel {
  display: grid;
  grid-template-rows: 58px 1fr 58px;
  gap: 12px;
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid #333846;
  border-radius: 8px;
  background: linear-gradient(180deg, #252934, #17191f);
}

.channel h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.12;
  text-align: center;
}

.slider-wrap {
  display: grid;
  place-items: center;
  min-height: 270px;
  overflow: hidden;
}

input[type="range"] {
  width: 34px;
  height: 270px;
  accent-color: var(--cyan);
  direction: rtl;
  writing-mode: vertical-lr;
}

.readout {
  display: grid;
  gap: 6px;
  text-align: center;
}

.readout strong {
  font-size: 1.32rem;
}

.readout span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.alerts h2 {
  margin-bottom: 20px;
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert {
  padding: 13px;
  border-left: 4px solid var(--amber);
  border-radius: 6px;
  background: var(--panel-2);
}

.alert.danger {
  border-left-color: var(--red);
}

.alert.good {
  border-left-color: var(--green);
}

.alert strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.93rem;
}

.alert p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

@media (max-width: 1120px) {
  .stage,
  .simulator {
    grid-template-columns: 1fr;
  }

  .target-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .sliders {
    min-height: 430px;
  }

  input[type="range"] {
    height: 250px;
  }
}

@media (max-width: 680px) {
  .app {
    padding: 16px;
  }

  .target-panel,
  .sliders {
    grid-template-columns: 1fr;
  }

  .sliders {
    min-height: 0;
  }

  .channel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .channel h3 {
    min-height: 0;
  }

  .slider-wrap {
    min-height: auto;
  }

  input[type="range"] {
    width: 100%;
    height: auto;
    direction: ltr;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .city {
    min-height: 280px;
  }
}

/* Wide layout: dashboard panels on top, mixer strip below. */
.app {
  width: min(1320px, 100%);
  padding: 18px 22px 24px;
}

.stage {
  padding: 10px 0 20px;
}

.intro h1 {
  font-size: clamp(3.2rem, 6.2vw, 5.8rem);
  line-height: 0.92;
}

.intro p {
  margin-top: 12px;
}

.simulator {
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
}

.console {
  grid-column: 1 / -1;
  order: 3;
}

.city-panel {
  order: 1;
}

.alerts {
  order: 2;
  max-height: 476px;
  overflow: auto;
}

.city {
  min-height: 292px;
  margin: 18px 0;
}

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

.console-top {
  align-items: center;
}

#verdict {
  max-width: 420px;
}

.sliders {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  min-height: 0;
  margin-top: 16px;
}

.channel {
  grid-template-columns: minmax(0, 1fr) minmax(70px, auto);
  grid-template-rows: auto auto;
  gap: 10px 14px;
  padding: 14px;
}

.channel h3 {
  grid-column: 1;
  grid-row: 1;
  min-height: 36px;
  font-size: 0.92rem;
  text-align: left;
}

.slider-wrap {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: auto;
  overflow: visible;
  place-items: center stretch;
}

input[type="range"] {
  width: 100%;
  height: 30px;
  direction: ltr;
  writing-mode: horizontal-tb;
}

.readout {
  grid-column: 2;
  grid-row: 1;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.readout strong {
  font-size: 1.42rem;
  line-height: 1;
}

.readout span {
  font-size: 0.72rem;
}

@media (min-width: 1121px) and (max-height: 820px) {
  .alerts {
    max-height: 432px;
  }
}

@media (max-width: 1120px) {
  .stage,
  .simulator {
    grid-template-columns: 1fr;
  }

  .alerts {
    max-height: none;
  }

  .sliders {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .target-panel,
  .sliders,
  .meters {
    grid-template-columns: 1fr;
  }

  .channel {
    grid-template-columns: 1fr;
  }

  .readout {
    grid-column: 1;
    grid-row: auto;
    justify-items: start;
    text-align: left;
  }

  .channel h3,
  .slider-wrap {
    grid-column: 1;
    grid-row: auto;
  }
}

.target-panel {
  grid-template-columns: repeat(4, minmax(104px, 1fr)) auto;
}

@media (max-width: 1120px) {
  .target-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Embed the score panel inside the mixer header. */
.stage {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 12px;
}

.console-top {
  align-items: start;
}

.console-status {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 1 1 760px;
  min-width: min(760px, 58vw);
}

.console-status .target-panel {
  width: 100%;
  grid-template-columns: repeat(4, minmax(96px, 1fr)) auto;
  gap: 12px;
  padding: 10px;
  border-color: #303541;
  background: rgba(34, 37, 45, 0.74);
  box-shadow: none;
}

.console-status .target-panel strong {
  margin-top: 4px;
  font-size: 1.34rem;
}

.console-status #reset {
  min-height: 42px;
  padding: 0 14px;
}

.console-status #verdict {
  max-width: none;
  min-height: 20px;
  text-align: right;
}

@media (max-width: 1120px) {
  .console-top {
    flex-direction: column;
  }

  .console-status {
    width: 100%;
    min-width: 0;
  }

  .console-status .target-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console-status #reset {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .console-status .target-panel {
    grid-template-columns: 1fr;
  }
}
