/* Menu System - BookOpen.webp background - Pure VW/VH Scaling */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 19300;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.menu-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.menu-container {
    position: relative;
    width: 95vw;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.menu-content-panel {
    position: relative;
    z-index: 10;
    max-width: 90vw;
    width: 100%;
    height: 85vh;
    margin-bottom: 0px;
    padding: 25px;
    background: transparent;
    text-align: center;
    animation: menuPanelSlideUp 0.8s ease-out;
    will-change: transform;
    transform: translateZ(0);
}

.menu-content-panel.panel > .panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 10px 15px;
}

.menu-content-panel.panel > .panel-content::-webkit-scrollbar {
    width: 10px;
}

.menu-content-panel.panel > .panel-content::-webkit-scrollbar-track {
    background: rgba(26, 15, 31, 0.5);
    border-radius: 5px;
    border: 1px solid #3a2a28;
}

.menu-content-panel.panel > .panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5a4a45 0%, #3a2a28 100%);
    border-radius: 5px;
    border: 1px solid #4a3a35;
    box-shadow: inset 0 0 5px rgba(90, 74, 69, 0.3);
}

.menu-content-panel.panel > .panel-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6a5a55 0%, #4a3a35 100%);
    box-shadow: 0 0 8px rgba(90, 74, 69, 0.6);
}

/* Menu Header Ornate - Art Deco style */
.menu-header-ornate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 1.5vh;
    margin-bottom: 1vh;
    padding: 0;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.menu-header-ornate .ornate-line-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 20vw;
}

.menu-header-ornate .ornate-line {
    height: 2px;
    background: var(--text-brown-dark);
    box-shadow: 0 0 4px rgba(90, 74, 69, 0.4);
}

.menu-header-ornate .ornate-line.short {
    width: 15px;
}

.menu-header-ornate .ornate-line.long {
    flex: 1;
    min-width: 20px;
}

.menu-header-ornate .ornate-diamond {
    color: var(--text-brown-medium);
    font-size: 12px;
    text-shadow: 0 0 5px rgba(122, 106, 101, 0.6);
    line-height: 1;
}

.menu-header-ornate .ornate-diamond.large {
    font-size: 16px;
    color: var(--text-brown-accent);
    text-shadow: 0 0 8px rgba(192, 160, 128, 0.7);
}

.menu-header-ornate .menu-title-text {
    color: var(--text-brown-accent);
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(18px, 2.2vw, 36px);
    font-weight: bold;
    text-shadow: 0 0 12px rgba(192, 160, 128, 0.6);
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Content divider line */
.menu-content-divider {
    position: relative;
    z-index: 2;
    width: 95%;
    height: 2px;
    margin: 0 auto;
    flex-shrink: 0;
    background: transparent;
}


.menu-content-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(168, 154, 144, 0.6) 30%,
        rgba(168, 154, 144, 0.6) 70%,
        transparent 100%
    );
}

.menu-subtitle {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-style: italic;
    font-size: clamp(18px, 1.2vw, 20px);
    color: var(--text-brown-light);
    margin-top: 0.5vh;
    text-shadow: 0 0 10px rgba(168, 154, 144, 0.4);
    letter-spacing: 0.1vw;
    flex-shrink: 0;
}

/* Skill Categories Grid Layout */
.skill-categories-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1fr;
    gap: 1.5vw;
    width: 100%;
    max-width: 95vw;
    margin: 0 auto;
    padding: 2vh 2vw;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4a3a35 #2a1a18;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.3);
}

/* Skill Categories (upgrade menu) - single row, 4 visible, scroll for rest */
.skill-categories-grid.skill_categories {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4.5vw) / 4);
    overflow-x: auto;
    overflow-y: hidden;
    gap: 1.5vw;
    padding: 0.5vh 1.5vw;
}

.skill-categories-grid.skill_categories .skill-category,
.skill-categories-grid.skill_categories .skill-category.panel.frame-compact,
.skill-categories-grid.skill_categories .skill-category.fundamentals,
.skill-categories-grid.skill_categories .skill-category.spell_slots {
    min-height: 0;
    height: 100%;
}

/* Character progression: acquire cards -> inspect collection -> spend
   fundamental points -> enter Mortis Mastery. This is intentionally a single
   four-step rail; spell schools live one level deeper in the collection. */
.skill-categories-grid.progression {
    grid-template-columns: none;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4.5vw) / 4);
    gap: 1.5vw;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 1.5vh 1.5vw;
    background:
        linear-gradient(90deg, transparent 4%, rgba(154, 128, 92, 0.34) 4%, rgba(154, 128, 92, 0.34) 96%, transparent 96%) center 4.2vh / 100% 2px no-repeat,
        rgba(0, 0, 0, 0.3);
}

.skill-categories-grid.progression .skill-category,
.skill-categories-grid.progression .skill-category.panel.frame-compact {
    min-height: 0;
    height: 100%;
}

.skill-categories-grid.progression .skill-category-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55vh;
    padding: 1.35vw;
    background: linear-gradient(180deg, transparent 0%, rgba(8, 5, 6, 0.72) 34%, rgba(8, 5, 6, 0.94) 100%);
}

.skill-categories-grid.progression .skill-category-quote {
    min-height: 3.2em;
    opacity: 0.82;
    transform: none;
}

.skill-categories-grid.progression .skill-category-progress {
    min-height: 2.6em;
    line-height: 1.25;
}

.progression-step-number {
    position: absolute;
    top: 1.5vh;
    left: 1vw;
    z-index: 12;
    min-width: 2.4vw;
    padding: 0.35vh 0.45vw;
    border: 1px solid rgba(196, 170, 122, 0.75);
    background: #110b0d;
    color: #d8c188;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(13px, 1vw, 18px);
    letter-spacing: 0.08em;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
}

.progression-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65vw;
    width: 100%;
    margin-top: 0.45vh;
    padding: 0.65vh 0.55vw;
    border-top: 1px solid rgba(196, 170, 122, 0.5);
    border-bottom: 1px solid rgba(196, 170, 122, 0.25);
    color: #f1ddb1;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.9vw, 16px);
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.progression-action span {
    color: #d2a85d;
    font-size: 1.35em;
    line-height: 0.7;
}

.skill-category.progression-packs.panel {
    --kit-frame-color: rgba(151, 93, 180, 0.7);
    --kit-frame-inner: rgba(91, 50, 112, 0.72);
    --kit-corner-color: rgba(183, 122, 210, 0.78);
    --kit-diamond-color: rgba(198, 141, 224, 0.9);
}

.skill-category.progression-collection.panel {
    --kit-frame-color: rgba(94, 126, 168, 0.7);
    --kit-frame-inner: rgba(48, 72, 105, 0.72);
    --kit-corner-color: rgba(120, 156, 199, 0.78);
    --kit-diamond-color: rgba(143, 181, 224, 0.9);
}

.skill-category.progression-fundamentals.panel {
    --kit-frame-color: rgba(170, 132, 76, 0.72);
    --kit-frame-inner: rgba(105, 77, 41, 0.74);
    --kit-corner-color: rgba(201, 164, 103, 0.8);
    --kit-diamond-color: rgba(224, 190, 125, 0.92);
}

.skill-category.progression-mastery.panel {
    --kit-frame-color: rgba(145, 61, 61, 0.72);
    --kit-frame-inner: rgba(88, 35, 42, 0.74);
    --kit-corner-color: rgba(184, 81, 88, 0.8);
    --kit-diamond-color: rgba(214, 106, 109, 0.92);
}

.skill-categories-grid.progression .skill-category.locked .progression-step-number {
    border-color: rgba(128, 128, 128, 0.55);
    color: #777;
}

@media (max-width: 1920px) {
    .skill-categories-grid.progression {
        gap: 1.2vw;
        grid-auto-columns: calc((100% - 3.6vw) / 4);
    }
}

@media (max-width: 1366px) {
    .skill-categories-grid.progression {
        gap: 0.9vw;
        grid-auto-columns: calc((100% - 2.7vw) / 4);
    }

    .skill-categories-grid.progression .skill-category-content {
        padding: 1vw;
    }
}

@media (max-width: 1280px) {
    .skill-categories-grid.progression {
        gap: 0.75vw;
        grid-auto-columns: calc((100% - 2.25vw) / 4);
    }
}


.skill-categories-grid::-webkit-scrollbar {
    width: 10px;
}

.skill-categories-grid::-webkit-scrollbar-track {
    background: rgba(26, 15, 31, 0.5);
    border-radius: 5px;
    border: 1px solid #3a2a28;
}

.skill-categories-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5a4a45 0%, #3a2a28 100%);
    border-radius: 5px;
    border: 1px solid #4a3a35;
    box-shadow: inset 0 0 5px rgba(90, 74, 69, 0.3);
}

.skill-categories-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6a5a55 0%, #4a3a35 100%);
    box-shadow: 0 0 8px rgba(90, 74, 69, 0.6);
}

.skill-category {
    cursor: var(--cm-cursor-action, pointer);
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 35vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    will-change: transform;
    transform: translateY(0) scale(1) translateZ(0);
}

.skill-category.panel.frame-compact {
    min-height: 35vh;
}

.skill-category-bg-layer {
    position: absolute;
    inset: 4px;
    background-image: var(--category-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.skill-category-bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: none;
}

.skill-category.panel > .panel-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

/* Shimmer sweep effect - on panel-texture */
.skill-category.panel > .panel-texture::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.skill-category.panel:hover:where(body:not(.gamepad-active) *) > .panel-texture::after,
.skill-category.panel.selected > .panel-texture::after {
    left: 100%;
}

.skill-category-content {
    position: relative;
    padding: 1.2vw;
    width: 100%;
}

.skill-category.panel:hover:where(body:not(.gamepad-active) *),
.skill-category.panel.selected {
    transform: translateY(-3px) scale(1.02);
    --kit-frame-color: rgba(255, 215, 0, 0.7);
    --kit-frame-inner: rgba(218, 165, 32, 0.6);
    --kit-corner-color: rgba(255, 215, 0, 0.8);
    --kit-diamond-color: rgba(255, 215, 0, 0.9);
}

/* Colored gradient overlay on hover/selected */
.skill-category.panel:hover:where(body:not(.gamepad-active) *) .skill-category-bg-layer::after,
.skill-category.panel.selected .skill-category-bg-layer::after {
    background: linear-gradient(to top, rgba(154, 58, 122, 0.8) 0%, rgba(106, 42, 82, 0.6) 50%, transparent 100%);
}

.skill-category.panel.selected {
    animation: categoryPulse 2s infinite ease-in-out;
}

.skill-category.panel:active {
    transform: translateY(-1px) scale(1.01);
}

/* Fundamentals - Special styling */
.skill-category.fundamentals {
    min-height: 35vh;
}

.skill-category.fundamentals.panel {
}

.skill-category.fundamentals.panel:hover:where(body:not(.gamepad-active) *),
.skill-category.fundamentals.panel.selected {
}

/* Red gradient overlay for fundamentals */

/* Spell Slots - Special styling */
.skill-category.spell_slots {
    min-height: 35vh;
}

.skill-category.spell_slots.panel {
    --kit-frame-color: rgba(154, 58, 122, 0.6);
    --kit-frame-inner: rgba(106, 42, 82, 0.5);
    --kit-corner-color: rgba(154, 58, 122, 0.7);
    --kit-diamond-color: rgba(154, 58, 122, 0.8);
}

.skill-category.spell_slots.panel:hover:where(body:not(.gamepad-active) *),
.skill-category.spell_slots.panel.selected {
    --kit-frame-color: rgba(255, 215, 0, 0.7);
    --kit-frame-inner: rgba(218, 165, 32, 0.6);
    --kit-corner-color: rgba(255, 215, 0, 0.8);
    --kit-diamond-color: rgba(255, 215, 0, 0.9);
}

/* Purple gradient overlay for spell_slots */
.skill-category.spell_slots.panel:hover:where(body:not(.gamepad-active) *) .skill-category-bg-layer::after,
.skill-category.spell_slots.panel.selected .skill-category-bg-layer::after {
    background: linear-gradient(to top, rgba(154, 58, 122, 0.8) 0%, rgba(106, 42, 82, 0.6) 50%, transparent 100%);
}

/* Special name styling for spell slots */
.skill-category.spell_slots .skill-category-name {
    color: #e5d4a8;
    text-shadow: 0 0 8px rgba(229, 212, 168, 0.4);
}

/* Special key badge for spell slots */
.skill-category.spell_slots .skill-category-key-badge {
    background: rgba(106, 42, 82, 0.9);
}

/* Regular categories */

/* World Selection - Horizontal scroll single row */
.skill-categories-grid.world_selection {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5vw;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1vh 2vw;
    scrollbar-width: thin;
    scrollbar-color: #4a3a35 #2a1a18;
}

.skill-categories-grid.world_selection::-webkit-scrollbar {
    height: 8px;
}

.skill-categories-grid.world_selection::-webkit-scrollbar-track {
    background: rgba(26, 15, 31, 0.5);
    border-radius: 4px;
}

.skill-categories-grid.world_selection::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #5a4a45 0%, #3a2a28 100%);
    border-radius: 4px;
}

.skill-categories-grid.world_selection .skill-category {
    flex: 0 0 18vw;
    min-width: 200px;
    min-height: 35vh;
}

/* Difficulty Selection - Horizontal scroll like world_selection */
.skill-categories-grid.difficulty_selection {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.2vw;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1vh 2vw;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #4a3a35 #2a1a18;
}

.skill-categories-grid.difficulty_selection::-webkit-scrollbar {
    height: 8px;
}

.skill-categories-grid.difficulty_selection::-webkit-scrollbar-track {
    background: rgba(26, 15, 31, 0.5);
    border-radius: 4px;
}

.skill-categories-grid.difficulty_selection::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #5a4a45 0%, #3a2a28 100%);
    border-radius: 4px;
}

.skill-categories-grid.difficulty_selection .skill-category {
    flex: 0 0 18vw;
    min-width: 220px;
    min-height: 38vh;
}

/* Carousel scroll navigation arrows - shown on horizontally scrollable grids */
.menu-scroll-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.menu-scroll-wrapper > .skill-categories-grid,
.menu-scroll-wrapper > .skills-grid {
    flex: 1;
    min-height: 0;
}

.menu-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(44px, 3.4vw, 64px);
    height: clamp(44px, 3.4vw, 64px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(74, 54, 44, 0.96) 0%, rgba(26, 17, 14, 0.96) 100%);
    border: 2px solid rgba(192, 160, 128, 0.75);
    color: rgba(255, 232, 192, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: var(--cm-cursor-action, pointer);
    z-index: 50;
    pointer-events: auto;
    padding: 0;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 4px 14px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(192, 160, 128, 0.28),
        inset 0 1px 0 rgba(255, 220, 180, 0.25),
        inset 0 0 12px rgba(192, 160, 128, 0.18);
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.menu-scroll-arrow::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(192, 160, 128, 0.35);
    pointer-events: none;
    opacity: 0.7;
}

.menu-scroll-arrow svg {
    width: 48%;
    height: 48%;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(255, 215, 130, 0.45));
    pointer-events: none;
}

.menu-scroll-arrow-left {
    left: clamp(2px, 0.4vw, 12px);
}

.menu-scroll-arrow-right {
    right: clamp(2px, 0.4vw, 12px);
}

.menu-scroll-arrow:hover:where(body:not(.gamepad-active) *) {
    transform: translateY(-50%) scale(1.08);
    border-color: rgba(255, 215, 0, 0.95);
    color: rgba(255, 245, 210, 1);
    background: radial-gradient(circle at 35% 30%, rgba(106, 78, 58, 1) 0%, rgba(38, 24, 18, 1) 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.7),
        0 4px 18px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.55),
        inset 0 1px 0 rgba(255, 240, 200, 0.35),
        inset 0 0 16px rgba(255, 215, 0, 0.22);
}

.menu-scroll-arrow:hover:where(body:not(.gamepad-active) *)::before {
    border-color: rgba(255, 215, 0, 0.65);
    opacity: 1;
}

.menu-scroll-arrow:active {
    transform: translateY(-50%) scale(0.94);
}

.menu-scroll-arrow.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 1920px) {
    .menu-scroll-arrow {
        width: clamp(40px, 3vw, 56px);
        height: clamp(40px, 3vw, 56px);
    }
}

@media (max-width: 1366px) {
    .menu-scroll-arrow {
        width: clamp(36px, 2.8vw, 48px);
        height: clamp(36px, 2.8vw, 48px);
    }
}

/* Fallback gradient gdy brak tekstury */
/* Difficulty bg-layer inherits background-image from --category-bg-image */
/* Color gradient is applied via ::after overlay */

/* Difficulty tier separators */
.difficulty-tier-separator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 0.3vw;
    gap: 0.5vh;
}

.tier-separator-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(to bottom, transparent, rgba(180, 140, 100, 0.5), transparent);
}

.tier-separator-label {
    color: rgba(180, 140, 100, 0.7);
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.8vw, 16px);
    text-shadow: 0 0 6px rgba(180, 140, 100, 0.3);
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* World act separators */
.world-act-separator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 0.3vw;
    gap: 0.5vh;
}

.act-separator-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(to bottom, transparent, rgba(180, 140, 100, 0.5), transparent);
}

.act-separator-label {
    color: rgba(180, 140, 100, 0.7);
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.8vw, 16px);
    text-shadow: 0 0 6px rgba(180, 140, 100, 0.3);
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Difficulty tier frame colors */
.skill-category.difficulty-tier-1.panel { --kit-frame-color: rgba(74, 222, 128, 0.6); --kit-corner-color: rgba(74, 222, 128, 0.7); }
.skill-category.difficulty-tier-2.panel { --kit-frame-color: rgba(251, 191, 36, 0.6); --kit-corner-color: rgba(251, 191, 36, 0.7); }
.skill-category.difficulty-tier-3.panel { --kit-frame-color: rgba(251, 146, 60, 0.6); --kit-corner-color: rgba(251, 146, 60, 0.7); }
.skill-category.difficulty-tier-4.panel { --kit-frame-color: rgba(248, 113, 113, 0.6); --kit-corner-color: rgba(248, 113, 113, 0.7); }
.skill-category.difficulty-tier-5.panel { --kit-frame-color: rgba(220, 38, 38, 0.6); --kit-corner-color: rgba(220, 38, 38, 0.7); }
.skill-category.difficulty-tier-6.panel { --kit-frame-color: rgba(153, 27, 27, 0.6); --kit-corner-color: rgba(153, 27, 27, 0.7); }
.skill-category.difficulty-tier-7.panel { --kit-frame-color: rgba(69, 10, 10, 0.6); --kit-corner-color: rgba(139, 0, 0, 0.7); }
.skill-category.difficulty-tier-8.panel { --kit-frame-color: rgba(40, 10, 60, 0.8); --kit-corner-color: rgba(167, 139, 250, 0.9); }

/* Difficulty tier name colors */
.skill-category.difficulty-tier-1 .skill-category-name { color: #4ade80; text-shadow: 0 0 8px rgba(74, 222, 128, 0.5); }
.skill-category.difficulty-tier-2 .skill-category-name { color: #fbbf24; text-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.skill-category.difficulty-tier-3 .skill-category-name { color: #fb923c; text-shadow: 0 0 8px rgba(251, 146, 60, 0.5); }
.skill-category.difficulty-tier-4 .skill-category-name { color: #f87171; text-shadow: 0 0 8px rgba(248, 113, 113, 0.5); }
.skill-category.difficulty-tier-5 .skill-category-name { color: #dc2626; text-shadow: 0 0 12px rgba(220, 38, 38, 0.7); }
.skill-category.difficulty-tier-6 .skill-category-name { color: #b91c1c; text-shadow: 0 0 15px rgba(185, 28, 28, 0.8); }
.skill-category.difficulty-tier-7 .skill-category-name { color: #ef4444; text-shadow: 0 0 20px rgba(239, 68, 68, 1), 0 0 40px rgba(220, 38, 38, 0.6); animation: apocalypsePulse 2s ease-in-out infinite; }
.skill-category.difficulty-tier-8 .skill-category-name { color: #e9d5ff; text-shadow: 0 0 20px rgba(167, 139, 250, 1), 0 0 40px rgba(124, 58, 237, 0.8), 0 0 60px rgba(139, 0, 0, 0.5); animation: mortisPulse 2.5s ease-in-out infinite; }

@keyframes mortisPulse {
    0%, 100% {
        text-shadow: 0 0 20px rgba(167, 139, 250, 1), 0 0 40px rgba(124, 58, 237, 0.8), 0 0 60px rgba(139, 0, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(233, 213, 255, 1), 0 0 60px rgba(167, 139, 250, 1), 0 0 90px rgba(220, 38, 38, 0.7);
    }
}

/* Chosen difficulty - subtle gradient only, no scale or gold border */
.skill-categories-grid.difficulty_selection .skill-category.chosen {
    transform: none;
}

.skill-categories-grid.difficulty_selection .skill-category.chosen .skill-category-bg-layer::after {
    background: linear-gradient(to top, rgba(154, 58, 122, 0.6) 0%, rgba(106, 42, 82, 0.4) 50%, transparent 100%);
}

/* Navigation selection for difficulty - full styling with scale and gold */
.skill-categories-grid.difficulty_selection .skill-category.panel.selected {
    transform: translateY(-3px) scale(1.02);
    --kit-frame-color: rgba(255, 215, 0, 0.7);
    --kit-frame-inner: rgba(218, 165, 32, 0.6);
    --kit-corner-color: rgba(255, 215, 0, 0.8);
    --kit-diamond-color: rgba(255, 215, 0, 0.9);
}

.skill-categories-grid.difficulty_selection .skill-category.panel.selected .skill-category-bg-layer::after {
    background: linear-gradient(to top, rgba(255, 215, 0, 0.5) 0%, rgba(218, 165, 32, 0.3) 50%, transparent 100%);
}

/* Completion badge for difficulty cards - Art Deco style */
.skill-category .completion-badge {
    position: absolute;
    top: 2.5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5vw;
    z-index: 10;
    white-space: nowrap;
}

.skill-category .completion-badge-diamond {
    color: var(--text-gold);
    font-size: clamp(12px, 0.8vw, 14px);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

.skill-category .completion-badge-line {
    width: 2vw;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text-gold), transparent);
}

.skill-category .completion-badge-text {
    color: var(--text-gold);
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.9vw, 15px);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1vw;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
    padding: 0 0.4vw;
}

.skill-category.completed.panel {
    box-shadow: inset 0 0 20px rgba(154, 58, 122, 0.3);
}

.skill-category.completed.panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(154, 58, 122, 0.1) 50%, transparent 100%);
    animation: completedShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

/* Game mode description panel - standalone */
/* Art Deco panel - game-mode-description-standalone */
.game-mode-description-standalone {
    margin: 0.8vh auto;
    max-width: 100%;
    text-align: center;
}

.game-mode-description-standalone .panel-content {
    padding: 1vh 1.5vw;
}

.game-mode-description-standalone .mode-description-text {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(13px, 1vw, 18px);
    color: var(--text-brown-light, #a89a90);
    line-height: 1.4;
}


.skill-category-name {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-weight: bold;
    font-size: clamp(15px, 1.4vw, 24px);
    color: #e5d4a8;
    margin-bottom: 0.6vh;
    letter-spacing: 0.1vw;
    text-shadow: 0 0 6px rgba(229, 212, 168, 0.3);
}

.skill-category.fundamentals .skill-category-name {
}

.skill-category-quote {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-style: italic;
    font-size: clamp(13px, 1vw, 17px);
    color: #ffe8d6;
    line-height: 1.2;
    margin-bottom: 0.5vh;
    text-shadow: 0 0 6px rgba(201, 169, 110, 0.3);
    letter-spacing: 0.05vw;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Show quote on hover and selected state */
.skill-category:hover:where(body:not(.gamepad-active) *) .skill-category-quote,
.skill-category.selected .skill-category-quote {
    opacity: 1;
    transform: translateY(0);
}

/* Stat line on cards (difficulty: "1x HP / 0.5x DMG ...") — banner style, no pill box */
.skill-category-progress {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6vw;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(13px, 1vw, 17px);
    color: #ffffff;
    font-weight: bold;
    background: none;
    padding: 0.35vh 0.8vw;
    border-radius: 0;
    border: none;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.7),
        0 1px 0 rgba(0, 0, 0, 0.95),
        -1px -1px 0 rgba(0, 0, 0, 0.9),
        1px -1px 0 rgba(0, 0, 0, 0.9),
        -1px 1px 0 rgba(0, 0, 0, 0.9),
        1px 1px 0 rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
}

.skill-category-progress::before,
.skill-category-progress::after {
    content: '';
    flex: 0 0 0.7vw;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        currentColor 60%,
        currentColor 100%);
    box-shadow: 0 0 5px currentColor;
    opacity: 0.7;
}

.skill-category-progress::after {
    background: linear-gradient(270deg,
        transparent 0%,
        currentColor 60%,
        currentColor 100%);
}

/* Badge UPGRADES AVAILABLE w kategorii */
.skill-category-upgrades-badge {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(14px, 1vw, 18px);
    font-weight: bold;
    color: #ffffff;
    background: none;
    padding: 0.2vh 0.5vw;
    border-radius: 0.4vw;
    border: none;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8c00;
    margin-bottom: 0.3vh;
    animation: categoryBadgePulse 1.5s ease-in-out infinite;
}

@keyframes categoryBadgePulse {
    0%, 100% {
        opacity: 0.9;
        text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8c00;
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 15px #ffd700, 0 0 30px #ff8c00, 0 0 40px #ffd700;
    }
}

/* Glow na calej kategorii gdy ma ulepszenia */
.skill-category.has-upgrades.panel {
    --kit-frame-color: rgba(255, 215, 0, 0.5);
    --kit-corner-color: rgba(255, 215, 0, 0.6);
    --kit-diamond-color: rgba(255, 215, 0, 0.7);
}

.skill-category.has-upgrades.panel > .deco-frame::before {
    box-shadow:
        0 0 15px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.15),
        inset 0 0 0 2px transparent,
        inset 0 0 0 3px var(--kit-frame-inner);
}

.skill-category-key-badge {
    position: absolute;
    top: calc(10px + 1vh);
    right: calc(10px + 1vw);
    background: rgba(106, 42, 82, 0.9);
    color: #ffffff;
    font-size: clamp(13px, 1vw, 18px);
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-weight: bold;
    padding: 0.4vh 0.6vw;
    border-radius: 50%;
    min-width: 1.8vw;
    text-align: center;
    opacity: 0.8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.skill-category.fundamentals .skill-category-key-badge {
}

/* Locked categories styling */
.skill-category.locked.panel {
    opacity: 0.5;
    cursor: var(--cm-cursor-disabled, not-allowed);
    filter: grayscale(100%) brightness(0.7);
    --kit-frame-color: rgba(128, 128, 128, 0.4);
    --kit-frame-inner: rgba(100, 100, 100, 0.3);
    --kit-corner-color: rgba(128, 128, 128, 0.5);
    --kit-diamond-color: rgba(128, 128, 128, 0.6);
}

.skill-category.locked.panel:hover:where(body:not(.gamepad-active) *),
.skill-category.locked.panel.selected {
    transform: none;
}

.skill-category.locked.panel .skill-category-bg-layer::after {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%) !important;
}

.skill-category.locked .skill-category-name {
    color: #888;
    text-shadow: 0 0 8px rgba(136, 136, 136, 0.4);
}

.skill-category.locked .skill-category-progress {
    background: none;
    border: none;
    color: #888;
}

.skill-category.locked .skill-category-quote {
    visibility: hidden;
}

.skill-category.locked .skill-category-key-badge {
    background: rgba(128, 128, 128, 0.6);
    color: #666;
}

/* Locked overlay — shown on locked skill categories (e.g. Mortis Mastery before fundamentals maxed) */
.skill-category-locked-overlay {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-weight: bold;
    font-size: clamp(12px, 1.1vw, 20px);
    color: #e5d4a8;
    text-shadow: 0 0 8px rgba(229, 212, 168, 0.5),
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    letter-spacing: 0.1vw;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
    pointer-events: none;
    z-index: 15;
}

/* Coming Soon / locked overlay — banner style, soft fade behind text to mask underlying description */
.skill-category-coming-soon {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 15vw;
    background: none;
    color: #ffd700;
    padding: 0.7vh 0.6vw;
    border-radius: 0;
    border: none;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.9vw, 15px);
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.4;
    z-index: 10;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.85),
        0 0 18px rgba(139, 0, 0, 0.6),
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    pointer-events: none;
}

/* Top + bottom glowing rails replacing the box border */
.skill-category-coming-soon::before,
.skill-category-coming-soon::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.9) 30%,
        rgba(255, 215, 0, 0.9) 70%,
        transparent 100%);
    box-shadow:
        0 0 8px rgba(255, 215, 0, 0.9),
        0 0 14px rgba(139, 0, 0, 0.6);
    pointer-events: none;
}

.skill-category-coming-soon::before { top: 0; }
.skill-category-coming-soon::after  { bottom: 0; }

/* World Development Badge on cards — clean, no dark band */
.world-dev-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    margin-top: 0.5vh;
    background: none;
    padding: 0.5vh 0;
    text-align: center;
    box-sizing: border-box;
}

/* World dev phase badge — banner style: no box, flanking accent rails */
.world-dev-phase {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5vw;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.75vw, 13px);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.25vh 1vw;
    border: none;
    background: none;
    border-radius: 0;
}

.world-dev-phase::before,
.world-dev-phase::after {
    content: '';
    flex: 0 0 0.8vw;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        currentColor 60%,
        currentColor 100%);
    box-shadow: 0 0 6px currentColor;
    opacity: 0.95;
}

.world-dev-phase::after {
    background: linear-gradient(270deg,
        transparent 0%,
        currentColor 60%,
        currentColor 100%);
}

.world-dev-phase.phase-concept   { color: #aaa;     text-shadow: 0 0 8px rgba(170, 170, 170, 0.7), 0 1px 0 rgba(0, 0, 0, 0.9); }
.world-dev-phase.phase-pre-alpha { color: #f87171;  text-shadow: 0 0 8px rgba(248, 113, 113, 0.8), 0 1px 0 rgba(0, 0, 0, 0.9); }
.world-dev-phase.phase-alpha     { color: #fb923c;  text-shadow: 0 0 8px rgba(251, 146, 60, 0.8),  0 1px 0 rgba(0, 0, 0, 0.9); }
.world-dev-phase.phase-beta      { color: #fbbf24;  text-shadow: 0 0 8px rgba(251, 191, 36, 0.8),  0 1px 0 rgba(0, 0, 0, 0.9); }
.world-dev-phase.phase-release   { color: #4ade80;  text-shadow: 0 0 10px rgba(74, 222, 128, 0.9), 0 1px 0 rgba(0, 0, 0, 0.9); }

/* World event badge — same banner treatment, cyan accent */
.world-event-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5vw;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.25vh 1vw;
    border: none;
    background: none;
    border-radius: 0;
    color: #67e8f9;
    text-shadow: 0 0 10px rgba(103, 232, 249, 0.85), 0 1px 0 rgba(0, 0, 0, 0.9);
    margin-top: 0.3vh;
}

.world-event-badge::before,
.world-event-badge::after {
    content: '';
    flex: 0 0 0.8vw;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        currentColor 60%,
        currentColor 100%);
    box-shadow: 0 0 6px currentColor;
    opacity: 0.95;
}

.world-event-badge::after {
    background: linear-gradient(270deg,
        transparent 0%,
        currentColor 60%,
        currentColor 100%);
}

.world-dev-completion {
    display: flex;
    align-items: center;
    gap: 0.4vw;
    width: 100%;
}

.world-dev-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.world-dev-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.world-dev-bar-fill.phase-concept {
    background: #888;
    box-shadow: 0 0 4px rgba(136, 136, 136, 0.5);
}

.world-dev-bar-fill.phase-pre-alpha {
    background: #f87171;
    box-shadow: 0 0 4px rgba(248, 113, 113, 0.5);
}

.world-dev-bar-fill.phase-alpha {
    background: #fb923c;
    box-shadow: 0 0 4px rgba(251, 146, 60, 0.5);
}

.world-dev-bar-fill.phase-beta {
    background: #fbbf24;
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.5);
}

.world-dev-bar-fill.phase-release {
    background: #4ade80;
    box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
}

.world-dev-percent {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(12px, 0.7vw, 13px);
    color: rgba(255, 255, 255, 0.7);
    min-width: 2.5vw;
    text-align: right;
}

/* Animations */
@keyframes menuPanelSlideIn {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes menuPanelSlideUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes categoryPulse {
    0%, 100% {
        filter: drop-shadow(0 8px 25px rgba(154, 58, 122, 0.4));
    }
    50% {
        filter: drop-shadow(0 8px 35px rgba(154, 58, 122, 0.6));
    }
}

@keyframes lockedTooltipFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.8);
    }
    15%, 85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.8);
    }
}

/* Gamepad hints for menu */
.menu-gamepad-hints {
    position: absolute;
    bottom: 2.5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2vw;
    z-index: 20;
    opacity: 0.8;
}

.menu-hint-item {
    color: #999;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: 1.2vw;
    display: flex;
    align-items: center;
    gap: 0.6vw;
}

.menu-hint-gamepad {
    font-size: 1.4vw;
}

/* Hide menu by default */
.menu-overlay:not(.active) {
    display: none;
}

.menu-overlay.active {
    display: flex;
}

/* Back button styling */
.menu-back-btn {
    position: absolute;
    top: calc(7.5vh - 27px);
    left: calc(5vw - 27px);
    z-index: 15;
    cursor: var(--cm-cursor-action, pointer);
}

.menu-back-btn.btn.panel {
    width: 36px;
    height: 36px;
    background: transparent;
}

.menu-back-btn.panel > .panel-content {
    font-size: 14px;
    line-height: 1;
    color: var(--kit-text-color, #8a7a75);
}

/* Selected state - keyboard/gamepad */
.menu-back-btn.selected {
    --kit-frame-color: #6a5040;
    --kit-frame-inner: #4a3530;
    --kit-corner-color: #8a6a55;
    --kit-diamond-color: #aa8a70;
}

.menu-back-btn.selected > .panel-texture {
    background:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        radial-gradient(ellipse 80px 120px at 30% 25%, rgba(40, 25, 20, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 100px 80px at 70% 45%, rgba(35, 20, 18, 0.12) 0%, transparent 70%),
        linear-gradient(180deg,
            #18100c 0%,
            #201510 12%,
            #2a1a14 30%,
            #302018 45%,
            #281814 58%,
            #201210 70%,
            #140c08 100%
        );
    background-blend-mode: soft-light, normal, normal, normal;
}

.menu-back-btn.selected > .panel-content {
    color: var(--text-brown-accent);
}

.menu-back-btn.selected > .deco-frame::before {
    box-shadow:
        0 0 10px rgba(120, 90, 60, 0.2),
        inset 0 0 0 4px transparent,
        inset 0 0 0 6px var(--kit-frame-inner, #4a3530);
}

/* Mobile */
@media (max-width: 768px) {
    .menu-gamepad-hints {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Art Deco Footer */
.menu-footer-deco {
    --deco-color: #3a2a28;
    --deco-diamond: #5a4a45;

    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1vh;
    opacity: 1;
    flex-shrink: 0;
}

.menu-footer-deco .footer-diamond-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.menu-footer-deco .footer-line {
    width: 40px;
    height: 1px;
    background: var(--deco-color);
}

.menu-footer-deco .footer-diamond-small {
    width: 7px;
    height: 7px;
    border: 1px solid var(--deco-diamond);
    transform: rotate(45deg);
    background: rgba(10, 6, 8, 0.8);
}

.menu-footer-deco .footer-diamond-center {
    width: 11px;
    height: 11px;
    border: 1px solid var(--deco-color);
    transform: rotate(45deg);
    background: rgba(10, 6, 8, 0.8);
    box-shadow: inset 0 0 4px rgba(90, 74, 69, 0.5);
}

.menu-footer-deco .footer-bottom-line {
    display: none;
}

.menu-footer-deco .footer-bottom-diamond {
    display: none;
}
