.animal-details {
    max-width: 100%;
    margin: 0;
}

.animal-details-icon {
    --animal-icon-size: 96px;
    --animal-icon-bg-scale: 0.375;
    border-radius: 50%;
    flex-shrink: 0;
}

.animal-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    width: fit-content;
}

.animal-title-row .content-hero__title {
    min-width: 0;
    max-width: min(58vw, 620px);
    overflow-wrap: anywhere;
}

.animal-name-inline-input {
    width: min(58vw, 520px);
    min-width: 220px;
    height: 38px;
    box-sizing: border-box;
    font-size: 18px;
    font-weight: 600;
}

.animal-title-row.is-editing {
    width: min(100%, 600px);
}

.animal-name-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(190, 230, 205, 0.34);
    border-radius: 50%;
    background: rgba(12, 24, 18, 0.72);
    color: rgba(226, 238, 230, 0.92);
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.animal-name-edit-button:hover,
.animal-name-edit-button:focus-visible {
    border-color: rgba(150, 220, 175, 0.8);
    background: rgba(36, 76, 48, 0.86);
    color: #ffffff;
    outline: none;
}

.animal-name-edit-button i {
    font-size: 13px;
}

.animal-types {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.type-pill {
    gap: 8px;
    font-size: 12px;
}

.type-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.type-pill .type-icon-render {
    --type-icon-size: 20px;
}

.move-type-cell .type-icon-render {
    --type-icon-size: 28px;
}

.animal-description {
    padding: 0;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(226, 238, 230, 0.9);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: rgba(200, 224, 210, 0.8);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
}

.animal-actions {
    display: flex;
    justify-content: flex-end;
}

.battle-history-panel {
    padding-top: 15px;
    padding-bottom: 22px;
}

.battle-history-head {
    margin-bottom: 12px;
    padding: 0 18px;
}

.battle-history-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 18px 18px;
}

.battle-history-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.battle-history-stat {
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(170, 210, 255, 0.24);
    border-radius: 8px;
    background: rgba(8, 16, 28, 0.58);
}

.battle-history-stat-label {
    color: rgba(200, 224, 210, 0.78);
    font-size: 12px;
    text-transform: uppercase;
}

.battle-history-stat strong {
    color: #ffffff;
    font-size: 20px;
}

.battle-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.battle-history-entry {
    position: relative;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) minmax(180px, 0.38fr);
    align-items: center;
    gap: 14px;
    min-height: 65px;
    padding: 6px 0 6px 6px;
    border: 1px solid rgba(170, 210, 255, 0.22);
    border-radius: 8px;
    background-color: rgba(8, 16, 28, 0.5);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.battle-history-entry::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 8, 16, 0.58), rgba(3, 8, 16, 0.2) 42%, rgba(3, 8, 16, 0.72)),
        linear-gradient(0deg, rgba(3, 8, 16, 0.36), rgba(3, 8, 16, 0.08));
    pointer-events: none;
}

.battle-history-icon-pane,
.battle-history-entry-main,
.battle-history-outcome {
    position: relative;
    z-index: 1;
}

.battle-history-icon-pane {
    position: relative;
    height: 64px;
    align-self: stretch;
    min-height: 64px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.battle-history-icon-pane::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.24));
}

.battle-history-enemy-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
}

.battle-history-entry-main {
    min-width: 0;
}

.battle-history-entry-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
}

.battle-history-level,
.battle-history-date {
    color: rgba(200, 224, 210, 0.76);
    font-size: 12px;
}

.battle-history-date {
    display: block;
    margin-top: 5px;
}

.battle-history-outcome {
    position: absolute;
    top: 45%;
    bottom: auto;
    right: 14px;
    transform: translateY(-50%);
    display: block;
    box-sizing: border-box;
    padding-top: 0;
    padding-right: 0;
    text-align: right;
    font-size: clamp(30px, 5vw, 58px);
    font-weight: 900;
    line-height: 0.72;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.16);
    background: none;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14),
        0 6px 18px rgba(0, 0, 0, 0.62);
}

.battle-history-entry--win .battle-history-outcome {
    color: rgba(105, 255, 154, 0.2);
}

.battle-history-entry--loss .battle-history-outcome {
    color: rgba(255, 94, 94, 0.2);
}

.battle-history-entry--draw .battle-history-outcome {
    color: rgba(220, 230, 245, 0.18);
}

.battle-history-empty {
    padding: 24px;
    border: 1px dashed rgba(170, 210, 255, 0.24);
    border-radius: 8px;
    color: rgba(200, 224, 210, 0.78);
    text-align: center;
}

.profile-battle-history-list {
    gap: 10px;
}

.profile-battle-history-entry {
    grid-template-columns: 360px minmax(0, 1fr) minmax(180px, 0.38fr);
}

.profile-battle-matchup {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(112px, 1fr) 34px 92px;
    align-items: center;
    gap: 8px;
    min-height: 64px;
}

.profile-battle-used {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    padding-left: 6px;
}

.profile-battle-used-icon {
    width: 92px;
    height: 64px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(8, 16, 28, 0.42);
    background-size: cover;
    background-position: center;
    flex: 0 0 auto;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-battle-used-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.24));
    pointer-events: none;
}

.profile-battle-used--count-4 .profile-battle-used-icon {
    width: 78px;
}

.profile-battle-used--count-5 .profile-battle-used-icon {
    width: 70px;
}

.profile-battle-used--count-6 .profile-battle-used-icon {
    width: 62px;
}

.profile-battle-used--count-4 .profile-battle-used-icon .battle-history-enemy-icon {
    width: 44px;
    height: 44px;
}

.profile-battle-used--count-5 .profile-battle-used-icon .battle-history-enemy-icon {
    width: 40px;
    height: 40px;
}

.profile-battle-used--count-6 .profile-battle-used-icon .battle-history-enemy-icon {
    width: 36px;
    height: 36px;
}

.profile-battle-chevron {
    color: rgba(255, 255, 255, 0.18);
    font-size: 38px;
    line-height: 1;
    text-align: center;
    text-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
}

.profile-battle-defeated-icon {
    width: 92px;
}

.animal-detail-tabs-card {
    padding: 0;
    overflow: hidden;
}

.animal-detail-tabs {
    display: flex;
    gap: 6px;
    padding: 14px 18px 0;
    border-bottom: 1px solid rgba(170, 210, 255, 0.18);
}

.animal-detail-tab {
    min-width: 108px;
    height: 38px;
    border: 1px solid rgba(170, 210, 255, 0.28);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: rgba(8, 16, 28, 0.52);
    color: rgba(200, 224, 210, 0.82);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.animal-detail-tab:hover,
.animal-detail-tab:focus-visible {
    color: #ffffff;
    background: rgba(22, 42, 66, 0.78);
    outline: none;
}

.animal-detail-tab.is-active {
    color: #ffffff;
    background: rgba(18, 32, 52, 0.92);
    border-color: rgba(170, 210, 255, 0.46);
}

.animal-tab-panel[hidden] {
    display: none !important;
}

.animal-tab-panel.is-hidden {
    display: none !important;
}

.animal-tab-panel {
    min-width: 0;
    padding-left: 18px;
    padding-right: 18px;
    box-sizing: border-box;
}

.stat-diagram-card {
    padding: 0;
}

.stat-diagram-head {
    margin-top: 15px;
    margin-bottom: 12px;
    padding: 0 18px;
}

.stat-diagram-hint {
    font-size: 12px;
    color: rgba(200, 224, 210, 0.8);
}

.stat-diagram-wrapper {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
    gap: 18px;
    align-items: center;
    padding: 20px;
    padding-left: 24px;
    padding-right: 24px;
    justify-content: space-between;
}

.stat-diagram-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 620px;
    width: 100%;
    justify-self: stretch;
}

.stat-diagram-empty {
    min-width: 180px;
    font-size: 12px;
    color: rgba(200, 224, 210, 0.8);
}

.stat-diagram-empty:empty {
    display: none;
}

.stat-diagram {
    position: relative;
    width: 260px;
    height: 260px;
    flex: 0 0 auto;
    justify-self: center;
    margin: 8px 0;
}

.stat-diagram svg {
    width: 100%;
    height: 100%;
    display: block;
}

.stat-grid polygon {
    fill: none;
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 1;
}

.stat-axes line {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1;
}

.stat-poly-value {
    fill: rgba(96, 170, 255, 0.28);
    stroke: rgba(96, 170, 255, 0.9);
    stroke-width: 2;
}

.stat-poly-iv {
    fill: rgba(255, 170, 64, 0.25);
    stroke: rgba(255, 170, 64, 0.95);
    stroke-width: 2;
}

.stat-poly-ev {
    fill: rgba(255, 170, 64, 0.10);
    stroke: rgba(255, 170, 64, 0.62);
    stroke-width: 2;
}

.stat-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.animal-stat-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 11px;
    line-height: 1.1;
    color: rgba(226, 238, 230, 0.9);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
    max-width: 86px;
}

.animal-stat-label .stat-label-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    color: rgba(255, 216, 160, 0.9);
    font-size: 10px;
    margin-top: 2px;
}

.stat-diagram-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: rgba(210, 225, 255, 0.75);
}

.stat-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: rgba(226, 238, 230, 0.9);
    table-layout: fixed;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(10, 16, 28, 0.65);
    border: 1px solid rgba(170, 210, 255, 0.25);
    margin-left: auto;
}

.stat-table-name-col {
    width: 48%;
}

.stat-table-value-col {
    width: 18%;
}

.stat-table-iv-col {
    width: 16%;
}

.stat-table-ev-col {
    width: 18%;
}

.stat-table th,
.stat-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(170, 210, 255, 0.12);
    word-break: normal;
    overflow-wrap: anywhere;
}

.stat-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(200, 224, 210, 0.8);
}

.stat-table tr:last-child td {
    border-bottom: none;
}

.stat-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stat-value-cell {
    font-family: "Michroma", sans-serif;
    font-size: 11px;
    white-space: nowrap;
}

.iv-grade-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 216, 160, 0.96);
    font-family: "Michroma", sans-serif;
    font-size: 16px;
    line-height: 1;
    box-sizing: border-box;
    text-align: center;
}

.iv-grade-badge.ffxiv-glyph {
    font-family: 'FFXIV_Lodestone_SSF', sans-serif;
    transform: none;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    width: 18px;
    height: 10px;
    border-radius: 4px;
    display: inline-block;
}

.legend-swatch.value {
    background: rgba(96, 170, 255, 0.9);
}

.legend-swatch.star {
    background: rgba(255, 170, 64, 0.9);
}

.legend-swatch.iv {
    background: rgba(255, 170, 64, 0.9);
}

.legend-swatch.ev {
    background: rgba(255, 170, 64, 0.9);
}

.legend-swatch.training {
    background: rgba(255, 170, 64, 0.95);
}

.animal-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .animal-details-icon {
        --animal-icon-size: 80px;
        --animal-icon-bg-scale: 0.3125;
    }

    .animal-name-inline-input {
        width: min(68vw, 420px);
        min-width: 0;
    }

    .animal-actions {
        justify-content: center;
    }

    .battle-history-summary {
        grid-template-columns: 1fr;
    }

    .battle-history-entry {
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: start;
        padding-right: 8px;
    }

    .battle-history-outcome {
        top: 45%;
        right: 14px;
        transform: translateY(-50%);
        padding-right: 0;
        font-size: 34px;
    }

    .stat-diagram {
        width: 220px;
        height: 220px;
    }

    .stat-diagram-meta {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .stat-diagram-wrapper {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}


