/* PokéDungeon Boss Planner. Neutral page, the game's logo red for actions and its stair gold for highlights;
   type colours are the game's own (flying, ghost, dragon, steel, poison moved off the blue-violet band). */
:root {
  --bg: #f3f4f2; --card: #fff; --ink: #1a1d1f; --mut: #5f666b; --line: #dfe2df;
  --red: #c8352b; --red-d: #a32a21; --gold: #e9b23a; --night: #171b22;
  --ok: #2f7d4f; --warn: #b7791f; --bad: #b03a2e;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.6 "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--red-d); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 18px 0 10px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; font-weight: 800; }
h3 { font-size: 1.1rem; margin: 22px 0 8px; }
p, li { max-width: 70ch; }
.lede { font-size: 1.06rem; color: #2d3236; }
.muted { color: var(--mut); }
small { font-size: .82rem; }

/* header and footer */
.top { background: var(--night); color: #fff; border-bottom: 3px solid var(--red); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand img { image-rendering: pixelated; border-radius: 6px; background: #2a2f38; }
.brand em { font-style: normal; color: var(--gold); }
.brand:hover { color: #fff; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #d9dde2; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .93rem; transition: background .15s, color .15s; }
.nav a:hover { background: #262c36; color: #fff; }
.foot { margin-top: 64px; padding: 28px 0 40px; background: #e8eae7; color: var(--mut); font-size: .88rem; }
.foot p { max-width: 72ch; }
.crumbs { font-size: .85rem; color: var(--mut); margin-top: 18px; }
.crumbs a { color: var(--mut); }

/* type tags and move chips */
.type, .mvchip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; color: #1a1d1f; background: var(--tc, #ddd); line-height: 1.6; white-space: nowrap; }
.mvchip { border-radius: 6px; margin: 2px 0; }
.t-normal { --tc: #c6c6a7 } .t-fire { --tc: #f5a26b } .t-water { --tc: #7aa6f5 } .t-grass { --tc: #8fd86a }
.t-electric { --tc: #f8e05a } .t-ice { --tc: #a6e3e3 } .t-fighting { --tc: #e07a63 } .t-poison { --tc: #cf83b5 }
.t-ground { --tc: #e3c77a } .t-flying { --tc: #a3c3e6 } .t-psychic { --tc: #f87fa0 } .t-bug { --tc: #b8c94a }
.t-rock { --tc: #c9b46b } .t-ghost { --tc: #a3adbf } .t-dragon { --tc: #7ea4dc } .t-dark { --tc: #b09a8a }
.t-steel { --tc: #c3cbd2 } .t-fairy { --tc: #f0a8d8 }

.face { image-rendering: pixelated; border-radius: 6px; background: #e9ece9; vertical-align: middle; }

/* planner */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 18px 0 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); scroll-margin-top: 12px; }
.pl-boss { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.pl-boss select { flex: 1 1 220px; min-width: 0; max-width: 100%; font: inherit; font-weight: 700; padding: 9px 10px; border: 1px solid #c9cdc9; border-radius: 8px; background: #fafbfa; color: var(--ink); }
.pl-head { margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pl-head span { font-weight: 800; }
.pl-head small { color: var(--mut); }
.pl-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 8px; }
.pl-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 62px 58px auto 28px; gap: 6px; align-items: center; background: #f7f8f7; border: 1px solid var(--line); border-radius: 10px; padding: 6px; transition: border-color .15s, background .15s; }
.pl-row:focus-within { border-color: #9aa19c; background: #fff; }
.pl-row img { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 6px; background: #e9ece9; }
.pl-row input, .pl-row select { font: inherit; font-size: .92rem; padding: 6px 6px; border: 1px solid #cfd3cf; border-radius: 6px; min-width: 0; background: #fff; color: var(--ink); }
.pl-row .role { font-size: .78rem; padding: 6px 2px; }
.pl-row .role[hidden] { display: none; }
.pl-del { border: 0; background: transparent; font-size: 1.2rem; color: var(--mut); cursor: pointer; border-radius: 6px; }
.pl-del:hover { background: #eceeec; color: var(--bad); }
.pl-add { display: flex; gap: 8px; margin-top: 8px; }
.ghost { font: inherit; font-size: .9rem; border: 1px dashed #b9beb9; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); transition: background .15s, border-color .15s; }
.ghost:hover { background: #f1f2f1; border-color: #8f968f; }
.tool-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.btn { font: inherit; font-weight: 800; font-size: 1.02rem; background: var(--red); color: #fff; border: 0; border-bottom: 3px solid var(--red-d); padding: 11px 22px; border-radius: 10px; cursor: pointer; transition: transform .08s, background .15s; }
.btn:hover { background: #d33e33; }
.btn:active { transform: translateY(2px); border-bottom-width: 1px; margin-bottom: 2px; }
.btn:disabled { opacity: .7; cursor: progress; }
.pl-quota { color: var(--mut); font-size: .88rem; }
.pl-err { color: var(--bad); font-weight: 700; }
.pl-out { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 4px; }
.pl-out:empty { display: none; }
.ex-h { font-size: 1.05rem; margin: 14px 0 10px; color: var(--mut); }
.plan { animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pl-sum { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: start; padding: 14px; border-radius: 12px; background: #f4f6f4; border-left: 6px solid var(--vc, var(--ok)); }
.v-favoured { --vc: var(--ok); } .v-even { --vc: var(--gold); } .v-risky { --vc: var(--warn); } .v-underleveled { --vc: var(--bad); }
.pl-rate b { display: block; font-size: 2.6rem; line-height: 1; font-weight: 800; color: var(--vc); }
.pl-rate small { color: var(--mut); }
.pl-verdict > b { font-size: 1.2rem; }
.pl-verdict p { margin: 2px 0 6px; }
.pl-facts { margin: 0; padding-left: 18px; font-size: .92rem; }
.pl-train { background: #fff6e0; border: 1px solid #f0d89c; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.pl-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-top: 14px; }
.pl-mem { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; transition: box-shadow .15s, transform .15s; }
.pl-mem:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); transform: translateY(-1px); }
.pl-mem header { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.pl-mem header small { color: var(--mut); }
.role { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: #eceeec; }
.r-leader .role { background: var(--gold); }
.r-bodyguard .role { background: #cfe3d6; }
.pl-mem dl { margin: 10px 0 0; font-size: .9rem; }
.pl-mem dt { font-weight: 800; font-size: .76rem; color: var(--mut); margin-top: 8px; }
.pl-mem dd { margin: 2px 0 0; }
.moves { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.mv { display: block; padding: 4px 8px; border-radius: 7px; background: color-mix(in srgb, var(--tc) 45%, #fff); border: 1px solid color-mix(in srgb, var(--tc) 80%, #000 5%); line-height: 1.25; }
.mv b { display: block; font-size: .86rem; }
.mv small { font-size: .72rem; color: #3b4144; }
.pl-alt { font-size: .92rem; margin: 12px 0 0; }
.pl-foot { font-size: .8rem; color: var(--mut); margin-top: 12px; }

/* paywall */
.wall { display: grid; grid-template-columns: 1fr 250px; gap: 18px; padding: 16px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; margin-top: 12px; }
.wall h3 { margin-top: 0; }
.teaser { display: flex; gap: 12px; align-items: center; background: #f4f6f4; padding: 10px; border-radius: 10px; }
.locked { display: flex; gap: 8px; margin: 10px 0; }
.locked span { flex: 1; height: 54px; border-radius: 10px; background: #eceeec; border: 1px dashed #c9cdc9; }
.buy { text-align: center; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.price { font-size: 2.2rem; font-weight: 800; }
.wall details { grid-column: 1 / -1; font-size: .9rem; }
.wall details input { font: inherit; padding: 6px 8px; border: 1px solid #cfd3cf; border-radius: 6px; margin-right: 6px; }
.wall details button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--ink); background: #fff; cursor: pointer; }

/* boss pages */
.bhero { display: grid; grid-template-columns: 384px auto 1fr; gap: 18px; align-items: start; margin: 14px 0; }
.dun { width: 100%; max-width: 384px; height: auto; border-radius: 12px; image-rendering: pixelated; display: block; }
.bfaces { display: flex; flex-direction: column; gap: 6px; }
.bfaces .face { border: 2px solid var(--night); }
.facts { margin: 0; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.facts dt { font-weight: 800; color: var(--mut); font-size: .86rem; }
.facts dd { margin: 0; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f2f0; font-size: .8rem; color: var(--mut); position: sticky; top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbf9; }
.who { display: flex; gap: 10px; align-items: center; min-width: 170px; }
.foes td:nth-child(5) { min-width: 240px; }
.fc .face { margin-right: 2px; }
.tips { padding-left: 20px; }
.tips li { margin: 6px 0; }
.pn { display: flex; justify-content: space-between; gap: 12px; margin: 34px 0 0; flex-wrap: wrap; }
.pn a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; font-weight: 700; transition: border-color .15s; }
.pn a:hover { border-color: var(--red); }

@media (max-width: 860px) {
  .bhero { grid-template-columns: 1fr; }
  .bfaces { flex-direction: row; }
  .wall { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  .tool { padding: 14px; margin-left: -6px; margin-right: -6px; }
  .pl-sum { grid-template-columns: 1fr; gap: 6px; }
  .pl-row { grid-template-columns: 40px minmax(0, 1fr) 52px 28px; grid-template-areas: "img mon lv del" "img stars role role"; row-gap: 4px; }
  .pl-row img { grid-area: img; align-self: start; }
  .pl-row [name=mon] { grid-area: mon; }
  .pl-row [name=lv] { grid-area: lv; }
  .pl-row .pl-del { grid-area: del; }
  .pl-row .stars { grid-area: stars; width: 70px; }
  .pl-row .role { grid-area: role; }
  .pl-row .stars, .pl-row .role { padding: 3px 4px; font-size: .8rem; }
  .nav a { padding: 4px 7px; font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* load the team from the game's data file */
.pl-load { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 14px; margin: 0 0 14px; border: 1.5px dashed #c9cdc9; border-radius: 12px; background: #fafbf9; transition: border-color .15s, background .15s; }
.pl-load.over { border-color: var(--red); background: #fff6f4; }
.pl-load small { flex: 1 1 360px; color: var(--mut); }
.pl-load .pl-quota { flex-basis: 100%; margin: 0; color: var(--ok); font-weight: 700; }
.pl-load .pl-quota:empty { display: none; }
.btn-file { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; font-weight: 800; cursor: pointer; transition: background .15s, transform .1s; }
.btn-file:hover { background: #f1f2ef; }
.btn-file:active { transform: translateY(1px); }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn-file:focus-within { outline: 2px solid var(--red); outline-offset: 2px; }

/* boss pages */
.phases { padding-left: 22px; }
.phases li { margin: 8px 0; }
.lvt tr.in td { background: #fbf7ea; }
.lvt td, .lvt th, .mvt td, .mvt th { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.lvt, .mvt { border-collapse: collapse; width: 100%; }
.mvt td:last-child { min-width: 220px; }
.hard { color: var(--bad); }
.formula { font-weight: 700; background: #fff; border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 6px; }
.cta { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 8px; padding: 12px 16px; }

/* focus and field edges (design-lint 26a / 40), heading wrap */
:focus-visible { outline: 2px solid var(--red-d); outline-offset: 2px; }
.top a:focus-visible { outline-color: var(--gold); }
.pl-row input, .pl-row select, .pl-boss select { border-color: #858c85 !important; }
h1, h2, h3 { text-wrap: balance; }
.lede, .qa p { max-width: 72ch; }
.mv { padding-top: 5px !important; padding-bottom: 5px !important; }

/* review fixes: verdict on boss pages, sample tag, price line, compact phone header */
.verdict { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 16px; margin: 6px 0 4px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; }
.verdict p { margin: 0; flex: 1 1 320px; }
.verdict .btn { text-decoration: none; font-size: .95rem; padding: 9px 16px; }
.pl-sample { font-style: normal; font-size: .78rem; font-weight: 800; color: #6b4e00; background: #fbefc8; padding: 1px 8px; border-radius: 999px; margin-left: 8px; }
.pl-sample[hidden] { display: none; }
.tool-go .pl-quota { color: var(--ink); font-weight: 700; }
@media (max-width: 560px) {
  .top .wrap { min-height: 50px; padding-top: 6px; padding-bottom: 6px; }
  .nav a { padding: 4px 7px; font-size: .86rem; }
  .bhero .dun { max-height: 120px; object-fit: cover; width: 100%; }
  h1 { font-size: 1.7rem; }
}
