:root {
  --bg: #eef3f8; --bg2: #e2eaf3; --card: #ffffff; --card2: #f6f9fc; --ink: #1d2433; --mut: #5f6b80; --line: #d8e1ec;
  --acc: #3fae3a; --acc2: #2b8a2a; --link: #1f6fd1; --shadow: 0 2px 0 rgba(20, 40, 70, .06), 0 8px 24px rgba(20, 40, 70, .06);
  --q-common: #8a94a3; --q-uncommon: #3aa64a; --q-rare: #2f7ee0; --q-mythical: #9b4fe0; --q-legendary: #f08a17; --q-cursed: #e0384b;
  --tile: radial-gradient(circle at 50% 35%, #ffffff 0%, #e8eff7 70%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11161f; --bg2: #161d29; --card: #1b2331; --card2: #202a3a; --ink: #e7ecf4; --mut: #93a0b5; --line: #2a3446;
  --acc: #5cc957; --acc2: #7ad975; --link: #6aa8ff; --shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .25);
  --q-common: #a3adbb; --q-uncommon: #5cc96a; --q-rare: #5b9dff; --q-mythical: #b77cff; --q-legendary: #ffa53d; --q-cursed: #ff5a6b;
  --tile: radial-gradient(circle at 50% 35%, #2b3850 0%, #1b2331 75%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161f; --bg2: #161d29; --card: #1b2331; --card2: #202a3a; --ink: #e7ecf4; --mut: #93a0b5; --line: #2a3446;
    --acc: #5cc957; --acc2: #7ad975; --link: #6aa8ff; --shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .25);
    --q-common: #a3adbb; --q-uncommon: #5cc96a; --q-rare: #5b9dff; --q-mythical: #b77cff; --q-legendary: #ffa53d; --q-cursed: #ff5a6b;
    --tile: radial-gradient(circle at 50% 35%, #2b3850 0%, #1b2331 75%);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, .display { font-family: "Lilita One", Nunito, sans-serif; font-weight: 400; letter-spacing: .01em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.loading { color: var(--mut); padding: 40px 0; text-align: center; }

/* header */
.top { background: linear-gradient(180deg, #57b8ff 0%, #3a9be8 100%); border-bottom: 4px solid #2a7bc0; position: sticky; top: 0; z-index: 10; }
:root[data-theme="dark"] .top { background: linear-gradient(180deg, #1f3c62 0%, #18304f 100%); border-bottom-color: #10233b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top { background: linear-gradient(180deg, #1f3c62 0%, #18304f 100%); border-bottom-color: #10233b; } }
.top-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none !important; flex: none; }
.brand img { height: 40px; width: auto; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.brand span { font-family: "Lilita One"; color: #fff; font-size: 22px; background: rgba(0, 0, 0, .18); padding: 0 10px; border-radius: 8px; line-height: 30px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #fff; font-weight: 800; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .18); text-decoration: none; }
.hsearch { width: 220px; flex: none; }
.search.hsearch svg { left: 11px; top: 10px; color: rgba(255, 255, 255, .9); z-index: 1; pointer-events: none; }
.search.hsearch input { font-size: 15px; padding: 7px 10px 7px 34px; border-radius: 10px; background: rgba(0, 0, 0, .2); border: 2px solid transparent; color: #fff; box-shadow: none; }
.search.hsearch input::placeholder { color: rgba(255, 255, 255, .85); }
.search.hsearch input:focus { background: var(--card); color: var(--ink); border-color: var(--acc); }
.search.hsearch:focus-within svg { color: var(--mut); }
.search.hsearch .results { width: 340px; left: auto; right: 0; }
.theme { flex: none; background: rgba(0, 0, 0, .18); color: #fff; border: 0; border-radius: 8px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; gap: 8px 12px; }
  .brand img { height: 32px; }
  .nav { order: 3; flex-basis: 100%; }
  .hsearch { flex: 1; width: auto; min-width: 0; }
  .search.hsearch .results { width: calc(100vw - 32px); left: auto; right: -50px; }
}
@media (max-width: 960px) and (min-width: 721px) { .hsearch { width: 160px; } }

/* list pages */
.page-head h1 { font-size: 36px; margin: 0 0 4px; }
.page-head p { margin: 0 0 14px; }
.small { font-size: 14px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; }
.search.small { flex: 1 1 240px; max-width: none; margin: 0; }
.search.small input { font-size: 15px; padding: 8px 12px 8px 40px; box-shadow: none; border-radius: 10px; }
.search.small svg { top: 9px; left: 12px; }
.filters select { font: 700 14px Nunito, sans-serif; color: var(--ink); background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.filters .count { margin-left: auto; color: var(--mut); font-weight: 800; font-size: 14px; white-space: nowrap; }
.qchips { display: flex; gap: 6px; flex-wrap: wrap; }
.qchip { font: 800 13px Nunito, sans-serif; border-radius: 99px; padding: 5px 11px; cursor: pointer; background: var(--card2); color: var(--qc); border: 2px solid var(--qc); }
.qchip[aria-pressed="true"] { background: var(--qc); color: #fff; }
.rules { padding: 14px 18px; }
.rules h2 { margin: 0 0 6px; font-size: 22px; }
.rules ul { margin: 0; padding-left: 20px; }
.rules li { margin: 6px 0; }
.rules .chip { vertical-align: middle; padding-top: 2px; padding-bottom: 2px; }
.rules .chip img { width: 28px; height: 28px; }
[hidden] { display: none !important; }

/* footer */
.foot { border-top: 1px solid var(--line); color: var(--mut); font-size: 14px; padding: 18px 0; }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sec { margin-top: 22px; }
.sec > h2 { font-size: 24px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.sec > h2 .n { font-family: Nunito; font-weight: 800; font-size: 13px; color: var(--mut); background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
.muted { color: var(--mut); }

/* home */
.hero { text-align: center; padding: 34px 20px 28px; background: linear-gradient(180deg, rgba(87, 184, 255, .18), transparent); border-radius: 20px; }
.hero img.logo { width: min(560px, 90%); height: auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .15)); }
.hero h1 { margin: 6px 0 4px; font-size: 30px; }
.hero p { margin: 0 auto 18px; max-width: 620px; color: var(--mut); }
.search { position: relative; max-width: 560px; margin: 0 auto; text-align: left; }
.search input { width: 100%; font: 700 17px Nunito, sans-serif; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 13px 16px 13px 46px; outline: none; box-shadow: var(--shadow); }
.search input:focus { border-color: var(--acc); }
.search svg { position: absolute; left: 15px; top: 15px; color: var(--mut); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 5; max-height: 420px; overflow-y: auto; }
.results a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; color: var(--ink); }
.results a:hover, .results a.on { background: var(--card2); text-decoration: none; }
.results img { width: 36px; height: 36px; object-fit: contain; }
.results .t { flex: 1; font-weight: 700; }
.results .empty { padding: 12px 14px; color: var(--mut); }
.stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; font-weight: 700; color: var(--mut); font-size: 14px; }
.stat b { color: var(--ink); font-size: 18px; margin-right: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px 12px; color: var(--ink); transition: transform .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--acc); text-decoration: none; }
.tile img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .18)); }
.tile .tt { font-family: "Lilita One"; font-size: 19px; }
.tile .ts { font-size: 13px; color: var(--mut); font-weight: 700; }
.station-tile .imgs { display: flex; height: 72px; align-items: center; }
.station-tile .imgs img { width: 56px; height: 56px; margin: 0 -6px; }
.note { background: var(--card2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; color: var(--mut); }

/* item grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.gi { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; text-align: center; color: var(--ink); border-bottom: 3px solid var(--qc, var(--line)); }
.gi:hover { text-decoration: none; transform: translateY(-2px); }
.gi img { width: 64px; height: 64px; object-fit: contain; }
.gi span { font-size: 13px; font-weight: 700; line-height: 1.2; }
.gi .gs { font-size: 11px; font-weight: 700; color: var(--mut); line-height: 1.2; }
.tip { margin-top: 10px; padding: 10px 14px; color: var(--mut); font-weight: 600; line-height: 2.2; }
.tip b { color: var(--ink); }
.tip .chip { vertical-align: middle; padding-top: 2px; padding-bottom: 2px; line-height: 1.4; }
.tip .chip img { width: 26px; height: 26px; }

/* item page */
.crumbs { font-size: 14px; color: var(--mut); margin-bottom: 10px; }
.item-head { display: grid; grid-template-columns: 220px 1fr; gap: 22px; padding: 20px; align-items: start; }
.big { width: 220px; height: 220px; border-radius: 18px; background: var(--tile); display: grid; place-items: center; border: 3px solid var(--qc, var(--line)); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .25), 0 0 28px -8px var(--qc, transparent); }
.big img { width: 168px; height: 168px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .22)); }
.item-head h1 { font-size: 40px; margin: 2px 0 8px; line-height: 1.1; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); color: var(--mut); }
.badge.q { color: #fff; border: 0; background: var(--qc); }
.desc { font-size: 17px; margin: 0 0 8px; }
.flavor { margin: 0; color: var(--mut); font-style: italic; border-left: 4px solid var(--qc, var(--line)); padding: 2px 0 2px 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fact .k { font-size: 12px; font-weight: 800; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; }
.fact .v { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.fact .v img { width: 24px; height: 24px; object-fit: contain; }
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .2); display: inline-block; }
.q-Common { --qc: var(--q-common); } .q-Uncommon { --qc: var(--q-uncommon); } .q-Rare { --qc: var(--q-rare); }
.q-Mythical { --qc: var(--q-mythical); } .q-Legendary { --qc: var(--q-legendary); } .q-Cursed { --qc: var(--q-cursed); }
@media (max-width: 720px) {
  .item-head { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 16px; }
  .big { width: 180px; height: 180px; }
  .big img { width: 136px; height: 136px; }
  .item-head h1 { font-size: 32px; }
  .badges { justify-content: center; }
  .flavor { text-align: left; }
}

/* drops + recipes */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.row .op { font-family: "Lilita One"; font-size: 22px; color: var(--mut); line-height: 1; }
.row .meta { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); color: var(--ink); font-weight: 700; border-bottom: 3px solid var(--qc, var(--line)); }
.chip:hover { text-decoration: none; border-color: var(--acc); }
.chip img, .chip .ph { width: 40px; height: 40px; object-fit: contain; }
.chip .qty { font-weight: 800; color: var(--mut); }
.chip.self { outline: 2px solid var(--acc); outline-offset: 1px; }
.ph { display: grid; place-items: center; border-radius: 8px; background: var(--line); color: var(--mut); font-family: "Lilita One"; font-size: 22px; }
.tag { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); color: var(--mut); white-space: nowrap; }
.tag.secret { background: #2a2140; color: #e6d7ff; border-color: #4a3a73; }
.tag.st { color: var(--ink); }
.drop .what { font-weight: 800; min-width: 54px; color: var(--mut); text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.drop .num { font-weight: 800; }
.empty-sec { color: var(--mut); font-weight: 600; padding: 12px 14px; }

/* animals */
.animal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); gap: 14px; }
.animal { padding: 16px; scroll-margin-top: 80px; }
.animal-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.animal-head h2 { font-size: 30px; margin: 0 0 6px; }
.animal-head .badges { margin: 0; }
.big.small-big { width: 112px; height: 112px; flex: none; border-radius: 16px; }
.big.small-big img { width: 88px; height: 88px; }
.animal-facts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.animal-facts .v { font-size: 16px; flex-wrap: wrap; }
.animal-facts .chip img { width: 30px; height: 30px; }
.what-l { font-weight: 800; color: var(--mut); text-transform: uppercase; font-size: 12px; letter-spacing: .05em; min-width: 130px; }

/* phones (kept last so it wins over the base rules above) */
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .gi img { width: 56px; height: 56px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 30px; }
}

/* current colour variant on a wearable page */
.gi.self { outline: 3px solid var(--acc); outline-offset: -3px; }
