html,body,ul,ol,li,p,td,h1,h2,h3,h4,h5,h6,form,fieldset,a,img{margin:0;padding:0;border:0}
a img{border:none;cursor:pointer;text-decoration:none}

html, body
    {
    height:100%;
    font-family: Helvetica;
    font-size: 72px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    }
body 
    {
    width: 100%;
    background:#fff;
    }

.main_wrap
    {
    position: relative;
    width: 100%;
    height: 100%;
    }

.noselect
    {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    }
.player
    {
    position: absolute;
    width: 100vw;
    height: 50vh;

    top: 50vh;

    vertical-align: center;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    background-size: cover;
    isolation: isolate;
    }
    /* Extra color layers for multicolor backgrounds: each layer shows its
       mana image and is masked to fade in over the previous stripe */
    .player-bg
        {
        position: absolute;
        top: 0; right: 0; bottom: 0; left: 0;
        z-index: -1;
        pointer-events: none;
        }
        .player-bg div
            {
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            background-size: cover;
            background-position: center center;
            }
        .player-bg .bg-green  { background-color: #26b569; background-image: url('../../img/green.jpg') }
        .player-bg .bg-red    { background-color: #f85555; background-image: url('../../img/red.jpg')   }
        .player-bg .bg-black  { background-color: #000;    background-image: url('../../img/black.jpg') }
        .player-bg .bg-blue   { background-color: #67c1f5; background-image: url('../../img/blue.jpg')  }
        .player-bg .bg-white  { background-color: #fefedf; background-image: url('../../img/white.jpg') }
    .green  { background-color: #26b569; color: #fff; background-image: url('../../img/green.jpg') }
    .red    { background-color: #f85555; color: #fff; background-image: url('../../img/red.jpg')   }
    .black  { background-color: #000;    color: #fff; background-image: url('../../img/black.jpg') }
    .blue   { background-color: #67c1f5; color: #fff; background-image: url('../../img/blue.jpg')  }
    .white  { background-color: #fefedf; color: #fff; background-image: url('../../img/white.jpg') }


    .p2
        {
        transform-origin: top center;
        transform: rotate(180deg);
        }
    .r90
        {
        transform-origin: top left;
        transform: rotate(90deg) translate(-50vh, -50vw);
        width: 50vh;
        height: 50vw;
        }
    .og.r90
        {
        transform: rotate(90deg) translate(0, -50vw);
        }


    .r-90
        {
        transform-origin: top left;
        transform: rotate(-90deg) translate(0, 50vw);
        width: 50vh;
        height: 50vw;
        }
    .p4.r-90
        {
        transform: rotate(-90deg) translate(-50vh, 50vw);
        }

    .cnt
        {
        width: 100%;
        font-weight: 700;
        font-size: 2em;
        text-shadow: 0 0 4px rgba(0,0,0,1);
        }

    .delta
        {
        position: absolute;
        top: 14%;
        left: 50%;
        transform: translateX(-50%);
        font-size: 40px;
        font-weight: 700;
        color: #fff;
        text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.6);
        z-index: 51;
        pointer-events: none;
        display: none;
        white-space: nowrap;
        letter-spacing: 2px;
        }

    .m, .p
        {
        position: absolute;
        width: 50%;
        height: 100%;
        top: 0;
        cursor: pointer;
        background-repeat: no-repeat;
        background-position: center center;
        }          
    .m
        {
        left: 0;
        }
    .p
        {
        left: 50%;
        }

    .marker
        {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 50px;
        height: 50px;
        outline: 1px red solid;
        background: rgba(255,0,0,0.5);
        z-index: 100;
        }



.mana
    {
    position: absolute;
    display: flex;
    top: calc (50% - 60px);
    width: 100%;
    background: #000;
    justify-content: space-around;
    align-items: center;
    border-top: 1px #e3e3e3 solid;
    border-bottom: 1px #e3e3e3 solid;
    opacity: 0;
    height: 0px;
    transition: all 0.5s ease;
    overflow: hidden;
    z-index: 0;
    }
    .r90 .mana,
    .r-90 .mana
        {
        width: calc(100% - 20px);
        }
    .r90 .mana,
    .p4.r-90 .mana 
        {
        margin: 0 20px 0 0 
        }
    .og.r90 .mana, 
    .r-90 .mana  
        {
        margin: 0 0 0 20px 
        }
    
    .mana.active
        {
        height: 120px;
        opacity: 1;
        z-index: 100;
        }
    .mana div
        {
        width: 80px;
        aspect-ratio: 1 / 1;
        background-size: auto 90%;
        background-position: center center;
        background-repeat: no-repeat;
        box-sizing: border-box;
        cursor: pointer;
        border-radius: 50%;
        border: 3px solid transparent;
        }
    @supports not (aspect-ratio: 1 / 1)
        {
        .mana div
            {
            /* padding-top % resolves against width, so it tracks the shrunk width where a fixed height wouldn't */
            width: 20%;
            max-width: 80px;
            height: 0;
            padding-top: calc(20% - 6px);
            }
        }
    .mana div.selected
        {
        border-color: #ffd700;
        box-shadow: 0 0 12px rgba(255,215,0,0.9);
        }
    .mana div:nth-child(1)  {background-image: url(../../img/green.png) }
    .mana div:nth-child(2)  {background-image: url(../../img/red.png) }
    .mana div:nth-child(3)  {background-image: url(../../img/black.png) }
    .mana div:nth-child(4)  {background-image: url(../../img/blue.png) }
    .mana div:nth-child(5)  {background-image: url(../../img/white.png) }


.player .dice_shadow
    {
    display: none;
    position: absolute;
    top:  10%;
    right: 10%;
    height: 143px;
    width: 143px;
    background-image: url(../../img/dice_shadow.png) 
    }
    .player.p2   .dice_shadow  { transform: rotate(180deg) }
    .player.r90  .dice_shadow  { transform: rotate(270deg) }
    .player.r-90 .dice_shadow  { transform: rotate(90deg)  }

    .player .dice
        {
        position: absolute;
        top: 0;
        left: 0;
        width: 100px;
        height: 100px;
        background-position: 0 0;
        background-repeat: no-repeat;
        z-index: 100;
        }
        .player .dice.rolled {background-image: url(../../img/dice_rolled.png) }
        .player .dice.static {background-image: url(../../img/dice_static.png) }


        .player .dice.d1 {background-position:      0 0 }
        .player .dice.d2 {background-position: -100px 0 }
        .player .dice.d3 {background-position: -200px 0 }
        .player .dice.d4 {background-position: -300px 0 }
        .player .dice.d5 {background-position: -400px 0 }
        .player .dice.d6 {background-position: -500px 0 }




.settings
    {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100vw;
    height: 1px;
    margin-top: 0px;
    display: flex;
    z-index: 100;
    transition: all 0.5s ease;
    background: rgba(0,0,0,0.1);
    }
    .settings-left,
    .settings-right
        {
        flex: 1;
        display: flex;
        justify-content: space-around;
        align-items: flex-start;
        }
    .settings.active
        {
        top: calc(50% - 20px);
        height: 40px;
        background: rgba(0,0,0,0.5);
        }
    .settings .icon
        {
        width: 40px;
        height: 40px;
        background-size: auto 100%;
        background-position: center center;
        background-repeat: no-repeat;
        transition: all 0.5s ease;
        cursor: pointer;
        opacity: 0;
        }
    .active .icon,
    .active .icon.cog
        {
        opacity: 1;
        }

    .icon.cog           {   background-image: url(../../img/settings.png); opacity: 0.3; display: block; }
    .icon.dice          {   background-image: url(../../img/dice.png)     }

    .icon.life20,
    .icon.life40
        {
        background-image: none;
        font-size: 36px;
        font-weight: 700;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        text-shadow: 0 0 6px rgba(0,0,0,1);
        width: 30px;
        }
    .icon.two_player    {   background-image: url(../../img/2_player.png) }
    .icon.three_player  {   background-image: url(../../img/3_player.png) }
    .icon.four_player   {   background-image: url(../../img/4_player.png) }

    .icon
        {
        margin-top: -20px;
        }
    .active .icon
        {
        margin-top: 0;
        }


    .layout_2_playes .icon.two_player   {display: none }
    .layout_3_playes .icon.three_player {display: none }
    .layout_4_playes .icon.four_player  {display: none }

@media (max-width: 480px)
    {
    .icon.life20,
    .icon.life40
        {
        font-size: 24px;
        }
    }


/* Poison toggle button */
.poison-toggle
    {
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 30px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    cursor: pointer;
    z-index: 51;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    }
.settings-open .poison-toggle
    {
    display: flex;
    pointer-events: auto;
    bottom: 72px;
    }
.settings-open .player.poison-active .poison-toggle
    {
    color: #e080ff;
    background: rgba(100, 0, 160, 0.7);
    border-color: rgba(200, 100, 255, 0.7);
    text-shadow: 0 0 12px rgba(200, 50, 255, 1);
    }

/* Poison counter */
.poison
    {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: none;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 30px;
    font-size: 20px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    white-space: nowrap;
    }
    .pm, .pp
        {
        cursor: pointer;
        font-size: 22px;
        line-height: 1;
        padding: 7px 13px;
        }
    .pcnt
        {
        min-width: 1.6em;
        text-align: center;
        font-weight: 700;
        padding: 7px 2px;
        }
    .pcnt::before
        {
        content: '☠ ';
        }

.player.poison-active .poison
    {
    display: flex;
    }
.player.poisoned .poison
    {
    background: rgba(90, 0, 110, 0.8);
    }
.player.poisoned::before
    {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(80, 0, 130, 0.45);
    z-index: 44;
    pointer-events: none;
    }
.player.poisoned::after
    {
    content: '☠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 140px;
    color: #e070ff;
    text-shadow: 0 0 40px rgba(180, 0, 255, 1), 0 0 15px rgba(0, 0, 0, 1);
    z-index: 46;
    opacity: 0.9;
    pointer-events: none;
    }
.player.poisoned .cnt
    {
    opacity: 0.4;
    }
    

/* Info button */
.info-toggle
    {
    position: absolute;
    top: 14px;
    right: 14px;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 26px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    display: none;
    cursor: pointer;
    z-index: 101;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    }
.settings-open .info-toggle
    {
    display: flex;
    }

/* Info screen */
.info-screen
    {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(0, 0, 0, 0.92);
    z-index: 300;
    }
    .info-screen.active
        {
        display: flex;
        }
    .info-screen .info-close
        {
        position: absolute;
        top: 14px;
        right: 14px;
        font-size: 40px;
        line-height: 1;
        color: #fff;
        cursor: pointer;
        }
    .info-screen .info-logo
        {
        width: 160px;
        height: 160px;
        border-radius: 24px;
        object-fit: cover;
        }
    .info-screen .info-email,
    .info-screen .info-kofi
        {
        font-size: 24px;
        color: #fff;
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,0.4);
        }

.fullscreen
    {
    position: absolute;
    font-size: 42px;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 200;
    opacity: 0;
    height: 1;
    overflow: hidden;
    transition: all 0.5s ease;
    cursor: pointer;
    color: #fff;
    }
    .layout_4_playes .fullscreen
        {
        left: calc((100% - 50vh + 20px) / 2);
        width: calc(50vh - 20px);
        transform-origin: center bottom;
        transform: rotate(90deg) translate(calc(-25vh + 10px), 30px);
        }

    .fullscreen.active
        {
        opacity: 1;
        height: 60px;
        background: rgba(0,0,0,0.3);
        display: flex;
        justify-content: center;
        align-items: center;
        }

    /* Native app is always fullscreen (immersive mode), the button is useless there */
    body.native-app .fullscreen
        {
        display: none !important;
        }

