* {
    user-select: none;
}

body, html {
    padding: 0;
    margin: 0;
}

body {
    background: #402766;
    display: flex;
    align-items: center;
    justify-content: center;

    font-family: 'Cabin', sans-serif;
    font-size: 16pt;
}

#content {
    position: relative;
}

#game {
    background: #7c69af;
    padding: 60px 80px 40px;
    position: relative;
    overflow: hidden;
}

.piece {
    width: 110px;
    height: 110px;
    margin: 2px 0;
    display: inline-block;

    color: transparent !important;
    font-weight: bold;
    text-align: center;
    position: relative;
    /* left: -10px; */

    z-index: 2;
}

/*
.piece:nth-child(n+7)
{
    left: 10px;
}

.piece:nth-child(n+13)
{
    left: -10px;
}

.piece:nth-child(n+19)
{
    left: 10px;
}
*/


.piece:before {
    content: "";
    position: absolute;
    
    top: 85px;
    bottom: 0px;
    left: 18px;
    right: 18px;
    border-radius: 50%;
    
    background: rgba(89, 47, 151, 0.15);
}

.piece.asleep:before, .piece.hibernating:before {
    left: 22px;
    right: 6px;
}

.piece .bear {
    content: "";
    position: absolute;
    top:-10px; bottom: 10px; left: 0; right: 0;

    background-size: 100px auto;
    background-position: bottom;
    background-repeat: no-repeat;

    z-index: 1;
}

.piece.awake .bear {
    background-image: url('img/bear_awake.png');
    animation-duration: 0.5s;
}

.piece.asleep .bear {
    background-image: url('img/bear_sleeping.png');
    animation-duration: 1.5s;
}

.piece.sleepy .bear {
    background-image: url('img/bear_sleepy.png');
    animation-duration: 1s;
}

.piece.hibernating .bear {
    background-image: url('img/bear_hibernating2.png');
    animation-duration: 1.5s;
}

.piece.awake {
    cursor: pointer;
}

.piece .highlight {
    background: #6c4c9d;
    opacity: 0;
    transition: opacity 200ms;
}

.piece.highlight:not(.hibernating) .highlight {
    position: absolute;

    top: 2px;
    bottom: 2px;
    left: 2px;
    right: 2px;
    opacity: 1;
    border-radius: 20px;
}

.piece.asleep:after {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    height: 25px;
    right: 27px;

    background: url('img/sleep_indicator.png') no-repeat top;
    background-size: contain;

    animation: zzz 0.75s infinite alternate;
}

@keyframes zzz {
    0% {
        top:5px;
    }
    100% {
        top: 2px;
    }
}

.piece.excited .bear:after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: 2px;
    height: 15px;

    background: url('img/excited_indicator.png') no-repeat top;
    background-size: contain;
}

.piece.excited .bear {
    background-image: url('img/bear_excited.png');
}

.piece.excited .bear, .piece.exited .bear:after {
    animation: shout 0.5s infinite;
}

@keyframes shout {
    0% {
        transform: scaleX(1) scaleY(1);
    }
    25% {
        transform: scaleX(0.95) scaleY(1.05);
    }
    50% {
        transform: scaleX(1) scaleY(1);
    }
    75% {
        transform: scaleX(1.05) scaleY(0.95);
    }
    100% {
        transform: scaleX(1) scaleY(1);
    }
}

#game-bg {
    position: absolute;
    top:0px; bottom: 0px; left: 0; right: 0;
}

#game-bg img {
    position: absolute;
    pointer-events: none;
}

.corner {
    z-index: 1;
}
.corner.top { top: 0; transform: scaleY(-1); }
.corner.bottom { bottom: 0; }
.corner.left { left: 0; transform: scaleX(-1); }
.corner.right { right: 0; }

.corner.top.left { transform: scale(-1, -1); }

.piece .bear {
    transform-origin: bottom;
    animation: pulse 1s infinite alternate ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scaleX(1) scaleY(1);
    }
    100% {
        transform: scaleX(1.02) scaleY(0.98);
    }
}

/* TODO shape selection */

#sidebar {
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;

    background: #402766;
    color: white;
    text-align: center;
    width: 105px;

    font-family: 'Fredoka One';
}

.showModal #sidebar {
    pointer-events: none;
}

.label {
    margin: 5px;
}

#content {
    display: flex;
    align-items: center;
    justify-content: center;
    align-items: stretch;
}

#shapes, .info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

.shape {
    width: 60px;
    height: 60px;
    margin: 5px 10px;

    cursor: pointer;

    background: #907ec2;
    border: 8px solid #6c4c9d;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
}
.shape.selected {
    background: white;
    border-color: #ffc75e;
}
.shape:hover {
    background: white;
}

.shape:after {
    transform: scale(0.75);
    filter: brightness(75%);
}

.shape.selected:after, .shape:hover:after {
    filter: none;
}

.shape.cross:after { content: url('img/shape_cross.png'); }
.shape.horiz:after { content: url('img/shape_horiz.png'); }
.shape.vert:after { content: url('img/shape_vert.png'); }
.shape.x:after { content: url('img/shape_x.png'); }

.shape .key {
    position: absolute;
    bottom: -10px;
    left: -8px;
    font-size: 14px;
    color: #8f7ec2;
    opacity: 50%;
}

.info .value {
    display: block;
    width: 60px;
    height: 60px;

    background: #6c4c9d;
    color: #ffc75e;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 30px;
    font-family: 'Fredoka One';
}

/* Show this for debug purposes */
/* .timer {
    position: absolute;
    z-index: 5;
    color: black;
    bottom: 10px;
    left: 55px;
} */

.modal {
    position: absolute;
    z-index: 10;
    top: 150px;
    left: 50px;
    right: 50px;

    background: #402766;
    color: white;
    padding: 20px;
    border-radius: 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    visibility: hidden;
}

.title {
    margin: 0;
    font-family: 'Fredoka One', sans-serif;
    font-size: 40pt;
    font-weight: normal;
}

p {
    margin: 10px;
}

#final-rounds {
    font-weight: bold;
    color: #ffc75e;
}

.button {
    background: #ffc75e;
    color: #402766;
    padding: 5px 30px 7px;
    border-radius: 20px;
    margin: 10px;
    font-family: 'Fredoka One';
}
.button:hover {
    background: #ffe7b9;
}

#how-to-play {
    position: absolute;
    top: 10px;
    z-index: 10;
    background: #402766;
    color: white;
    right: 105px;
    text-align: center;
    padding: 10px;
    margin: 40px;
    border-radius: 20px;
}

#how-to-play .piece {
    width: 100px;
    margin-bottom: -5px;
    cursor: auto;
}

#how-to-play .piece:before {
    display: none;
}

#how-to-play .button {
    display: inline-block;
}

#how-to-play .p2 {
    margin: 10px 30px;
}

#example {
    display: flex;
    align-items: center;
    color: #ffc75e;
    padding: 5px;
}

.banner-wrapper {
    position:absolute;
    top: 0; left: 0; right: 0;

    z-index: 2;
    display: flex;
    justify-content: center;
}

#banner {
    background: #5e4289;
    color: white;
    padding: 8px 25px;
    border-radius: 20px;
    font-size: 20px;

    visibility: hidden;
}