/* Simple reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Page layout */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    sans-serif;
  background: radial-gradient(circle at top, #e0edff, transparent 55%),
    radial-gradient(circle at bottom, #fde7ff, transparent 55%), #f3f4f6;
  color: #0f172a;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Card container */
.card {
  max-width: 480px;
  width: 100%;
  padding: 1.8rem 1.6rem 2rem;
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.16), transparent 55%),
    radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.12), transparent 55%),
    #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0 0 1.4rem;
  color: #6b7280;
  font-size: 0.96rem;
}

/* Controls row: dropdown + toggle */
.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

/* Label + field wrapper */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.field-label {
  font-weight: 500;
  color: #4b5563;
}

/* Select styling to match the pill button vibe a bit */
#asset-select {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 0.9rem;
  outline: none;
}

#asset-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.18);
}

/* Inline checkbox + label */
.field--inline-toggle {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

/* Colored checkbox (modern browsers) */
.field--inline-toggle input[type="checkbox"] {
  accent-color: #6366f1;
}

/* Button */
button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.6rem 1.3rem;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #a855f7);
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.35);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.45);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

/* Result box */
.result {
  margin-top: 1.5rem;
  padding: 1rem 0.9rem;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
  min-height: 3rem;
}

/* Chart wrapper under the result */
.chart-wrapper {
  margin-top: 1.4rem;
  padding-top: 0.4rem;
}

.chart-wrapper canvas {
  width: 100%;
  max-width: 100%;
  display: block;
}

/* Portfolio box */
.portfolio-box {
  margin-top: 1.4rem;
  padding: 1rem 0.9rem;
  background: #f9fafb;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}

.portfolio-box h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.portfolio-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.portfolio-field input {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
}

.portfolio-field input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Muted text */
.muted {
  margin: 0;
  color: #9ca3af;
}

/* 24h change colors: green if positive, red if negative */
.change-positive {
  color: #16a34a;
  font-weight: 500;
}

.change-negative {
  color: #dc2626;
  font-weight: 500;
}

.chart-wrapper {
  margin-top: 1.4rem;
  padding-top: 0.4rem;
  height: 220px; /* 👈 REQUIRED */
}

/* -------------------------------------
   Responsive tweaks
   ------------------------------------- */

/* Small screens (iPhone SE, etc.): stack controls + softer spacing */
@media (max-width: 420px) {
  .card {
    padding: 1.5rem 1.25rem 1.7rem;
    border-radius: 18px;
  }

  .card h1 {
    font-size: 1.4rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  button {
    width: 100%;
    text-align: center;
  }
}

/* Larger screens: give the card more presence (Dribbble style) */
@media (min-width: 768px) {
  .card {
    max-width: 520px;
    padding: 2.1rem 2rem 2.4rem;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.14);
  }

  .card h1 {
    font-size: 1.8rem;
  }
}