/* Title screen */
    .modal-container.main-screen-container{
        align-items: flex-start;
        justify-content: space-between;
        height: 100%;
        max-height: 600px;
        padding: 24px;
    }
    .background-key{
        background-image: url(/img/bg/key.svg);
        background-position: center;
        background-repeat: no-repeat;
        background-color: var(--screen-bg);
    }
    .logo{
        width: calc(86px * 1.5);
    }

/* Map */
    #map{
        background-color: var(--stage-bg-1);

        width: 100%;
        height: 100%;
        min-width: 362px;

        position: relative;
        overflow: scroll;

        display: flex;
        justify-content: center;
        align-items: center;
    }
    #map-container{
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        
        /* border-right: 1px dashed var(--map-frame) !important;
        border-top: 1px dashed var(--map-frame) !important; */
    }

    .map-frame{
        min-width:100%;
        height: 100%;
        display: flex;
        justify-content: center;
        overflow: scroll;
    }
    .map-tile{
        width: 120px;
        height: 120px;

        border-left: 1px dashed var(--map-frame) !important;
        border-bottom: 1px dashed var(--map-frame) !important;
        background-color: var(--w0);

        position: relative;
        box-shadow: none;
    }
    .map-tile:hover{
        background-color: var(--w0);
    }
    .map-tile:active, .map-tile:focus{
        background-color: var(--w0);
        border: none;
    }
    .map-unit{
        position: absolute;
        z-index: 1;
        bottom: 4px;
        right: 4px;
    }
    #map-desc{
        position: absolute;
        top:12px;
        left: 12px;
        font-size: 18px;
        color: var(--b50);
    }
    #map, #map *{
        touch-action: pan-y !important;
        overscroll-behavior-y: none;
        overscroll-behavior-x: none;

        scroll-behavior: smooth;
    }
    .dungeon{
        background-color: rgb(67, 67, 67) !important;

        /* #map-container{    
            border-right: 1px dashed var(--dungeon-border) !important;
            border-top: 1px dashed var(--dungeon-border) !important;
        } */

        .map-tile{
            border-left: 1px dashed var(--dungeon-border) !important;
            border-bottom: 1px dashed var(--dungeon-border) !important;
        }
    }

/* Map animation */
    #player-unit{ 
        width: 18px;
        height: 32px;
        /* left: 4px; */
        /* right: calc(50% - 8px); */

        /* Required for auto-scrolling possition */
        padding-bottom: 150px; 
        bottom: -114px;

        pointer-events: none;

    }
    #player-unit * {
        position: absolute;
        left: 0;
    }
    #player-unit-arms{
        animation: player-char-idle-map 0.9s steps(2) infinite alternate;
    } @keyframes player-char-idle-map {
        0% {
            transform: translateY(0px);
        }
        100%{
            transform: translateY(-2px);
        }
    }

/* Quiz */
    .quiz-container img {
        height: 192px;
    }
    .quiz-btn-container {

        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        max-width: 288px;

        justify-content: center;

    }
    .quiz-btn-container button{
        width: calc(50% - 4px);
        /* background-color: var(--b10); */
        border: 2px solid var(--b10);
        border-radius: 8px;
    }
    
/* Casino */
    #casino-screen .modal-container{
        gap: 32px;
        overflow: visible;
        
    }
    #casino-screen .modal-container .casino-card-container{
        display: flex;
        width: 360px;
        height: 160px;
        align-items: center;
        justify-content: center;
        position: relative;
        gap: 4px;
        overflow: visible;
    }
    #casino-screen .modal-container .casino-card{
        width: 112px;
        height: 160px;
    }
    #casino-screen .modal-container #card-0{
        transform:rotate(-8deg);
    }
    #casino-screen .modal-container #card-2{

        transform:rotate(12deg);
    }
    #casino-screen .modal-container #casino-coins, #casino-screen .modal-container #casino-outcome{
        color: rgb(135, 116, 59);
        font-weight: 400;
        font-size: 28px;
    }
    #casino-screen .modal-container #casino-outcome{
        color: rgb(66, 66, 66);
    }

/*Character screen*/
    #character-content {
        align-items: flex-start;
        gap: 24px;
        /* padding: 0 24px 24px 24px; */
        align-items: stretch;

    }
    #character-content .stat-block{
        display: flex;
        border: 2px solid black;
    }
    #character-content .stat-block section{
        padding: 8px 8px 0px 8px;
        width: 50%;
        display: column;
        flex-wrap: wrap;

    }
    #character-content .stat-block section div{
        margin-bottom: 8px;
    }
    #character-content #action-list, #character-content #passive-list{
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 2px;
        
    }
    #character-content #action-list button, #character-content #passive-list button {
        width: calc(50% - 1px);
        height: 72px;

        pointer-events: none;

        background-color: var(--btn-bg);

        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
    }
    #character-content .social-container{
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 8px;

        width: 100%;

    }
    #character-content .social-container a {
        min-height: 48px;
        border-radius: 4px;
        text-decoration: none;
        display: flex;
        gap: 8px;
        align-items: center;
        font-size: 14px;
        flex: 1;
        padding: 8px 16px 8px 8px;
    }
    #character-content .social-container .x-social{
        background-color: var(--b10);
        color: black;
    }
    #character-content .social-container .discord{
        background-color: #3366FF;
        color: white;
    }
    .torch{
        background-image: url(/img/ui/torch-glow.svg);
        background-size: cover;
        height: 200px;
        width: 200px;

        position: absolute;
        top: -6px;
        right: 64px;

        display: flex;
        justify-content: center;
        align-items: center;
    }

/* Combat */
    #combat{
        height: 100%;
        overflow: hidden;
        background-color: rgb(0, 0, 0);
        flex-direction: column;
        align-items: center;
        position: relative;
 
    }
    #combat .units-container{
        /* width:100%; 
        align-items: stretch; 
        padding: 0 4px;  */
        position: relative;
        /* left: 50%; */
    }
    .bg-cover{
        position: absolute;
        left: 50%;
        transform: translate(-50%, -24px);
    }
    #combat #log{

        font-size: 13px;
        line-height: 16px;
        color: var(--white);
        position: fixed;

        top: 4px;
        left: 4px;

        padding: 4px 8px;
        background-color: var(--black);
        z-index: 99;
    }

/* Actions */
    .actions-container{
        display: flex;
        flex-direction: row;
        
        height: 208px;
        width: 352px;

        overflow: scroll;
        z-index: 1;
        margin-bottom: 4px;
    }

    .actions-container #cards-row{
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 2px;
        width: 100%;
        background-color: black;
    }
    
    .action{
        max-width: 200px;
        width: calc(50% - 1px);
        height: 68px;
        padding: 0px;

        display: flex;
        align-items: flex-start;
        justify-content: flex-start;

        text-align: left;
        font-size: 12px;
        line-height: 14px;

        position: relative;
        overflow: hidden;
        
    }
    .action h3 {
        color: var(--heading-yellow);;
    }
    .action div{
        display: flex;
        justify-content: space-between;
    }
    .action span{
        display: flex;
        justify-content: space-between;
        padding: 6px 0 0 6px;
    }
    .action .desc{
        padding: 0 38px 6px 6px;
        overflow: hidden;
        position: relative;
        height: 44px;
    }
    .action img{
        position: absolute;
        right: -8px;
        bottom: -8px;
    } 
    .action .cooldown-indicator{
        color: var(--white);
        background-color: black;
        padding: 4px 6px;
        position: absolute;
        bottom: 0px;
        left: 0px;

        border-radius: 0 4px 0 0;
        z-index: 5;
    }
    .action .charge-indicator, span.slot-indicator{
        color: var(--white);
        background-color: black;

        padding: 2px 4px 2px 6px;

        position: absolute;
        top: 0px;
        right: 0px;

        border-radius: 0 0 0 4px;
    }

    .action, .action:hover, .action:active{
        /* background-color: var(--sc); */
        border: none;
        /* border: none; */
    }
    
/*Sprites*/
    .imgcont{
        /*Pos for intent indicator*/
        position: relative;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;

        min-height: 192px;
        min-width: 180px;

        /*Offset for bottom shadow*/
        margin-top: 16px;
    }
    #enemy-sprite, .player-sprite, .generic-sprite {
        z-index: 3;
        position: relative;
        display: flex;
        width: 100%;
        height: 100%;

        align-items: flex-end;
        justify-content: center;

    }
    #enemy-sprite img, .player-sprite img, .generic-sprite img {
        position: absolute;
    }
    #enemy-sprite{
        z-index: 2; 
    }
    .generic-sprite img:nth-child(1), .generic-sprite img:nth-child(2), .generic-sprite img:nth-child(5),
    .player-sprite  img:nth-child(1), .player-sprite  img:nth-child(2), .player-sprite  img:nth-child(5),
    #enemy-sprite   img:nth-child(1):not(.boss-sprite), #enemy-sprite   img:nth-child(4){
        animation: player-char-idle 0.8s steps(2) infinite alternate;
    } @keyframes player-char-idle {
        0% {
            transform: translateY(0px);
        }

        100%{
            transform: translateY(4px);
        }
    }
    .character-page-sprite{
        width: 128px;
        height: 144px;
        margin-top: 26px;
    }
    
/*Entrance anim*/
    .enemyEntrance{
        animation-name: enemy-entrance;
        animation-duration: 2s;
        animation-iteration-count: 1;
    } @keyframes enemy-entrance {
        0%{
            margin-left: 120px;
        }
        100%{
            margin-left: 0px;
        }
    }

/* Ghosts */
    #p-ghost, #e-ghost{
        opacity: 0;
    }
    .ghost-trigger{
        animation-name: ghostfx;
        animation-duration: 4s;
        animation-iteration-count: 1;
    } @keyframes ghostfx {

        0%{
            opacity: 0.75;
        }
        100%{
            opacity: 0;
        }
    }

/* Combat: Intent indicator */
    #intent-indicator{
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute;

        bottom: 172px;
        z-index: 1;

        
    }
    #intent-indicator div{
        max-width: 180px;
        background-color: var(--b80);

        padding: 8px 8px;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;

        text-align: center;
        line-height: 16px;
        color: white;

    }
    #intent-indicator div img{
        width: 16px;
        height: 16px;
        margin-top: 0px;
        margin-bottom: 4px;
    }
    #intent-indicator svg{
        fill: var(--b80);
        width: 12px;
        height: 12px;
    }

    #status-fx{
        font-size: 12px;
        line-height: 12px;

        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;

        margin-top: 4px;
    }
    #status-fx span {
        background-color: var(--w10);
        border-radius: 3px;
        
        padding: 0px 5px;
        height: 18px;
        display: flex;
        
        align-items: center;
        background-color: black;
    }
    #status-fx #action-tag{
        color: var(--w70);
        order: 1;
    }
    #status-fx #poison-tag{
        color: var(--green);
        order: 4;
        padding: 2px 5px 2px 0px;
    }
    #status-fx #ban-tag{
        color: var(--orange);
        order: 3;
    }
    #status-fx #reflect-tag{
        color: var(--yellow);
        order: 2;
    }
    #status-fx  img {
        /* transform: translate(2px, 4px); */
        height: 14px !important;
        width: 14px !important;
        margin-bottom: 0px !important;
    }
    #status-fx:empty{
        margin-top: 0px;
    }

/* Boss */
    .boss #intent-indicator{
        /* bottom: -22px !important;
        background-color: black;
        border-bottom: 1px solid var(--w20); */
    }
    .boss #intent-indicator div{
        /* min-width: 180px !important;
        flex-direction: row !important;
        padding: 4px 4px !important;
        font-size: 13px !important;
        line-height: 16px !important; */
    }
    .boss #intent-indicator svg{
        /* display: none; */
    }

    .boss .stat-group{
        /* background-color: black;
        min-width: 180px !important;
        bottom: -62px !important; */
    }
    /* Remove idle anim */
    .boss  #enemy-sprite img:nth-child(2){
        animation: none !important;
    }


/* Combat: stats ui */
    .stat-group{
        color: var(--white);
        font-size: 13px;

        display: flex;
        flex-wrap: wrap;
        flex:1 1 0;
        justify-content: center;
        gap: 0px;

        overflow: hidden;
        position: absolute;
        bottom: -40px;
        z-index: 2;
        
    }
    .stat-group .stat{
        padding: 4px 4px 2px 4px;
        background-color: var(--b80);

        backdrop-filter: blur(2px);
        /* -webkit-backdrop-filter: blur(2px); */

        border-radius: 0px;
        border-left: 1px solid var(--black);

        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;

        min-width: 26px;
        position: relative;
    }

    .stat-group .stat:first-child{
        border: none;
    }

    .stat-group span, .stat-group span{
        color: var(--w50);
    }

    .stat-group #e-life, .stat-group #p-life{
        color: #FF3371;
    }
/*Dice anim*/
    .roll-dice{
        animation-name: dice-roll;
        animation-duration: 1s;
        animation-iteration-count: 1;
    }
    @keyframes dice-roll{
        0%{
            transform: rotate(0deg);
        }
        100%{
            transform: rotate(720deg);
        }
    }

/* Floating stat numbers */
    .floater{
        position: absolute;
        opacity: 0;
        background-color: rgb(0, 0, 0);
        border-radius: 0px;

        width: 100%;
        height: 50%;

        text-align: center;
        padding: 0 4px;
    }
    .stat-float{
        animation-name: stat-float;
        animation-duration: 4s;
        animation-iteration-count: 1;
    }
    @keyframes stat-float{
        0%{
            top: 18px;
            opacity: 0;
        }
        10%{
            top: 0px;
            opacity: 1;
        }
        90%{
            top: 0px;
            opacity: 1;
        }
        100%{
            top: 0px;
        }
    }

/*Items & inventory*/
    .item-list{
        max-width: calc(var(--item-card-max-width) * 2);

        display: flex;
        flex-wrap: wrap;

        gap: 2px;

    }
    .item-list .item-card{
        display: flex;
        flex-direction: column;

        max-width: var(item-card-max-width);
        width: calc(50% - 2px);
        height: 160px;

        background-color: var(--btn-bg);
    }
    .item-list .item-card img{
        height: 52px;
        width: 52px;
        z-index: 1;
    }
    .item-glow{
        background-image: radial-gradient(
            circle 100px at bottom left,
            rgba(255, 255, 255, 0.1), 
            rgba(0,0,0,0)
        );
        height: 100px;
        width: 100px;
        position: absolute;
        left: 0;
        bottom: 0;
        z-index: 0;
    }
    .magic{
        background-image: radial-gradient(
            circle 100px at bottom left,
            rgba(74, 167, 255, 0.4), 
            rgba(0,0,0,0)
        );
    }
    .rare{
        background-image: radial-gradient(
            circle 100px at bottom left,
            rgba(251, 255, 0, 0.5), 
            rgba(255, 225, 0, 0.1), 
            rgba(249, 255, 82, 0.0)
        );
    }
    .epic{
        background-image: radial-gradient(
            circle 100px at bottom left,
            rgba(255, 92, 228, 0.4), 
            rgba(0,0,0,0)
        );
    }
    .unique{
        background-image: radial-gradient(
            circle 100px at bottom left,
            rgba(255, 127, 92, 0.4), 
            rgba(0,0,0,0)
        );
    }
    .item-list .item-card button{
        border: none;
        background-color: var(--w0);
        
        display: flex;
        flex-direction: row;
        gap: 4px;
        
        font-style: italic;
        padding: 12px;
    }
    .item-list .item-card button img{
        height: 24px;
        width: 24px;
    }

    .item-list .item-card .item-top-container{
        flex-direction: column;
        height: 100%;   

    }
    .item-list .item-card .item-top-container p {
        /*Removes margin from modal <p>*/
        margin: 0px;
        max-height: 120px;
        height: 100%;
        overflow: hidden;
    }
    .item-list .item-card .item-top-container .passive-container{
        display: flex;
        align-items: flex-end;
        gap: 4px;

    }
    .item-list .item-card .item-top-container .passive-container div {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .item-list .item-card .item-top-container .passive-container img{
        height: 16px;
        width: 16px;
    }
    .item-list .item-card .item-top-container, .item-bottom-container{
        display: flex;
        min-height: 52px;
        position: relative;
        justify-content: space-between;

    }
    .item-list .item-card .item-top-container, .item-bottom-container span {
        color: white;
        padding: 6px 6px 2px 6px;
        border-radius: 0 0 0 4px;
        right: 0;
        top: 0;
    }

/* Item details modal */
    #item-modal{
        z-index: 5;      
    }
    #item-modal .action-ref{
        display: flex;
        flex-direction: column;
        
        margin-top: 4px;
        background-color: var(--b10);

        padding: 8px;
        border-radius: 4px;

        width: calc(100%);
        max-width: 320px;

        text-align: left;
    }
    #item-modal .stat{
        background-color: var(--b10);
        padding: 4px 8px 4px 4px;
        border-radius: 4px;

        margin-top: 4px;
        gap: 4px;

        width: calc(50%);
        max-width: 320px;

    }
    #item-modal .stat p{
        width: 100%;
        font-style: italic;
        text-align: left;
    }
    #item-modal .stat-ico{
        height: 16px;
        width: 16px;
    }
    #item-modal .modal-container{
        align-items: center;
        text-align: center;

    }
    #item-modal .modal-container p{
        max-width: 280px;
    }
    #item-modal .item-img{
        height: 104px;
        width: 104px;
    }

/* Skill tree */
    #tree, #tree *{ 
        touch-action: auto !important;
        /* height: auto; */
    }
    #skill-tree{
        height:            calc(var(--tree-cell) * var(--tree-rows));
        width:             calc(var(--tree-cell) * var(--tree-columns));

        display:               grid;
        grid-template-columns: repeat(var(--tree-columns),1fr);
        grid-template-rows:    repeat(var(--tree-rows),   1fr);

        margin: 160px 24px 160px 24px;
        cursor: url(/img/ico/cursor-move.svg), auto;
    }

    #tree-node-popup{
        width: calc(100% - 16px);
        max-width: 400px;
        min-height: 72px;

        background-color: black;
        padding: 4px 8px;
        color: var(--w80);

        position: absolute;
        bottom:  102px;
        left: 50%;
        transform: translateX(-50%);

        display: flex;
        gap: 12px;
        justify-content: space-between;
        z-index: 6;

        border-bottom: 1px solid var(--w20);

    }
    #tree-node-popup button{
        margin-top: 4px;
    }

    /* Tree rendering */
    .tree-tile{
        width:  var(--tree-cell);
        height: var(--tree-cell);

        font-size: 10px;
        line-height: 100%;

        position: relative;

        display: flex;
        justify-content: center;
        align-items: center;
        background-color: var(--w0);

        border: none;
        padding: 0;
        box-shadow: none;

    }
    .tree-tile img {
        /* background-color: var(--tree-node); */
        z-index: 1;
        padding: 0;
        height: 48px;
        width: 48px;
        border-radius: 0px;
    }
    .compact-node img{
        height: 32px;
        width:  32px;
        outline: 2px solid var(--btn-border);
        border: 2px solid var(--btn-bg);
        background-color: black;
    }
    .tree-tile p{
        position: absolute;
        top: 0;
        left: 0; 

        z-index: 3;
        color: red;
    }

    .tree-path{
        height: 100%;
        width: 2px;
        background-color: var(--btn-border);
    }
 
    .R, .L, .T, .D, .RD, .LD, .RT, .LT{
        position: absolute;
        height: 2px;
        width: 50%;
        transform: translateX(50%);
        background-color: var(--btn-border);
    }
    .L{
        transform: translateX(-50%);
    }
    .T, .D{
        height: 50%;
        width: 2px;
        transform: translateY(-50%);
        background-color: var(--btn-border);
    }
    .D{
        transform: translateY(50%);
    }
    .LD{
        transform: rotate(-45deg) translate(-92%);
    }
    .RD{
        transform: rotate(45deg)  translate(92%);
    }
    .LT{
        transform: rotate(45deg)  translate(-92%);
    }
    .RT{
        transform: rotate(-45deg) translate(92%);
    }

    .node-allocated img{
        border: 2px solid var(--heading-yellow);
        box-shadow: 0px 0px 6px 0px var(--heading-yellow);
        transition: all 300ms;
        outline: none;
    }
    .compact-node.node-allocated img{
        outline: none;
        border: 2px solid var(--heading-yellow);
        box-shadow: 0px 0px 6px 0px var(--heading-yellow);
    }
    .node-allocated div, .active-path div{
        background-color: var(--heading-yellow);
        box-shadow: 0px 0px 6px 0px var(--heading-yellow);
        transition: all 300ms;
    }


    /* Char selection screen */
    .char-selection{
        width: 100%;
        height: 100%;
        max-width: none;
        position: relative;
    }
    #char-text-container{
        position: absolute;
        top: 20%;

        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    #characters{
        display: flex;
        transform: translateY(40px);
    }
    
    #characters button{
        width: 108px;
        height: 144px;
        border: none;
        background-color: var(--w0);
        box-shadow: none;
        padding: 0;
    }
    .char-highlight{
        background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3)) !important;
    }

    #char-select-button{
        position: absolute;
        bottom: 8px;
        width: 100%;
        max-width: calc(360px - 16px);
    }
    .char-bg{
        z-index: -1;
        position: absolute;
    }