/* Launchpad styles. No framework, no webfonts, no JavaScript. */

:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --fg: #f4f7fb;
  --muted: #b7c2ce;
  --card: #161d27;
  --card-press: #222b38;
  --line: #314053;
  --accent: #9ec0ff;
  --strong: #9ed9a8;
  --weak: #f3b0ad;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  max-width: 28rem;
  margin: 0 auto;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.9rem, env(safe-area-inset-right))
    max(2rem, env(safe-area-inset-bottom))
    max(0.9rem, env(safe-area-inset-left));
}

h1 {
  margin: 0.2rem 0 0.85rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 1.05rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

nav > section:first-child h2 {
  margin-top: 0.15rem;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.hit,
summary {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  background: var(--card);
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

summary {
  cursor: pointer;
  gap: 0.75rem;
}

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

summary::marker {
  content: "";
}

summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-left: auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-0.12rem) rotate(45deg);
}

details[open] > summary::after {
  transform: translateY(0.12rem) rotate(-135deg);
}

.hit:hover,
summary:hover {
  background: #1c2531;
}

.hit:active,
summary:active {
  background: var(--card-press);
}

.hit:focus-visible,
summary:focus-visible,
.back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

details {
  display: grid;
  gap: 0.4rem;
}

/* Author `ul { display: grid }` would otherwise beat the browser's closed-details rule. */
details:not([open]) > :not(summary) {
  display: none;
}

.nest {
  margin-left: 0.7rem;
  padding-left: 0.55rem;
  border-left: 2px solid var(--line);
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: 0.15rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.note {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.type {
  margin: 0 0 0.7rem;
  padding: 0.7rem 0.75rem 0.75rem;
  border-radius: 0.8rem;
  background: var(--card);
}

.type h2 {
  margin: 0 0 0.55rem;
  color: var(--fg);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.match {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  align-items: start;
  gap: 0.35rem 0.45rem;
  margin: 0.4rem 0 0;
}

.k {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-top: 0.28rem;
}

.k.strong {
  color: var(--strong);
}

.k.weak {
  color: var(--weak);
}

/* Type chips. Colors match the Pokémon GO palette from type_icons_page. */
.t-bug { --c: #92bc2c; }
.t-dark { --c: #595761; }
.t-dragon { --c: #0c69c8; }
.t-electric { --c: #f2d94e; }
.t-fairy { --c: #ee90e6; }
.t-fighting { --c: #d3425f; }
.t-fire { --c: #fba54c; }
.t-flying { --c: #a1bbec; }
.t-ghost { --c: #5f6dbc; }
.t-grass { --c: #5fbd58; }
.t-ground { --c: #da7c4d; }
.t-ice { --c: #75d0c1; }
.t-normal { --c: #a0a29f; }
.t-poison { --c: #b763cf; }
.t-psychic { --c: #fa8581; }
.t-rock { --c: #c9bb8a; }
.t-steel { --c: #5695a3; }
.t-water { --c: #539ddf; }

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: #d7dee7;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.1;
}

.mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.28rem;
  background: var(--c);
}

.mark img {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  filter: drop-shadow(0 0 0.45px rgba(0, 0, 0, 0.75));
}

.type h2 .chip {
  gap: 0.45rem;
  color: var(--fg);
  font-size: 1.15rem;
  font-weight: 700;
}

.type h2 .mark {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.42rem;
}

.type h2 .mark img {
  width: 1.2rem;
  height: 1.2rem;
}

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