:root {
  --bg: #04050a;
  --panel: #0d101a;
  --accent: #43d1ff;
  --accent-soft: rgba(67, 209, 255, 0.12);
  --text: #f6f7fb;
  --muted: #8e9bbf;
  --loss: #ff7d9b;
  --win: #6af2b4;
  --border: rgba(255, 255, 255, 0.08);
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(67, 209, 255, 0.08), transparent 45%), var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  margin: 0 0 6px;
  color: var(--muted);
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.subtext {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(67, 209, 255, 0.3);
}

.ghost-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ghost-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.panel {
  background: var(--panel);
  border-radius: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.res-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.market-card h3 {
  margin: 0 0 12px;
}

.price-focus {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 12px;
}

.price-focus .price {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
}

.price-label {
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.live-feed {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-pill.ok {
  border-color: rgba(106, 242, 180, 0.6);
  color: var(--win);
}

.status-pill.error {
  border-color: rgba(255, 125, 155, 0.6);
  color: var(--loss);
}

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

.quote-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.quote-card.yes {
  border-color: rgba(106, 242, 180, 0.35);
}

.quote-card.no {
  border-color: rgba(255, 125, 155, 0.35);
}

.quote-card.flash-yes {
  box-shadow: 0 0 24px rgba(106, 242, 180, 0.5);
  background: rgba(106, 242, 180, 0.12);
}

.quote-card.flash-no {
  box-shadow: 0 0 24px rgba(255, 125, 155, 0.45);
  background: rgba(255, 125, 155, 0.12);
}

.quote-card p {
  margin: 0;
}

.quote-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.quote-value {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 4px;
}

.quote-size {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.chart-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 360px;
  display: flex;
}

.chart-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
}

.resolutions {
  margin-top: 10px;
}

.resolution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.resolution-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resolution-card.up {
  border-color: rgba(106, 242, 180, 0.5);
}

.resolution-card.down {
  border-color: rgba(255, 125, 155, 0.5);
}

.resolution-label {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.resolution-value {
  font-size: 1.6rem;
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.resolution-delta {
  font-size: 0.9rem;
  font-weight: 500;
}

.resolution-card.up .resolution-value {
  color: var(--win);
}

.resolution-card.down .resolution-value {
  color: var(--loss);
}

.resolution-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.positions-panel {
  margin-top: 24px;
}

.positions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.position-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.position-card h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.position-address {
  margin: 6px 0 12px;
  font-family: "Space Grotesk", monospace;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--text);
}

.position-metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.position-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.position-tag.live {
  border-color: rgba(106, 242, 180, 0.6);
  color: var(--win);
}

.position-tag.idle {
  border-color: rgba(255, 125, 155, 0.6);
  color: var(--loss);
}

.position-tag.error {
  border-color: rgba(255, 125, 155, 0.8);
  color: var(--loss);
}

.position-error {
  margin: 8px 0;
  font-size: 0.8rem;
  color: var(--loss);
}

.position-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  font-size: 0.85rem;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.position-line:first-of-type {
  border-top: none;
}

.position-line.match {
  color: var(--accent);
}

.position-line.flash-yes {
  animation: flashYes 1s ease;
}

.position-line.flash-no {
  animation: flashNo 1s ease;
}

@keyframes flashYes {
  0% {
    background: rgba(106, 242, 180, 0.25);
  }
  100% {
    background: transparent;
  }
}

@keyframes flashNo {
  0% {
    background: rgba(255, 125, 155, 0.25);
  }
  100% {
    background: transparent;
  }
}

.position-slug {
  overflow: hidden;
  text-overflow: ellipsis;
}

.position-side {
  font-weight: 600;
}

.position-qty {
  font-family: "Space Grotesk", monospace;
}

.error-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 125, 155, 0.1);
  border: 1px solid rgba(255, 125, 155, 0.4);
  font-size: 0.9rem;
  color: var(--loss);
  margin-bottom: 14px;
  display: none;
}

.error-banner.visible {
  display: block;
}

@media (max-width: 600px) {
  .live-feed {
    padding: 12px;
  }
  .quote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.positions-header {
  gap: 16px;
  flex-wrap: wrap;
}

.wallet-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.wallet-form input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  min-width: 240px;
}

.wallet-form button {
  border: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
