@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b111b;
  --panel: #131d2d;
  --panel-soft: #1a263a;
  --line: #2d3c54;
  --ink: #f3f6fa;
  --muted: #9eb0c4;
  --accent: #5ce1e6;
  --accent-bright: #9ff0f3;
  --q-color: #f4a261;
  --q-soft: #f4a26122;
  --e-color: #5ce1e6;
  --e-soft: #5ce1e620;
  --w-color: #a78bfa;
  --w-soft: #a78bfa22;
  --gold: #e4bd79;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: radial-gradient(ellipse 60% 40% at 50% -10%, #182a42 0%, transparent 90%), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background: repeating-linear-gradient(115deg, transparent 0, transparent 114px, #586d87 115px, transparent 116px);
  mask-image: linear-gradient(to bottom, #000, transparent 65%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-shell { position: relative; max-width: 1260px; margin: auto; padding: 0 36px; }
.masthead { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #30435e80; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; font-family: 'Space Grotesk', Arial, sans-serif; font-weight: 700; letter-spacing: .13em; white-space: nowrap; }
.brand em { font-style: normal; color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--accent); border-radius: 11px; transform: rotate(-8deg); color: var(--accent-bright); font: 700 22px Georgia, serif; box-shadow: inset 0 0 0 3px #172538; }
.patch-pill { border: 1px solid #394d69; padding: 7px 12px; border-radius: 100px; font-size: .74rem; letter-spacing: .14em; color: #c4d3e3; font-weight: 700; white-space: nowrap; }
.masthead-right { display: flex; align-items: center; gap: 10px; }
.lang-select {
  appearance: none;
  background: #131d2d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235ce1e6' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid #3e5370;
  border-radius: 100px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  padding: 7px 28px 7px 12px;
  cursor: pointer;
}
.lang-select:hover { border-color: var(--accent); }
.lang-select option { background: #131d2d; color: var(--ink); }

.page-intro { padding: 38px 0 26px; max-width: 780px; }
.eyebrow { margin: 0 0 10px; font-size: .77rem; font-weight: 700; letter-spacing: .22em; color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: 'Space Grotesk', Arial, sans-serif; font-size: clamp(2.3rem, 4.6vw, 3.85rem); letter-spacing: -.05em; line-height: 1.05; margin: 0 0 12px; }
.page-intro > p:last-child { font-size: 1.02rem; color: var(--muted); line-height: 1.52; margin: 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: 22px; align-items: stretch; }
.card { background: linear-gradient(145deg, #182538 0%, var(--panel) 84%); border: 1px solid #2e3f57; border-radius: 18px; box-shadow: 0 22px 70px #0003; min-width: 0; padding: 28px; }
.card-top { display: flex; align-items: center; gap: 12px; min-height: 34px; margin-bottom: 22px; }
.compact-top { margin-bottom: 8px; }
.section-number { color: var(--gold); font-family: 'Space Grotesk', Arial, sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
h2 { font-size: 1.3rem; letter-spacing: -.02em; margin: 0; font-weight: 700; }
.card-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pill-button { border: 1px solid #415673; background: #1a2a40; color: #dbe6f2; border-radius: 100px; padding: 5px 12px; font-size: .78rem; font-weight: 600; }
.pill-button:hover { border-color: var(--accent); color: var(--accent); }
.pill-button.copied { border-color: #79d7a3; color: #79d7a3; background: #79d7a320; }
.text-button { border: 0; background: none; color: var(--muted); font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.text-button:hover { color: var(--ink); }

.level-heading, .item-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.level-heading label { font-weight: 700; font-size: 1rem; }
.level-badge { background: #22344d; border: 1px solid #48607e; border-radius: 11px; padding: 6px 13px; font: 700 1.3rem 'Space Grotesk', sans-serif; min-width: 48px; text-align: center; color: var(--accent-bright); }
.level-control { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.level-control button { background: #203147; color: var(--ink); border: 1px solid #3c516e; width: 40px; height: 40px; flex: none; border-radius: 10px; font-size: 1.3rem; line-height: 1; }
.level-control button:hover:not(:disabled) { border-color: var(--accent); background: #293e59; }
.level-control input { width: 100%; min-width: 0; accent-color: var(--accent); height: 32px; cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; margin: 2px 54px 0; color: #8399b0; font-size: .72rem; font-weight: 700; letter-spacing: .12em; }

/* Bot Role Quest (7th Boots Slot) */
.quest-banner { margin-top: 18px; padding: 13px 14px; border: 1px solid #31445e; border-radius: 12px; background: #0f1826; }
.quest-toggle { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: #d5e1ee; cursor: pointer; user-select: none; }
.quest-toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.quest-toggle strong { color: var(--accent); }
.boots-slot-wrap { margin-top: 11px; padding-top: 11px; border-top: 1px solid #24354c; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.boots-slot-label { font-size: .7rem; font-weight: 700; letter-spacing: .15em; color: var(--accent); }
.boots-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.boots-quick-btn { border: 1px dashed #445c7a; background: #152234; color: #c9d8e8; border-radius: 8px; padding: 5px 10px; font-size: .79rem; }
.boots-quick-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Presets */
.presets { margin-top: 18px; }
.presets > p { color: #849ab0; font-size: .71rem; letter-spacing: .15em; font-weight: 700; margin: 0 0 8px; }
.preset-list { display: flex; flex-wrap: wrap; gap: 7px; }
.preset-btn { border: 1px solid #364a63; background: #0f1927; color: #cfe0f0; padding: 6px 10px; border-radius: 9px; font-size: .77rem; font-weight: 600; }
.preset-btn:hover { border-color: var(--accent); color: var(--ink); background: #1a2b40; }
.preset-btn.is-active { border-color: var(--accent); color: var(--accent-bright); background: #193245; }

/* Items */
.item-heading { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; align-items: flex-start; }
.item-heading h3 { margin: 0 0 4px; font-size: 1rem; display: flex; align-items: center; gap: 9px; }
.gold-pill { font-family: 'Space Grotesk', Arial, sans-serif; font-size: .78rem; color: var(--gold); background: #e4bd791a; border: 1px solid #e4bd7955; border-radius: 100px; padding: 2px 9px; font-weight: 700; }
.item-heading p { margin: 0; color: var(--muted); font-size: .83rem; }
.item-count { border: 1px solid var(--line); border-radius: 100px; color: var(--gold); padding: 4px 10px; font-size: .8rem; font-weight: 700; white-space: nowrap; }

.selected-items { min-height: 58px; margin: 14px 0 11px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.selected-items:empty:before { content: attr(data-empty); display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; border: 1px dashed #3d516b; border-radius: 10px; color: #8da2b8; font-size: .84rem; padding: 0 12px; text-align: center; }
.selected-item { border: 1px solid #445a75; border-radius: 10px; background: #1e2f45; display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 11px; max-width: 100%; font-size: .83rem; }
.selected-item .item-stats { font-size: .76rem; color: #b7c8db; white-space: nowrap; }
.selected-item button { border: 0; background: #304560; border-radius: 7px; color: #dbe6f2; width: 24px; height: 24px; line-height: 1; font-size: 1rem; flex: none; padding: 0; }
.selected-item button:hover { background: #4a6485; color: #fff; }

.item-search-wrap { position: relative; }
.item-search-wrap input { width: 100%; height: 45px; padding: 0 42px 0 14px; border-radius: 10px; color: var(--ink); border: 1px solid #3f546e; background: #0c1522; outline: none; }
.item-search-wrap input::placeholder { color: #7b90a6; }
.search-glyph { position: absolute; right: 15px; top: 5px; font-size: 1.75rem; color: var(--gold); pointer-events: none; line-height: 1; }
.search-results { max-height: 240px; overflow: auto; border: 1px solid #455c78; border-radius: 11px; margin-top: 5px; padding: 5px; background: #0c1522; box-shadow: 0 14px 28px #0006; }
.search-choice { width: 100%; border: 0; background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border-radius: 6px; min-height: 40px; padding: 7px 10px; }
.search-choice:hover { background: #1e2f45; }
.search-choice-meta { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.search-results p { color: var(--muted); margin: 6px 9px; font-size: .85rem; }

/* Quick Add + Live Evolve Badges */
.popular { margin-top: 15px; }
.popular-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.popular-head > p { color: #849ab0; font-size: .71rem; letter-spacing: .15em; font-weight: 700; margin: 0; }
.popular-hint { font-size: .73rem; color: var(--gold); }
.popular-list { display: flex; flex-wrap: wrap; gap: 7px; }
.popular-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #3a4f69; color: #dbe6f2; background: transparent; padding: 6px 10px; border-radius: 100px; font-size: .79rem; min-height: 34px; }
.popular-btn:hover:not(:disabled) { border-color: var(--accent); background: #1c2d42; }
.popular-btn.grants-evolve:not(:disabled) { border-color: #6f8fb3; background: #1c2c40; }

.evo-badge { font-family: 'Space Grotesk', Arial, sans-serif; font-size: .66rem; font-weight: 700; padding: 2px 6px; border-radius: 100px; letter-spacing: .04em; white-space: nowrap; }
.evo-badge.badge-q { background: var(--q-color); color: #1b1108; }
.evo-badge.badge-e { background: var(--e-color); color: #061c21; }
.evo-badge.badge-w { background: var(--w-color); color: #140f24; }

.custom-details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.custom-details summary { color: var(--muted); cursor: pointer; font-size: .84rem; }
.custom-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, 72px) auto; gap: 7px; align-items: end; margin-top: 12px; }
.custom-fields label { font-size: .73rem; color: var(--muted); font-weight: 700; min-width: 0; }
.custom-fields input { display: block; width: 100%; margin-top: 6px; border: 1px solid #3f546e; border-radius: 8px; background: #0c1522; color: var(--ink); height: 39px; padding: 0 8px; }
.custom-add { background: var(--gold); border: 0; color: #111c2b; border-radius: 8px; font-weight: 700; min-height: 39px; padding: 0 13px; font-size: .84rem; }
.custom-add:hover { background: #f2d294; }
.field-error { font-size: .8rem; color: #ffa9a9; margin: 8px 0 0; }

/* Right Card: 3 Evolution Cards */
.result { display: flex; flex-direction: column; }
.summary-pill { margin-left: auto; font-family: 'Space Grotesk', Arial, sans-serif; font-size: .76rem; font-weight: 700; letter-spacing: .08em; padding: 5px 11px; border-radius: 100px; border: 1px solid #3d526e; color: #c7d6e6; background: #18263a; }
.summary-pill.all-evolved { border-color: var(--accent); color: var(--accent-bright); background: #5ce1e622; }

.evolve-stack { display: flex; flex-direction: column; gap: 14px; }
.evolve-card { border: 1px solid #2e4059; background: #0f1826; border-radius: 14px; padding: 17px 18px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.evolve-card.is-evolved.evolve-q { border-color: var(--q-color); background: linear-gradient(145deg, #242126, #111a28); box-shadow: 0 0 22px #f4a2611c; }
.evolve-card.is-evolved.evolve-e { border-color: var(--e-color); background: linear-gradient(145deg, #132836, #111a28); box-shadow: 0 0 22px #5ce1e61c; }
.evolve-card.is-evolved.evolve-w { border-color: var(--w-color); background: linear-gradient(145deg, #1d1d36, #111a28); box-shadow: 0 0 22px #a78bfa1f; }

.evolve-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.evolve-title-group { display: flex; align-items: center; gap: 11px; }
.ability-key { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-family: 'Space Grotesk', Arial, sans-serif; font-weight: 700; font-size: 1rem; flex: none; }
.key-q { background: var(--q-soft); color: var(--q-color); border: 1px solid #f4a26166; }
.key-e { background: var(--e-soft); color: var(--e-color); border: 1px solid #5ce1e666; }
.key-w { background: var(--w-soft); color: var(--w-color); border: 1px solid #a78bfa66; }
.evolve-title-group h3 { margin: 0; font-size: 1rem; line-height: 1.2; }
.ability-perk { font-size: .76rem; color: var(--muted); }

.evolve-status { font-family: 'Space Grotesk', Arial, sans-serif; font-size: .7rem; font-weight: 700; letter-spacing: .1em; padding: 4px 10px; border-radius: 100px; border: 1px solid #394d66; color: #8da2b8; background: #162233; }
.evolve-card.is-evolved.evolve-q .evolve-status { background: var(--q-color); color: #1b1108; border-color: var(--q-color); }
.evolve-card.is-evolved.evolve-e .evolve-status { background: var(--e-color); color: #061c21; border-color: var(--e-color); }
.evolve-card.is-evolved.evolve-w .evolve-status { background: var(--w-color); color: #140f24; border-color: var(--w-color); }

.evolve-numbers { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.evolve-numbers strong { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 1.18rem; color: var(--ink); }
.evolve-numbers span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.evolve-card.is-evolved .evolve-numbers span { color: #79d7a3; }

.track { height: 10px; overflow: hidden; background: #223247; border-radius: 100px; }
.track-fill { height: 100%; width: 0; border-radius: 100px; transition: width .22s ease; }
.fill-q { background: linear-gradient(90deg, #cf7942, var(--q-color)); }
.fill-e { background: linear-gradient(90deg, #2c9ea8, var(--e-color)); }
.fill-w { background: linear-gradient(90deg, #7c62d6, var(--w-color)); }

.evolve-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: #8aa0b8; margin-top: 8px; flex-wrap: wrap; }
.note { font-size: .83rem; line-height: 1.55; color: var(--muted); margin: auto 0 0; padding-top: 18px; }
.note strong { color: var(--ink); }

.formula { color: #8aa0b8; text-align: center; font-size: .79rem; line-height: 1.6; margin: 20px 0 24px; }
.formula span { color: var(--gold); padding: 0 6px; }

/* Timeline Table */
.timeline-card { margin-bottom: 34px; }
.timeline-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.timeline-sub { color: var(--muted); font-size: .9rem; margin: 0; }
.toggle-control { display: inline-flex; align-items: center; gap: 9px; font-size: .84rem; color: #dbe6f2; cursor: pointer; background: #0f1826; border: 1px solid #394d66; border-radius: 100px; padding: 7px 14px; user-select: none; }
.toggle-control input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.bp-table-wrap { overflow-x: auto; border: 1px solid #2c3e57; border-radius: 12px; background: #0d1623; }
.bp-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.bp-table th { text-align: left; font-size: .71rem; letter-spacing: .12em; text-transform: uppercase; color: #8ca2b8; padding: 11px 14px; border-bottom: 1px solid #26384f; background: #131f30; white-space: nowrap; }
.bp-table td { padding: 9px 14px; border-bottom: 1px solid #1d2c40; color: #cfdce9; white-space: nowrap; }
.bp-table tbody tr { cursor: pointer; transition: background .12s ease; }
.bp-table tbody tr:last-child td { border-bottom: 0; }
.bp-table tbody tr:hover { background: #1a2a40; }
.bp-table tbody tr.is-unlock { background: #1b283b; }
.bp-table tbody tr.is-current { background: #153142; box-shadow: inset 3px 0 0 var(--accent); }
.bp-table tbody tr.is-current td { color: var(--ink); font-weight: 600; }
.bp-level-cell { display: inline-flex; align-items: center; gap: 8px; font-family: 'Space Grotesk', Arial, sans-serif; font-weight: 700; }
.current-tag { font-family: 'DM Sans', Arial, sans-serif; font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; color: #061c21; background: var(--accent); border-radius: 100px; padding: 2px 7px; font-weight: 700; }
.stat-hit-q { color: var(--q-color); font-weight: 700; }
.stat-hit-e { color: var(--e-color); font-weight: 700; }
.stat-hit-w { color: var(--w-color); font-weight: 700; }
.evo-cell { display: inline-flex; align-items: center; gap: 5px; }

/* FAQ & Footer */
.how-it-works { border-top: 1px solid #30435e80; padding: 42px 0 46px; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 44px; }
.how-it-works h2 { font: 700 clamp(1.6rem, 3vw, 2.1rem)/1.14 'Space Grotesk', Arial, sans-serif; letter-spacing: -.04em; margin: 0 0 14px; }
.how-it-works p { color: var(--muted); line-height: 1.6; margin: 0; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 30px; }
.faq-grid h3 { font-size: 1rem; line-height: 1.38; color: var(--ink); margin: 0 0 7px; }
.faq-grid p { font-size: .9rem; }
.footer { border-top: 1px solid #30435e80; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0 28px; color: #8298b0; font-size: .75rem; }
.footer-link { color: #b5d6d9; text-underline-offset: 3px; }
.footer-link:hover { color: var(--accent-bright); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .site-shell { padding: 0 20px; }
  .workspace { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .how-it-works { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .site-shell { padding: 0 15px; }
  .patch-pill { display: none; }
  h1 { font-size: 2.1rem; }
  .custom-fields { grid-template-columns: 1fr 1fr 1fr; }
  .custom-fields label:first-child { grid-column: 1 / -1; }
  .custom-add { grid-column: 1 / -1; }
  .faq-grid { grid-template-columns: 1fr; }
  .footer { display: block; line-height: 1.7; }
  .footer span { display: block; }
}
