body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #121417;
  color: #e0e0e0;
  padding: 20px;
  user-select: none;
}

.container {
  max-width: 900px;
  margin: auto;
  background-color: #1e2228;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  border: 1px solid #2c313a;
  position: relative;
}

h1 {
  color: #4db6ac;
  margin-bottom: 15px;
  text-align: center;
}

p {
  margin-bottom: 30px;
  font-size: 1rem;
  color: #a5d6a7;
  text-align: center;
}

/* Network Diagram */
.network-diagram {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
  position: relative;
  padding: 0 20px;
  min-height: 150px;
}

.device,
.firewall {
  width: 130px;
  height: 130px;
  background-color: #2c313a;
  border: 2px solid #4db6ac;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #a5d6a7;
  box-shadow: inset 0 0 10px #4db6ac;
  text-align: center;
  padding: 10px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  transition: background-color 0.3s ease;
  position: relative;
}

.device span.emoji,
.firewall span.emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

.firewall {
  background-color: #3a3f47;
  border-color: #e08e79;
  box-shadow: inset 0 0 15px #e08e79;
  color: #f4a261;
}

/* Removed static connection line */
.network-diagram::after {
  content: none;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.controls label {
  color: #a5d6a7;
  font-weight: 600;
  white-space: nowrap;
}

select,
button {
  padding: 8px 15px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  min-width: 160px;
}

select {
  background-color: #2c313a;
  color: #e0e0e0;
}

button {
  background-color: #4db6ac;
  color: #121417;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #399786;
}

/* Log Area */
.log {
  background-color: #2c313a;
  padding: 20px;
  border-radius: 10px;
  height: 180px;
  overflow-y: auto;
  color: #a5d6a7;
  font-family: monospace;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.log h2 {
  color: #4db6ac;
  margin-top: 0;
}

.log ul {
  padding-left: 20px;
  margin: 0;
}

.log li {
  margin-bottom: 5px;
  line-height: 1.3;
}

/* Animated Packet */
.packet {
  position: absolute;
  font-size: 24px;
  z-index: 10;
  pointer-events: none;
}

/* Optional red glow for blocked packets */
.packet.blocked {
  color: #e07a5f;
}
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 1.5rem;
  }

  p {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .network-diagram {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 10px;
  }

  .device,
  .firewall {
    width: 100px;
    height: 100px;
    font-size: 14px;
  }

  .device span.emoji,
  .firewall span.emoji {
    font-size: 30px;
    margin-bottom: 5px;
  }

  .controls {
    flex-direction: column;
    gap: 10px;
  }

  select,
  button {
    width: 100%;
    min-width: unset;
    font-size: 1rem;
  }

  .log {
    font-size: 0.85rem;
    padding: 15px;
    height: 150px;
  }

  .log h2 {
    font-size: 1.2rem;
  }

  .packet {
    font-size: 20px;
  }
}
