* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

header {
  grid-column: 1 / -1;
  padding: 1rem;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

header h1 { font-size: 1.2rem; }

/* Sidebar */
nav#sidebar {
  padding: 1rem;
  background: #16213e;
  border-right: 1px solid #0f3460;
  overflow-y: auto;
}

#new-list-btn {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #533483;
  border-radius: 4px;
  cursor: pointer;
}

#saved-lists { list-style: none; }

#saved-lists li {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#saved-lists li:hover { background: #0f3460; }
#saved-lists li.active { background: #533483; }

#saved-lists li .delete-btn {
  background: none;
  border: none;
  color: #e94560;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Main content */
main {
  padding: 1rem;
  overflow-y: auto;
  min-width: 0;
}

textarea#list-input {
  width: 100%;
  height: 300px;
  padding: 1rem;
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #0f3460;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
}

#submit-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 2rem;
  background: #533483;
  color: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#submit-btn:hover { background: #e94560; }

.error {
  color: #e94560;
  margin-top: 0.5rem;
}

/* Result cards */
#result-header {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #16213e;
  border-radius: 4px;
  border-left: 4px solid #533483;
}

.unit-card {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #16213e;
  border-radius: 4px;
  border-left: 4px solid #0f3460;
  overflow: hidden;
}

.unit-card h3 { margin-bottom: 0.5rem; }

.stat-line {
  font-family: monospace;
  font-size: 0.85rem;
  color: #a0a0a0;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.weapon {
  font-size: 0.85rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #0f3460;
  word-break: break-word;
}

.ability {
  font-size: 0.85rem;
  color: #c0a0e0;
  margin-top: 0.25rem;
}

.section-header {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #e94560;
  margin: 1.5rem 0 0.5rem;
  border-bottom: 1px solid #0f3460;
  padding-bottom: 0.25rem;
}

/* Mobile toggle button */
#sidebar-toggle {
  display: none;
  background: #0f3460;
  color: #e0e0e0;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 4px;
}

/* Mobile */
@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
  }

  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #sidebar-toggle { display: block; }

  nav#sidebar {
    display: none;
    border-right: none;
    border-bottom: 1px solid #0f3460;
  }

  nav#sidebar.open { display: block; }

  textarea#list-input { height: 200px; font-size: 16px; }

  .unit-card { padding: 0.75rem; }

  .stat-line { font-size: 0.75rem; }

  .weapon, .ability { font-size: 0.8rem; }
}
