* {
  box-sizing: border-box;
}

body {
  font-family: 'STIX Two Text', serif;
  background: #FAFAFA;
  margin: 0;
  padding: 20px;
}

#container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

#tree-svg {
  width: 100%;
  height: auto;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  display: block;
}

/* Clickable hit area (invisible) */
.edge-hit.clickable {
  cursor: pointer;
}

/* Visible edge hover state (triggered by hit area hover) */
.edge-main.hover {
  stroke-width: 8px;
}

.edge-taper.hover {
  stroke-width: 4px;
}

/* Optimal (correct) edge */
.edge.optimal {
  stroke: #DC2626;
  stroke-width: 3px;
  pointer-events: none;
}

/* Shake animation for wrong answers */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.edge.shake {
  animation: shake 0.3s ease-in-out;
}

/* Particles (used in explosion animations) */
.particle {
  pointer-events: none;
}

/* Print button styling */
#print-button {
  background-color: #2563EB;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#print-button:hover {
  background-color: #1D4ED8;
}

#print-button:active {
  background-color: #1E40AF;
}

/* Print-specific styles */
@media print {
  /* Hide everything except the tree */
  #print-button-container {
    display: none !important;
  }

  body {
    margin: 0;
    padding: 0;
    background: white;
  }

  #container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  #tree-svg {
    border: none;
    border-radius: 0;
    width: 100%;
    height: auto;
    page-break-inside: avoid;
  }

  /* Landscape orientation for better tree visibility */
  @page {
    size: landscape;
    margin: 0.5in;
  }

  /* Ensure optimal edges are clearly visible in print */
  .edge.optimal {
    stroke: #000000 !important;
    stroke-width: 4px !important;
  }

  /* Make all text darker for better print quality */
  text {
    fill: #000000 !important;
  }

  /* Ensure all interactive elements are hidden */
  .edge-hit {
    display: none !important;
  }
}
