#screen-trade {
  display: flex;
  justify-content: center;
  height: 100%;
  overflow-y: auto;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(232, 179, 79, 0.12), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(127, 176, 105, 0.08), transparent 28%),
    linear-gradient(180deg, #15100b, #090705);
}

.trade-wrap {
  width: min(96vw, 1220px);
}

.trade-header {
  position: relative;
  text-align: center;
  margin-bottom: 26px;
}

.trade-brand {
  font-size: 32px;
}

.trade-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.trade-code-panel,
.trade-session-panel,
.trade-card-panel {
  border: 1px solid rgba(232, 179, 79, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(38, 32, 56, 0.84), rgba(18, 14, 24, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(232, 179, 79, 0.1), transparent 46%);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.trade-code-panel h2,
.trade-session-panel h2,
.trade-card-panel h2 {
  font-family: "Cinzel", serif;
  color: var(--cream);
  font-size: 18px;
  margin: 0;
}

.trade-code-row,
.trade-join-row,
.trade-actions,
.trade-panel-header,
.trade-session-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trade-code-row,
.trade-join-row {
  margin-top: 12px;
}

.trade-code {
  flex: 1;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(8, 6, 15, 0.78), rgba(22, 15, 9, 0.74));
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 22px;
  letter-spacing: 3px;
}

.trade-session-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.trade-session-item {
  min-height: 34px;
  border: 1px solid rgba(232, 179, 79, 0.22);
  border-radius: 5px;
  background: rgba(8, 6, 15, 0.52);
  color: var(--cream);
  font-family: inherit;
  text-align: left;
  padding: 7px 9px;
  cursor: pointer;
}
.trade-session-item.active {
  border-color: var(--gold);
  color: var(--gold);
}

.trade-session-header,
.trade-panel-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

.trade-status,
.trade-panel-header span {
  color: var(--cream-dim);
  font-size: 12px;
}

.trade-offer-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.trade-offer-card {
  min-height: 70px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(232, 179, 79, 0.22);
  border-radius: 6px;
  background: rgba(8, 6, 15, 0.48);
  padding: 10px;
}
.trade-offer-card span {
  color: var(--cream-dim);
  font-size: 12px;
}
.trade-offer-card strong {
  color: var(--cream);
  font-size: 14px;
}
.trade-offer-card small {
  color: var(--hp);
}
.trade-offer-card.confirmed small {
  color: var(--taunt);
}

.trade-actions {
  justify-content: flex-end;
}

.trade-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.trade-card-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.trade-card-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
.trade-card-button:hover:not(:disabled) .trade-card-preview {
  transform: translateY(-5px);
}
.trade-card-button.selected .trade-card-preview {
  outline: 2px solid var(--gold);
  box-shadow: 0 0 18px rgba(232, 179, 79, 0.45);
}

.trade-card-preview {
  display: block;
  width: auto;
}

@media (max-width: 980px) {
  .trade-layout {
    grid-template-columns: 1fr;
  }
}
