* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: linear-gradient(160deg, #eef1f6 0%, #e4e9f2 100%);
  margin: 0;
  padding: clamp(12px, 4vw, 24px);
  overflow-x: hidden;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  min-width: 0;
}

.cash-bar {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, 0.12);
  padding: 16px;
  margin-bottom: 16px;
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  color: #0f172a;
  text-align: center;
}

.flash {
  background: #fff8c5;
  border: 1px solid #d4a72c;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, 0.12);
  padding: 18px 12px;
  text-align: center;
  min-width: 0;
}

@media (min-width: 640px) {
  .card {
    padding: 32px 28px;
  }
}

h1 {
  margin: 0 0 4px 0;
  font-size: clamp(0.95rem, 3.6vw, 1.4rem);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.symbol {
  color: #94a3b8;
  font-weight: 500;
  font-size: clamp(0.72rem, 2.6vw, 0.95rem);
}

.price {
  font-size: clamp(1.25rem, 6vw, 2.25rem);
  font-weight: 700;
  margin: 12px 0 18px 0;
  color: #0f172a;
  overflow-wrap: break-word;
}

.stats {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 18px;
  text-align: left;
}

.stats td {
  padding: 6px 2px;
  border-bottom: 1px solid #eef0f4;
  color: #475569;
  font-size: clamp(0.68rem, 2.4vw, 0.92rem);
  word-break: break-word;
}

.stats tr:last-child td {
  border-bottom: none;
}

.stats td:last-child {
  text-align: right;
  font-weight: 600;
  color: #0f172a;
}

.gain {
  color: #15803d;
}

.loss {
  color: #dc2626;
}

.actions {
  display: inline-block;
  width: 48%;
}

.actions:first-of-type {
  margin-right: 4%;
}

button {
  width: 100%;
  padding: 10px 4px;
  font-size: clamp(0.7rem, 2.6vw, 0.95rem);
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.buy {
  background: #16a34a;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

button.buy:hover {
  background: #15803d;
}

button.sell {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

button.sell:hover {
  background: #b91c1c;
}

.footnote {
  margin-top: 8px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.78rem;
}
