* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0d1117; color: #e6edf3;
}
.app { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.main-row { flex: 1; display: flex; min-height: 0; }
.side {
  flex: 0 0 230px; max-width: 32vw; padding: 14px; overflow-y: auto;
  background: #0d1117; border: solid #21262d; border-width: 0 1px 0 0;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 10px;
}
.side.right { border-width: 0 0 0 1px; }
.view {
  flex: 1; position: relative; min-width: 0; min-height: 0; background: #0a0e14;
}
.view canvas { display: block; width: 100%; height: 100%; }
.view-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 2; font-size: 11px; color: #6e7681; pointer-events: none;
  text-align: center; line-height: 1.4; max-width: 90%;
}
.view-hint kbd { background: #21262d; padding: 1px 5px; border-radius: 4px; }
#ui { width: 100%; }
#ui h1 {
  margin: 0 0 10px; font-size: 14px; font-weight: 700;
  color: #58a6ff; letter-spacing: 0.02em; text-align: left;
}
#ui label { display: block; font-size: 12px; color: #8b949e; margin-bottom: 6px; }
#fireSlider { width: 100%; margin-bottom: 2px; accent-color: #f78166; }
#fireValue { font-variant-numeric: tabular-nums; color: #79c0ff; }
#resetBtn {
  width: 100%; padding: 8px 12px;
  background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
#resetBtn:hover { background: #30363d; border-color: #8b949e; }
.hud {
  background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 10px 12px;
  font-size: 12px; line-height: 1.5;
}
.hud h2 { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #c9d1d9; }
.hud .row { display: flex; justify-content: space-between; gap: 10px; }
.hud .k { color: #8b949e; }
.hud .v { font-variant-numeric: tabular-nums; color: #7ee787; }
.hud-b { border-left: 3px solid #58a6ff; }
.hud-p { border-left: 3px solid #a371f7; }
.hud-didatic {
  font-size: 11px; color: #6e7681; line-height: 1.45; margin: 0; padding: 0 0 0 2px; border: none; background: none;
}

.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }

.back-home {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #30363d;
  background: rgba(13, 17, 23, 0.75);
  color: #e6edf3;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  backdrop-filter: blur(10px);
}
.back-home:hover {
  background: rgba(13, 17, 23, 0.9);
  border-color: #58a6ff;
}

/* Mobile-first: empilhar painéis e preservar a área de simulação */
@media (max-width: 980px) {
  .main-row { flex-direction: column; }

  .side {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
    border-width: 0 0 1px 0;
  }
  .side.right { border-width: 1px 0 0 0; }

  .view {
    min-height: 44vh;
  }

  .view-hint {
    top: auto;
    bottom: 10px;
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid rgba(48, 54, 61, 0.55);
    padding: 6px 10px;
    border-radius: 999px;
  }
}

