@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: #0b1420;
  --panel: #142237;
  --panel-soft: #1b2c43;
  --line: #34435a;
  --line-soft: #28374e;
  --ink: #f6f3e9;
  --muted: #a9b8c8;
  --gold: #e4bd79;
  --gold-bright: #ffdc9a;
  --teal: #81c6c1;
  --danger: #f06e6e;
  --danger-soft: #f06e6e24;
  --success: #79d7a3;
  --success-soft: #79d7a322;
  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% 42% at 50% -10%, #1c3550 0%, transparent 90%), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background: repeating-linear-gradient(115deg, transparent 0, transparent 114px, #637287 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: .43; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-shell { position: relative; max-width: 1260px; margin: auto; padding: 0 36px; }
.masthead { min-height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #39506b78; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; font-family: 'Space Grotesk', Arial, sans-serif; font-weight: 700; letter-spacing: .13em; color: var(--ink); white-space: nowrap; }
.brand em { font-style: normal; color: var(--gold); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--gold); border-radius: 11px; transform: rotate(-8deg); color: var(--gold); font: 700 24px Georgia, serif; letter-spacing: 0; box-shadow: inset 0 0 0 3px #1c2c40; }
.patch-pill { border: 1px solid #40566c; padding: 8px 12px; border-radius: 100px; font-size: .74rem; letter-spacing: .14em; color: #bdcddd; font-weight: 700; white-space: nowrap; }
.masthead-right { display: flex; align-items: center; gap: 10px; }
.lang-select {
  appearance: none;
  background: #142237 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='%23e4bd79' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid #445b75;
  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(--gold); }
.lang-select option { background: #142237; color: var(--ink); }

.page-intro { padding: 40px 0 26px; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.intro-row > div:first-child { max-width: 720px; }
.eyebrow { margin: 0 0 10px; font-size: .77rem; font-weight: 700; letter-spacing: .23em; color: var(--teal); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: 'Space Grotesk', Arial, sans-serif; font-size: clamp(2.3rem, 4.6vw, 3.9rem); letter-spacing: -.06em; line-height: 1.05; margin: 0 0 12px; }
.intro-row > div:first-child > p:last-child { font-size: 1.02rem; color: var(--muted); line-height: 1.5; margin: 0; }

/* Mode Switcher Tabs */
.mode-tabs {
  display: inline-flex;
  background: #0e1a2b;
  border: 1px solid #3b5068;
  border-radius: 14px;
  padding: 5px;
  gap: 5px;
  flex-shrink: 0;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mode-tab:hover { color: var(--ink); background: #192a40; }
.mode-tab[aria-selected="true"] {
  background: linear-gradient(145deg, #253b56, #1b2f47);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 4px 16px #0004;
}
.tab-key {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: .8rem;
  background: #24374f;
  color: var(--ink);
  border: 1px solid #425a75;
}
.mode-tab[aria-selected="true"] .tab-key {
  background: var(--gold);
  color: #142237;
  border-color: var(--gold-bright);
}

/* Workspace & Cards */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .94fr); gap: 22px; align-items: stretch; }
.card { background: linear-gradient(145deg, #192a40 0%, var(--panel) 84%); border: 1px solid #33455d; border-radius: 18px; box-shadow: 0 22px 80px #0002; min-width: 0; padding: 30px; }
.card-top { display: flex; align-items: center; gap: 13px; min-height: 34px; margin-bottom: 24px; }
.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.32rem; 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 #465d78;
  background: #1b2d43;
  color: #dce6ed;
  border-radius: 100px;
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 600;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.pill-button:hover { border-color: var(--teal); color: var(--teal); background: #213751; }
.pill-button.copied { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.text-button { border: 0; background: none; color: var(--muted); font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; margin-left: auto; padding: 6px 0; }
.card-actions .text-button { margin-left: 0; }
.text-button:hover { color: var(--ink); }

.level-heading, .item-heading, .threshold-head, .threshold-foot { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.level-heading label { font-weight: 700; font-size: 1rem; }
.level-badge { background: #2f465e; border: 1px solid #526782; border-radius: 11px; padding: 6px 13px; font: 700 1.35rem 'Space Grotesk', sans-serif; min-width: 49px; text-align: center; color: var(--gold-bright); }
.level-control { display: flex; align-items: center; gap: 15px; margin-top: 11px; }
.level-control button { background: #273a51; color: var(--ink); border: 1px solid #3f5670; width: 42px; height: 42px; flex: none; border-radius: 10px; font-size: 1.35rem; line-height: 1; }
.level-control button:hover:not(:disabled) { border-color: var(--gold); background: #314761; }
.level-control input { width: 100%; min-width: 0; accent-color: var(--gold); height: 34px; cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; margin: 3px 57px 0; color: #8da0b4; font-size: .72rem; font-weight: 700; letter-spacing: .12em; }

/* Build Presets */
.presets { margin-top: 22px; }
.presets > p, .field-caption { color: #8ba1b5; font-size: .71rem; letter-spacing: .15em; font-weight: 700; margin: 0 0 9px; }
.preset-list { display: flex; flex-wrap: wrap; gap: 7px; }
.preset-btn {
  border: 1px solid #3c536d;
  background: #112033;
  color: #cfe0ee;
  padding: 6px 11px;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 600;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.preset-btn:hover { border-color: var(--teal); color: var(--ink); background: #1d324b; }
.preset-btn.is-active { border-color: var(--teal); color: var(--teal); background: #183546; }

/* Items */
.item-heading { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; align-items: flex-start; }
.item-heading h3 { margin: 0 0 4px; font-size: 1rem; }
.item-heading p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.item-count { border: 1px solid var(--line); border-radius: 100px; color: var(--gold); padding: 5px 10px; font-size: .81rem; font-weight: 700; white-space: nowrap; }
.selected-items { min-height: 60px; margin: 16px 0 12px; 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: 56px; border: 1px dashed #475b74; border-radius: 10px; color: #91a5b8; font-size: .85rem; padding: 0 12px; text-align: center; }
.selected-item { border: 1px solid #566379; border-radius: 10px; background: #263a50; display: inline-flex; align-items: center; gap: 9px; padding: 7px 9px 7px 12px; max-width: 100%; font-size: .85rem; }
.selected-item .item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-item .item-stat { white-space: nowrap; color: var(--gold-bright); font-weight: 700; }
.selected-item button { border: 0; background: #364d65; border-radius: 7px; color: #d5e0e8; width: 25px; height: 25px; line-height: 1; font-size: 1rem; flex: none; padding: 0; }
.selected-item button:hover { background: #556b7f; color: #fff; }

.item-search-wrap { position: relative; }
.item-search-wrap input { width: 100%; height: 46px; padding: 0 45px 0 15px; border-radius: 10px; color: var(--ink); border: 1px solid #4b6078; background: #0e1b2b; outline: none; }
.item-search-wrap input::placeholder { color: #8196ab; }
.search-glyph { position: absolute; right: 16px; top: 5px; font-size: 1.8rem; color: var(--gold); pointer-events: none; line-height: 1; }
.search-results { max-height: 254px; overflow: auto; border: 1px solid #526782; border-radius: 11px; margin-top: 5px; padding: 5px; background: #0d1b2a; box-shadow: 0 14px 28px #0005; }
.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: 42px; padding: 7px 10px; }
.search-choice:hover, .search-choice:focus-visible { background: #263a50; }
.search-choice-meta { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.search-choice-stat { font-weight: 700; color: var(--gold); }
.search-results p { color: var(--muted); margin: 6px 9px; font-size: .86rem; }

/* Quick Add & Live +1 Spin Badges */
.popular { margin-top: 16px; }
.popular-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.popular-head > p { color: #8ba1b5; font-size: .71rem; letter-spacing: .15em; font-weight: 700; margin: 0; }
.popular-hint { font-size: .73rem; color: var(--gold); opacity: .9; }
.popular-list { display: flex; flex-wrap: wrap; gap: 7px; }
.popular-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #465a70;
  color: #dce6ed;
  background: transparent;
  padding: 7px 11px;
  border-radius: 100px;
  font-size: .8rem;
  min-height: 36px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.popular-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright); background: #26384e; }
.popular-btn.grants-spin:not(:disabled) {
  border-color: #d6a95cb0;
  background: #27323f;
  color: var(--ink);
}
.popular-btn.grants-spin:hover:not(:disabled) {
  border-color: var(--gold-bright);
  background: #333f4d;
}
.gain-badge {
  background: var(--gold);
  color: #142237;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: .69rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.custom-details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.custom-details summary { color: var(--muted); cursor: pointer; font-size: .84rem; line-height: 1.5; }
.custom-fields { display: grid; grid-template-columns: minmax(0, 1fr) 132px auto; gap: 8px; align-items: end; margin-top: 14px; }
.custom-fields label { font-size: .75rem; color: var(--muted); font-weight: 700; min-width: 0; }
.custom-fields input { display: block; width: 100%; margin-top: 7px; border: 1px solid #4b6078; border-radius: 8px; background: #0e1b2b; color: var(--ink); height: 42px; padding: 0 10px; }
.custom-add { background: var(--gold); border: 0; color: #172237; border-radius: 8px; font-weight: 700; min-height: 42px; padding: 0 13px; font-size: .84rem; }
.custom-add:hover { background: var(--gold-bright); }
.field-error { font-size: .8rem; color: #ffa9a9; margin: 8px 0 0; min-height: 0; }

/* E Result Card */
.result { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.result:after { content: ""; position: absolute; width: 440px; height: 440px; right: -210px; top: 80px; border: 1px solid #35516c55; border-radius: 50%; pointer-events: none; }
.spin-hero { position: relative; display: grid; place-items: center; min-height: 240px; margin: -6px 0 8px; }
.spin-orbit { position: absolute; width: 208px; height: 208px; border-radius: 50%; border: 2px solid #d8a85866; border-top-color: var(--gold); border-right-color: var(--gold); transform: rotate(-40deg); box-shadow: inset 0 0 0 15px #142236, 0 0 45px #be915026; }
.spin-orbit:before, .spin-orbit:after { content: ""; position: absolute; border-radius: 50%; inset: -13px; border: 1px dashed #b6894f88; }
.spin-orbit:after { inset: 16px; border-style: solid; opacity: .34; }
.orbit-tick { position: absolute; width: 5px; height: 13px; border-radius: 4px; background: var(--gold); top: -7px; left: 50%; transform: rotate(35deg); }
.tick-two { top: 58px; left: 195px; transform: rotate(117deg); }
.tick-three { top: 198px; left: 50%; transform: rotate(-28deg); }
.spin-reading { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.spin-count { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 6rem; letter-spacing: -.09em; font-weight: 700; color: var(--gold-bright); text-shadow: 0 0 44px #f3bd6760; margin-right: .1em; }
.spin-label { font-size: .78rem; font-weight: 700; letter-spacing: .19em; color: #cfdbdf; margin-top: 3px; }
.as-summary { border: 1px solid #3b5068; background: #1b2c43; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 15px 16px; margin: 2px 0 23px; }
.as-summary div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.as-summary div span { font-size: .73rem; color: #afc0d0; line-height: 1.2; }
.as-summary strong { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 1.11rem; color: var(--ink); }
.as-summary div:last-child strong { color: var(--gold-bright); }
.plus-sign, .equals-sign { font-size: 1.1rem; color: #839cb1; align-self: center; }
.threshold-head { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.threshold-head strong { color: var(--gold-bright); font-size: 1rem; white-space: nowrap; }
.track { height: 12px; overflow: hidden; background: #34455b; border-radius: 100px; box-shadow: inset 0 1px 4px #0004; }
.track-fill { height: 100%; width: 0; background: linear-gradient(90deg, #c69453, #ffe3a8); border-radius: 100px; transition: width .25s ease; }
.threshold-foot { color: #91a7ba; font-size: .79rem; margin-top: 9px; }
.next-level { border-top: 1px solid var(--line); padding-top: 18px; margin: 24px 0 0; font-size: .96rem; line-height: 1.5; color: var(--ink); min-height: 58px; }
.next-level strong { color: var(--gold-bright); }
.note { font-size: .84rem; line-height: 1.55; color: #acbdcc; margin: auto 0 0; padding-top: 19px; }
.note strong { color: #d8e4e7; }

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

/* Level 1–20 Breakpoints Table */
.breakpoints-card { margin-bottom: 34px; }
.breakpoints-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.breakpoints-sub { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0; max-width: 680px; }
.toggle-control { display: inline-flex; align-items: center; gap: 9px; font-size: .85rem; color: #d5e2ee; cursor: pointer; background: #101e30; border: 1px solid #3c536d; border-radius: 100px; padding: 7px 14px; user-select: none; }
.toggle-control input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.bp-table-wrap { overflow-x: auto; border: 1px solid #31445c; border-radius: 12px; background: #0f1c2d; }
.bp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.bp-table th { text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #8ea5ba; padding: 11px 14px; border-bottom: 1px solid #2b3d53; background: #132236; white-space: nowrap; }
.bp-table td { padding: 9px 14px; border-bottom: 1px solid #203147; color: #d2dee8; 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: #1b2f47; }
.bp-table tbody tr.is-gain { background: #262e39; }
.bp-table tbody tr.is-gain:hover { background: #313b47; }
.bp-table tbody tr.is-current { background: #163445; box-shadow: inset 3px 0 0 var(--teal); }
.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; }
.bp-spins-cell { font-family: 'Space Grotesk', Arial, sans-serif; font-weight: 700; color: var(--gold-bright); }
.quest-tag { font-family: 'DM Sans', Arial, sans-serif; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); border: 1px solid #48797a; border-radius: 100px; padding: 1px 7px; font-weight: 700; }
.current-tag { font-family: 'DM Sans', Arial, sans-serif; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: #102030; background: var(--teal); border-radius: 100px; padding: 2px 7px; font-weight: 700; }

/* R Ult Execute Tab */
.ult-rank-block { margin-bottom: 24px; }
.rank-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.rank-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: #101e30;
  border: 1px solid #3f556f;
  border-radius: 11px;
  padding: 12px 13px;
  color: var(--ink);
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.rank-btn strong { font-family: 'Space Grotesk', Arial, sans-serif; font-size: .98rem; }
.rank-btn span { font-size: .76rem; color: var(--muted); }
.rank-btn:hover { border-color: var(--gold); background: #1b2e46; }
.rank-btn[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(145deg, #2b3c53, #1e3148); box-shadow: 0 0 0 1px #e4bd7955; }
.rank-btn[aria-pressed="true"] strong { color: var(--gold-bright); }

.ult-field { border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 20px; }
.hp-number {
  width: 116px;
  height: 40px;
  text-align: right;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-bright);
  background: #0e1b2b;
  border: 1px solid #526782;
  border-radius: 10px;
  padding: 0 12px;
}
.hp-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.hp-presets button {
  border: 1px solid #415770;
  background: transparent;
  color: #cfe0ee;
  border-radius: 100px;
  padding: 6px 11px;
  font-size: .78rem;
  font-weight: 600;
}
.hp-presets button:hover { border-color: var(--gold); color: var(--gold-bright); background: #23374f; }

.ult-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.ult-input-label { display: flex; flex-direction: column; gap: 7px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ult-input-label input { height: 44px; border: 1px solid #4b6078; border-radius: 9px; background: #0e1b2b; color: var(--ink); padding: 0 12px; font-size: .95rem; }
.ult-hint { font-size: .84rem; color: var(--muted); line-height: 1.5; margin: 18px 0 0; }
.ult-hint strong { color: var(--ink); }

.ult-hero {
  background: linear-gradient(145deg, #1e2f47, #152336);
  border: 1px solid #465d79;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.ult-eyebrow { display: block; font-size: .71rem; font-weight: 700; letter-spacing: .16em; color: var(--teal); margin-bottom: 8px; }
.ult-kill-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ult-kill-hp { font-family: 'Space Grotesk', Arial, sans-serif; font-size: clamp(2.4rem, 4vw, 3.3rem); line-height: 1; color: var(--gold-bright); letter-spacing: -.04em; text-shadow: 0 0 32px #f3bd6745; }
.ult-kill-pct { font-family: 'Space Grotesk', Arial, sans-serif; font-size: 1.08rem; font-weight: 700; color: #f6b0a6; background: var(--danger-soft); border: 1px solid #f06e6e66; border-radius: 100px; padding: 4px 12px; }
.ult-formula-line { font-size: .84rem; color: var(--muted); margin: 10px 0 0; }

.hp-bar-block { margin-bottom: 20px; }
.hp-bar-labels { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.exec-label { color: var(--gold); font-weight: 700; letter-spacing: .1em; }
.enemy-hp-bar {
  position: relative;
  height: 22px;
  background: linear-gradient(180deg, #2b4437, #1f3329);
  border: 1px solid #466155;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px #0006;
}
.enemy-hp-exec {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 25%;
  background: linear-gradient(90deg, #c94646, #e4a84f);
  border-right: 2px solid var(--gold-bright);
  transition: width .2s ease;
}
.enemy-hp-shield {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: repeating-linear-gradient(135deg, #c6dff566 0 6px, #e4f2ff99 6px 12px);
  border-left: 2px solid #d9eeff;
  transition: width .2s ease;
}
.enemy-hp-marker {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 3px;
  background: #ffffff;
  box-shadow: 0 0 8px #fff;
  transform: translateX(-50%);
}
.hp-bar-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: #8298ad; margin-top: 6px; }

.ult-verdict { border-radius: 11px; padding: 12px 15px; font-size: .9rem; line-height: 1.45; margin-bottom: 18px; border: 1px solid transparent; }
.ult-verdict.is-kill { background: var(--success-soft); border-color: #79d7a366; color: #d8f8e5; }
.ult-verdict.is-survive { background: var(--danger-soft); border-color: #f06e6e66; color: #ffd9d9; }

.ult-ref-block { margin-top: auto; }
.ult-ref-wrap { overflow-x: auto; border: 1px solid #31445c; border-radius: 10px; background: #0f1c2d; }
.ult-ref-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ult-ref-table th { text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #8ea5ba; padding: 8px 11px; border-bottom: 1px solid #2b3d53; background: #132236; }
.ult-ref-table td { padding: 7px 11px; border-bottom: 1px solid #203147; color: #cfe0ee; white-space: nowrap; }
.ult-ref-table tbody tr { cursor: pointer; transition: background .12s ease; }
.ult-ref-table tbody tr:last-child td { border-bottom: 0; }
.ult-ref-table tbody tr:hover { background: #1c3049; }
.ult-ref-table tbody tr.is-active { background: #163445; }
.ult-ref-table td.is-selected-rank { color: var(--gold-bright); font-weight: 700; }

/* FAQ & Footer */
.how-it-works { border-top: 1px solid #39506b78; padding: 44px 0 48px; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 46px; }
.how-it-works h2 { font: 700 clamp(1.65rem, 3vw, 2.15rem)/1.14 'Space Grotesk', Arial, sans-serif; letter-spacing: -.04em; margin: 0 0 15px; }
.how-it-works p { color: var(--muted); line-height: 1.62; margin: 0; }
.how-it-works .eyebrow { color: var(--teal); margin: 0 0 13px; line-height: 1.3; }
.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: .91rem; }
.faq-grid strong { color: #e9e4d5; }
.footer { border-top: 1px solid #39506b78; display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 28px; color: #8199ad; font-size: .75rem; }
.footer-link { color: #b5d6d9; text-underline-offset: 3px; }
.footer-link:hover { color: var(--gold-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: 24px; }
  .result { min-height: 540px; }
  .ult-result { min-height: auto; }
  .page-intro { padding-top: 30px; }
  .how-it-works { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 560px) {
  .site-shell { padding: 0 15px; }
  .masthead { min-height: 68px; }
  .brand { font-size: .84rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: 19px; }
  .patch-pill { display: none; }
  .page-intro { padding: 22px 0 20px; }
  .intro-row > div:first-child > p:last-child { font-size: .9rem; }
  .eyebrow { font-size: .65rem; }
  h1 { font-size: 2.15rem; }
  .mode-tabs { width: 100%; }
  .mode-tab { flex: 1; justify-content: center; padding: 10px 10px; font-size: .84rem; }
  .card { padding: 20px; border-radius: 14px; }
  .card-top { margin-bottom: 18px; }
  .workspace { gap: 15px; }
  .range-ends { margin: 3px 46px 0; }
  .item-heading { margin-top: 20px; padding-top: 18px; }
  .custom-fields { grid-template-columns: 1fr 108px; }
  .custom-add { grid-column: 1 / -1; }
  .spin-hero { min-height: 210px; }
  .spin-orbit { transform: rotate(-40deg) scale(.83); }
  .spin-count { font-size: 5.2rem; }
  .as-summary { padding: 12px 10px; }
  .as-summary strong { font-size: .95rem; }
  .as-summary div span { font-size: .67rem; }
  .result { min-height: 500px; }
  .ult-result { min-height: auto; }
  .rank-selector { grid-template-columns: 1fr; }
  .ult-two-col { grid-template-columns: 1fr; }
  .footer { display: block; line-height: 1.7; }
  .footer span { display: block; }
  .formula { font-size: .73rem; }
  .how-it-works { padding: 32px 0; }
  .faq-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .track-fill, .enemy-hp-exec, .enemy-hp-shield { transition: none; }
}
