/* Profile-only refinements. Kept separate so the shared Perdix shell remains stable. */

.profile-archetype-feature[hidden] {
    display: none;
}

/* Keep the tall rank card independent from the naturally sized analysis rail. */
.profile-page .profile-shell {
    width: min(1320px, 100%);
}

.profile-page .profile-grid {
    align-items: start;
}

.profile-dashboard-rail {
    display: grid;
    gap: 20px;
    align-content: start;
    min-width: 0;
}

.profile-page .profile-rank-card,
.profile-page .profile-objective-card {
    align-self: start;
}

.profile-status-line.is-loading {
    display: flex;
    gap: 9px;
    align-items: center;
}

.profile-status-line.is-loading::before,
.profile-match-loading::before,
.profile-champion-loading::before,
.mini-analysis-loading::before {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    content: "";
    border: 2px solid rgba(255, 255, 240, 0.25);
    border-top-color: var(--crimson-bright);
    border-radius: 999px;
    animation: profile-loading-spin 700ms linear infinite;
}

.profile-match-loading {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 64px;
    margin: 0;
    color: var(--muted-on-dark);
}

.profile-match-error {
    color: #ffb4c2;
}

@keyframes profile-loading-spin {
    to {
        transform: rotate(1turn);
    }
}

.lp-chart-time-label {
    fill: rgba(255, 255, 240, 0.68);
    font-size: 11px;
}

.profile-page .lp-history-chart {
    cursor: crosshair;
}

.profile-page .lp-history-figure {
    position: relative;
    overflow: hidden;
    background: #26223f;
}

.profile-page .lp-history-chart:focus-visible {
    outline: 2px solid var(--ivory);
    outline-offset: -3px;
}

.lp-chart-hover-highlight {
    pointer-events: none;
}

.lp-chart-hover-guide {
    stroke: rgba(255, 255, 240, 0.68);
    stroke-dasharray: 4 5;
    stroke-width: 1.5;
}

.lp-chart-hover-point {
    fill: #26223f;
    stroke: var(--ivory);
    stroke-width: 3;
}

.lp-chart-hover-readout {
    --lp-readout-x: 50%;
    --lp-readout-y: 50%;
    position: absolute;
    z-index: 2;
    top: clamp(64px, calc(var(--lp-readout-y) - 12px), calc(100% - 10px));
    left: clamp(76px, var(--lp-readout-x), calc(100% - 76px));
    display: grid;
    gap: 1px;
    min-width: 128px;
    padding: 8px 11px;
    color: var(--purple);
    background: var(--ivory);
    border: 1px solid rgba(13, 6, 34, 0.28);
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(13, 6, 34, 0.3);
    pointer-events: none;
    transform: translate(-50%, -100%);
}

.lp-chart-hover-readout[hidden] {
    display: none;
}

.lp-chart-hover-readout span {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.035em;
}

.lp-chart-hover-readout strong {
    color: var(--crimson);
    font-size: 19px;
    line-height: 1.05;
}

.profile-champion-summary {
    display: grid;
    gap: 12px;
    margin-top: 2px;
    padding: 15px;
    color: var(--ivory);
    background:
        radial-gradient(circle at 100% 0, rgba(220, 20, 60, 0.17), transparent 45%),
        #19102f;
    border: 1px solid rgba(13, 6, 34, 0.24);
    border-radius: 5px;
    box-shadow: 0 14px 30px rgba(13, 6, 34, 0.12);
}

.profile-champion-summary-heading {
    display: grid;
    gap: 2px;
}

.profile-champion-summary .section-kicker {
    color: #ff8299;
}

.profile-champion-summary h3 {
    margin: 0;
    color: var(--ivory);
    font-size: 22px;
    line-height: 1.05;
}

.profile-champion-list {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.profile-champion-item {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 11px;
    background: rgba(255, 255, 240, 0.055);
    border: 1px solid rgba(255, 255, 240, 0.12);
    border-radius: 4px;
}

.profile-champion-identity {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.profile-champion-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 240, 0.28);
    border-radius: 3px;
}

.profile-champion-identity div {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.profile-champion-identity strong {
    overflow: hidden;
    color: var(--ivory);
    font-size: 18px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-champion-identity span {
    color: var(--muted-on-dark);
    font-size: 13px;
}

.profile-champion-metrics {
    display: grid;
    grid-template-columns: 0.8fr 1.45fr 0.75fr;
    gap: 5px;
    margin: 0;
}

.profile-champion-metrics div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 7px;
    background: rgba(13, 6, 34, 0.3);
    border-radius: 3px;
}

.profile-champion-metrics dt {
    overflow: hidden;
    color: rgba(255, 255, 240, 0.62);
    font-size: 10px;
    letter-spacing: 0.035em;
    line-height: 1.15;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.profile-champion-metrics dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--ivory);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-champion-status {
    margin: 0;
    padding: 9px 2px;
    color: var(--muted-on-dark);
    font-size: 14px;
    line-height: 1.35;
}

.profile-champion-loading,
.mini-analysis-loading {
    display: flex;
    gap: 9px;
    align-items: center;
}

.profile-champion-error {
    color: #ffb4c2;
}

/* The expanded analysis uses the same Perdix palette, with a calmer information hierarchy. */
.profile-page .match-mini-analysis {
    position: relative;
    display: grid;
    gap: 22px;
    margin-top: 12px;
    padding: clamp(18px, 2.5vw, 30px);
    overflow: hidden;
    color: var(--ivory);
    background:
        radial-gradient(circle at 100% 0, rgba(95, 143, 255, 0.13), transparent 38%),
        linear-gradient(145deg, rgba(25, 16, 47, 0.98), rgba(13, 6, 34, 0.96));
    border: 1px solid rgba(255, 255, 240, 0.15);
    border-top: 3px solid var(--match-accent);
    border-radius: 8px;
    box-shadow: 0 20px 44px rgba(13, 6, 34, 0.28);
    cursor: default;
}

.profile-page .match-mini-analysis[hidden] {
    display: none;
}

.profile-page .match-mini-analysis::after {
    position: absolute;
    top: -80px;
    right: -60px;
    width: 190px;
    height: 190px;
    content: "";
    border: 1px solid rgba(255, 255, 240, 0.08);
    border-radius: 999px;
    pointer-events: none;
}

.profile-page .mini-analysis-header {
    position: relative;
    z-index: 1;
    gap: 7px;
    max-width: 850px;
    padding-left: 16px;
    border-left: 3px solid var(--match-accent);
}

.profile-page .mini-analysis-kicker {
    color: var(--match-accent);
    font-size: 11px;
    letter-spacing: 0.13em;
}

.profile-page .mini-analysis-header strong {
    color: var(--ivory);
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.015em;
    line-height: 1.04;
}

.profile-page .mini-analysis-header p {
    max-width: 760px;
    color: rgba(255, 255, 240, 0.7);
    font-size: 16px;
    line-height: 1.5;
}

.profile-page .mini-analysis-metrics {
    position: relative;
    z-index: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.profile-page .mini-analysis-metric {
    gap: 7px;
    min-height: 82px;
    padding: 14px 15px;
    background: linear-gradient(145deg, rgba(255, 255, 240, 0.085), rgba(255, 255, 240, 0.035));
    border: 1px solid rgba(255, 255, 240, 0.13);
    border-radius: 6px;
}

.profile-page .mini-analysis-metric b {
    color: rgba(255, 255, 240, 0.63);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.profile-page .mini-analysis-metric span {
    align-self: end;
    color: var(--ivory);
    font-size: clamp(19px, 2vw, 24px);
    line-height: 1.05;
}

.profile-page .mini-analysis-plot-wrap {
    position: relative;
    z-index: 1;
    gap: 11px;
    padding: clamp(12px, 2vw, 20px);
    overflow: hidden;
    background: rgba(7, 3, 20, 0.52);
    border: 1px solid rgba(255, 255, 240, 0.14);
    border-radius: 7px;
    box-shadow: inset 0 1px rgba(255, 255, 240, 0.04);
}

.profile-page .mini-analysis-plot {
    max-height: 390px;
}

.profile-page .mini-analysis-plot-legend {
    gap: 8px 18px;
    color: rgba(255, 255, 240, 0.67);
}

.profile-page .mini-analysis-plot-wrap figcaption {
    max-width: 880px;
    color: rgba(255, 255, 240, 0.6);
    line-height: 1.45;
}

.profile-page .mini-analysis-review {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
}

.profile-page .mini-analysis-review-heading {
    display: grid;
    gap: 3px;
}

.profile-page .mini-analysis-review-heading > strong {
    color: var(--ivory);
    font-size: 22px;
    line-height: 1.1;
}

.profile-page .mini-analysis-moments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-page .mini-analysis-moment {
    position: relative;
    align-content: start;
    gap: 9px;
    padding: 17px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 240, 0.075), rgba(255, 255, 240, 0.025));
    border: 1px solid rgba(255, 255, 240, 0.14);
    border-radius: 7px;
}

.profile-page .mini-analysis-moment::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: "";
    background: var(--match-accent);
}

.profile-page .mini-analysis-moment-label {
    color: var(--match-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.profile-page .mini-analysis-moment > strong {
    color: var(--ivory);
    font-size: 21px;
    line-height: 1.1;
}

.profile-page .mini-analysis-moment p {
    color: rgba(255, 255, 240, 0.7);
    line-height: 1.45;
}

.profile-page .mini-analysis-moment-signal {
    justify-self: start;
    padding: 5px 8px;
    color: var(--ivory);
    background: rgba(13, 6, 34, 0.55);
    border: 1px solid rgba(255, 255, 240, 0.12);
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.15;
}

.profile-page .mini-analysis-contributors {
    gap: 6px;
    padding: 11px 0 0;
    color: rgba(255, 255, 240, 0.62);
    border-top: 1px solid rgba(255, 255, 240, 0.1);
    font-size: 13px;
    line-height: 1.35;
    list-style: none;
}

.profile-page .mini-analysis-contributors li {
    position: relative;
    padding-left: 12px;
}

.profile-page .mini-analysis-contributors li::before {
    position: absolute;
    top: 0.58em;
    left: 0;
    width: 4px;
    height: 4px;
    content: "";
    background: var(--match-accent);
    border-radius: 999px;
}

.profile-page .mini-analysis-loading {
    min-height: 76px;
    margin: 0;
    color: rgba(255, 255, 240, 0.72);
}

.profile-page .match-mini-analysis > .empty-state,
.profile-page .mini-analysis-moments > .empty-state {
    margin: 0;
    color: rgba(255, 255, 240, 0.7);
    background: rgba(255, 255, 240, 0.055);
    border: 1px solid rgba(255, 255, 240, 0.12);
    border-radius: 6px;
}

.profile-page .match-history-item.is-analysis-locked {
    cursor: pointer;
}

.profile-page .match-mini-analysis.is-premium-gate {
    isolation: isolate;
    min-height: clamp(380px, 45vw, 610px);
    border-top-color: #d5ae62;
}

.profile-page .mini-analysis-premium-preview {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 22px;
    filter: blur(7px);
    opacity: 0.56;
    pointer-events: none;
    transform: scale(1.015);
    transform-origin: center;
    user-select: none;
}

.profile-page .mini-analysis-premium-gate {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    gap: 18px;
    place-content: center;
    justify-items: center;
    padding: 28px;
    text-align: center;
    background: radial-gradient(
        circle at center,
        rgba(13, 6, 34, 0.94) 0,
        rgba(13, 6, 34, 0.82) 28%,
        rgba(13, 6, 34, 0.28) 62%,
        transparent 82%
    );
}

.profile-page .mini-analysis-premium-gate > strong {
    max-width: 560px;
    color: var(--ivory);
    font-size: clamp(23px, 3vw, 34px);
    line-height: 1.12;
    text-wrap: balance;
}

.profile-page .mini-analysis-premium-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 164px;
    min-height: 46px;
    padding: 11px 22px;
    color: var(--purple);
    background: #f2d99d;
    border: 1px solid #f2d99d;
    border-radius: 4px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 140ms ease, background-color 140ms ease;
}

.profile-page .mini-analysis-premium-link:hover,
.profile-page .mini-analysis-premium-link:focus-visible {
    color: var(--purple);
    background: var(--ivory);
    transform: translateY(-1px);
}

@media (max-width: 720px) {
    .profile-page .match-mini-analysis.is-premium-gate {
        min-height: 430px;
    }

    .profile-page .mini-analysis-premium-preview {
        filter: blur(6px);
    }

    .profile-page .mini-analysis-premium-gate {
        padding: 22px;
    }
}

.profile-page .match-item-row {
    display: grid;
    grid-template-columns: repeat(7, 25px);
    gap: 4px;
    overflow: visible;
}

.match-item-slot {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    overflow: hidden;
    background: rgba(13, 6, 34, 0.42);
    border: 1px solid rgba(255, 255, 240, 0.2);
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(13, 6, 34, 0.25);
}

.profile-page .match-item-slot .match-item-icon {
    width: 100%;
    height: 100%;
    background: transparent;
}

@media (prefers-reduced-motion: reduce) {
    .profile-status-line.is-loading::before,
    .profile-match-loading::before,
    .profile-champion-loading::before,
    .mini-analysis-loading::before {
        animation: none;
    }
}

@media (max-width: 760px) {
    .profile-page .mini-analysis-metrics,
    .profile-page .mini-analysis-moments {
        grid-template-columns: 1fr;
    }

    .profile-page .match-mini-analysis {
        gap: 17px;
        border-radius: 5px;
    }
}

@media (min-width: 1100px) {
    .profile-page .profile-grid {
        grid-template-columns: minmax(340px, 0.9fr) minmax(0, 2.1fr);
    }
}

.profile-page .profile-dashboard-rail .match-history-list {
    min-width: 0;
    max-width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.profile-page .profile-dashboard-rail .match-history-item {
    grid-template-columns: 85px 205px 85px 105px minmax(130px, 1fr);
    grid-template-rows: auto;
    column-gap: 6px;
    row-gap: 12px;
    min-width: 672px;
    padding: 13px 14px;
}

.profile-page .profile-dashboard-rail .match-result-block {
    grid-column: 1;
    grid-row: 1;
}

.profile-page .profile-dashboard-rail .match-result-block,
.profile-page .profile-dashboard-rail .match-score-block,
.profile-page .profile-dashboard-rail .match-metrics-block {
    gap: 3px;
}

.profile-page .profile-dashboard-rail .match-result-block strong {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-page .profile-dashboard-rail .match-result-block b {
    margin-top: 3px;
}

.profile-page .profile-dashboard-rail .match-result-block span,
.profile-page .profile-dashboard-rail .match-score-block span,
.profile-page .profile-dashboard-rail .match-metrics-block span {
    font-size: 13px;
}

.profile-page .profile-dashboard-rail .match-loadout-block {
    grid-column: 2;
    grid-row: 1;
    grid-template-areas:
        "champ spells"
        "items items";
    grid-template-columns: 58px minmax(139px, 1fr);
    gap: 8px;
    width: 100%;
}

.profile-page .profile-dashboard-rail .match-spell-rune-grid {
    justify-self: start;
}

.profile-page .profile-dashboard-rail .match-score-block {
    grid-column: 3;
    grid-row: 1;
}

.profile-page .profile-dashboard-rail .match-score-block strong {
    font-size: 24px;
}

.profile-page .profile-dashboard-rail .match-metrics-block {
    grid-column: 4;
    grid-row: 1;
}

.profile-page .profile-dashboard-rail .match-participants {
    grid-column: 5;
    grid-row: 1;
    gap: 6px;
}

.profile-page .profile-dashboard-rail .match-team-column {
    gap: 3px;
}

.profile-page .profile-dashboard-rail .match-team-heading {
    font-size: 10px;
}

.profile-page .profile-dashboard-rail .match-participant {
    gap: 4px;
    font-size: 12px;
}

.profile-page .profile-dashboard-rail .match-participant-icon {
    width: 20px;
    height: 20px;
}

.profile-page .profile-dashboard-rail .match-mini-analysis {
    grid-column: 1 / -1;
    grid-row: 2;
}

@media (max-width: 1099px) {
    .profile-page .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .profile-champion-metrics {
        grid-template-columns: 1fr 1.35fr;
    }

    .profile-champion-metrics div:last-child {
        grid-column: 1 / -1;
    }
}

/* Account privacy controls share this small page-specific sheet to remain CSP-safe. */
body[data-page="account"] .account-panel.account-settings-panel {
    width: min(680px, calc(100% - 68px));
}

body[data-page="account"] .account-privacy {
    display: grid;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

body[data-page="account"] .account-privacy-intro {
    max-width: 58ch;
    color: var(--muted);
    line-height: 1.55;
}

body[data-page="account"] .account-data-action,
body[data-page="account"] .account-danger-zone {
    display: grid;
    gap: 12px;
    padding: 18px;
    background: rgba(13, 6, 34, 0.035);
    border: 1px solid var(--line);
}

body[data-page="account"] .account-data-action h3,
body[data-page="account"] .account-data-action p,
body[data-page="account"] .account-danger-zone p {
    margin: 0;
}

body[data-page="account"] .account-data-action p,
body[data-page="account"] .account-danger-zone p {
    color: var(--muted);
    line-height: 1.5;
}

body[data-page="account"] .account-danger-zone a {
    color: var(--crimson);
    text-underline-offset: 2px;
}

body[data-page="account"] .account-data-action .secondary-button {
    width: fit-content;
    min-width: 190px;
}

body[data-page="account"] .account-danger-zone {
    padding: 0;
    overflow: hidden;
    border-color: rgba(153, 0, 0, 0.28);
    background: rgba(153, 0, 0, 0.035);
}

body[data-page="account"] .account-danger-zone summary {
    padding: 18px;
    color: var(--crimson);
    font-weight: 800;
    cursor: pointer;
}

body[data-page="account"] .account-danger-zone summary:hover,
body[data-page="account"] .account-danger-zone summary:focus-visible {
    background: rgba(153, 0, 0, 0.07);
}

body[data-page="account"] .account-danger-form {
    display: grid;
    gap: 14px;
    padding: 0 18px 18px;
    border-top: 1px solid rgba(153, 0, 0, 0.16);
}

body[data-page="account"] .account-danger-form > p:first-child {
    padding-top: 16px;
}

body[data-page="account"] .account-confirmation-hint {
    font-size: 14px;
}

body[data-page="account"] .account-confirmation-hint code {
    color: var(--purple);
    font-family: inherit;
    font-weight: 900;
}

body[data-page="account"] .account-acknowledgement {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}

body[data-page="account"] .account-acknowledgement input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: 0 0 auto;
}

body[data-page="account"] .account-danger-button {
    width: 100%;
    min-height: 43px;
    color: var(--white);
    background: var(--crimson);
    border: 1px solid var(--crimson);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

body[data-page="account"] .account-danger-button:hover:not(:disabled) {
    background: #7f0000;
}

body[data-page="account"] .account-danger-button:disabled,
body[data-page="account"] .account-data-action button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

body[data-page="account"] .account-data-status {
    min-height: 20px;
    color: var(--muted);
    font-size: 14px;
}

body[data-page="account"] .account-data-status.is-error {
    color: var(--crimson);
}

@media (max-width: 620px) {
    body[data-page="account"] .account-data-action .secondary-button {
        width: 100%;
    }
}
