/* EGGFART v8 — Fluid Harmonics */

:root {
  --paper: #0f0f23;
  --ink: #e0e0f0;
  --bg: #1a1a2e;
  --muted: #6e6e8e;
  --highlight: #00d4aa;
  --accent: #7f00ff;
  --card: #16162a;
  --border: #2a2a3e;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  max-width: 100%;
  overflow-x: hidden;
}

.app-header {
  padding: 2rem 1.5rem;
  text-align: center;
}

.app-header .title {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.app-header .subtitle {
  color: var(--muted);
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.app-main {
  padding: 1.5rem;
}

.ecosystems {
  padding: 1rem 0;
}

.ecosystem-grid {
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

@media (min-width: 400px) {
  .ecosystem-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 600px) {
  .ecosystem-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 800px) {
  .ecosystem-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1000px) {
  .ecosystem-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

.ecosystem-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: 120px;
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ecosystem-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ecosystem-card:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.ecosystem-card .canvas-wrapper {
  width: 100%;
  height: 100%;
}

.ecosystem-card .label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.4rem;
  background: rgba(0,0,0,0.7);
  color: var(--ink);
  font-size: 0.7rem;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.controls {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.control-panel {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 80px;
}

.btn:hover {
  background: #6600e6;
}

.btn:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

.btn.minor {
  background: var(--muted);
  color: var(--paper);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
}

.btn.minor:hover {
  background: #5a5a7a;
}

.spacer {
  flex: 1;
}

.app-footer {
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.app-footer .dot {
  color: var(--highlight);
}

/* --- Ecosystem card canvas styling --- */

.ecosystem-card .canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  .ecosystem-card:hover {
    transform: none;
    box-shadow: none;
  }
}
