/* Pokémon — 63 × 88 mm (630 × 880 px). */

.tpl-pokemon {
    --pk-1: #f6f4ec;
    --pk-2: #cfcabb;
    --pk-ink: #161616;
    --pk-border-1: #fbe27a;
    --pk-border-2: #e2b322;
    background: var(--pk-border-2);
    font-family: 'Cabin', 'Gill Sans', sans-serif;
    color: var(--pk-ink);
}

.pk-border-yellow { --pk-border-1: #fce786; --pk-border-2: #e3b01c; }
.pk-border-silver { --pk-border-1: #f1f4f6; --pk-border-2: #a3acb4; }
.pk-border-black  { --pk-border-1: #4a4a4a; --pk-border-2: #0f0f0f; }

.pk-type-grass     { --pk-1: #dcefb4; --pk-2: #7fb24f; }
.pk-type-fire      { --pk-1: #fbd0b0; --pk-2: #dd5f33; }
.pk-type-water     { --pk-1: #cfe8f8; --pk-2: #4b93d1; }
.pk-type-lightning { --pk-1: #fdf0ae; --pk-2: #e6b522; }
.pk-type-psychic   { --pk-1: #ead7f3; --pk-2: #9b6ac0; }
.pk-type-fighting  { --pk-1: #f0d2b1; --pk-2: #b8743e; }
.pk-type-darkness  { --pk-1: #6a808b; --pk-2: #1c2a31; --pk-ink: #f4f7f8; }
.pk-type-metal     { --pk-1: #f1f4f6; --pk-2: #9ea9b1; }
.pk-type-dragon    { --pk-1: #f1e4b8; --pk-2: #b0913b; }
.pk-type-fairy     { --pk-1: #fad7e7; --pk-2: #d7709f; }
.pk-type-colorless { --pk-1: #fbfaf5; --pk-2: #cbc6b8; }
.pk-kind-trainer   { --pk-1: #fdfdfd; --pk-2: #c9d2d9; }

/* ---- Bordo e pannello ---- */

.pk-border {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, var(--pk-border-1), var(--pk-border-2) 48%, var(--pk-border-1) 100%);
}

.pk-panel {
    position: absolute;
    left: 24px;
    top: 24px;
    right: 24px;
    bottom: 24px;
    overflow: hidden;
    border-radius: 14px;
    background:
        radial-gradient(130% 55% at 50% 28%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 62%),
        linear-gradient(172deg, var(--pk-1), var(--pk-2));
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.pk-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../../Data/Background/Base_PerlinNoise_002.png') center / 380px auto;
    mix-blend-mode: soft-light;
    opacity: 0.45;
}

.pk-type-darkness .pk-panel { background: radial-gradient(130% 55% at 50% 28%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 62%), linear-gradient(172deg, var(--pk-1), var(--pk-2)); }

/* ---- Intestazione ---- */

.pk-header {
    position: absolute;
    left: 38px;
    right: 36px;
    top: 32px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pk-stage {
    flex: none;
    padding: 4px 13px 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #78838c, #2f363c);
    color: #fff;
    font-family: 'Jost', Futura, sans-serif;
    font-style: italic;
    font-weight: 800;
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pk-name {
    flex: 1 1 auto;
    min-width: 0;
    font-family: 'Cabin', 'Gill Sans', sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 1.1;
}

.pk-suffix {
    font-family: 'Jost', Futura, sans-serif;
    font-style: italic;
    font-weight: 800;
    color: #fff;
    -webkit-text-stroke: 5px #1a1a1a;
    paint-order: stroke fill;
    letter-spacing: -0.01em;
}

.pk-suffix--ex { background: none; }

.pk-hp {
    flex: none;
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-family: 'Jost', Futura, sans-serif;
    font-weight: 800;
}

.pk-hp small { font-size: 17px; }
.pk-hp b { font-size: 42px; line-height: 1; font-weight: 800; }

.pk-type { flex: none; display: inline-flex; font-size: 44px; }
.pk-type .sym { vertical-align: 0; }

.pk-evolves {
    position: absolute;
    left: 42px;
    top: 84px;
    font-size: 14px;
    font-style: italic;
    font-weight: 500;
    line-height: 1;
    opacity: 0.85;
}

/* ---- Illustrazione ---- */

.pk-art-frame {
    position: absolute;
    left: 44px;
    top: 102px;
    width: 542px;
    height: 376px;
    background: linear-gradient(135deg, #ffffff, #a9b3bb 28%, #f4f6f8 52%, #8e99a2 78%, #e9edf0);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.pk-art-frame::after {
    content: '';
    position: absolute;
    inset: 6px;
    box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.pk-art {
    left: 6px;
    top: 6px;
    width: 530px;
    height: 364px;
}

.pk-info {
    position: absolute;
    left: 96px;
    right: 96px;
    top: 482px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    background: linear-gradient(180deg, #fbf3cf, #cdb163);
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 100%, 0 100%);
    color: #3a2c05;
}

.pk-info-text {
    display: block;
    max-width: 100%;
    font-size: 15px;
    font-style: italic;
    font-weight: 600;
    line-height: 26px;
    text-align: center;
}

/* ---- Abilità e attacchi ---- */

.pk-body {
    position: absolute;
    left: 46px;
    right: 46px;
    top: 516px;
    height: 234px;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    gap: 0.4em;
    font-size: 30px;
}

.pk-ability-head,
.pk-attack-head {
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.pk-ability-badge {
    flex: none;
    padding: 0.08em 0.45em 0.12em;
    border-radius: 0.22em;
    background: linear-gradient(180deg, #e5504d, #a51d1f);
    color: #fff;
    font-family: 'Jost', Futura, sans-serif;
    font-style: italic;
    font-weight: 800;
    font-size: 0.6em;
    line-height: 1.1;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.pk-ability-name {
    font-weight: 700;
    font-size: 1.02em;
    line-height: 1.1;
    color: #b31f22;
}

.pk-type-darkness .pk-ability-name { color: #ff8a86; }

.pk-cost {
    flex: none;
    display: flex;
    gap: 0.08em;
    min-width: 2.3em;
    font-size: 1.05em;
}

.pk-cost .sym { vertical-align: 0; }

.pk-attack-name {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 1.05em;
    line-height: 1.1;
}

.pk-damage {
    flex: none;
    font-family: 'Jost', Futura, sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    line-height: 1;
}

.pk-ability-text,
.pk-attack-text {
    margin-top: 0.18em;
    font-weight: 500;
    font-size: 0.66em;
    line-height: 1.22;
}

.pk-ability-text .sym,
.pk-attack-text .sym { font-size: 1.1em; }

/* ---- Debolezza, resistenza, ritirata ---- */

.pk-stats {
    position: absolute;
    left: 46px;
    right: 46px;
    top: 756px;
    height: 46px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    align-items: center;
    border-top: 2px solid rgba(0, 0, 0, 0.3);
    padding-top: 3px;
}

.pk-type-darkness .pk-stats { border-top-color: rgba(255, 255, 255, 0.35); }

.pk-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.pk-stat-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    opacity: 0.85;
}

.pk-stat-value {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    font-family: 'Jost', Futura, sans-serif;
    font-weight: 700;
    font-size: 19px;
    line-height: 1;
}

.pk-stat-value .sym { font-size: 22px; vertical-align: 0; }

/* ---- Piè di pagina ---- */

.pk-footer {
    position: absolute;
    left: 42px;
    right: 42px;
    top: 806px;
    height: 46px;
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.pk-meta {
    flex: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
}

.pk-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pk-regulation {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: #111;
    color: #fff;
    font-family: 'Jost', Futura, sans-serif;
    font-weight: 800;
    font-size: 11px;
}

.pk-type-darkness .pk-regulation { background: #f4f7f8; color: #111; }

.pk-rarity { font-size: 13px; }

.pk-flavor,
.pk-rule {
    flex: 1 1 auto;
    margin-left: auto;
    max-width: 330px;
    padding: 3px 8px;
    border: 1.5px solid rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
    line-height: 1.2;
}

.pk-rule {
    font-style: normal;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.4);
}

.pk-type-darkness .pk-flavor,
.pk-type-darkness .pk-rule { border-color: rgba(255, 255, 255, 0.35); background: none; }

/* ---- Allenatore ---- */

.pk-panel--trainer::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(115deg, rgba(120, 140, 160, 0.1) 0 3px, transparent 3px 14px),
        radial-gradient(90% 40% at 50% 0%, rgba(255, 255, 255, 0.9), transparent 70%);
}

.pk-trainer-head {
    position: absolute;
    left: 42px;
    right: 42px;
    top: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pk-trainer-label {
    font-family: 'Jost', Futura, sans-serif;
    font-style: italic;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2f3a44;
}

.pk-trainer-type {
    padding: 5px 16px 6px;
    border-radius: 999px;
    color: #fff;
    font-family: 'Jost', Futura, sans-serif;
    font-weight: 800;
    font-size: 19px;
    line-height: 1;
    text-transform: uppercase;
    background: linear-gradient(180deg, #4f8fd8, #1f5ea8);
}

.pk-trainer-type--supporter { background: linear-gradient(180deg, #f39a45, #c8601a); }
.pk-trainer-type--stadium { background: linear-gradient(180deg, #52b36b, #237a3b); }
.pk-trainer-type--tool { background: linear-gradient(180deg, #a77ad6, #6a3f9e); }

.pk-trainer-name {
    position: absolute;
    left: 44px;
    right: 44px;
    top: 80px;
    height: 58px;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 46px;
    line-height: 1;
}

.pk-art-frame--trainer {
    left: 74px;
    top: 146px;
    width: 482px;
    height: 312px;
}

.pk-trainer-text {
    position: absolute;
    left: 58px;
    right: 58px;
    top: 482px;
    height: 250px;
    font-size: 27px;
    font-weight: 500;
    line-height: 1.25;
}

.pk-trainer-text p + p { margin-top: 0.4em; }

.pk-trainer-rule {
    position: absolute;
    left: 50px;
    right: 50px;
    top: 740px;
    height: 58px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(47, 58, 68, 0.1);
    border: 1.5px solid rgba(47, 58, 68, 0.35);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.pk-footer--trainer { top: 808px; }
