.relationship-panel {
  background:
    linear-gradient(180deg, rgba(16, 19, 29, 0.96), rgba(12, 14, 22, 0.98)),
    #0a0a0f;
  color: #eef4fb;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.relationship-panel h2 {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(120, 144, 170, 0.18);
  display: flex;
  font-size: 1rem;
  gap: 12px;
  justify-content: space-between;
  margin: 0;
  padding: 16px;
}

.relationship-status {
  border: 1px solid rgba(0, 255, 136, 0.28);
  border-radius: 999px;
  color: #00ff88;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  text-transform: uppercase;
}

.relationship-controls {
  border-bottom: 1px solid rgba(120, 144, 170, 0.18);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.relationship-tabs {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(120, 144, 170, 0.2);
  border-radius: 9px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.relationship-tabs button {
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(120, 144, 170, 0.16);
  color: #97a4b3;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  min-height: 34px;
  padding: 0 6px;
}

.relationship-tabs button:last-child {
  border-right: 0;
}

.relationship-tabs button.active {
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.18), rgba(0, 255, 136, 0.08));
  color: #00ff88;
}

.relationship-sort {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(120, 144, 170, 0.2);
  border-radius: 9px;
  color: #eef4fb;
  font: inherit;
  height: 36px;
  padding: 0 10px;
}

.relationship-columns {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 12px;
}

.relationship-section {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(120, 144, 170, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

.relationship-section h3 {
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(120, 144, 170, 0.16);
  color: #97a4b3;
  font-size: 0.72rem;
  letter-spacing: 0;
  margin: 0;
  padding: 9px 10px;
  text-transform: uppercase;
}

.relationship-gauges {
  align-items: end;
  display: grid;
  gap: 12px 10px;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  min-height: 148px;
  padding: 14px 10px;
}

.relationship-empty {
  align-self: center;
  color: #97a4b3;
  font-size: 0.76rem;
  grid-column: 1 / -1;
  text-align: center;
}

.relationship-gauge {
  background: rgba(10, 12, 20, 0.28);
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 8px;
  grid-template-rows: auto 108px auto;
  justify-items: center;
  min-height: 172px;
  padding: 8px 6px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.relationship-gauge:hover {
  background: rgba(101, 184, 255, 0.07);
  border-color: rgba(101, 184, 255, 0.26);
  transform: translateY(-1px);
}

.relationship-gauge.changed {
  animation: relationship-pulse 0.6s ease;
}

.relationship-score {
  align-items: center;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 18px;
}

.relationship-score.positive {
  color: #00ff88;
}

.relationship-score.negative {
  color: #ff3355;
}

.relationship-score.neutral {
  color: #97a4b3;
}

.relationship-bar {
  background: linear-gradient(180deg, rgba(5, 7, 14, 0.94), rgba(11, 13, 23, 0.98));
  border: 1px solid rgba(120, 144, 170, 0.22);
  border-radius: 9px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.32);
  height: 108px;
  overflow: hidden;
  position: relative;
  width: 34px;
}

.relationship-bar::before {
  background: rgba(238, 244, 251, 0.45);
  content: "";
  height: 1px;
  left: 6px;
  position: absolute;
  right: 6px;
  top: 50%;
  z-index: 2;
}

.relationship-fill {
  border-radius: 999px;
  height: 0;
  left: calc(50% - 7px);
  position: absolute;
  transition: height 0.6s ease;
  width: 14px;
}

.relationship-fill.positive {
  background: #00ff88;
  bottom: 50%;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.72);
}

.relationship-fill.negative {
  background: #ff3355;
  box-shadow: 0 0 15px rgba(255, 51, 85, 0.72);
  top: 50%;
}

.relationship-name {
  color: #dbe5ef;
  font-size: 0.68rem;
  line-height: 1.2;
  min-height: 32px;
  overflow-wrap: anywhere;
  text-align: center;
}

.relationship-ticker {
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(120, 144, 170, 0.18);
  overflow: hidden;
  padding: 11px 0;
  white-space: nowrap;
}

.relationship-ticker-track {
  animation: relationship-scroll 90s linear infinite;
  display: inline-flex;
  gap: 24px;
  padding-left: 100%;
}

.relationship-event {
  font-size: 0.76rem;
}

.relationship-event.praise {
  color: #00ff88;
}

.relationship-event.attack {
  color: #ff3355;
}

.relationship-event.neutral {
  color: #97a4b3;
}

.relationship-detail {
  border-top: 1px solid rgba(120, 144, 170, 0.18);
  display: none;
  padding: 12px;
}

.relationship-detail.open {
  display: block;
}

.relationship-detail-title {
  color: #eef4fb;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.relationship-detail-meta {
  color: #97a4b3;
  font-size: 0.72rem;
  margin-bottom: 10px;
}

.relationship-quote {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(120, 144, 170, 0.18);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 9px;
}

.relationship-quote p {
  color: #dbe5ef;
  font-size: 0.76rem;
  line-height: 1.35;
  margin: 0 0 6px;
}

.relationship-quote small {
  color: #97a4b3;
  font-size: 0.68rem;
}

@keyframes relationship-pulse {
  0% { box-shadow: 0 0 0 rgba(0, 255, 136, 0); }
  35% { box-shadow: 0 0 24px rgba(0, 255, 136, 0.36); }
  100% { box-shadow: 0 0 0 rgba(0, 255, 136, 0); }
}

@keyframes relationship-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (max-width: 1100px) {
  .relationship-columns {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .relationship-panel {
    border-radius: 10px;
  }

  .relationship-panel h2 {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
  }

  .relationship-status {
    font-size: 0.62rem;
  }

  .relationship-controls {
    padding: 10px;
  }

  .relationship-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relationship-tabs button {
    border-bottom: 1px solid rgba(120, 144, 170, 0.16);
    font-size: 0.7rem;
  }

  .relationship-tabs button:nth-child(2n) {
    border-right: 0;
  }

  .relationship-tabs button:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .relationship-sort {
    width: 100%;
  }

  .relationship-columns {
    gap: 10px;
    padding: 10px;
  }

  .relationship-gauges {
    gap: 9px 7px;
    grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
    min-height: 126px;
    padding: 10px 7px;
  }

  .relationship-gauge {
    gap: 6px;
    grid-template-rows: auto 86px auto;
    min-height: 144px;
    padding: 6px 4px;
  }

  .relationship-score {
    font-size: 0.72rem;
  }

  .relationship-bar {
    height: 86px;
    width: 30px;
  }

  .relationship-fill {
    left: calc(50% - 6px);
    width: 12px;
  }

  .relationship-name {
    font-size: 0.62rem;
    min-height: 30px;
  }

  .relationship-ticker {
    padding: 9px 0;
  }

  .relationship-event {
    font-size: 0.68rem;
  }

  .relationship-detail {
    padding: 10px;
  }
}

@media (max-width: 420px) {
  .relationship-gauges {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  }

  .relationship-gauge {
    min-height: 136px;
  }

  .relationship-name {
    font-size: 0.58rem;
  }
}
