// Hero Selection Screen
.hero-selection-card {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    overflow: hidden;
}

.hero-selection-body {
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 2rem 1.5rem;
    }
}

.hero-selection-content {
    max-width: 500px;
    margin: 0 auto;
}

.hero-selection-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

.hero-selection-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 1.5rem;

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
}

.hero-selection-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

// Hero Selection Panel
.hero-selection-panel {
    height: 85vh;
    max-height: 85vh;
    padding: 0.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;

    @media (orientation: landscape) {
        height: 85vh;
        max-height: 85vh;
        padding: 0.25rem;
    }

    @media (orientation: portrait) {
        height: 85vh;
        max-height: 85vh;
        padding: 0.5rem;
    }

    @media (orientation: portrait) and (max-height: 667px) {
        height: 85vh;
        max-height: 85vh;
        padding: 0.25rem;
    }

    @media (max-height: 450px) and (orientation: landscape) {
        height: 85vh;
        max-height: 85vh;
        padding: 0.15rem;
    }
}

.hero-selection-row {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.hero-selection-left {
    padding: 0;
    height: 100%;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0;
    }
}

.hero-selection-card-wrapper {
    height: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    @media (max-height: 450px) and (orientation: landscape) {
        border-radius: 8px;
    }
}

.hero-selection-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.5rem 0.75rem;
        border-bottom-width: 1px;
    }
}

.hero-selection-title-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;

    @media (max-height: 450px) and (orientation: landscape) {
        gap: 0.5rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        gap: 0.5rem;
    }
}

.hero-selection-hero-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 0.95rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        font-size: 1rem;
    }
}

.hero-selection-class {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 0.7rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        font-size: 0.75rem;
    }
}

.hero-selection-counter {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: auto;

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 0.65rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        font-size: 0.7rem;
    }
}

.hero-selection-content-area {
    flex: 1;
    padding: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.4rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        padding: 0.5rem;
    }
}

.hero-select-image-col,
.hero-select-skills-col {
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.2rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        padding: 0.3rem;
    }
}

.hero-select-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.hero-select-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hero-select-stats-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    border-radius: 0 0 8px 8px;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.35rem;
    }
}

.hero-select-skills {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 0;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.4rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        padding: 0.5rem;
    }
}

.hero-selection-actions {
    padding: 0.75rem;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.5rem;
        gap: 0.35rem;
        border-top-width: 1px;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        padding: 0.5rem;
        gap: 0.5rem;
    }
}

.nav-hero-btn {
    flex: 1;
    min-height: 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s;
    padding: 0.5rem;

    @media (max-height: 450px) and (orientation: landscape) {
        min-height: 32px;
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        min-height: 38px;
        font-size: 0.8rem;
    }
}

.select-hero-btn {
    flex: 2;
    min-height: 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    padding: 0.5rem;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    }

    @media (max-height: 450px) and (orientation: landscape) {
        min-height: 32px;
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }

    @media (orientation: portrait) and (max-width: 767px) {
        min-height: 38px;
        font-size: 0.85rem;
    }
}

.MD2Hp {
    font-size: xx-large;
    position: fixed;
    z-index: 92;
    color: white;
    bottom: 23%;
    left: 46%;
}
.MD2Mp {
    font-size: xx-large;
    position: fixed;
    z-index: 92;
    color: white;
    bottom: 22%;
    left: 7%;
}

.MD2Name {
    font-size: xx-large;
    position: fixed;
    z-index: 92;
    color: #2e2e30;
    bottom: 20%;
    left: 23%;
}
.MD2HeroCard {
    //position: absolute;

    max-width: 100%;
    max-height: 100%;
    &.HpMpBar {
        z-index: 10;
    }
}

.tp-wrapper {
    -webkit-perspective: 800px;
    perspective: 800px;
    height: 40vh; // Default for portrait

    @media (orientation: landscape) {
        height: 85vh;
    }

    @media (orientation: portrait) and (max-height: 667px) {
        height: 50vh;
    }
}

.tp-box {
    position: relative;
    width: 100%;
    height: 100%;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transform: transform 1s;
    -ms-transform: transform 1s;
    transform: transform 1s;
}

.tp-box__side {
    width: 100%;
    height: 100%;
    position: absolute;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

// Hero Card Content Section
.hero-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.5rem;
    overflow: hidden;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.25rem;
    }
}

.hero-image-col {
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.15rem;
    }
}

.hero-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;

    &:hover {
        transform: scale(1.02);
    }
}

// HP and Mana Bars Overlay
.hero-stats-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    border-radius: 0 0 8px 8px;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.35rem;
    }
}

.stat-bar-overlay {
    margin-bottom: 0.5rem;

    &:last-child {
        margin-bottom: 0;
    }

    @media (max-height: 450px) and (orientation: landscape) {
        margin-bottom: 0.35rem;
    }
}

.stat-bar-label-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    gap: 0.5rem;

    md2-icon {
        flex-shrink: 0;
        width: 18px;
        height: 18px;
    }

    .stat-value-overlay {
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        flex-shrink: 0;
    }

    @media (max-height: 450px) and (orientation: landscape) {
        margin-bottom: 0.15rem;
        gap: 0.3rem;

        md2-icon {
            width: 14px;
            height: 14px;
        }

        .stat-value-overlay {
            font-size: 0.65rem;
        }
    }
}

.stat-progress-bar-overlay {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);

    @media (max-height: 450px) and (orientation: landscape) {
        height: 16px;
        border-radius: 8px;
    }
}

.stat-progress-fill-overlay {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;

    @media (max-height: 450px) and (orientation: landscape) {
        border-radius: 8px;
    }

    &::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        animation: shimmer 2s infinite;
    }

    &.full-stat {
        width: 100%;
    }
}

.hp-fill-overlay {
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
    box-shadow: 0 0 8px rgba(238, 90, 111, 0.6);
}

.mp-fill-overlay {
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    box-shadow: 0 0 8px rgba(68, 160, 141, 0.6);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.hero-skills-col {
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.15rem;
    }
}

.hero-skills {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.5rem;
    }
}

.skills-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #667eea;

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
        padding-bottom: 0.15rem;
    }
}

.shadow-skills-title {
    margin-top: 1rem;
    color: #764ba2;
    border-bottom-color: #764ba2;

    @media (max-height: 450px) and (orientation: landscape) {
        margin-top: 0.5rem;
    }
}

.skill-content {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #495057;

    @media (max-height: 450px) and (orientation: landscape) {
        font-size: 0.7rem;
        line-height: 1.3;
    }
}

.shadow-skill-content {
    color: #6c757d;
}

// Action Buttons Section
.hero-actions {
    padding: 0.75rem;
    border-top: 2px solid #e9ecef;
    margin-top: auto;

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.5rem;
        border-top-width: 1px;
    }
}

.action-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;

    @media (max-height: 450px) and (orientation: landscape) {
        gap: 0.25rem;
        margin-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
}

.action-btn {
    flex: 1;
    min-width: 100px;
    min-height: 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    @media (max-height: 450px) and (orientation: landscape) {
        min-width: 70px;
        min-height: 36px;
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }
}

.special-action-btn {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    min-height: 40px;
    font-size: 0.875rem;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    @media (max-height: 450px) and (orientation: landscape) {
        margin-bottom: 0.35rem;
        min-height: 32px;
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }
}

.start-activation-btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem;
    min-height: 44px;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.5rem;
        min-height: 36px;
        font-size: 0.8rem;
    }
}

.end-activation-btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem;
    min-height: 44px;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: none;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    }

    @media (max-height: 450px) and (orientation: landscape) {
        padding: 0.5rem;
        min-height: 36px;
        font-size: 0.85rem;
        margin-top: 0.35rem;
    }
}

.tp-box__front {
    -webkit-transform: rotateY(0deg);
    -ms-transform: rotateY(0deg);
    transform: rotateY(0deg);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.tp-box__back {
    -webkit-transform: rotateY(-180deg);
    -ms-transform: rotateY(-180deg);
    transform: rotateY(-180deg);
}
::ng-deep .skill-content .MD2Icon {
    font-size: 30px;
}
