/* === 09. WYBOR KLASY ======================================================= */
#class-select-view {
    padding: 0;
    overflow: hidden;
    background-image: url("../image/bg/class_select.png");
    background-size: 1920px 1080px;
    background-position: center;
    color: #d7c5a3;
}

.class-picker-layout {
    position: relative;
    width: 1920px;
    height: 1080px;
    margin: auto;
    transform-origin: center;
}

.class-picker-grid {
    position: absolute;
    left: 62px;
    top: 26px;
    width: 1432px;
    display: grid;
    grid-template-columns: repeat(4, 352px);
    grid-auto-rows: 280px;
    gap: 8px;
}

@keyframes classPickerSelectedPulse {

    0%,
    100% {
        transform: scale(1.015);
    }

    50% {
        transform: scale(1.025);
    }
}

@keyframes classPickerSelectedGlow {

    0%,
    100% {
        filter: saturate(1.06) brightness(1.03) drop-shadow(0 0 10px rgba(224, 178, 94, .52));
    }

    50% {
        filter: saturate(1.1) brightness(1.06) drop-shadow(0 0 18px rgba(238, 196, 112, .64));
    }
}

.class-picker-card {
    position: relative;
    width: 352px;
    height: 280px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
    transition: transform .18s ease;
}

.class-picker-card img {
    position: absolute;
    inset: 0;
    width: 352px;
    height: 280px;
    object-fit: contain;
    filter: saturate(.92) brightness(.74);
    transition: filter .18s;
}

.class-picker-card:hover img {
    filter: saturate(1.08) brightness(.95);
}

.class-picker-card.selected {
    z-index: 3;
    overflow: visible;
    transform: scale(1.015);
    animation: classPickerSelectedPulse 2.6s ease-in-out infinite;
}

.class-picker-card.selected img {
    filter: saturate(1.06) brightness(1.03) drop-shadow(0 0 10px rgba(224, 178, 94, .52));
    animation: classPickerSelectedGlow 2.6s ease-in-out infinite;
}

.class-picker-card.selected .class-picker-card-name {
    color: #b3a37f;
    text-shadow: 0 2px 0 #000, 0 0 12px rgba(224, 178, 94, .62);
}

@media (prefers-reduced-motion: reduce) {

    .class-picker-card.selected,
    .class-picker-card.selected img {
        animation: none;
    }
}

.class-picker-card-shade {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    height: 112px;
    background: linear-gradient(to top, rgba(5, 3, 2, .94), rgba(5, 3, 2, .6) 55%, rgba(5, 3, 2, 0));
    z-index: 1;
}

.class-picker-card-name,
.class-picker-card-tagline {
    position: absolute;
    left: 18px;
    right: 18px;
    z-index: 2;
    display: block;
    text-align: center;
    text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .85);
}

.class-picker-card-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    bottom: 39px;
    color: #b3a37f;
    font-family: var(--font-title);
    font-size: 25px;
    line-height: 1;
    text-transform: none;
}

.class-picker-card-tagline {
    bottom: 16px;
    color: #cdbb9b;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.1;
}

.class-picker-card-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d2b173;
    font-family: var(--font-title);
    font-size: 92px;
}

.class-picker-details {
    /* --- Pelne strojenie prawego panelu wyboru klasy: uklad i wyglad w jednym miejscu --- */

    /* Okno panelu: polozenie, rozmiar, grafika i wewnetrzne odstepy. */
    --details-section-title-x: 0px;
    --details-section-title-y: 0px;
    --details-button-text-shadow: 0 2px 0 #000;

    padding: 128px 54px 78px;
    text-align: center;
}

/* Ikona klasy nad nazwa. */
.class-picker-details-icon {
    width: 64px;
    height: 96px;
    margin: 0 auto 8px;
    background: transparent url("../image/ui/icon_class.png") var(--class-icon-offset, 0px) center / 768px 96px no-repeat;
    transform: translate(0px, 0px);
}

/* Nazwa wybranej klasy. */
.class-picker-details h2 {
    margin: 0;
    color: #caba95;
    font-family: var(--font-title);
    font-size: 34px;
    line-height: 1;
    text-transform: uppercase;
    transform: translate(0px, 0px);
}

.class-picker-name-initial,
.hub-class-name-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f3d69d;
    border: 1px solid #a67b3d;
    background: #5a1115;
    box-shadow: inset 0 0 0 2px rgba(38, 7, 8, .8), inset 0 0 12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .65);
}

.class-picker-name-initial {
    flex: 0 0 28px;
    width: 28px;
    height: 34px;
    font-size: 30px;
    line-height: 1;
}

/* Rola klasy pod nazwa. */
.class-picker-role {
    margin-top: 8px;
    color: #bca177;
    font-family: var(--font-title);
    font-size: 14px;
    text-transform: uppercase;
    transform: translate(0px, 0px);
}

/* Tytuly sekcji: Specjalizacje, Kosci, Statystyki. */
.class-picker-section-title {
    margin: 22px 0 12px;
    color: #cba86c;
    font-family: var(--font-title);
    font-size: 16px;
    text-align: left;
    text-transform: uppercase;
    transform: translate(var(--details-section-title-x), var(--details-section-title-y));
}

/* Indywidualne przesuniecia tytulow sekcji. */
.class-picker-section-title--specs {
    transform: translate(calc(var(--details-section-title-x) + 0px), calc(var(--details-section-title-y) + 0px));
}

.class-picker-section-title--dice {
    transform: translate(calc(var(--details-section-title-x) + 0px), calc(var(--details-section-title-y) + 0px));
}

.class-picker-section-title--stats {
    transform: translate(calc(var(--details-section-title-x) + 0px), calc(var(--details-section-title-y) + 0px));
}

/* Lista specjalizacji. */
.class-picker-specs {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
    transform: translate(0px, 0px);
}

.class-picker-specs li {
    min-height: 27px;
    color: #cdbb9b;
    font-size: 14px;
}

/* Rzad kosci. */
.class-picker-dice {
    display: flex;
    justify-content: center;
    gap: 8px;
    transform: translate(0px, 0px);
}

/* Ikony kości: klatki atlasu 128x128 prezentowane w skali 50%. */
.class-picker-die-icon {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    background-image: url("../image/dice/player/dice_icon.png");
    background-size: 768px 192px;
    background-position: calc(var(--dice-icon-col, 0) * -64px) calc(var(--dice-icon-row, 0) * -64px);
    background-repeat: no-repeat;
    image-rendering: auto;
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .8));
}

/* Siatka statystyk. */
.class-picker-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    transform: translate(0px, 0px);
}

.class-picker-stat {
    display: flex;
    justify-content: space-between;
    color: #bfae91;
    font-size: 14px;
}

.class-picker-stat strong {
    color: #ead29d;
}

/* Przyciski na dole panelu. */
.class-picker-confirm {
    position: absolute;
    left: 50%;
    bottom: 144px;
    color: #f6dfad;
    font-family: var(--font-title);
    font-size: 18px;
    text-transform: none;
    text-shadow: var(--details-button-text-shadow);
    transform: translateX(-50%) translate(0px, -8px);
}

.class-picker-back {
    position: absolute;
    left: 50%;
    bottom: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f6dfad;
    font-family: var(--font-title);
    text-transform: none;
    text-shadow: var(--details-button-text-shadow);
    font-size: 16px;
    transform: translateX(-50%) translate(0px, -16px);
}

/* === 09.1 PIERWSZY WSTEP I WYBOR KLASY =================================== */
#onboarding-view {
    padding: 0;
    overflow: hidden;
    background: #030201;
    color: #d8c6a3;
}

.onboarding-intro,
.onboarding-class-choice {
    position: absolute;
    inset: 0;
}

.onboarding-slide-stage {
    position: absolute;
    left: 124px;
    top: 9px;
    width: 1672px;
    height: 941px;
    overflow: hidden;
    background: #020201;
}

.onboarding-story-image {
    position: absolute;
    inset: 0;
    width: 1672px;
    height: 941px;
    object-fit: contain;
    opacity: 0;
    transform: scale(1);
    transform-origin: center;
    transition: opacity 2.2s ease-in-out;
    will-change: opacity;
}

.onboarding-story-image.is-active {
    opacity: 1;
}

@keyframes onboardingStoryZoom {
    from {
        transform: scale(.95);
    }

    to {
        transform: scale(1);
    }
}

.onboarding-story-image.is-active.is-zooming {
    animation: onboardingStoryZoom var(--onboarding-slide-duration, 12s) linear forwards;
    will-change: opacity, transform;
}

.onboarding-story-image.is-paused {
    animation-play-state: paused;
}

.onboarding-shadow-frame {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    width: 1920px;
    height: 960px;
    pointer-events: none;
}

.onboarding-story-copy {
    position: absolute;
    left: 50%;
    bottom: 52px;
    z-index: 6;
    width: 1320px;
    min-height: 136px;
    padding: 16px 48px 12px;
    border-top: 1px solid rgba(190, 145, 73, .5);
    border-bottom: 1px solid rgba(92, 60, 29, .48);
    background: linear-gradient(90deg, transparent, rgba(8, 5, 3, .9) 12%, rgba(8, 5, 3, .94) 88%, transparent), linear-gradient(180deg, rgba(31, 20, 12, .68), rgba(3, 2, 1, .9));
    text-align: center;
    text-shadow: 0 2px 2px #000, 0 0 12px #000;
    transform: translateX(-50%);
}

#onboarding-story-text {
    position: relative;
    max-width: 1160px;
    height: 108px;
    margin: 0 auto;
    color: #e2d1ad;
    font: 400 18px/1.5 "MedievalSharp", serif;
    letter-spacing: .012em;
    text-transform: none;
    font-variant: normal;
}

.onboarding-story-copy-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 2.2s ease-in-out;
    pointer-events: none;
}

.onboarding-story-copy-layer.is-active {
    opacity: 1;
}

.onboarding-story-copy-layer p {
    margin: 0;
}

.onboarding-story-progress {
    width: 520px;
    height: 6px;
    margin: 16px auto 0;
    padding: 1px;
    overflow: hidden;
    border: 1px solid rgba(151, 108, 53, .58);
    background: rgba(24, 15, 8, .8);
    box-shadow: inset 0 1px 3px #000, 0 1px 2px #000;
}

.onboarding-story-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #75501f, #d0a35a 55%, #f0cf88);
    box-shadow: 0 0 5px rgba(216, 164, 81, .5);
    transform-origin: left center;
}

.onboarding-story-progress span.is-running {
    animation: onboardingStoryCountdown var(--onboarding-slide-duration, 12s) linear forwards;
}

.onboarding-story-progress span.is-paused {
    animation-play-state: paused;
}

@keyframes onboardingStoryCountdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.onboarding-story-hint {
    display: block;
    min-height: 0;
    margin: 6px 0 0;
    color: #bca67d;
    font: 600 12px/1.2 var(--font-body);
}

.onboarding-class-choice {
    isolation: isolate;
}

.onboarding-class-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: opacity .22s ease;
}

.onboarding-class-background::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(0, 0, 0, .5), transparent 30%, transparent 70%, rgba(0, 0, 0, .54));
    pointer-events: none;
}

.onboarding-class-logo-wrap {
    position: absolute;
    top: 48px;
    left: 49.5%;
    z-index: 2;
    width: 560px;
    height: 256px;
    isolation: isolate;
    pointer-events: none;
    transform: translateX(-50%) translateX(-24px);
}

.onboarding-class-logo-wrap::before {
    position: absolute;
    top: 40px;
    right: 14px;
    bottom: auto;
    left: 14px;
    height: 136px;
    z-index: -1;
    content: "";
    background: rgba(0, 0, 0, 0.96);
    filter: blur(14px);
}

.onboarding-class-logo {
    display: block;
    width: 480px;
    height: 256px;
    margin-left: 40px;
    object-fit: contain;
}

.onboarding-class-list-window {
    position: absolute;
    left: 144px;
    top: 80px;
    z-index: 3;
    width: 400px;
    height: 800px;
    background: transparent url("../image/ui/window_middle_tall.png") center / 400px 800px no-repeat;
}

.onboarding-class-list-window h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 146px 0 0;
    color: #d2ba89;
    font: 700 25px/1 var(--font-title);
    letter-spacing: .02em;
    text-align: center;
    text-shadow: 0 2px 2px #000;
}

.onboarding-heading-initial {
    display: flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 36px;
    color: #f3d69d;
    border: 1px solid #a67b3d;
    background: #5a1115;
    box-shadow: inset 0 0 0 2px rgba(38, 7, 8, .8), inset 0 0 12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .65);
    font-size: 31px;
    line-height: 1;
}

.onboarding-class-icons {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-auto-rows: 96px;
    gap: 8px 20px;
    width: 232px;
    margin: 30px auto 0;
}

.onboarding-class-icon {
    position: relative;
    width: 64px;
    height: 96px;
    padding: 0;
    border: 0;
    background-color: transparent;
    background-repeat: no-repeat;
    filter: saturate(.72) brightness(.68);
    transform: translateZ(0) scale(.94);
    transition: filter .16s ease, transform .16s ease;
    will-change: transform;
}

.onboarding-class-icon:hover {
    filter: saturate(1) brightness(.93);
    transform: translateZ(0) scale(1.02);
}

.onboarding-class-icon.is-selected {
    z-index: 2;
    filter: saturate(1.08) brightness(1.08) drop-shadow(0 0 5px rgba(224, 179, 92, .48));
    transform: translateZ(0) scale(1.14);
}

.onboarding-class-confirm {
    position: absolute;
    left: 50%;
    bottom: 68px;
    color: #f6dfad;
    font: 700 18px/1 var(--font-title);
    letter-spacing: .06em;
    text-transform: none;
    text-shadow: 0 2px 0 #000;
    transform: translateX(-50%);
}

.onboarding-class-message {
    position: absolute;
    right: 54px;
    bottom: 134px;
    left: 54px;
    min-height: 34px;
    margin: 0;
    color: #bca67d;
    font: 600 13px/1.3 var(--font-body);
    text-align: center;
    text-shadow: 0 2px 2px #000;
}

.onboarding-class-hero {
    position: absolute;
    left: 640px;
    bottom: 28px;
    z-index: 1;
    width: 640px;
    height: 720px;
    pointer-events: none;
}

.onboarding-class-hero img {
    display: block;
    width: 640px;
    height: 720px;
    object-fit: contain;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .72));
}

.onboarding-class-description {
    position: absolute;
    right: 144px;
    top: 192px;
    z-index: 3;
    width: 400px;
    height: 576px;
    padding: 76px 52px 40px;
    background: transparent url("../image/ui/window_character.png") center / 400px 576px no-repeat;
    text-align: center;
}

.onboarding-class-description h2 {
    position: absolute;
    top: 18px;
    right: 42px;
    left: 42px;
    margin: 0;
    overflow: hidden;
    color: #e3c990;
    font: 700 25px/34px var(--font-title);
    text-overflow: ellipsis;
    text-shadow: 0 2px 2px #000;
    text-transform: uppercase;
    white-space: nowrap;
}

#onboarding-class-role {
    display: block;
    color: #bb9862;
    font: 700 14px/1.2 var(--font-title);
    letter-spacing: .05em;
    text-transform: uppercase;
}

#onboarding-class-desc {
    margin: 25px 0 0;
    color: #d2c09f;
    font: 500 17px/1.48 var(--font-body);
    text-align: left;
    text-shadow: 0 2px 2px #000;
}

#onboarding-class-specs {
    margin: 26px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid rgba(176, 129, 62, .34);
    color: #c9ad7f;
    font: 600 15px/1.65 var(--font-body);
    list-style: none;
    text-align: left;
}

#onboarding-class-specs li::before {
    margin-right: 9px;
    color: #8d632d;
    content: "◆";
    font-size: 9px;
}

@media (prefers-reduced-motion: reduce) {

    .onboarding-story-image,
    .onboarding-story-copy-layer {
        transition-duration: .35s;
    }

    .onboarding-story-image.is-active.is-zooming {
        animation: none;
        transform: scale(1);
    }
}
