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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

header {
  padding: 2rem 1.5rem 1rem;
  text-align: center;
  border-bottom: 2px solid #2a2a4e;
}

header h1 {
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  color: #fff;
}

header h1 span {
  color: #f5c542;
}

header p {
  margin-top: 0.4rem;
  color: #aaa;
  font-size: 0.95rem;
}

nav {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

nav a {
  color: #f5c542;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  transition: background 0.15s;
}

nav a:hover { background: #2a2a4e; }

main {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

/* ---------- index grid ---------- */

.intro {
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #ccc;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.type-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.55), 1px -1px 0 rgba(0,0,0,0.55),
               -1px  1px 0 rgba(0,0,0,0.55), 1px  1px 0 rgba(0,0,0,0.55);
  transition: transform 0.1s, opacity 0.1s;
}

.type-badge:hover { transform: translateY(-2px); opacity: 0.9; }

.type-badge.fire    { background: #e25822; }
.type-badge.water   { background: #1a78c2; }
.type-badge.grass   { background: #3d8c40; }
.type-badge.electric{ background: #c9a000; }
.type-badge.psychic { background: #c2185b; }
.type-badge.ice     { background: #3e9ea3; }
.type-badge.dragon  { background: #5e35b1; }
.type-badge.dark    { background: #37474f; }
.type-badge.fairy   { background: #ad1457; }
.type-badge.normal  { background: #78716c; }
.type-badge.fighting{ background: #b71c1c; }
.type-badge.flying  { background: #5c6bc0; }
.type-badge.poison  { background: #7b1fa2; }
.type-badge.ground  { background: #8d6e63; }
.type-badge.rock    { background: #6d6011; }
.type-badge.bug     { background: #558b2f; }
.type-badge.ghost   { background: #311b92; }
.type-badge.steel   { background: #455a64; }

.featured-link {
  display: inline-block;
  margin: 0.3rem 0.3rem 0 0;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  color: #fff;
  letter-spacing: 0.04em;
  transition: filter 0.15s;
}

.featured-link:hover { filter: brightness(1.15); }
.featured-link.fire  { background: #e25822; }
.featured-link.water { background: #1a78c2; }

/* ---------- type detail page ---------- */

.type-hero {
  border-radius: 14px;
  padding: 2rem;
  margin-bottom: 2rem;
  color: #fff;
}

.type-hero.fire  { background: linear-gradient(135deg, #e25822, #ff8c00); }
.type-hero.water { background: linear-gradient(135deg, #1a78c2, #00bcd4); }

.type-hero h2 { font-size: 2.2rem; margin-bottom: 0.3rem; }
.type-hero p  { opacity: 0.9; font-size: 1rem; line-height: 1.6; }

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin: 1.8rem 0 0.8rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: -1px -1px 0 rgba(0,0,0,0.55), 1px -1px 0 rgba(0,0,0,0.55),
               -1px  1px 0 rgba(0,0,0,0.55), 1px  1px 0 rgba(0,0,0,0.55);
}

.tag.fire    { background: #e25822; }
.tag.water   { background: #1a78c2; }
.tag.grass   { background: #3d8c40; }
.tag.electric{ background: #c9a000; }
.tag.psychic { background: #c2185b; }
.tag.ice     { background: #3e9ea3; }
.tag.dragon  { background: #5e35b1; }
.tag.rock    { background: #6d6011; }
.tag.ground  { background: #8d6e63; }
.tag.bug     { background: #558b2f; }
.tag.steel   { background: #455a64; }
.tag.flying  { background: #5c6bc0; }
.tag.ghost   { background: #311b92; }
.tag.fairy   { background: #ad1457; }
.tag.normal  { background: #78716c; }
.tag.dark    { background: #37474f; }
.tag.poison  { background: #7b1fa2; }
.tag.fighting{ background: #b71c1c; }
.tag.neutral { background: #444; }

.pokemon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.poke-card {
  background: #16213e;
  border: 1px solid #2a2a4e;
  border-radius: 10px;
  padding: 1rem;
}

.poke-card .name {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.poke-card .desc {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.5;
}

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  color: #f5c542;
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover { text-decoration: underline; }

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #555;
  font-size: 0.82rem;
  border-top: 1px solid #2a2a4e;
  margin-top: 3rem;
}
