.hero-page { padding-top: 24px; }
.profile-tools { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.profile-back { padding-block: 8px; font-size: 14px; }
.profile-back span { margin: 0 4px 0 0; font-size: 18px; }
.profile-search { position: relative; margin-left: auto; width: min(100%, 300px); }
.profile-search label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.profile-search input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--input); }
.profile-search input:disabled { opacity: .65; }
.profile-search-results { position: absolute; z-index: 2; inset: calc(100% + 4px) 0 auto; max-height: 320px; margin: 0; padding: 4px; overflow: auto; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.profile-search-results a { display: flex; align-items: center; min-height: 36px; padding: 4px 8px; border-radius: 5px; text-decoration: none; font-size: 14px; }
.profile-search-results a:hover, .profile-search-results a:focus-visible { background: var(--layer); color: var(--accent); }
.profile-search-results a:focus-visible { outline-offset: -2px; }
.profile-search-results .profile-empty { padding: 8px; }
.profile-directory-heading { margin-bottom: 24px; }
.profile-directory-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.profile-directory-list a { display: grid; height: 100%; overflow: hidden; padding: 8px; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; }
.profile-directory-list a:hover { border-color: var(--accent); color: var(--accent); }
.directory-portrait { display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: var(--layer); }
.directory-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.directory-name { padding: 0 4px 4px; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.profile-load { margin-block: 12px; color: var(--muted); }
.profile-load:empty { display: none; }
.profile-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 16px; padding: 16px; }
.profile-summary:has(.profile-portrait[hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
.profile-summary h1 { margin: 0 0 4px; font-size: clamp(26px, 4.5vw, 56px); line-height: 1.1; overflow-wrap: anywhere; }
.profile-portrait { width: clamp(108px, 18vw, 230px); height: auto; border-radius: 7px; object-fit: cover; }
.profile-share { justify-self: end; }
.profile-share p:not(:empty) { margin-top: 4px; max-width: 176px; }
.profile-button { min-height: 38px; padding: 8px 12px; border: 1px solid #67473d; border-radius: 7px; color: #ffc5b5; background: var(--accent-soft); font-size: 13px; font-weight: 650; }
.profile-button:hover { border-color: var(--accent); }
.profile-ranks { margin-bottom: 16px; }
.profile-role-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 0 16px 16px; }
.profile-role { display: grid; align-content: start; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--input); text-align: left; }
.profile-role:hover { border-color: #705047; }
.profile-role[aria-pressed="true"] { border-color: #8b574a; background: var(--accent-soft); }
.profile-role-name { color: var(--muted); font-size: 12px; font-weight: 600; }
.profile-role-rank { font-size: 21px; font-weight: 670; font-variant-numeric: tabular-nums; }
.profile-role-unranked { font-size: 14px; font-weight: 590; }
.profile-role-detail { display: grid; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.profile-role-detail a, .profile-farm-links a { color: #ffb39f; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; width: fit-content; }
.profile-sections { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr); align-items: start; gap: 16px; }
.profile-sections > section { min-width: 0; }
.profile-sections:has(.profile-farm-content[aria-busy="true"]) .profile-farm-content { opacity: .7; }
.profile-matchup-table { table-layout: fixed; }
.profile-matchup-table th, .profile-matchup-table td { padding: 8px 4px; border-top: 1px solid var(--line-soft); }
.profile-matchup-table th { white-space: normal; }
.profile-matchup-table th:first-child, .profile-matchup-table td:first-child { padding-left: 16px; }
.profile-matchup-table th:not(:first-child), .profile-matchup-table td:not(:first-child) { text-align: right; }
.profile-matchup-table th:last-child, .profile-matchup-table td:last-child { padding-right: 16px; }
.profile-matchup-table th:nth-child(2) { width: 26%; }
.profile-matchup-table th:last-child { width: 23%; }
.profile-opponent { display: flex; align-items: center; gap: 8px; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.profile-opponent:hover { color: var(--accent); text-decoration: underline; }
.profile-matchup-table .portrait { width: 38px; height: 22px; }
.profile-matchup-table .profile-matchup-hero { color: var(--ink); background: transparent; font-size: 13px; font-weight: 650; }
.profile-matchup-table td:nth-child(2) { font-weight: 680; }
.profile-matchup-table .subtle { margin-top: 2px; font-size: 11px; white-space: nowrap; }
.profile-empty { padding: 12px 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.profile-method { border-top: 1px solid var(--line-soft); }
.profile-method div { display: grid; }
.profile-role-status { padding: 0 16px 8px; color: #ffc5b5; }
.profile-role-status:empty { display: none; }
.profile-build-setup { margin: 0 16px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); }
.profile-enemy-search { width: 100%; margin: 0; }
.profile-enemy-search [role="option"] { display: flex; align-items: center; gap: 8px; padding: 4px 8px; min-height: 36px; border-radius: 4px; font-size: 13px; }
.profile-enemy-search [data-enemy-id] { cursor: pointer; }
.profile-enemy-search [data-enemy-id]:hover, .profile-enemy-search [aria-selected="true"] { color: #ffb39f; background: var(--accent-soft); }
.profile-enemy-search .portrait, .profile-enemy-pick .portrait { width: 28px; height: 18px; }
.profile-enemy-help { margin-top: 6px; }
.profile-enemy-selection, .profile-enemy-picks, .profile-condition-links, .profile-condition-modes { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.profile-enemy-selection { margin-top: 8px; }
.profile-enemy-picks { padding: 0; margin: 0; list-style: none; }
.profile-enemy-pick, .profile-condition-links button, .profile-condition-modes button, .profile-condition-order button, .profile-build-clear { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 12px; }
.profile-enemy-pick { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; }
.profile-enemy-pick:hover, .profile-condition-links button:hover, .profile-condition-links button[aria-pressed="true"], .profile-condition-modes button:hover, .profile-condition-modes button[aria-pressed="true"], .profile-condition-order button:hover { border-color: #8b574a; color: #ffb39f; background: var(--accent-soft); }
.profile-build-clear { padding: 4px 8px; color: var(--muted); background: transparent; border-color: transparent; }
.profile-build-clear:hover { color: var(--ink); text-decoration: underline; }
.profile-condition-field { min-inline-size: 0; margin: 12px 0 0; padding: 0; border: 0; }
.profile-condition-field legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.profile-condition-modes button { padding: 4px 8px; font-weight: 600; }
.profile-condition-editor { margin-top: 8px; font-size: 13px; }
.profile-condition-editor summary { cursor: pointer; padding: 6px 0; color: #ffb39f; }
.profile-condition-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 152px), 1fr)); gap: 4px 8px; padding: 4px 0; }
.profile-condition-options label { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.profile-condition-options label:hover, .profile-condition-options label:has(input:checked) { background: var(--accent-soft); }
.profile-condition-options input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.profile-condition-order { margin-top: 8px; }
.profile-condition-order ol { margin: 3px 0 0; padding-inline-start: 24px; font-size: 13px; }
.profile-condition-order li { margin-top: 2px; }
.profile-condition-order button { min-height: 28px; padding: 2px 6px; margin-inline-start: 6px; }
.profile-condition-hints:not(:empty) { margin-top: 8px; display: grid; gap: 6px; }
.profile-condition-links button { display: grid; gap: 2px; padding: 4px 8px; text-align: left; }
.profile-condition-links button span:last-child { color: var(--muted); font-size: 11px; }
.profile-condition-change { color: #ffc5b5; }
.profile-change-label { display: block; margin-bottom: 2px; color: var(--muted); }
.profile-scenario-items .profile-counter-item strong { color: #ffc5b5; }
.profile-farm-content { padding: 0 16px 16px; }
.profile-farm-content .profile-empty { padding: 0; }
.profile-farm-source { margin-bottom: 12px; }
.profile-farm-source strong { display: block; margin-bottom: 2px; color: var(--ink); }
.profile-farm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profile-scenario { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); }
.profile-scenario h3 { font-size: 15px; }
.profile-scenario-budget { margin: 4px 0 8px; color: #eac18e; font-weight: 670; font-size: 17px; font-variant-numeric: tabular-nums; }
.profile-scenario-items { display: grid; gap: 8px; list-style: none; margin: 8px 0 0; padding: 0; }
.profile-scenario-items li { display: flex; align-items: start; gap: 8px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.profile-scenario-items .item-icon { width: 30px; height: 22px; }
.profile-scenario-items strong { font-weight: 640; }
.profile-purchase-step { flex: 0 0 12px; color: var(--muted); font-size: 11px; text-align: right; line-height: 22px; font-variant-numeric: tabular-nums; }
.profile-first-purchase { display: block; color: #ffb39f; font-size: 11px; }
.profile-next-purchases { margin-top: 8px; color: var(--muted); font-size: 12px; }
.profile-next-purchases summary, .profile-observed summary { cursor: pointer; }
.profile-observed { margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.profile-observed > p { margin-top: 8px; }
.profile-observed ul { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.profile-scenario-value { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line); }
.profile-scenario-value strong { color: var(--positive); }
.profile-role-actions, .profile-farm-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.profile-farm-links { margin-top: 12px; }

@media (max-width: 1120px) {
  .profile-sections { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .hero-page { padding-top: 16px; }
  .profile-summary { gap: 12px; padding: 12px; }
  .profile-role-list { gap: 6px; padding-inline: 12px; }
  .profile-role { padding-inline: 8px; }
  .profile-role-detail, .profile-farm-content { padding-inline: 12px; }
  .profile-build-setup { margin-inline: 12px; }
  .profile-matchup-table th:first-child, .profile-matchup-table td:first-child { padding-left: 12px; }
  .profile-matchup-table th:last-child, .profile-matchup-table td:last-child { padding-right: 12px; }
  .profile-farm-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-scenario { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 8px; }
  .profile-scenario-budget { margin: 0; }
  .profile-scenario > .subtle, .profile-scenario-items, .profile-next-purchases { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .profile-tools { gap: 8px; }
  .profile-search { width: 100%; }
  .profile-summary, .profile-summary:has(.profile-portrait[hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
  .profile-summary:has(.profile-portrait:not([hidden])) { grid-template-columns: auto minmax(0, 1fr); }
  .profile-summary .profile-share { grid-column: 1 / -1; justify-self: start; }
  .profile-role-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-directory-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
