@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Instrument+Serif:ital@0;1&family=DM+Sans:wght@300;400;500&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #0c0c0e;
  color: #e8e6e0;
  min-height: 100vh;
}

.app {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: 1200px;
  margin: 36px auto;
}

/* Top Bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
}

.topbar h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 2.4rem;
  font-weight: 400;
  font-style: italic;
  color: #e8e6e0;
  letter-spacing: -0.5px;
  line-height: 1;
}

.topbar h1::after {
  content: '.';
  color: #4ade80;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons */
button {
  padding: 10px 18px;
  border-radius: 8px;
  border: 0.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #e8e6e0;
  cursor: pointer;
  font-weight: 400;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.2px;
}

button:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.25);
}

button:active {
  transform: scale(0.98);
}

#connectWallet {
  background: #e8e6e0;
  color: #0c0c0e;
  border-color: transparent;
  font-weight: 500;
}

#connectWallet:hover {
  background: #fff;
  border-color: transparent;
}

.secondary-btn {
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.12);
  color: #7a7a74;
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #e8e6e0;
}

/* Cards */
.card {
  background: #141416;
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: none;
  box-shadow: none;
}

/* Hero Grid */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.wallet-card h2,
.market-card h2 {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4a4a44;
  margin-bottom: 16px;
}

.wallet-card p,
.market-card p {
  font-size: 13px;
  color: #6a6a64;
  margin-top: 6px;
  font-family: 'DM Mono', monospace;
}

#walletAddress {
  font-size: 13px;
  color: #9a9a94;
}

#balance {
  font-family: 'DM Mono', monospace;
  font-size: 26px !important;
  color: #e8e6e0 !important;
  letter-spacing: -0.5px;
  margin-top: 8px !important;
}

#lastUpdated {
  font-size: 11px !important;
  color: #4a4a44 !important;
}

#marketStatus {
  font-size: 12px !important;
  color: #4ade80 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px !important;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4a4a44;
}

/* Crypto Grid */
.crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.coin-box {
  background: #0c0c0e;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 0.5px solid rgba(255,255,255,0.06);
  transition: border-color 0.2s, background 0.2s;
}

.coin-box:hover {
  background: #141416;
  border-color: rgba(255,255,255,0.12);
  transform: none;
}

.coin-box h3 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 3px;
  color: #e8e6e0;
}

.coin-box p {
  color: #4a4a44;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.price-wrap {
  text-align: right;
  font-weight: 500;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #e8e6e0;
  letter-spacing: -0.3px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  min-height: 400px;
}

#btcChart {
  width: 100%;
  max-height: 300px;
  margin-top: 8px;
}

/* Portfolio */
.portfolio-card h2 {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4a4a44;
}

.form-group {
  margin-bottom: 10px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  color: #4a4a44;
  font-family: 'DM Mono', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 0.5px solid rgba(255,255,255,0.07);
  outline: none;
  background: #0c0c0e;
  color: #e8e6e0;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  transition: border-color 0.15s;
}

input:focus {
  border-color: rgba(255,255,255,0.2);
  box-shadow: none;
}

input::placeholder {
  color: #2a2a24;
}

.portfolio-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}

#calculateBtn {
  background: #e8e6e0;
  color: #0c0c0e;
  border-color: transparent;
  font-weight: 500;
}

#calculateBtn:hover {
  background: #fff;
}

/* Portfolio Results */
.portfolio-results {
  border-top: 0.5px solid rgba(255,255,255,0.06);
  padding-top: 14px;
}

.portfolio-results p {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #4a4a44;
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
}

.portfolio-results h3 {
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  color: #e8e6e0;
  margin-top: 12px;
  letter-spacing: -0.5px;
}

/* Price colors */
.price-up { color: #4ade80; }
.price-down { color: #f87171; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar h1 { font-size: 1.8rem; }
  .app { width: 95%; margin: 20px auto; }
}
