/* Pets section: the "meadow" look (D16): a cartoony outdoors, like a child's
   digital drawing. Link after /assets/css/base.css, which holds the core
   meadow tokens. James approved the direction (Q19); _meadow.html is the sample. */

:root {
  --meadow-sky-top: #7cc8ff;
  --meadow-flower: #ff8fb8;
  --meadow-water: #5bb8e8;
  --meadow-grass-3: #3d8a2e;
  --meadow-paper: #fffbea;
  /* rarity tints of the bot's embed colours (bot/constants.py); ink text stays readable */
  --rarity-0: #e4c9f2;
  --rarity-1: #e1e6e7;
  --rarity-2: #c6efd5;
  --rarity-3: #cfe2fb;
  --rarity-4: #ffe79a;
  --wobble: 18px 24px 16px 26px / 22px 16px 26px 18px;
}

.meadow {
  margin: 0;
  min-height: 100vh;
  color: var(--meadow-ink);
  font-family: var(--font-label);
  font-size: 18px;
  line-height: 1.45;
  background:
    linear-gradient(var(--meadow-sky-top), var(--meadow-sky) 200px, var(--meadow-grass) 200px);
}

.meadow a { color: var(--meadow-ink); }
.meadow h1, .meadow h2 { font-family: var(--font-display); font-weight: normal; letter-spacing: .02em; margin: 0; }

/* Hand-drawn box: thick ink outline, uneven corners, flat offset shadow. */
.doodle {
  background: var(--meadow-cloud);
  border: 3px solid var(--meadow-ink);
  border-radius: var(--wobble);
  box-shadow: 4px 5px 0 rgba(43, 42, 51, .85);
  padding: 16px 18px;
}
.doodle.paper { background: var(--meadow-paper); }
.doodle-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -16px -18px 14px; padding: 6px 14px;
  background: var(--meadow-sun);
  border-bottom: 3px solid var(--meadow-ink);
  border-radius: 15px 21px 0 0 / 19px 13px 0 0;
  font-weight: 700;
}

.meadow-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 60px; }

/* Sky scene with sun, clouds and a grassy hill (inline SVG in the page). */
.scene { position: relative; height: 220px; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-title { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%) rotate(-2deg); text-align: center; white-space: nowrap; }
.scene-title h1 { font-size: clamp(30px, 8vw, 46px); color: var(--meadow-cloud); text-shadow: 3px 3px 0 var(--meadow-ink), -1px -1px 0 var(--meadow-ink), 1px -1px 0 var(--meadow-ink), -1px 1px 0 var(--meadow-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; background: var(--meadow-cloud);
  border: 2px solid var(--meadow-ink); border-radius: 14px 18px 12px 16px;
  font-size: 16px;
}
.chip b { font-weight: 700; }
.rarity { color: var(--meadow-ink); }
.holo { background: linear-gradient(90deg, #ffd1e8, #fff3b0, #c9f7d4, #cfe6ff, #e6d2ff); }
.rarity-0 { background: var(--rarity-0); }
.rarity-1 { background: var(--rarity-1); }
.rarity-2 { background: var(--rarity-2); }
.rarity-3 { background: var(--rarity-3); }
.rarity-4 { background: var(--rarity-4); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* Featured pet */
.pet-card { text-align: center; }
.pet-card img { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto 8px;
  background: radial-gradient(circle at 50% 60%, var(--meadow-paper) 0 55%, transparent 56%); }
.pet-card .name { font-size: 26px; font-weight: 700; }
.embed-box { margin-top: 12px; text-align: left; font-family: var(--font-meta); font-size: 15px;
  background: var(--meadow-paper); border: 2px dashed var(--meadow-ink); border-radius: 10px; padding: 8px; word-break: break-all; }
.btn-doodle {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 6px 16px; background: var(--meadow-flower); color: var(--meadow-ink);
  border: 3px solid var(--meadow-ink); border-radius: 16px 20px 14px 22px;
  box-shadow: 3px 3px 0 var(--meadow-ink);
}
.btn-doodle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--meadow-ink); }

/* World map: habitats as an illustrated landscape, each tile a landmark scene */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.habitat {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end; min-height: 110px; padding: 8px 10px;
  border: 3px solid var(--meadow-ink); border-radius: var(--wobble);
  font-weight: 700; text-decoration: none; background: var(--meadow-grass);
  box-shadow: 3px 3px 0 var(--meadow-ink);
}
.habitat span { position: relative; z-index: 2; background: var(--meadow-cloud); border: 2px solid var(--meadow-ink); border-radius: 10px; padding: 0 8px; }
.habitat.sea { background: linear-gradient(var(--meadow-sky) 30%, var(--meadow-water) 30%); }
.habitat.cave { background: radial-gradient(ellipse at 50% 90%, #3b3346 0 45%, #8a7f73 46%); }
.habitat.forest { background: linear-gradient(var(--meadow-sky) 25%, var(--meadow-grass-3) 25%); }
.habitat.sky { background: linear-gradient(var(--meadow-sky-top), #c8ecff); }
.habitat.snowy { background: linear-gradient(var(--meadow-sky) 35%, #f4fbff 35%); }
.habitat.savannah { background: linear-gradient(var(--meadow-sky) 35%, #f2c75c 35%); }
.habitat.town { background: linear-gradient(var(--meadow-sky) 40%, #e9dcc4 40%); }
.habitat.field { background: linear-gradient(var(--meadow-sky) 35%, var(--meadow-grass) 35%); }

.habitat-landmark {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}
.habitat-resident {
  position: absolute; z-index: 2; right: 6px; bottom: 6px;
  width: 44px; height: 44px; object-fit: contain;
  filter: drop-shadow(2px 2px 0 rgba(43, 42, 51, .4));
}
@media (prefers-reduced-motion: no-preference) {
  .habitat:hover .habitat-resident, .habitat:focus-visible .habitat-resident { transform: translateY(-3px); }
}
.habitat-resident { transition: transform .15s ease; }

/* The pixel font draws "&" like a 6, so tile labels say "and". World map tiles are taller so the scene shows above the label. */
#world-map .habitat { min-height: 140px; }

@media (max-width: 480px) {
  .map-grid { grid-template-columns: 1fr; }
  .habitat { min-height: 96px; }
}

/* Dex */
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.dex-tile { text-align: center; padding: 8px 6px 10px; background: var(--meadow-cloud);
  border: 3px solid var(--meadow-ink); border-radius: var(--wobble); box-shadow: 3px 3px 0 var(--meadow-ink); font-size: 15px; }
.dex-tile img { width: 96px; height: 96px; display: block; margin: 0 auto 4px; }
.dex-tile .no { font-family: var(--font-meta); font-size: 13px; color: #5a5866; }

/* Leaderboard */
.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: grid; grid-template-columns: 38px 56px 1fr auto; gap: 10px; align-items: center;
  padding: 6px 4px; border-bottom: 2px dotted rgba(43, 42, 51, .35); }
.lb li:last-child { border-bottom: 0; }
.lb .rank { font-weight: 700; font-size: 22px; text-align: center; }
.lb img { width: 56px; height: 56px; }
.lb .lvl { font-weight: 700; }
.lb small { display: block; font-size: 14px; color: #4a4856; }

.section-gap { margin-top: 26px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches div { width: 74px; height: 46px; border: 2px solid var(--meadow-ink); border-radius: 8px 12px 6px 10px;
  display: flex; align-items: flex-end; padding: 2px 4px; font: 12px/1.1 var(--font-meta); }

/* ---------- real pages ---------- */
.pets-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 4px 0 0; font-weight: 700; }
.pets-nav a { text-decoration: none; padding: 1px 8px; border-radius: 10px; }
.pets-nav a:hover, .pets-nav a[aria-current="page"] { background: var(--meadow-cloud); box-shadow: 0 0 0 2px var(--meadow-ink); }
.scene.small { height: 150px; }
.meadow.short { background: linear-gradient(var(--meadow-sky-top), var(--meadow-sky) 130px, var(--meadow-grass) 130px); }
.meadow .lede { font-size: 20px; }
.btn-doodle.link { display: inline-block; text-decoration: none; }
.btn-doodle.sun { background: var(--meadow-sun); }
.doodle p:first-of-type { margin-top: 0; }
.doodle ol.steps { margin: 0; padding-left: 1.3em; }
.doodle ol.steps li { margin: 6px 0; }
.meadow code { font-family: var(--font-meta); background: var(--meadow-paper); border: 1px solid rgba(43,42,51,.35); border-radius: 6px; padding: 0 4px; }
.lookup { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.lookup input, .filters input, .filters select {
  font: inherit; color: var(--meadow-ink); background: var(--meadow-cloud);
  border: 3px solid var(--meadow-ink); border-radius: 12px 16px 10px 14px; padding: 4px 10px; min-width: 0;
}
.lookup input { width: 9em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input { flex: 1 1 12em; }
.dex-tile .meta { font-size: 13px; color: #4a4856; }
.dex-top { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; padding: 0 8px;
  border: 2px solid var(--meadow-ink); border-radius: 10px 12px 9px 11px; background: var(--meadow-sun); text-decoration: none; }
.dex-top:hover { background: var(--meadow-flower); }
.lb a { text-decoration: none; }
.lb a:hover .pet-name { text-decoration: underline; }
.lb .lvl small { text-align: right; }
.pet-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px auto 0; max-width: 320px; text-align: left; }
.pet-stats dt { font-weight: 700; }
.pet-stats dd { margin: 0; }
.embed-box textarea { width: 100%; box-sizing: border-box; min-height: 5.5em; resize: vertical; font: inherit; color: inherit;
  background: transparent; border: 0; padding: 0; }
.notice { text-align: center; font-size: 20px; }
.hint { font-size: 15px; color: #4a4856; }

/* ---------- my pets (logged in, D46) ---------- */
.me-profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.me-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--meadow-ink); background: var(--meadow-paper); }
.me-who { flex: 1 1 12em; }
.me-who .name { font-size: 24px; font-weight: 700; }
.me-chips { justify-content: flex-start; margin: 6px 0 0; }
.me-login { text-align: center; }
.btn-doodle.discord { background: #b9c2ff; }
.btn-doodle.small { font-size: 14px; padding: 2px 10px; margin-top: 6px; box-shadow: 2px 2px 0 var(--meadow-ink); }
.my-pet a { color: var(--meadow-ink); }
.privacy h2 { font-size: 20px; margin: 18px 0 4px; font-family: var(--font-label); font-weight: 700; }
.privacy ul { padding-left: 1.2em; }

/* ---------- admin (D48) ---------- */
.me-admin-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-chip { background: #2b2a33; color: #fffdf5; }
.admin-panel { border-style: dashed; }
.admin-stats { justify-content: flex-start; margin: 0 0 10px; }
.admin-commands { margin: 6px 0 0; padding-left: 1.1em; font-size: 16px; }
.admin-commands li { margin: 4px 0; }
.admin-commands .chip { font-size: 13px; padding: 0 8px; }
.admin-bar {
  position: fixed; left: 12px; top: 12px; z-index: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 12px; background: #2b2a33; color: #fffdf5; border: 3px solid var(--meadow-ink);
  border-radius: 14px 18px 12px 16px; box-shadow: 3px 3px 0 rgba(43,42,51,.5); font-size: 15px;
}
.admin-bar a { color: #fffdf5; }
.admin-bar button { font: inherit; font-size: 14px; cursor: pointer; padding: 1px 10px; border-radius: 10px; border: 2px solid #fffdf5; background: transparent; color: #fffdf5; }
.admin-bar button:hover { background: #fffdf5; color: #2b2a33; }
