.py-gym {
    --gym-bg: #17130b;
    --gym-panel: #2b2415;
    --gym-panel-deep: #201a0e;
    --gym-panel-raised: #372c17;
    --gym-line: #6a5425;
    --gym-gold: #f6cf3c;
    --gym-cream: #fff6cf;
    --gym-navy: #2c2d63;
    --gym-red: #ce5252;
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 22px;
}

.py-gym [hidden] {
    display: none !important;
}

.py-gym button,
.py-gym input {
    font: inherit;
}

.py-gym button,
.py-gym a {
    outline-offset: 3px;
}

.py-gym button:focus-visible,
.py-gym a:focus-visible,
.py-gym input:focus-visible,
.py-gym summary:focus-visible {
    outline: 3px solid var(--gym-gold);
}

.py-gym-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 470px);
    align-items: center;
    gap: 34px;
    min-height: 250px;
    padding: 34px 38px;
    overflow: hidden;
    border: 2px solid #9c7827;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(246, 207, 60, .16), transparent 46%),
        repeating-linear-gradient(0deg, rgba(255, 246, 207, .025) 0 2px, transparent 2px 6px),
        linear-gradient(120deg, #31260f, #211a0e 58%, #2c2d63 150%);
    box-shadow:
        inset 0 0 0 4px #17130b,
        inset 0 0 0 6px rgba(246, 207, 60, .22),
        0 20px 44px rgba(0, 0, 0, .34);
}

.py-gym-hero::before,
.py-gym-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.py-gym-hero::before {
    top: -80px;
    right: 22%;
    width: 260px;
    height: 260px;
    border: 28px solid rgba(246, 207, 60, .055);
    border-radius: 50%;
    box-shadow: inset 0 0 0 12px rgba(206, 82, 82, .035);
}

.py-gym-hero::after {
    right: 0;
    bottom: 0;
    width: 42%;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--gym-red) 0 22px, var(--gym-gold) 22px 44px, var(--gym-navy) 44px 66px);
}

.py-gym-eyebrow,
.py-gym-kicker {
    color: var(--gym-gold);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.py-gym-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.py-gym-eyebrow span {
    color: var(--gym-red);
    font-size: 14px;
}

.py-gym-hero h1 {
    margin: 0;
    color: #fffdf0;
    font-size: clamp(38px, 5vw, 66px);
    font-weight: 950;
    letter-spacing: -.045em;
    line-height: .98;
    text-shadow: 4px 4px 0 rgba(23, 19, 11, .8);
}

.py-gym-hero h1 span {
    display: block;
    color: var(--gym-gold);
}

.py-gym-hero-copy > p:not(.py-gym-eyebrow) {
    max-width: 680px;
    margin: 17px 0 0;
    color: #e3d5a8;
    font-size: 15px;
    line-height: 1.65;
}

.py-gym-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.py-gym-hero-tags span {
    padding: 5px 9px;
    border: 1px solid rgba(246, 207, 60, .3);
    border-radius: 4px;
    background: rgba(23, 19, 11, .48);
    color: #f6e8b8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.py-gym-trainer-card {
    position: relative;
    padding: 17px;
    border: 3px solid #17130b;
    border-radius: 6px;
    background:
        linear-gradient(rgba(44, 45, 99, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 45, 99, .08) 1px, transparent 1px),
        #f6cf3c;
    background-size: 16px 16px;
    color: #17130b;
    box-shadow:
        inset 0 0 0 3px #ffe678,
        7px 7px 0 #9c3a08;
}

.py-gym-trainer-card::before {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: 6px;
    left: 6px;
    border: 1px solid rgba(23, 19, 11, .35);
    pointer-events: none;
}

.py-gym-card-topline,
.py-gym-card-note {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.py-gym-card-topline {
    padding: 1px 2px 11px;
    border-bottom: 2px solid #17130b;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .11em;
}

.py-gym-card-topline strong {
    color: var(--gym-navy);
    font-size: 15px;
    letter-spacing: .02em;
}

.py-gym-card-topline b {
    color: #9c3a08;
}

.py-gym-badge-strip {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    padding: 14px 0 10px;
}

.py-gym-badge-slot,
.py-gym-badge-strip .is-placeholder {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-width: 0;
    border: 1px solid rgba(23, 19, 11, .52);
    border-radius: 3px;
    background: rgba(255, 246, 207, .44);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22);
}

.py-gym-badge-strip .is-placeholder::after {
    content: "?";
    color: rgba(23, 19, 11, .45);
    font-weight: 950;
}

.py-gym-badge-slot {
    padding: 2px;
    cursor: pointer;
}

.py-gym-badge-slot:hover {
    background: rgba(255, 246, 207, .72);
}

.py-gym-badge-slot img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    filter: grayscale(1) opacity(.27);
    transition: filter .16s ease, transform .16s ease;
}

.py-gym-badge-slot.is-earned img {
    filter: none;
}

.py-gym-badge-slot.is-earned::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 6px;
    height: 6px;
    border: 1px solid #17130b;
    border-radius: 50%;
    background: #77b769;
}

.py-gym-badge-slot:hover img {
    transform: translateY(-1px);
}

.py-gym-progress-track {
    position: relative;
    height: 8px;
    overflow: hidden;
    border: 2px solid #17130b;
    background: rgba(255, 246, 207, .58);
}

.py-gym-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--gym-navy) 0 12px, #4d4f92 12px 24px);
    transition: width .22s ease;
}

.py-gym-card-note {
    margin-top: 9px;
    color: #463413;
    font-size: 10px;
    font-weight: 750;
}

.py-gym-card-note button {
    padding: 2px 5px;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    color: #5b2d11;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.py-gym-load-state,
.py-gym-noscript {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 180px;
    margin-top: 16px;
    padding: 24px;
    border: 1px solid var(--gym-line);
    border-radius: 9px;
    background: rgba(43, 36, 21, .96);
    color: #eadcaf;
    text-align: left;
}

.py-gym-load-state strong,
.py-gym-load-state small {
    display: block;
}

.py-gym-load-state strong {
    color: #fff8d9;
    font-size: 14px;
}

.py-gym-load-state small {
    margin-top: 3px;
    color: #a9955f;
}

.py-gym-load-state.is-error {
    border-color: rgba(206, 82, 82, .72);
}

.py-gym-load-state.is-error .py-gym-loader {
    border-color: var(--gym-red);
    animation: none;
}

.py-gym-load-state button {
    margin-top: 10px;
    padding: 6px 10px;
    border: 1px solid var(--gym-red);
    border-radius: 5px;
    background: #3b1e18;
    color: #fff0d2;
    cursor: pointer;
}

.py-gym-loader {
    width: 34px;
    height: 34px;
    border: 4px solid #5f4b21;
    border-top-color: var(--gym-gold);
    border-radius: 50%;
    animation: py-gym-spin .75s steps(8) infinite;
}

@keyframes py-gym-spin {
    to { transform: rotate(360deg); }
}

.py-gym-workbench {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    margin-top: 16px;
}

.py-gym-route-panel,
.py-gym-panel,
.py-gym-leader-stage,
.py-gym-facts > article {
    border: 1px solid var(--gym-line);
    background: rgba(43, 36, 21, .97);
    box-shadow: 0 13px 28px rgba(0, 0, 0, .22);
}

.py-gym-route-panel {
    position: sticky;
    top: 78px;
    padding: 14px;
    border-radius: 8px;
}

.py-gym-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 11px;
    border-bottom: 1px solid rgba(246, 207, 60, .17);
}

.py-gym-panel-heading.compact {
    min-height: 42px;
}

.py-gym-panel-heading h2 {
    margin: 2px 0 0;
    color: #fff9df;
    font-size: 16px;
    line-height: 1.15;
}

.py-gym-route-light,
.py-gym-save-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border: 2px solid #17130b;
    border-radius: 50%;
    background: var(--gym-red);
    box-shadow: 0 0 0 2px rgba(206, 82, 82, .2), 0 0 10px rgba(206, 82, 82, .4);
}

.py-gym-save-dot {
    background: #77b769;
    box-shadow: 0 0 0 2px rgba(119, 183, 105, .18), 0 0 10px rgba(119, 183, 105, .35);
}

.py-gym-route-list {
    display: grid;
    gap: 6px;
}

.py-gym-route-button {
    --route-accent: var(--gym-gold);
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 53px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #211b0f;
    color: #d9c999;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.py-gym-route-button:hover {
    border-color: rgba(246, 207, 60, .35);
    background: #302612;
    transform: translateX(2px);
}

.py-gym-route-button.is-active {
    border-color: var(--route-accent);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--route-accent) 22%, transparent), transparent 62%),
        #302612;
    box-shadow: inset 3px 0 0 var(--route-accent);
}

.py-gym-route-button.is-earned .py-gym-route-badge img {
    filter: none;
}

.py-gym-route-badge {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #5f4b21;
    border-radius: 4px;
    background: #151109;
}

.py-gym-route-badge img {
    width: 31px;
    height: 31px;
    image-rendering: pixelated;
    filter: grayscale(1) opacity(.32);
}

.py-gym-route-copy {
    min-width: 0;
}

.py-gym-route-copy strong,
.py-gym-route-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-gym-route-copy strong {
    color: #fff5d0;
    font-size: 12px;
}

.py-gym-route-copy small {
    margin-top: 2px;
    color: #9e8b59;
    font-size: 10px;
}

.py-gym-route-order {
    color: var(--route-accent);
    font-size: 10px;
    font-weight: 900;
}

.py-gym-route-note {
    margin-top: 11px;
    padding: 10px;
    border: 1px dashed rgba(246, 207, 60, .25);
    border-radius: 6px;
    background: rgba(23, 19, 11, .46);
}

.py-gym-route-note strong {
    color: var(--gym-gold);
    font-size: 11px;
}

.py-gym-route-note p {
    margin: 5px 0 0;
    color: #aa9866;
    font-size: 10px;
    line-height: 1.45;
}

.py-gym-dashboard {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.py-gym-leader-stage {
    --gym-accent: var(--gym-gold);
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px 142px;
    align-items: stretch;
    gap: 16px;
    min-height: 228px;
    padding: 20px;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--gym-accent) 64%, #5f4b21);
    border-radius: 9px;
    background:
        linear-gradient(105deg, color-mix(in srgb, var(--gym-accent) 19%, transparent), transparent 48%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 8px),
        #2b2415;
}

.py-gym-leader-stage::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -90px;
    right: 200px;
    width: 250px;
    height: 250px;
    border: 35px solid color-mix(in srgb, var(--gym-accent) 9%, transparent);
    border-radius: 50%;
}

.py-gym-overview-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.py-gym-overview-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.py-gym-order-chip,
.py-gym-type-chip,
.py-gym-data-chip,
.py-gym-count-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 23px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.py-gym-order-chip {
    border-color: var(--gym-accent);
    background: color-mix(in srgb, var(--gym-accent) 18%, #211b0f);
    color: #fff8d8;
}

.py-gym-city-label {
    color: #bca970;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.py-gym-overview-copy h2 {
    margin: 12px 0 0;
    color: #fffdf0;
    font-size: clamp(28px, 3.2vw, 45px);
    font-weight: 950;
    letter-spacing: -.035em;
    line-height: .98;
}

.py-gym-overview-copy h2 span {
    display: block;
    margin-top: 7px;
    color: var(--gym-accent);
    font-size: .46em;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.py-gym-leader-quote {
    position: relative;
    max-width: 650px;
    margin: auto 0 0;
    padding: 12px 14px 12px 32px;
    border-left: 3px solid var(--gym-accent);
    background: rgba(23, 19, 11, .46);
    color: #e6d9ac;
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
}

.py-gym-leader-quote::before {
    content: "“";
    position: absolute;
    top: -2px;
    left: 9px;
    color: var(--gym-accent);
    font-size: 30px;
    font-style: normal;
    font-weight: 950;
}

.py-gym-leader-portrait,
.py-gym-stage-badge {
    display: grid;
    align-content: center;
    justify-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 7px;
    background: rgba(23, 19, 11, .64);
}

.py-gym-leader-portrait img {
    width: 138px;
    height: 138px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(5px 7px 0 rgba(0, 0, 0, .34));
}

.py-gym-leader-portrait strong {
    margin-top: 6px;
    color: #fff7d5;
    font-size: 13px;
}

.py-gym-leader-portrait span {
    margin-top: 2px;
    color: #9f8c5b;
    font-size: 10px;
    text-transform: uppercase;
}

.py-gym-stage-badge img {
    width: 82px;
    height: 82px;
    image-rendering: pixelated;
    filter: drop-shadow(4px 5px 0 rgba(0, 0, 0, .3));
}

.py-gym-stage-badge strong {
    margin-top: 8px;
    color: #fff7d5;
    font-size: 11px;
    text-align: center;
}

.py-gym-earned-button {
    width: 100%;
    margin-top: 10px;
    padding: 6px 7px;
    border: 1px solid var(--gym-accent);
    border-radius: 5px;
    background: transparent;
    color: #e9dba9;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.py-gym-earned-button.is-earned {
    background: var(--gym-accent);
    color: #17130b;
}

.py-gym-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.py-gym-facts > article {
    position: relative;
    min-width: 0;
    padding: 12px 13px;
    overflow: hidden;
    border-radius: 7px;
}

.py-gym-facts > article::after {
    content: "";
    position: absolute;
    right: -12px;
    bottom: -12px;
    width: 42px;
    height: 42px;
    border: 8px solid rgba(246, 207, 60, .04);
    border-radius: 50%;
}

.py-gym-facts span,
.py-gym-facts strong,
.py-gym-facts small {
    display: block;
    min-width: 0;
}

.py-gym-facts span {
    color: #9d8a59;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.py-gym-facts strong {
    margin-top: 4px;
    overflow: hidden;
    color: #fff6d3;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-gym-facts small {
    margin-top: 2px;
    color: #b4a16c;
    font-size: 10px;
}

.py-gym-panel {
    min-width: 0;
    padding: 15px;
    border-radius: 8px;
}

.py-gym-battle-grid,
.py-gym-guide-grid,
.py-gym-lower-grid {
    display: grid;
    gap: 14px;
}

.py-gym-battle-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, .72fr);
}

.py-gym-guide-grid {
    grid-template-columns: minmax(420px, 1.15fr) minmax(300px, .85fr);
}

.py-gym-lower-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
}

.py-gym-data-chip,
.py-gym-count-chip {
    border-color: rgba(246, 207, 60, .32);
    background: #211b0f;
    color: var(--gym-gold);
}

.py-gym-count-chip {
    color: #d9c99b;
    letter-spacing: 0;
    text-transform: none;
}

.py-gym-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: 8px;
}

.py-gym-pokemon-card {
    --pokemon-accent: #8b7f63;
    position: relative;
    min-width: 0;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 7px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--pokemon-accent) 14%, transparent), transparent 58%),
        #211b0f;
}

.py-gym-pokemon-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--pokemon-accent);
}

.py-gym-pokemon-level {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    padding: 3px 5px;
    border: 1px solid rgba(246, 207, 60, .35);
    border-radius: 3px;
    background: rgba(23, 19, 11, .82);
    color: var(--gym-gold);
    font-size: 10px;
    font-weight: 950;
}

.py-gym-pokemon-card img {
    display: block;
    width: 86px;
    height: 86px;
    margin: 4px auto 0;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(4px 5px 0 rgba(0, 0, 0, .28));
}

.py-gym-pokemon-card h3 {
    margin: 5px 0 0;
    overflow: hidden;
    color: #fff8da;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-gym-type-row,
.py-gym-key-moves {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 7px;
}

.py-gym-type-chip {
    min-height: 19px;
    padding: 2px 5px;
    border: 0;
    color: #fff;
    font-size: 8px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
}

.py-gym-key-moves {
    align-content: flex-start;
    min-height: 21px;
}

.py-gym-key-moves span {
    padding: 2px 5px;
    border: 1px solid rgba(246, 207, 60, .17);
    border-radius: 3px;
    background: #17130b;
    color: #bba96f;
    font-size: 8px;
}

.py-gym-move-note {
    margin: 9px 0 0;
    color: #8f7c4c;
    font-size: 9px;
    line-height: 1.4;
}

.py-gym-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(246, 207, 60, .14);
    border-radius: 6px;
    background: #17130b;
}

.py-gym-mode-switch button {
    min-height: 31px;
    padding: 5px 7px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #9e8b58;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.py-gym-mode-switch button.is-active {
    background: var(--gym-navy);
    color: #fff4c9;
    box-shadow: inset 0 -2px 0 var(--gym-red);
}

.py-gym-readiness-result {
    --readiness-color: #f6cf3c;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 11px;
    padding: 11px;
    border: 1px solid color-mix(in srgb, var(--readiness-color) 44%, #5f4b21);
    border-radius: 7px;
    background: color-mix(in srgb, var(--readiness-color) 8%, #211b0f);
}

.py-gym-readiness-level {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border: 4px solid var(--readiness-color);
    border-radius: 50%;
    background: #17130b;
    color: #fff8d8;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--readiness-color) 13%, transparent);
}

.py-gym-readiness-level strong,
.py-gym-readiness-level small {
    display: block;
    text-align: center;
}

.py-gym-readiness-level strong {
    font-size: 19px;
    line-height: 1;
}

.py-gym-readiness-level small {
    margin-top: 3px;
    color: #a99864;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.py-gym-readiness-copy strong,
.py-gym-readiness-copy span {
    display: block;
}

.py-gym-readiness-copy strong {
    color: var(--readiness-color);
    font-size: 13px;
}

.py-gym-readiness-copy span {
    margin-top: 4px;
    color: #c9b881;
    font-size: 10px;
    line-height: 1.4;
}

.py-gym-party-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
}

.py-gym-party-mini {
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 5px;
    background: #211b0f;
    text-align: center;
}

.py-gym-party-mini.is-match {
    border-color: rgba(119, 183, 105, .52);
    background: rgba(44, 75, 38, .3);
}

.py-gym-party-mini img {
    display: block;
    width: 45px;
    height: 45px;
    margin: 0 auto;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-gym-party-mini strong,
.py-gym-party-mini small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-gym-party-mini strong {
    color: #f5e8bb;
    font-size: 9px;
}

.py-gym-party-mini small {
    margin-top: 1px;
    color: var(--gym-gold);
    font-size: 8px;
}

.py-gym-coverage-note,
.py-gym-party-empty,
.py-gym-manual-note {
    margin: 9px 0 0;
    color: #a4915d;
    font-size: 10px;
    line-height: 1.45;
}

.py-gym-coverage-note strong {
    color: #d9ca97;
}

.py-gym-party-empty {
    padding: 10px;
    border: 1px dashed rgba(246, 207, 60, .2);
    border-radius: 6px;
    background: #211b0f;
}

.py-gym-party-empty a,
.py-gym-readiness-actions a {
    color: var(--gym-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.py-gym-manual-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 9px;
    align-items: center;
    margin-top: 11px;
}

.py-gym-manual-control input[type="range"] {
    width: 100%;
    accent-color: var(--gym-gold);
}

.py-gym-manual-control input[type="number"] {
    width: 100%;
    height: 36px;
    padding: 5px 7px;
    border: 1px solid #6a5425;
    border-radius: 5px;
    background: #17130b;
    color: #fff5d1;
    font-weight: 900;
    text-align: center;
}

.py-gym-readiness-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    color: #8f7d4d;
    font-size: 9px;
}

.py-gym-readiness-actions button {
    padding: 4px 6px;
    border: 1px solid #5f4b21;
    border-radius: 4px;
    background: #211b0f;
    color: #c7b47b;
    font-size: 9px;
    cursor: pointer;
}

.py-gym-small-link {
    flex: 0 0 auto;
    color: var(--gym-gold);
    font-size: 10px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.py-gym-map-frame {
    position: relative;
    padding: 11px;
    overflow: hidden;
    border: 1px solid #5f4b21;
    border-radius: 7px;
    background:
        linear-gradient(45deg, #17130b 25%, #1d180e 25%, #1d180e 50%, #17130b 50%, #17130b 75%, #1d180e 75%);
    background-size: 16px 16px;
}

.py-gym-map-canvas {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: 3px solid #17130b;
    background: #fff6cf;
    box-shadow: 0 0 0 1px #9c7827, 6px 6px 0 rgba(0, 0, 0, .26);
}

.py-gym-map-canvas > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    image-rendering: pixelated;
}

.py-gym-map-pin {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 2px solid #17130b;
    border-radius: 50% 50% 50% 3px;
    background: #6d83df;
    color: #fff;
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
    box-shadow: 2px 3px 0 rgba(23, 19, 11, .55);
}

.py-gym-map-pin::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
}

.py-gym-map-pin.is-leader {
    z-index: 4;
    background: var(--gym-gold);
    color: #17130b;
}

.py-gym-map-pin:hover {
    z-index: 6;
    transform: translate(-50%, -50%) scale(1.14);
}

.py-gym-map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 11px;
    color: #aa9863;
    font-size: 9px;
}

.py-gym-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.py-gym-map-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid #17130b;
    border-radius: 50%;
    background: #6d83df;
}

.py-gym-map-legend .leader-dot {
    background: var(--gym-gold);
}

.py-gym-puzzle-card {
    position: relative;
    padding: 13px;
    overflow: hidden;
    border: 1px solid rgba(246, 207, 60, .28);
    border-radius: 7px;
    background:
        linear-gradient(135deg, rgba(246, 207, 60, .1), transparent 58%),
        #211b0f;
}

.py-gym-puzzle-card::after {
    content: "?";
    position: absolute;
    right: 9px;
    bottom: -18px;
    color: rgba(246, 207, 60, .06);
    font-size: 86px;
    font-weight: 950;
    line-height: 1;
}

.py-gym-puzzle-card span {
    color: var(--gym-red);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.py-gym-puzzle-card h3 {
    margin: 4px 0 0;
    color: #fff6d3;
    font-size: 15px;
}

.py-gym-puzzle-card p {
    position: relative;
    z-index: 1;
    margin: 7px 0 0;
    color: #cbb982;
    font-size: 11px;
    line-height: 1.52;
}

.py-gym-puzzle-tip {
    margin-top: 9px !important;
    padding: 8px 9px;
    border-left: 3px solid var(--gym-gold);
    background: rgba(23, 19, 11, .52);
    color: #e2d4a6 !important;
}

.py-gym-plan-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 11px 0 0;
    list-style: none;
    counter-reset: gym-plan;
}

.py-gym-plan-list li {
    position: relative;
    min-height: 40px;
    padding: 9px 10px 9px 42px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 6px;
    background: #211b0f;
    color: #c9b882;
    font-size: 11px;
    line-height: 1.48;
    counter-increment: gym-plan;
}

.py-gym-plan-list li::before {
    content: counter(gym-plan, decimal-leading-zero);
    position: absolute;
    top: 8px;
    left: 9px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 1px solid var(--gym-gold);
    border-radius: 4px;
    background: #17130b;
    color: var(--gym-gold);
    font-size: 9px;
    font-weight: 950;
}

.py-gym-counter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.py-gym-counter-card {
    --counter-accent: #8b7f63;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    min-height: 110px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 7px;
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--counter-accent) 13%, transparent), transparent 64%),
        #211b0f;
    transition: border-color .15s ease, transform .15s ease;
}

.py-gym-counter-card:hover {
    border-color: color-mix(in srgb, var(--counter-accent) 60%, #5f4b21);
    transform: translateY(-2px);
}

.py-gym-counter-card img {
    align-self: center;
    width: 76px;
    height: 76px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(4px 5px 0 rgba(0, 0, 0, .25));
}

.py-gym-counter-copy {
    min-width: 0;
}

.py-gym-counter-copy h3 {
    margin: 1px 0 0;
    color: #fff7d5;
    font-size: 13px;
}

.py-gym-counter-copy .py-gym-type-row {
    justify-content: flex-start;
    margin-top: 5px;
}

.py-gym-counter-copy p {
    margin: 7px 0 0;
    color: #b9a873;
    font-size: 10px;
    line-height: 1.42;
}

.py-gym-trainer-list {
    display: grid;
    gap: 7px;
}

.py-gym-trainer-empty {
    padding: 16px;
    border: 1px dashed rgba(246, 207, 60, .24);
    border-radius: 7px;
    color: #aa9863;
    text-align: center;
}

.py-gym-trainer-card {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 7px;
    background: #211b0f;
    transition: border-color .15s ease, background .15s ease;
}

.py-gym-trainer-card[open],
.py-gym-trainer-card.is-focused {
    border-color: rgba(109, 131, 223, .72);
    background: #252034;
}

.py-gym-trainer-card summary {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 6px 9px;
    list-style: none;
    cursor: pointer;
}

.py-gym-trainer-card summary::-webkit-details-marker {
    display: none;
}

.py-gym-trainer-card summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border: 1px solid #5f4b21;
    border-radius: 4px;
    color: var(--gym-gold);
    font-weight: 900;
}

.py-gym-trainer-card[open] summary::after {
    content: "−";
}

.py-gym-trainer-card summary > img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-gym-trainer-summary {
    min-width: 0;
}

.py-gym-trainer-summary strong,
.py-gym-trainer-summary span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-gym-trainer-summary strong {
    color: #f8edc6;
    font-size: 12px;
}

.py-gym-trainer-summary span {
    margin-top: 3px;
    color: #9f8c59;
    font-size: 9px;
}

.py-gym-trainer-party {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px 11px 63px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.py-gym-trainer-mon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 31px;
    padding: 3px 6px 3px 3px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 5px;
    background: #17130b;
    color: #d8c898;
    font-size: 9px;
}

.py-gym-trainer-mon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
}

.py-gym-trainer-mon strong {
    color: var(--gym-gold);
}

.py-gym-reward-badge {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px;
    border: 1px solid rgba(246, 207, 60, .22);
    border-radius: 7px;
    background: #211b0f;
}

.py-gym-reward-badge img {
    width: 78px;
    height: 78px;
    image-rendering: pixelated;
}

.py-gym-reward-badge strong,
.py-gym-reward-badge span,
.py-gym-reward-badge small {
    display: block;
}

.py-gym-reward-badge strong {
    color: #fff7d4;
    font-size: 14px;
}

.py-gym-reward-badge span {
    margin-top: 5px;
    color: #baa873;
    font-size: 10px;
    line-height: 1.45;
}

.py-gym-reward-badge span b {
    display: block;
    margin-bottom: 1px;
    color: #8e7c4d;
    font-size: 8px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.py-gym-reward-badge span.is-engine {
    color: #f6cf3c;
}

.py-gym-reward-badge small {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(246, 207, 60, .14);
    color: #9f8c58;
    font-size: 8px;
    line-height: 1.45;
}

.py-gym-tm-card {
    --tm-color: #8b7f63;
    margin-top: 9px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--tm-color) 54%, #5f4b21);
    border-radius: 7px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--tm-color) 14%, transparent), transparent 58%),
        #211b0f;
}

.py-gym-tm-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.py-gym-tm-title div {
    min-width: 0;
}

.py-gym-tm-title span,
.py-gym-tm-title strong {
    display: block;
}

.py-gym-tm-title span {
    color: var(--gym-gold);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .08em;
}

.py-gym-tm-title strong {
    margin-top: 2px;
    color: #fff8da;
    font-size: 15px;
}

.py-gym-tm-disc {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    flex: 0 0 auto;
    border: 5px solid var(--tm-color);
    border-radius: 50%;
    background: #17130b;
    color: #fff;
    font-size: 9px;
    font-weight: 950;
    box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--tm-color) 40%, #fff6cf);
}

.py-gym-tm-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
}

.py-gym-tm-stats span {
    min-width: 0;
    padding: 5px 4px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 4px;
    background: rgba(23, 19, 11, .65);
    color: #9d8b58;
    font-size: 8px;
    text-align: center;
    text-transform: uppercase;
}

.py-gym-tm-stats strong {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #ecddb0;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.py-gym-tm-card p {
    margin: 9px 0 0;
    color: #b6a570;
    font-size: 10px;
    line-height: 1.45;
}

.py-gym-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.py-gym-pager button {
    display: grid;
    gap: 3px;
    min-height: 58px;
    padding: 9px 12px;
    border: 1px solid var(--gym-line);
    border-radius: 7px;
    background: #211b0f;
    color: #d9ca9a;
    cursor: pointer;
}

.py-gym-pager button:last-child {
    text-align: right;
}

.py-gym-pager button:hover {
    border-color: var(--gym-gold);
    background: #302612;
}

.py-gym-pager span {
    color: #8f7d4c;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.py-gym-pager strong {
    color: #fff6d3;
    font-size: 12px;
}

.py-gym-data-note {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    padding: 12px 3px 2px;
    border-top: 1px solid rgba(246, 207, 60, .13);
}

.py-gym-data-note p {
    max-width: 720px;
    margin: 0;
    color: #867545;
    font-size: 9px;
    line-height: 1.5;
}

.py-gym-data-note strong {
    color: #aa9760;
}

.py-gym-noscript {
    min-height: auto;
    border-color: var(--gym-red);
}

@media (max-width: 1240px) {
    .py-gym {
        padding: 16px;
    }

    .py-gym-workbench {
        grid-template-columns: 226px minmax(0, 1fr);
    }

    .py-gym-battle-grid,
    .py-gym-lower-grid {
        grid-template-columns: 1fr;
    }

    .py-gym-readiness-panel {
        order: -1;
    }

    .py-gym-party-mini-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1020px) {
    .py-gym-hero {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .py-gym-trainer-card {
        width: min(560px, 100%);
    }

    .py-gym-workbench {
        grid-template-columns: 1fr;
    }

    .py-gym-route-panel {
        position: static;
    }

    .py-gym-route-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .py-gym-route-button {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .py-gym-route-order {
        display: none;
    }

    .py-gym-route-note {
        display: none;
    }
}

@media (max-width: 820px) {
    .py-gym-leader-stage {
        grid-template-columns: minmax(0, 1fr) 145px;
    }

    .py-gym-stage-badge {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 74px minmax(0, 1fr) auto;
        justify-items: start;
        gap: 10px;
    }

    .py-gym-stage-badge img {
        width: 68px;
        height: 68px;
    }

    .py-gym-stage-badge strong {
        align-self: center;
        margin: 0;
        text-align: left;
    }

    .py-gym-earned-button {
        align-self: center;
        width: auto;
        min-width: 120px;
        margin: 0;
    }

    .py-gym-guide-grid {
        grid-template-columns: 1fr;
    }

    .py-gym-counter-grid {
        grid-template-columns: 1fr;
    }

    .py-gym-counter-card {
        min-height: 100px;
    }
}

@media (max-width: 650px) {
    .py-gym {
        padding: 10px;
    }

    .py-gym-hero {
        padding: 26px 20px 30px;
    }

    .py-gym-hero h1 {
        font-size: clamp(36px, 13vw, 54px);
    }

    .py-gym-trainer-card {
        padding: 14px;
        box-shadow: inset 0 0 0 3px #ffe678, 5px 5px 0 #9c3a08;
    }

    .py-gym-badge-strip {
        gap: 2px;
    }

    .py-gym-route-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .py-gym-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .py-gym-leader-stage {
        grid-template-columns: 1fr 112px;
        gap: 10px;
        padding: 15px;
    }

    .py-gym-leader-portrait {
        padding: 7px;
    }

    .py-gym-leader-portrait img {
        width: 98px;
        height: 110px;
    }

    .py-gym-leader-quote {
        margin-top: 16px;
        padding-left: 27px;
        font-size: 11px;
    }

    .py-gym-stage-badge {
        grid-template-columns: 62px minmax(0, 1fr);
    }

    .py-gym-stage-badge img {
        width: 58px;
        height: 58px;
    }

    .py-gym-earned-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .py-gym-party-mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .py-gym-team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .py-gym-map-frame {
        padding: 7px;
    }

    .py-gym-trainer-party {
        padding-left: 10px;
    }

    .py-gym-data-note {
        display: grid;
        gap: 8px;
    }
}

@media (max-width: 430px) {
    .py-gym-hero-tags span:nth-child(3) {
        display: none;
    }

    .py-gym-card-note span {
        max-width: 190px;
    }

    .py-gym-route-button {
        min-height: 49px;
        padding: 5px;
    }

    .py-gym-route-badge {
        width: 30px;
        height: 30px;
    }

    .py-gym-route-badge img {
        width: 28px;
        height: 28px;
    }

    .py-gym-route-copy strong {
        font-size: 10px;
    }

    .py-gym-route-copy small {
        font-size: 8px;
    }

    .py-gym-leader-stage {
        grid-template-columns: 1fr;
    }

    .py-gym-leader-portrait {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        justify-items: start;
    }

    .py-gym-leader-portrait img {
        grid-row: 1 / 3;
        width: 82px;
        height: 88px;
    }

    .py-gym-leader-portrait strong,
    .py-gym-leader-portrait span {
        align-self: end;
        margin-left: 5px;
    }

    .py-gym-leader-portrait span {
        align-self: start;
    }

    .py-gym-panel {
        padding: 12px;
    }

    .py-gym-team-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .py-gym-pokemon-card {
        padding: 8px 5px;
    }

    .py-gym-pokemon-card img {
        width: 72px;
        height: 72px;
    }

    .py-gym-readiness-result {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .py-gym-readiness-level {
        width: 58px;
        height: 58px;
    }

    .py-gym-tm-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .py-gym-pager {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .py-gym *,
    .py-gym *::before,
    .py-gym *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
