html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 3rem;
  width: 100%;
  box-sizing: border-box;
  height: calc(100vh - 70px);
  overflow: hidden;
  min-height: 0;
}

.profile-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  background: var(--color-surface);
  padding: 2rem 2.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

#profile-content {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.left-column {
  flex: 0 0 75%;
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}


.right-column {
  flex: 0 0 25%;
  max-width: 25%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}


.details-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  padding: 1rem;
  border-radius: 12px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#investmentDetailsContainer {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}


.user-skin {
  width: 96px;
  height: 96px;
  border-radius: 8px;
}

.user-name {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.floating-logout {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.floating-logout:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.coin-list.compact {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin-top: 0rem;
}

.coin-list.compact .coin-item {
  font-size: 0.9rem;
  padding: 0.2rem 0.5rem;
  border-left: none;
  border-radius: 6px;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  white-space: nowrap;
}

.coin-list.compact .coin-item span {
  font-size: 1.32rem;
  margin-bottom: 0.2rem;
}

.coin-list.compact .coin-item strong {
  font-size: 1.32rem;
  color: inherit;
}

.profile-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.profile-grid.flipped {
  grid-template-columns: 1fr 1fr;
}

.details-section {
  background: var(--color-surface);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}


.chart-section {
  margin-top: -1.92rem;
  background: var(--color-surface);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chart-container {
  flex: 1;
  position: relative;
  height: 100%;
  max-height: 530px;
}

.chart-container canvas {
  height: 100% !important;
  width: 100% !important;
  margin-bottom: 0.6rem;
}

.chart-placeholder,
#investmentPlaceholder {
  text-align: center;
  font-style: italic;
  color: var(--color-muted);
  padding: 1rem 1;
  font-size: 0.95rem;
}

.investment-item {
  background: var(--color-surface);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.3rem;
  min-height: unset;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  position: relative;
  color: var(--color-text);
}

.investment-item.positive {
  border-left: 4px solid #4CAF50;
}

.investment-item.negative {
  border-left: 4px solid #e74c3c;
}

.investment-item .player {
  margin-top: 0rem;
  font-weight: bold;
  margin-bottom: 0rem;
}

.investment-item .info-line {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0rem;
}

.sell-button {
  background: var(--color-accent);
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  margin-top: auto;
  cursor: pointer;
  align-self: flex-end;
  transition: background 0.2s;
  margin-bottom: 0rem;
}

.sell-button:hover:enabled {
  background-color: var(--color-accent-strong);
}

.sell-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.invest-button {
  padding: 0.8rem 2rem;
  font-size: 1.4rem;
  background-color: var(--color-accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.footer-link {
  color: var(--color-muted);
  margin-left: 1rem;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-accent);
}

.investment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

span.positive { color: #4CAF50; }
span.negative { color: #e74c3c; }
span.neutral  { color: #f1c40f; }

#logoutButton {
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  background-color: var(--color-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: inline-block;
}
#logoutButton:hover {
  background-color: var(--color-accent-strong);
}

#portfolioBalance {
  color: inherit;
}
