/* ==========================================================================
   MAPokemon 2026 - shared design system
   Lightweight, static, no build step. One stylesheet for every page.
   ========================================================================== */

:root {
  --navy: #131a2e;
  --navy-2: #1d2742;
  --ink: #11151f;
  --slate: #51607a;
  --line: #e3e8f0;
  --paper: #f6f8fc;
  --white: #ffffff;

  --go: #2bb673;        /* GO green */
  --go-dark: #1d9c5e;
  --teal: #20bfd0;
  --blue: #3b6fe0;
  --berry: #ef4b6c;     /* pokeball red */
  --gold: #ffce4a;
  --violet: #7a5cff;

  --strong: #2bb673;
  --neutral: #8a94a6;
  --weak: #ef6a4b;
  --double-weak: #c63d2c;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 6px rgba(19, 26, 46, 0.06);
  --shadow: 0 14px 34px rgba(19, 26, 46, 0.10);
  --shadow-lg: 0 26px 60px rgba(19, 26, 46, 0.16);

  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: min(1160px, calc(100% - 36px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(43, 182, 115, 0.08), transparent 60%),
    radial-gradient(1000px 520px at -10% 0%, rgba(59, 111, 224, 0.08), transparent 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--blue); }

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0 0 1em; }

button, input, select { font: inherit; }
button { cursor: pointer; }

.kicker {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--go-dark);
  margin: 0 0 0.5em;
}

.muted { color: var(--slate); }

.wrap { width: var(--wrap); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 248, 252, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  width: var(--wrap);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 132px; height: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}
.site-nav a:hover,
.site-nav a:focus-visible { background: rgba(43, 182, 115, 0.14); color: var(--go-dark); }
.site-nav a.active { background: var(--navy); color: #fff; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 0;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.button img { width: 22px; height: 22px; }
.button-primary { background: var(--go); color: #08321f; box-shadow: var(--shadow-sm); }
.button-primary:hover { background: var(--go-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.button-secondary { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 2px var(--line); }
.button-secondary:hover { box-shadow: inset 0 0 0 2px var(--go); transform: translateY(-2px); }

/* ---------- generic section ---------- */
main { display: block; }
.section { width: var(--wrap); margin: 0 auto; padding: 46px 0; }
.section-head { max-width: 720px; margin-bottom: 26px; }
.section-head p { color: var(--slate); margin-bottom: 0; }

/* ---------- hero ---------- */
.hero {
  width: var(--wrap);
  margin: 26px auto 8px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-copy h1 { margin-bottom: 0.3em; }
.hero-copy .lede { font-size: 1.15rem; color: var(--slate); max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.hero-card {
  position: relative;
  background: linear-gradient(160deg, var(--navy), var(--navy-2));
  border-radius: 24px;
  padding: 26px;
  color: #eaf0ff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 120% at 70% 10%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 120% at 70% 10%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-card .kicker { color: var(--gold); }
.hero-card h3 { color: #fff; position: relative; z-index: 1; }
.hero-card p { color: #b8c4e0; position: relative; z-index: 1; }
.hero-pins { position: relative; z-index: 1; display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.hero-pins img { width: 46px; height: 46px; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35)); }

/* ---------- card grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.card h3 { margin-bottom: 0.3em; }
.card p { color: var(--slate); margin-bottom: 0; font-size: 0.98rem; }
.card img.icon { width: 44px; height: 44px; margin-bottom: 12px; }

/* tool cards (links) */
a.tool-card { text-decoration: none; display: block; position: relative; }
a.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--go); }
a.tool-card .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--go-dark); font-weight: 600; font-size: 0.95rem; }
a.tool-card.featured-tool {
  grid-column: span 2;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(43, 182, 115, 0.16), transparent 55%),
    var(--white);
  border-color: rgba(43, 182, 115, 0.35);
}
.tool-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(43, 182, 115, 0.14);
  color: var(--go-dark);
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 700;
}
a.tool-card.accent-blue:hover { border-color: var(--blue); }
a.tool-card.accent-blue .go { color: var(--blue); }
a.tool-card.accent-berry:hover { border-color: var(--berry); }
a.tool-card.accent-berry .go { color: var(--berry); }
a.tool-card.accent-violet:hover { border-color: var(--violet); }
a.tool-card.accent-violet .go { color: var(--violet); }
a.tool-card.accent-teal:hover { border-color: var(--teal); }
a.tool-card.accent-teal .go { color: var(--teal); }
a.tool-card.accent-gold:hover { border-color: var(--gold); }

/* ---------- matchup tool ---------- */
.tool {
  width: var(--wrap);
  margin: 26px auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.tool-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 26px; align-items: stretch; }
.matchup-form { display: grid; gap: 14px; align-content: start; }
.matchup-form label { display: grid; gap: 6px; font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.matchup-form select {
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 40px 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2351607a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  font-weight: 600;
  color: var(--ink);
}
.matchup-form select:focus-visible { outline: 3px solid rgba(59,111,224,0.35); border-color: var(--blue); }

.matchup-output {
  background: linear-gradient(160deg, var(--navy), var(--navy-2));
  color: #eaf0ff;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.metric-label { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
#matchupResult { font-family: var(--display); font-size: 1.55rem; font-weight: 700; color: #fff; margin: 6px 0 8px; line-height: 1.2; }
#matchupExplanation { color: #b8c4e0; font-size: 0.96rem; margin-bottom: 14px; }
.type-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip-row span {
  padding: 6px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 700;
}
.chip-strong { background: rgba(43,182,115,0.22); color: #7df5b8; }
.chip-neutral { background: rgba(255,255,255,0.12); color: #d7deef; }
.chip-weak { background: rgba(239,106,75,0.22); color: #ffb59f; }
.note { color: var(--slate); font-size: 0.92rem; margin: 16px 0 0; }
.reviewed {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(59, 111, 224, 0.09);
  color: var(--blue) !important;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 2px;
}

/* ---------- type grid ---------- */
.grid-scroll {
  width: max-content; max-width: 100%; margin-inline: auto;
  overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm);
}
table.type-grid { border-collapse: separate; border-spacing: 0; width: max-content; font-size: 12px; }
table.type-grid th, table.type-grid td { text-align: center; padding: 0; }
table.type-grid thead th {
  position: sticky; top: 0;
  background: var(--navy); color: #fff; font-family: var(--display); font-weight: 600;
  padding: 8px 5px; font-size: 11px; z-index: 2;
}
table.type-grid thead th:first-child { left: 0; z-index: 3; }
table.type-grid tbody th {
  background: var(--navy); color: #fff; font-family: var(--display); font-weight: 600;
  padding: 6px 9px; text-align: right; white-space: nowrap; position: sticky; left: 0; z-index: 1;
}
table.type-grid td { width: 38px; height: 34px; font-weight: 700; color: #1c2233; border: 1px solid #fff; }
.cell-2 { background: #2bb673; color: #06311e; }      /* super effective */
.cell-1 { background: #eef1f6; color: #9aa3b4; }       /* neutral */
.cell-0625 { background: #ffd9cd; color: #9e3b22; }    /* not very effective */
.cell-039 { background: #f4a08c; color: #5e1d0c; }     /* double resist */
.grid-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 0.85rem; color: var(--slate); }
.grid-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* ---------- data tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
table.data { border-collapse: collapse; width: 100%; min-width: 520px; }
table.data caption { text-align: left; padding: 14px 18px; font-family: var(--display); font-weight: 600; color: var(--navy); }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.96rem; }
table.data thead th { background: var(--paper); color: var(--navy); font-family: var(--display); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(59,111,224,0.04); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: rgba(43,182,115,0.16); color: var(--go-dark); }
.pill.km1 { background: rgba(43,182,115,0.16); color: var(--go-dark); }
.pill.km3 { background: rgba(59,111,224,0.14); color: var(--blue); }
.pill.km5 { background: rgba(122,92,255,0.16); color: var(--violet); }
.pill.km20 { background: rgba(239,75,108,0.14); color: var(--berry); }

/* ---------- info columns / lists ---------- */
.info-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.info-columns article { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.info-columns ul { margin: 0; padding-left: 18px; color: var(--slate); }
.info-columns li { margin-bottom: 8px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---------- checklist ---------- */
.checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.checklist label {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; font-weight: 600; color: var(--navy); cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.checklist label:hover { border-color: var(--go); }
.checklist input { width: 20px; height: 20px; accent-color: var(--go); flex: none; }
.checklist input:checked + span { color: var(--slate); text-decoration: line-through; }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.faq summary { font-family: var(--display); font-weight: 600; color: var(--navy); cursor: pointer; padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--go-dark); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { color: var(--slate); margin-top: 0; }

/* ---------- links grid ---------- */
.link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.link-grid a {
  display: block; text-decoration: none; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; color: var(--slate); font-size: 0.92rem;
  box-shadow: var(--shadow-sm); transition: transform 140ms ease, box-shadow 140ms ease;
}
.link-grid a span { display: block; font-family: var(--display); font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.link-grid a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------- ads ----------
   Containers stay invisible until AdSense reports a filled ad.
   app.js adds .ad-filled when a slot fills, or hides the container when it doesn't. */
.ad-band { width: var(--wrap); margin: 0 auto; text-align: center; }
.ad-band.ad-filled { margin: 22px auto; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.5); }
.ad-panel { border-radius: var(--radius); }
.ad-panel.ad-filled { background: var(--white); border: 1px solid var(--line); padding: 14px; box-shadow: var(--shadow-sm); }
.ad-band > span, .ad-panel > span {
  display: none; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #9aa3b4; margin-bottom: 6px;
}
.ad-band.ad-filled > span, .ad-panel.ad-filled > span { display: block; }

/* ---------- support / cross-promo strip ---------- */
.support-strip {
  width: var(--wrap); margin: 30px auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  align-items: center; background: linear-gradient(160deg, var(--navy), var(--navy-2));
  border-radius: 22px; padding: 30px; color: #eaf0ff; box-shadow: var(--shadow-lg);
}
.support-strip h2 { color: #fff; }
.support-strip p { color: #b8c4e0; margin-bottom: 0; }
.support-strip.ad-empty { grid-template-columns: 1fr; }

/* related tools strip */
.related { width: var(--wrap); margin: 10px auto 0; padding: 30px 0; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 30px; border-top: 1px solid var(--line);
  background: var(--white);
}
.site-footer .inner { width: var(--wrap); margin-inline: auto; padding: 30px 0; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 26px; }
.site-footer img.flogo { width: 128px; margin-bottom: 12px; }
.site-footer p { color: var(--slate); font-size: 0.9rem; }
.site-footer h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--slate); margin-bottom: 0.7em; }
.site-footer nav { display: grid; gap: 7px; }
.site-footer nav a { color: var(--navy); text-decoration: none; font-weight: 500; font-size: 0.94rem; }
.site-footer nav a:hover { color: var(--go-dark); }
.footer-legal { width: var(--wrap); margin-inline: auto; padding: 16px 0 30px; border-top: 1px solid var(--line); color: #9aa3b4; font-size: 0.82rem; }

/* ---------- breadcrumb ---------- */
.crumb { width: var(--wrap); margin: 18px auto 0; font-size: 0.86rem; color: var(--slate); }
.crumb a { color: var(--slate); text-decoration: none; }
.crumb a:hover { color: var(--go-dark); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .link-grid { grid-template-columns: repeat(2, 1fr); }
  .support-strip { grid-template-columns: 1fr; }
  .site-footer .inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .ad-band,
  .ad-panel {
    display: none !important;
  }
  .support-strip {
    margin: 20px auto;
    padding: 22px;
  }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .grid-4, .grid-3, .grid-2, .info-columns, .checklist, .link-grid { grid-template-columns: 1fr; }
  a.tool-card.featured-tool { grid-column: auto; }
  .tool-badge { position: static; width: max-content; margin-bottom: 10px; }
  .site-header .bar { flex-direction: column; gap: 6px; align-items: stretch; padding: 8px 0 0; }
  .brand { justify-content: center; }
  .brand img { width: 108px; }
  .site-nav {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding: 3px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 0.9rem;
  }
  .site-footer .inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
