* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 2000px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #394867;
}

h1 {
  font-size: 2.8rem;
  color: #4cc9f0;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(76, 201, 240, 0.3);
}

.subtitle {
  font-size: 1.2rem;
  color: #a9b7c6;
}

.main-content {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
}

.map-container {
  flex: 1;
  min-width: 300px;
  background: rgba(25, 30, 45, 0.8);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid #394867;
  overflow: hidden;
}

.controls-panel {
  width: 350px;
  background: rgba(25, 30, 45, 0.8);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid #394867;
}

#quest-map {
  width: 100%;
  height: 850px;
  position: relative;
  overflow: hidden;
}

.quest-node {
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(30, 35, 55, 0.95);
  border-radius: 10px;
  padding: 20px;
  margin: 5px;
  width: 320px;
  border: 3px solid;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  pointer-events: all;
  overflow: hidden;
}

.quest-node:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.quest-node.active {
  border-color: #4cc9f0;
}

.quest-node.completed {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
}

.quest-node.locked {
  border-color: #7f8c8d;
  background: rgba(127, 140, 141, 0.1);
  opacity: 0.8;
  cursor: not-allowed;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  position: relative;
}

.quest-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #4cc9f0;
  flex: 1;
  margin-right: 10px;
  line-height: 1.3;
}

.quest-node.completed .quest-title {
  color: #2ecc71;
}

.kappa-flag {
  color: #f1c40f;
  font-size: 1.5rem;
}

.quest-description {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #bdc3c7;
  margin-bottom: 15px;
  min-height: 70px;
  max-height: 105px;
  overflow-y: auto;
  padding-right: 5px;
}

.quest-description::-webkit-scrollbar {
  width: 4px;
}

.quest-description::-webkit-scrollbar-thumb {
  background: #4cc9f0;
  border-radius: 2px;
}

.quest-rewards {
  font-size: 0.9rem;
  color: #95a5a6;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.quest-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #7f8c8d;
}

.quest-id {
  font-weight: bold;
}

.quest-prerequisites {
  text-align: right;
}

.quest-connection {
  fill: none;
  stroke-width: 3;
  pointer-events: none;
  transition: all 0.3s ease;
}

.quest-connection.normal {
  stroke: #4a5568;
  stroke-dasharray: none;
}

.quest-connection.completed {
  stroke: #2ecc71;
  stroke-dasharray: 5;
}

.panel-title {
  font-size: 1.5rem;
  color: #4cc9f0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #394867;
}

.legend {
  margin-bottom: 30px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  margin-right: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.legend-color.active {
  background-color: rgba(76, 201, 240, 0.1);
  border-color: #4cc9f0;
}

.legend-color.completed {
  background-color: rgba(46, 204, 113, 0.1);
  border-color: #2ecc71;
}

.legend-color.locked {
  background-color: rgba(127, 140, 141, 0.1);
  border-color: #7f8c8d;
}

.legend-text {
  font-size: 1rem;
}

.stats {
  background: rgba(30, 35, 55, 0.7);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 25px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.stat-value {
  color: #4cc9f0;
  font-weight: bold;
}

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

button {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

button:hover {
  background: linear-gradient(to right, #2980b9, #1f639b);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

button.secondary {
  background: linear-gradient(to right, #2c3e50, #34495e);
}

button.secondary:hover {
  background: linear-gradient(to right, #34495e, #2c3e50);
}

button.danger {
  background: linear-gradient(to right, #e74c3c, #c0392b);
}

button.danger:hover {
  background: linear-gradient(to right, #c0392b, #a93226);
}

.instructions {
  background: rgba(30, 35, 55, 0.7);
  border-radius: 8px;
  padding: 18px;
  margin-top: 25px;
}

.instructions h3 {
  color: #4cc9f0;
  margin-bottom: 12px;
}

.instructions ul {
  padding-left: 20px;
}

.instructions li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.trader-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background: rgba(30, 35, 55, 0.7);
  border-radius: 8px;
  padding: 15px;
}

.trader-filter {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trader-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.trader-1-color {
  background-color: #3498db;
}
.trader-2-color {
  background-color: #2ecc71;
}
.trader-3-color {
  background-color: #e74c3c;
}
.trader-4-color {
  background-color: #f1c40f;
}
.trader-5-color {
  background-color: #9b59b6;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #394867;
  color: #a9b7c6;
  font-size: 0.9rem;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 1.5rem;
  color: #4cc9f0;
}

.notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(30, 35, 55, 0.95);
  border-left: 5px solid #4cc9f0;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transform: translateX(400px);
  transition: transform 0.5s ease;
}

.notification.show {
  transform: translateX(0);
}

.trader-header-svg {
  text-align: center;
  padding: 15px;
  background: rgba(57, 72, 103, 0.7);
  border-radius: 8px;
  border: 2px solid;
  color: white;
}

@media (max-width: 1600px) {
  .main-content {
    flex-direction: column;
  }

  .controls-panel {
    width: 100%;
  }

  #quest-map {
    height: 750px;
  }
}
