:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-2: #222226;
  --text: #f3f4f6;
  --muted: #a4a4aa;
  --accent: #b3122f;
  --accent-2: #7f0d21;
  --border: #323238;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  line-height: 1.6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(14, 14, 16, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(179, 18, 47, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: var(--transition);
  position: relative;
}

nav a:hover {
  background: var(--surface-2);
  color: var(--accent);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
  transform: translateX(-50%);
}

nav a:hover::after {
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.panel {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.panel:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.panel-header {
  padding: 2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.panel-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.panel-header p {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.card-content {
  padding: 1.5rem;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

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

/* Battle Detail Styles */
.battle-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.battle-info {
  text-align: center;
  max-width: 400px;
}

.battle-info h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.battle-info p {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.trainer-image-container {
  margin-bottom: 1rem;
}

.trainer-image {
  max-width: 150px;
  height: auto;
  border-radius: 12px;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.trainer-image:hover {
  transform: scale(1.05);
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.button:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(179, 18, 47, 0.3);
}

.team-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding: 2rem;
}

.pokemon-card {
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: var(--transition);
}

.pokemon-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pokemon-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pokemon-sprite {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.pokemon-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.subtext {
  font-size: 0.875rem;
  color: var(--muted);
}

.pokemon-meta {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: default;
  user-select: none;
}

.move-list li {
  cursor: default;
}

.ability-badge,
.item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 0.5rem;
  gap: 0.25rem;
}

.ability-badge {
  font-size: 0.75rem;
  font-weight: 600;
}

.ability-badge:hover,
.item-badge:hover {
  background: rgba(255, 255, 255, 0.12);
}

.item-sprite {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}
.move-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.move-list li {
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.move-list li:hover {
  background: var(--surface);
  border-color: var(--accent);
}

/* Pokedex Styles */
.poke-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.poke-card {
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.poke-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.sprite {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.sprite:hover {
  transform: scale(1.1);
}

.dex {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.poke-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.poke-head {
  margin-bottom: 1rem;
}

/* Encounters Styles */
.encounters-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.block {
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 2rem;
  transition: var(--transition);
}

.block:hover {
  border-color: var(--accent);
}

.block h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
}

.table tr:hover {
  background: var(--surface);
}

/* Search and Filters */
.search-container {
  margin-bottom: 2rem;
  text-align: center;
}

#search {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 18, 47, 0.1);
}

#search::placeholder {
  color: var(--muted);
}

/* Loading States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  nav ul {
    justify-content: center;
    flex-wrap: wrap;
  }

  .container {
    padding: 1rem;
  }

  .panel-header {
    padding: 1.5rem;
  }

  .panel-header h2 {
    font-size: 1.5rem;
  }

  .grid,
  .poke-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .battle-header {
    flex-direction: column;
    text-align: center;
  }

  .trainer-image {
    max-width: 120px;
  }

  .pokemon-card-header {
    flex-direction: column;
    text-align: center;
  }
}
}

.brand h1 {
  margin: 0;
  font-size: 1rem;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

nav a:hover {
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
}

.panel-header h2 {
  margin: 0;
}

.panel-header p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.hero h2 {
  margin-top: 0;
}

.hero p {
  color: var(--muted);
}

.menu-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.menu-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #141417;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.menu-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.menu-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.menu-card p {
  margin: 0;
  color: var(--muted);
}

.controls {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

input,
select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

#search {
  flex: 1;
  min-width: 210px;
}

.grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: start;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #141417;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
}

.card summary::-webkit-details-marker {
  display: none;
}

.sprite {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
}

/* Accordion Styles */
.accordion {
  margin-top: 2rem;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  background: var(--surface-2);
  border: none;
  padding: 1.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
}

.accordion-header:hover {
  background: var(--surface);
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.accordion-icon {
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.accordion-content {
  display: none;
  padding: 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

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

.types {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: var(--surface-2);
}

.card-content {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.89rem;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.stat-grid span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 500;
}

.stack {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.block {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.block h3 {
  margin: 0;
  padding: 0.75rem;
  background: #131316;
  border-bottom: 1px solid var(--border);
}

.footer {
  color: var(--muted);
  text-align: center;
  padding: 1.2rem;
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    flex-wrap: wrap;
  }
}

.trainer-image-container {
  text-align: center;
  margin: 1rem 0;
}

.trainer-image {
  max-width: 200px;
  height: auto;
  border-radius: 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.battle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.battle-info h2 {
  margin: 0;
}

.battle-info p {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
}

.battle-info {
  text-align: center;
}

.button {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: rgba(179, 18, 47, 0.9);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pokemon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pokemon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.pokemon-sprite {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
}

.pokemon-card-header h3 {
  margin: 0;
}

.subtext {
  color: var(--muted);
  font-size: 0.9rem;
}

.pokemon-meta {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.move-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.move-list li {
  padding: 0.3rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f4f6;
}
