/*
 * Legend of Realms - Character creation
 * V5: responsive creation flow, name UX and review presentation.
 */

.createChar-Container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #3b2413;
}

.createChar-Box {
    width: 100%;
    position: relative;
    flex: 0 0 auto;
}

.createChar-TabTitle {
    box-sizing: border-box;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 14px;
    background-image: url("../assets/img/background/charCreation/charCreationTitle.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    text-align: center;
    transition: color .2s ease, filter .2s ease, text-shadow .2s ease;
}

.createChar-stepNumber {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(88, 47, 16, .65);
    border-radius: 50%;
    background: rgba(76, 40, 14, .18);
    box-shadow: inset 0 0 5px rgba(255, 226, 151, .25);
    font-size: 13px;
    line-height: 1;
}

.createChar-tabLabel {
    line-height: 1;
}

.tabTitleInactive {
    color: rgba(168, 92, 15, .72);
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 1px 1px rgba(255,255,255,.35), 0 2px 3px rgba(0,0,0,.35);
}

.tabTitleActive {
    color: #ffe300;
    font-weight: bold;
    font-size: 19px;
    text-shadow: 0 0 4px #4f2a00, 0 2px 2px #000;
    filter: saturate(1.08) brightness(1.03);
}

.tabTitleActive .createChar-stepNumber {
    color: #fff2a0;
    border-color: #9a5d17;
    background: rgba(72, 34, 5, .58);
    box-shadow: inset 0 0 5px rgba(255, 214, 86, .35), 0 0 7px rgba(255, 186, 34, .22);
}

.createChar-content {
    height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden auto;
    background-image: url("../assets/img/background/charCreation/createCharDisplayBox.webp");
    background-size: cover;
    background-repeat: round;
    transition: height .42s ease-in-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(92, 49, 17, .7) transparent;
}

.createChar-stepIntro {
    flex: 0 0 auto;
    padding: 10px 18px 6px;
    text-align: center;
}

.createChar-stepEyebrow {
    color: #865016;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    opacity: .86;
}

.createChar-stepHelp {
    max-width: 520px;
    margin: 3px auto 0;
    color: #4e301a;
    font-size: 14px;
    line-height: 1.22;
    text-shadow: 0 1px rgba(255,255,255,.35);
}

.createChar-displayContainer {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 3px 8px 7px;
}

.createChar-choiceGrid {
    gap: 4px;
}

.createChar-choiceCard {
    cursor: pointer;
    border-radius: 7px;
    transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
    -webkit-tap-highlight-color: transparent;
}

.createChar-choiceCard:hover {
    transform: translateY(-2px);
    filter: brightness(1.08) saturate(1.04);
}

.createChar-choiceCard:active {
    transform: translateY(1px) scale(.98);
}

.createChar-PictureBox {
    width: 78px;
    height: 78px;
    margin: 1px;
}

.createChar-PictureFrame {
    background-image: url("../assets/img/background/charCreation/createCharPictureBox.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.createChar-Picture {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    margin: 3px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.createChar-ClassBox {
    width: 69px;
    height: 69px;
    margin: 1px;
    border: 2px solid rgba(81, 43, 16, .78);
    border-radius: 7px;
    background: rgba(79, 42, 15, .24);
    box-shadow: inset 0 0 0 2px rgba(239, 185, 92, .18), 0 2px 4px rgba(45, 22, 5, .28);
}

.createChar-classIcon {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 5px;
}

.createChar-Container .createChar-PictureFrameSelected {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px #d87913, 0 0 0 4px #472407, 0 4px 11px rgba(77, 36, 2, .48);
    border-radius: 7px;
    filter: brightness(1.08) saturate(1.12);
}

.createChar-resumeContainer {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    margin: 0 8px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    overflow: auto;
    background-image: url("../assets/img/background/charCreation/CharDescriptionBox.webp");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.createChar-resumeBox {
    width: 100%;
    height: 100%;
    position: relative;
}

.createChar-resumeBoxContent {
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 13px 14px;
}

.createChar-emptyState {
    width: min(80%, 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: rgba(82, 48, 22, .76);
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
}

.createChar-emptyIcon {
    font-size: 25px;
    color: #a66a25;
    text-shadow: 0 1px rgba(255,255,255,.55);
}

.createChar-profileCard {
    width: 100%;
    max-width: 600px;
    display: grid;
    grid-template-columns: minmax(120px, 43%) minmax(135px, 1fr);
    align-items: center;
    gap: 10px;
}

.createChar-profileVisual {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.createChar-profileName {
    color: #6f3d13;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px rgba(255,255,255,.5);
}

.createChar-pictureContainer {
    width: 100%;
    max-width: 230px;
    height: 185px;
    min-height: 145px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.createChar-profileDescription {
    max-height: 68px;
    overflow: auto;
    padding: 0 3px;
    color: #5d3a20;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    scrollbar-width: none;
}

.createChar-profileDescription::-webkit-scrollbar {
    display: none;
}

.createChar-statsGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    min-width: 0;
}

.createChar-resumeItem {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.createChar-resumeItem .char-status-text {
    min-width: 0;
    flex: 1 1 auto;
}

.createChar-classProfile {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.createChar-classHero {
    width: 100%;
    height: clamp(205px, 40vh, 330px);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.createChar-classInfo {
    width: min(92%, 430px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.createChar-classInfo .createChar-profileDescription {
    max-height: 62px;
    font-size: 12px;
}

/* Name step */
.createChar-nameFormContainer {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    box-sizing: border-box;
}

.createChar-namePanel {
    width: min(100%, 430px);
    box-sizing: border-box;
    padding: 20px 18px 17px;
    border: 1px solid rgba(103, 58, 18, .58);
    border-radius: 9px;
    background: linear-gradient(rgba(255,245,205,.24), rgba(111,64,20,.08));
    box-shadow: inset 0 0 18px rgba(255,241,194,.32), 0 5px 14px rgba(62,31,6,.16);
    text-align: center;
}

.createChar-nameRune {
    width: 38px;
    height: 38px;
    margin: 0 auto 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(110, 62, 20, .58);
    border-radius: 50%;
    color: #9f641e;
    background: rgba(255, 234, 174, .28);
    font-size: 23px;
    box-shadow: inset 0 0 8px rgba(118,67,18,.2);
}

.createChar-nameLabel {
    display: block;
    color: #613613;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 1px rgba(255,255,255,.5);
}

.createChar-nameRules {
    max-width: 340px;
    margin: 5px auto 14px;
    color: #775232;
    font-size: 12px;
    line-height: 1.25;
}

.createChar-nameInputShell {
    width: 100%;
    box-sizing: border-box;
    padding: 4px;
    border: 1px solid rgba(80, 40, 10, .82);
    border-radius: 7px;
    background: rgba(69, 32, 5, .68);
    box-shadow: inset 0 0 0 1px rgba(231,171,75,.24), 0 3px 8px rgba(60,27,4,.28);
    transition: box-shadow .16s ease, transform .16s ease;
}

.createChar-nameInputShell:focus-within {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(255,204,92,.38), 0 0 0 2px rgba(177,104,29,.26), 0 4px 10px rgba(60,27,4,.3);
}

.createChar-nameInput {
    display: block;
    width: 100%;
    height: 47px;
    box-sizing: border-box;
    padding: 0 13px;
    border: 0;
    outline: 0;
    border-radius: 4px;
    background-image: url("../assets/img/background/charCreation/Char-class-name-box.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: #3c1d06;
    color: #fff0c4;
    caret-color: #ffd96a;
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 2px 2px #000;
}

.createChar-nameInput::selection {
    background: rgba(218, 145, 49, .55);
}

.createChar-nameMeta {
    min-height: 25px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.createChar-nameValidation {
    flex: 1 1 auto;
    color: #6e4b2d;
    font-size: 12px;
    line-height: 1.2;
    text-align: left;
}

.createChar-nameValidation.is-error {
    color: #8c382c;
}

.createChar-nameValidation.is-ready {
    color: #356b35;
    font-weight: 700;
}

.createChar-nameValidation.is-ready::before {
    content: "✓ ";
}

.createChar-nameLenghtInfo {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 4px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(93,53,20,.35);
    border-radius: 10px;
    background: rgba(112,64,24,.12);
    color: #5d371c;
    font-size: 12px;
    font-weight: 700;
}

/* Bottom navigation */
.createChar-bottomButons {
    flex: 0 0 58px;
    min-height: 58px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 8px 10px;
    margin-top: auto;
}

.createChar-Container .book-login-button {
    min-width: 92px;
    margin: 1px;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.createChar-Container .createChar-primaryButton {
    filter: saturate(1.08) drop-shadow(5px 6px 7px rgba(0,0,0,.32));
}

.createChar-Container .createChar-secondaryButton {
    filter: saturate(.88) brightness(.96) drop-shadow(5px 6px 7px rgba(0,0,0,.28));
}

.createChar-buttonDisabled {
    pointer-events: none;
    opacity: .48;
    filter: grayscale(.5) brightness(.9) !important;
}

.createChar-Container .book-login-button.is-loading {
    pointer-events: none;
    opacity: .62;
    animation: createCharButtonPulse .8s ease-in-out infinite alternate;
}

/* Review step */
.createChar-reviewContainer {
    padding: 6px 9px;
    box-sizing: border-box;
}

.createChar-Review {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
}

.createChar-reviewCard {
    width: min(100%, 430px);
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 13px;
    border: 1px solid rgba(102, 57, 17, .55);
    border-radius: 9px;
    background: linear-gradient(rgba(255,247,214,.29), rgba(114,67,26,.08));
    box-shadow: inset 0 0 20px rgba(255,239,184,.26), 0 4px 12px rgba(70,34,7,.17);
}

.createChar-reviewTitle {
    color: #6e3c12;
    font-size: 21px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px rgba(255,255,255,.45);
}

.createChar-reviewSubtitle {
    margin-top: 2px;
    color: #775234;
    font-size: 12px;
    text-align: center;
}

.createChar-reviewPictureWrap {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.createChar-BasePicture {
    width: min(100%, 270px);
    height: clamp(170px, 31vh, 280px);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.createChar-reviewName {
    margin-top: -2px;
    color: #582b0d;
    font-size: 25px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px rgba(255,255,255,.55);
}

.createChar-reviewDetails {
    width: min(100%, 300px);
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.createChar-reviewDetails > div {
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(103,59,22,.25);
    border-radius: 6px;
    background: rgba(102,59,20,.08);
    text-align: center;
}

.createChar-reviewDetails span,
.createChar-reviewDetails strong {
    display: block;
}

.createChar-reviewDetails span {
    color: #815a39;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.createChar-reviewDetails strong {
    margin-top: 1px;
    overflow: hidden;
    color: #553016;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.successBox {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    min-width: 280px;
    max-width: 400px;
    padding: 14px 18px;
    border: 2px solid rgba(0, 255, 0, .8);
    border-radius: 10px;
    background-color: rgba(0, 80, 0, .72);
    box-shadow: 0 0 12px rgba(0, 255, 0, .3);
    color: #fff;
    font-size: 14px;
    text-align: center;
    animation: createCharSuccessIn .3s ease-in-out, createCharSuccessOut .3s ease-in-out 2s forwards;
}

/* Legacy keyboard helpers kept for compatibility with older cached markup. */
.KeyboardBackClearKey,
.KeyboardBackSpaceKey,
.KeyboardShiftKey {
    width: 25px;
    height: 25px;
    background-size: 70% 70%;
    background-repeat: no-repeat;
    background-position: center;
}
.KeyboardBackClearKey { background-image: url("../assets/img/icons/cancel.webp"); }
.KeyboardBackSpaceKey { background-image: url("../assets/img/icons/back.webp"); }
.KeyboardShiftKey { background-image: url("../assets/img/icons/up.webp"); }
.KeyboardKey {
    width: 25px;
    height: 25px;
    margin: 2px;
    display: flex;
    align-items: center;
    border: 1px solid #000;
    font-weight: bold;
    text-transform: lowercase;
}
.KeyboardKeyLine { display: inline-flex; }
.KeyboardKeySpace {
    width: 200px;
    height: 25px;
    margin: 2px;
    display: flex;
    align-items: center;
    border: 1px solid #000;
}

@keyframes createCharButtonPulse {
    from { filter: brightness(.86); }
    to { filter: brightness(1.08); }
}

@keyframes createCharSuccessIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes createCharSuccessOut {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
}

@media (max-width: 520px) {
    .createChar-stepIntro {
        padding: 8px 12px 4px;
    }

    .createChar-stepHelp {
        font-size: 12px;
    }

    .createChar-PictureBox {
        width: 70px;
        height: 70px;
    }

    .createChar-ClassBox {
        width: 64px;
        height: 64px;
    }

    .createChar-resumeBoxContent {
        padding: 9px 9px 11px;
    }

    .createChar-profileCard {
        grid-template-columns: minmax(105px, 41%) minmax(130px, 1fr);
        gap: 5px;
    }

    .createChar-pictureContainer {
        height: 155px;
        min-height: 130px;
    }

    .createChar-profileName {
        font-size: 17px;
    }

    .createChar-profileDescription {
        max-height: 52px;
        font-size: 10px;
    }

    .createChar-classHero {
        height: clamp(190px, 34vh, 275px);
    }

    .createChar-classInfo .createChar-profileDescription {
        max-height: 54px;
        font-size: 11px;
    }

    .createChar-nameFormContainer {
        padding: 8px 12px;
    }

    .createChar-namePanel {
        padding: 16px 13px 13px;
    }

    .createChar-nameLabel {
        font-size: 17px;
    }

    .createChar-nameInput {
        height: 46px;
        font-size: 20px;
    }

    .createChar-nameMeta {
        align-items: flex-start;
    }

    .createChar-reviewCard {
        padding: 11px 12px;
    }

    .createChar-BasePicture {
        height: clamp(155px, 27vh, 235px);
    }

    .createChar-reviewName {
        font-size: 22px;
    }
}

/* ========================================================================== */
/* V6 - Responsive character creation UX                                     */
/* ========================================================================== */

.createChar-Container {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overscroll-behavior: contain;
}

.createChar-TabTitle {
    min-height: 48px;
    height: clamp(48px, 6vh, 54px);
    flex: 0 0 auto;
    cursor: default;
}

.createChar-content {
    min-width: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.createChar-stepIntro {
    padding-inline: clamp(12px, 4vw, 24px);
}

.createChar-stepHelp {
    max-width: 580px;
}

.createChar-displayContainer {
    min-width: 0;
}

.createChar-choiceGrid {
    width: min(100%, 590px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 82px));
    justify-content: center;
    align-items: center;
    gap: clamp(4px, 1.4vw, 9px);
}

.createChar-choiceCard {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.createChar-choiceCard:focus-visible {
    outline: 2px solid #e8b451;
    outline-offset: 2px;
}

.createChar-resumeContainer {
    width: auto;
    box-sizing: border-box;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.createChar-profileCard,
.createChar-classProfile,
.createChar-namePanel,
.createChar-reviewCard {
    min-width: 0;
}

.createChar-nameInput {
    min-height: 48px;
    font-size: max(16px, 21px); /* 16px+ prevents iOS focus zoom */
}

.createChar-bottomButons {
    box-sizing: border-box;
    min-height: 62px;
    padding-bottom: max(9px, env(safe-area-inset-bottom));
}

.createChar-Container .book-login-button {
    box-sizing: border-box;
    min-width: 104px;
    min-height: 46px;
    height: auto;
    padding: 7px 13px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.successBox {
    box-sizing: border-box;
    width: min(calc(100% - 28px), 430px);
    min-width: 0;
    max-width: 430px;
    padding: 17px 20px;
    line-height: 1.3;
}

/* Wider tablet/desktop character creation gets room to breathe instead of
   keeping the original narrow phone column. */
@media (min-width: 760px) {
    .createChar-stepIntro {
        padding-top: 12px;
        padding-bottom: 8px;
    }

    .createChar-stepEyebrow {
        font-size: 12px;
    }

    .createChar-stepHelp {
        font-size: 15px;
        line-height: 1.3;
    }

    .createChar-PictureBox {
        width: 88px;
        height: 88px;
    }

    .createChar-ClassBox {
        width: 78px;
        height: 78px;
    }

    .createChar-resumeContainer {
        margin-inline: 18px;
        margin-bottom: 9px;
    }

    .createChar-resumeBoxContent {
        padding: 18px 22px 20px;
    }

    .createChar-profileCard {
        max-width: 620px;
        grid-template-columns: minmax(210px, 46%) minmax(220px, 1fr);
        gap: 22px;
    }

    .createChar-pictureContainer {
        max-width: 300px;
        height: clamp(210px, 34vh, 300px);
    }

    .createChar-profileName {
        font-size: 24px;
    }

    .createChar-profileDescription {
        max-height: 86px;
        font-size: 13px;
    }

    .createChar-statsGrid {
        gap: 4px;
    }

    .createChar-classProfile {
        max-width: 610px;
        display: grid;
        grid-template-columns: minmax(250px, 56%) minmax(190px, 1fr);
        grid-template-areas: "hero info";
        gap: 18px;
    }

    .createChar-classHero {
        grid-area: hero;
        height: clamp(245px, 41vh, 365px);
    }

    .createChar-classInfo {
        grid-area: info;
        width: 100%;
    }

    .createChar-classInfo .createChar-profileDescription {
        max-height: 105px;
        font-size: 13px;
    }

    .createChar-namePanel {
        width: min(100%, 500px);
        padding: 26px 25px 22px;
    }

    .createChar-nameLabel {
        font-size: 22px;
    }

    .createChar-reviewCard {
        width: min(100%, 560px);
        display: grid;
        grid-template-columns: minmax(220px, 48%) minmax(210px, 1fr);
        grid-template-areas:
            "picture title"
            "picture subtitle"
            "picture name"
            "picture details";
        align-content: center;
        column-gap: 18px;
        padding: 18px 22px;
    }

    .createChar-reviewTitle { grid-area: title; }
    .createChar-reviewSubtitle { grid-area: subtitle; }
    .createChar-reviewPictureWrap { grid-area: picture; }
    .createChar-reviewName { grid-area: name; }
    .createChar-reviewDetails { grid-area: details; width: 100%; }

    .createChar-BasePicture {
        width: 100%;
        height: clamp(220px, 36vh, 330px);
    }

    .createChar-reviewName {
        margin-top: 8px;
        font-size: 27px;
    }
}

@media (max-width: 559px) {
    .createChar-TabTitle {
        height: 48px;
        padding-inline: 9px;
    }

    .tabTitleInactive {
        font-size: 16px;
    }

    .tabTitleActive {
        font-size: 17px;
    }

    .createChar-stepNumber {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .createChar-stepIntro {
        padding-top: 7px;
    }

    .createChar-choiceGrid {
        grid-template-columns: repeat(4, minmax(58px, 72px));
        gap: 4px;
    }

    .createChar-PictureBox {
        width: 68px;
        height: 68px;
        max-width: 100%;
    }

    .createChar-ClassBox {
        width: 62px;
        height: 62px;
        max-width: 100%;
    }

    .createChar-resumeContainer {
        margin-inline: 7px;
    }

    .createChar-bottomButons {
        gap: 3px;
        padding-inline: 7px;
    }

    .createChar-Container .book-login-button {
        min-width: 100px;
        min-height: 46px;
        padding-inline: 11px;
    }

    .createChar-reviewDetails {
        gap: 5px;
    }
}

@media (max-width: 339px) {
    .createChar-choiceGrid {
        grid-template-columns: repeat(2, 72px);
    }

    .createChar-profileCard {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .createChar-pictureContainer {
        height: 120px;
    }

    .createChar-statsGrid {
        width: min(100%, 190px);
    }

    .createChar-reviewDetails {
        grid-template-columns: 1fr;
    }
}

/* When the mobile keyboard or landscape orientation drastically reduces the
   usable height, shrink decorative content before sacrificing controls. */
@media (max-height: 620px) {
    .createChar-stepIntro {
        padding-top: 4px;
        padding-bottom: 2px;
    }

    .createChar-stepEyebrow {
        display: none;
    }

    .createChar-stepHelp {
        font-size: 11px;
        line-height: 1.15;
    }

    .createChar-PictureBox {
        width: 62px;
        height: 62px;
    }

    .createChar-ClassBox {
        width: 58px;
        height: 58px;
    }

    .createChar-pictureContainer {
        height: 118px;
        min-height: 100px;
    }

    .createChar-classHero {
        height: 170px;
    }

    .createChar-namePanel {
        padding-block: 12px;
    }

    .createChar-nameRune {
        display: none;
    }

    .createChar-nameRules {
        margin-bottom: 8px;
    }

    .createChar-BasePicture {
        height: 145px;
    }

    .createChar-bottomButons {
        min-height: 52px;
        flex-basis: 52px;
        padding-top: 4px;
        padding-bottom: max(5px, env(safe-area-inset-bottom));
    }
}

@media (hover: none), (pointer: coarse) {
    .createChar-choiceCard:hover {
        transform: none;
        filter: none;
    }

    .createChar-choiceCard:active {
        transform: scale(.97);
        filter: brightness(.92);
    }
}

@media (prefers-reduced-motion: reduce) {
    .createChar-content,
    .createChar-choiceCard,
    .createChar-nameInputShell,
    .createChar-Container .book-login-button {
        transition: none !important;
        animation: none !important;
    }
}

/* ========================================================================== */
/* V7 - Creation presentation, image proportions and class skill previews     */
/* ========================================================================== */

.createChar-resumeBoxContent {
    overflow: hidden;
}

.createChar-profileCard {
    width: min(100%, 570px);
    max-width: 570px;
    margin: auto;
    grid-template-columns: minmax(190px, 245px) minmax(190px, 245px);
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 3vw, 28px);
}

.createChar-profileVisual {
    width: 100%;
    min-width: 0;
    max-width: 245px;
    justify-self: center;
    box-sizing: border-box;
    padding: 4px 6px;
}

.createChar-pictureContainer {
    width: min(100%, 210px);
    max-width: 210px;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    margin: 4px auto 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
}

.createChar-profileImage,
.createChar-classHeroImage {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
}

.createChar-profileDescription {
    width: 100%;
    max-width: 245px;
    max-height: 84px;
    box-sizing: border-box;
    margin-inline: auto;
    padding: 2px 5px;
    color: #513019;
    font-size: 12px;
    line-height: 1.28;
    text-align: center;
    overflow: auto;
}

.createChar-statsPanel {
    width: min(100%, 235px);
    min-width: 0;
    justify-self: center;
    box-sizing: border-box;
    padding: 12px 13px 11px;
    border: 1px solid rgba(109, 66, 25, .32);
    border-radius: 9px;
    background: rgba(255, 240, 199, .25);
    box-shadow: inset 0 0 15px rgba(255, 249, 224, .34), 0 3px 8px rgba(66, 34, 8, .12);
}

.createChar-statsTitle {
    margin-bottom: 7px;
    color: #6a3c14;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .45px;
}

.createChar-statsGrid {
    width: 100%;
    gap: 4px;
}

.createChar-resumeItem {
    width: 100%;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 4px;
}

.createChar-resumeItem .char-status-icon {
    float: none;
    margin: 0;
    align-self: center;
}

.createChar-resumeItem .char-status-text {
    width: 100%;
    height: 18px;
    float: none;
}

.createChar-resumeItem .barra-container,
.createChar-resumeItem .barra-externa {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.createChar-resumeItem .barra-externa {
    height: 17px;
}

.createChar-resumeItem .barra-container-text {
    color: #211308;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05px;
    text-shadow:
        -1px -1px 0 rgba(255, 247, 218, .92),
         1px -1px 0 rgba(255, 247, 218, .92),
        -1px  1px 0 rgba(255, 247, 218, .92),
         1px  1px 0 rgba(255, 247, 218, .92),
         0  1px 2px rgba(255,255,255,.72);
}

.createChar-classProfile {
    width: min(100%, 600px);
    max-width: 600px;
    margin: auto;
    align-items: center;
    justify-content: center;
}

.createChar-classHero {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
}

.createChar-classInfo {
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 9px;
    border: 1px solid rgba(107, 62, 20, .25);
    border-radius: 9px;
    background: rgba(255, 241, 202, .18);
    box-shadow: inset 0 0 14px rgba(255, 248, 220, .22);
}

.createChar-skillPreview {
    width: 100%;
    min-width: 0;
    margin-top: 7px;
}

.createChar-skillPreviewTitle {
    margin-bottom: 5px;
    color: #6b3d15;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.createChar-skillTreeGrid {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}

.createChar-skillTreeChip {
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid rgba(100, 58, 20, .3);
    border-radius: 6px;
    background: rgba(250, 224, 157, .3);
    color: #42250f;
    font-family: Arial, sans-serif;
}

.createChar-skillTreeName {
    min-width: 0;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.createChar-skillExample {
    min-width: 0;
    max-width: 58%;
    padding-left: 7px;
    border-left: 1px solid rgba(103, 61, 22, .25);
    color: #76502c;
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 760px) {
    .createChar-profileCard {
        grid-template-columns: 245px 235px;
        gap: 28px;
    }

    .createChar-pictureContainer {
        width: 205px;
        max-width: 205px;
    }

    .createChar-profileName {
        font-size: 23px;
    }

    .createChar-profileDescription {
        max-height: 95px;
        font-size: 12px;
    }

    .createChar-classProfile {
        grid-template-columns: minmax(245px, 52%) minmax(235px, 1fr);
        gap: 22px;
    }

    .createChar-classHero {
        height: clamp(240px, 39vh, 345px);
    }

    .createChar-classInfo {
        padding: 11px 12px;
    }

    .createChar-classInfo .createChar-profileDescription {
        max-height: 92px;
    }
}

@media (max-width: 559px) {
    .createChar-profileCard {
        width: min(100%, 320px);
        grid-template-columns: minmax(118px, 43%) minmax(135px, 1fr);
        gap: 7px;
    }

    .createChar-profileVisual {
        max-width: 138px;
        padding-inline: 2px;
    }

    .createChar-profileName {
        font-size: 17px;
    }

    .createChar-pictureContainer {
        width: min(100%, 126px);
        max-width: 126px;
        aspect-ratio: 1 / 1;
    }

    .createChar-profileDescription {
        max-width: 138px;
        max-height: 80px;
        padding-inline: 2px;
        font-size: 10px;
        line-height: 1.23;
    }

    .createChar-statsPanel {
        max-width: 165px;
        padding: 8px 8px 7px;
    }

    .createChar-statsTitle {
        margin-bottom: 5px;
        font-size: 10px;
    }

    .createChar-resumeItem {
        grid-template-columns: 16px minmax(0, 1fr);
        gap: 3px;
    }

    .createChar-resumeItem .barra-container-text {
        font-size: 9px;
    }

    .createChar-classInfo {
        width: min(96%, 330px);
        padding: 7px 8px;
    }

    .createChar-classInfo .createChar-profileDescription {
        max-width: 100%;
        max-height: 54px;
    }

    .createChar-skillPreview {
        margin-top: 5px;
    }

    .createChar-skillPreviewTitle {
        font-size: 10px;
    }

    .createChar-skillTreeGrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3px;
    }

    .createChar-skillTreeChip {
        min-height: 42px;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 4px 3px;
        text-align: center;
    }

    .createChar-skillTreeName,
    .createChar-skillExample {
        width: 100%;
        max-width: 100%;
        padding: 0;
        border: 0;
        font-size: 9px;
    }
}

@media (max-width: 339px) {
    .createChar-profileCard {
        width: min(100%, 275px);
        display: grid;
        grid-template-columns: minmax(105px, 42%) minmax(125px, 1fr);
    }

    .createChar-pictureContainer {
        width: 104px;
    }

    .createChar-profileDescription {
        max-height: 58px;
    }

    .createChar-statsPanel {
        padding-inline: 6px;
    }
}

@media (max-height: 620px) {
    .createChar-pictureContainer {
        width: 105px;
        max-width: 105px;
        height: auto;
        min-height: 0;
    }

    .createChar-profileDescription {
        max-height: 48px;
    }

    .createChar-classHero {
        height: 150px;
    }

    .createChar-skillTreeChip {
        padding-block: 3px;
    }
}

/* ========================================================================== */
/* V8 - Unified creation cards and strict attribute-row alignment              */
/* ========================================================================== */

/* Steps 1 and 2 now use the book page itself as the visual background. The
   selected character/class is presented inside one coherent parchment card. */
#createCharAttributes,
#createCharClassAttributes {
    background-image: none;
    background-color: transparent;
    margin-inline: clamp(10px, 2.5vw, 22px);
    padding: clamp(6px, 1.4vw, 12px);
    border-radius: 0;
    overflow: auto;
}

#createCharAttributes .createChar-resumeBoxContent,
#createCharClassAttributes .createChar-resumeBoxContent {
    padding: 0;
}

#createCharAttributes .createChar-profileCard,
#createCharClassAttributes .createChar-classProfile {
    box-sizing: border-box;
    border: 1px solid rgba(102, 57, 18, .46);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 247, 216, .54), rgba(232, 196, 126, .22)),
        rgba(255, 235, 181, .18);
    box-shadow:
        inset 0 0 24px rgba(255, 249, 226, .38),
        inset 0 0 0 1px rgba(255, 244, 203, .18),
        0 4px 10px rgba(62, 30, 5, .14);
}

#createCharAttributes .createChar-profileCard {
    width: min(100%, 590px);
    max-width: 590px;
    padding: clamp(13px, 2vw, 20px);
    gap: clamp(14px, 3vw, 28px);
}

/* The attributes are a section of the unified card rather than another card. */
#createCharAttributes .createChar-statsPanel {
    width: 100%;
    max-width: none;
    padding: 3px 0 3px clamp(12px, 2vw, 20px);
    border: 0;
    border-left: 1px solid rgba(105, 62, 23, .28);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#createCharAttributes .createChar-statsTitle {
    margin-bottom: 9px;
    color: #5d3514;
    font-size: 12px;
    letter-spacing: .65px;
}

/* Never allow old/global status styles to move the icon above its bar. */
#createCharAttributes .createChar-resumeItem {
    width: 100%;
    min-width: 0;
    min-height: 19px;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px;
    margin: 0;
}

#createCharAttributes .createChar-resumeItem .char-status-icon {
    order: 0;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    float: none !important;
    align-self: center;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#createCharAttributes .createChar-resumeItem .char-status-text {
    order: 1;
    flex: 1 1 auto;
    display: block;
    position: relative;
    float: none !important;
    width: auto !important;
    min-width: 0;
    height: 18px;
    margin: 0;
}

#createCharAttributes .createChar-resumeItem .barra-container,
#createCharAttributes .createChar-resumeItem .barra-externa {
    width: 100%;
    min-width: 0;
    height: 18px;
    box-sizing: border-box;
}

#createCharAttributes .createChar-resumeItem .barra-container-text {
    color: #fff3cf;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-shadow:
        -1px -1px 0 rgba(37, 19, 6, .92),
         1px -1px 0 rgba(37, 19, 6, .92),
        -1px  1px 0 rgba(37, 19, 6, .92),
         1px  1px 0 rgba(37, 19, 6, .92),
         0  1px 2px rgba(0, 0, 0, .75);
}

/* Class selection uses the same single-card language. */
#createCharClassAttributes .createChar-classProfile {
    width: min(100%, 610px);
    max-width: 610px;
    padding: clamp(14px, 2vw, 21px);
    gap: clamp(15px, 3vw, 26px);
}

#createCharClassAttributes .createChar-classHero {
    width: 100%;
    max-width: 300px;
    justify-self: center;
}

#createCharClassAttributes .createChar-classInfo {
    width: 100%;
    max-width: none;
    padding: 4px 0 4px clamp(12px, 2vw, 20px);
    border: 0;
    border-left: 1px solid rgba(105, 62, 23, .28);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#createCharClassAttributes .createChar-skillTreeChip {
    background: rgba(247, 218, 151, .28);
    border-color: rgba(100, 58, 20, .26);
}

/* Phone/tablet portrait: preserve the two-column character comparison while
   keeping one visual card, then stack class information below its artwork. */
@media (max-width: 559px) {
    #createCharAttributes,
    #createCharClassAttributes {
        margin-inline: 6px;
        padding: 5px;
    }

    #createCharAttributes .createChar-profileCard {
        width: min(100%, 330px);
        grid-template-columns: minmax(105px, .92fr) minmax(142px, 1.08fr);
        gap: 10px;
        padding: 12px 10px;
    }

    #createCharAttributes .createChar-profileVisual {
        max-width: 145px;
        padding: 0;
    }

    #createCharAttributes .createChar-pictureContainer {
        width: min(100%, 126px);
        max-width: 126px;
    }

    #createCharAttributes .createChar-profileDescription {
        max-width: 140px;
        max-height: 86px;
        font-size: 10px;
        line-height: 1.24;
    }

    #createCharAttributes .createChar-statsPanel {
        padding-left: 9px;
    }

    #createCharAttributes .createChar-statsGrid {
        gap: 3px;
    }

    #createCharAttributes .createChar-resumeItem {
        gap: 4px;
    }

    #createCharAttributes .createChar-resumeItem .char-status-icon {
        flex-basis: 16px;
        width: 16px;
        height: 16px;
    }

    #createCharAttributes .createChar-resumeItem .barra-container-text {
        font-size: 9px;
    }

    #createCharClassAttributes .createChar-classProfile {
        width: min(100%, 336px);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 11px 10px 12px;
    }

    #createCharClassAttributes .createChar-classHero {
        width: min(100%, 255px);
        max-width: 255px;
        height: clamp(190px, 34vh, 265px);
    }

    #createCharClassAttributes .createChar-classInfo {
        width: 100%;
        padding: 9px 3px 0;
        border-left: 0;
        border-top: 1px solid rgba(105, 62, 23, .26);
    }

    #createCharClassAttributes .createChar-classInfo .createChar-profileDescription {
        max-width: 100%;
        margin-inline: auto;
    }
}

@media (max-width: 339px) {
    #createCharAttributes .createChar-profileCard {
        grid-template-columns: minmax(98px, .9fr) minmax(128px, 1.1fr);
        gap: 7px;
        padding-inline: 8px;
    }

    #createCharAttributes .createChar-statsPanel {
        padding-left: 6px;
    }
}
