/******************** jQuery UI select menu **********************/

.ui-menu-item .ui-icon {
    background-image: none;
    width: 26px;
    height: 26px;
}

.ui-selectmenu-button {
    vertical-align: middle;
}

/******************** General Boxes **********************/
.box{
    -webkit-filter: drop-shadow(0px 12px 7px rgba(0,0,0,0.25));
    filter: drop-shadow(0px 12px 7px rgba(0,0,0,0.25));
    position: absolute;
    z-index: 100;

    /* Fix to make drop-shadow filter look correct on Safari on Retina displays */
    -webkit-transform: translateZ(0);

    font-family: Arial;
    font-weight: bold;
    color: #464646;

    text-align: center;
}

.box .content{
    border-radius: 5px;
	background: linear-gradient(to bottom, #cccccc 10%, #999999 90%);
    padding: 5px;
}

.boxbackground{
    background-color: #000000;
    opacity: 0.0;
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 100;
}

.box .spaced{
    padding: 5px;
}

.box button{
    margin: 5px;
}

.box .tab{
	position: absolute;
    z-index: -1;
    width: 34px;
    height: 34px;

    margin: -17px -17px;
}

.box.left .tab.left{
    display: inherit;
}

.box.right .tab.right{
    display: inherit;
}

.box.top .tab.top{
    display: inherit;
}

.box.topRight .tab.topRight{
    display: inherit;
}

.box.bottom .tab.bottom{
    display: inherit;
}


.box .tab.left{
    left: 0;
    top: 35px;
	background: linear-gradient(-45deg, #999999 -400%, #cccccc 90%);
    -webkit-transform: scaleY(0.7) rotate(45deg);
    -ms-transform: scaleY(0.7) rotate(45deg);
    transform:  scaleY(0.7) rotate(45deg);
    display: none;
}

.box .tab.right{
    right: 0;
    top: 35px;
	background: linear-gradient(-45deg, #999999 -400%, #cccccc 90%);
    -webkit-transform: scaleY(0.7) rotate(45deg);
    -ms-transform: scaleY(0.7) rotate(45deg);
    transform:  scaleY(0.7) rotate(45deg);
    display: none;
}

.box.localPlayer .tab.left,
.box.localPlayer .tab.right{
    background: linear-gradient(-45deg, #999999 -400%, #cccccc 50%);
}

.box .tab.bottom{
    left: 50%;
    bottom: 0;
	background: linear-gradient(-45deg, #999999 70%, #cccccc 300%);
    -webkit-transform: scaleX(0.7) rotate(45deg);
    -ms-transform: scaleX(0.7) rotate(45deg);
    transform:  scaleX(0.7) rotate(45deg);
    display: none;
}

.box .tab.top{
    left: 50%;
    top: 0;
	background: linear-gradient(-45deg, #999999 -300%, #cccccc 30%);
    -webkit-transform: scaleX(0.7) rotate(45deg);
    -ms-transform: scaleX(0.7) rotate(45deg);
    transform:  scaleX(0.7) rotate(45deg);
    display: none;
}

.box .tab.topRight{
    right: 35px;
    top: 0;
	background: linear-gradient(-45deg, #999999 -300%, #cccccc 30%);
    -webkit-transform: scaleX(0.7) rotate(45deg);
    -ms-transform: scaleX(0.7) rotate(45deg);
    transform:  scaleX(0.7) rotate(45deg);
    display: none;
}

/* When viewport width is 800 we assume we are on a mobile and let .box center on top of .boxbackground */
@media (max-width: 800px){
    .box{
        position: fixed;
        left: 50% !important;
        top: 50% !important;

        -webkit-transform: translate(-50%, -50%) !important;
        -ms-transform: translate(-50%, -50%) !important;
        transform: translate(-50%, -50%) !important;
    }

    .boxbackground{
        opacity: 0.5;
    }

    .box .tab{
        display: none !important;
    }
}

/******************** Error Box **********************/
#error{
    position: fixed;
    left: 50%;
    top: 50%;

    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

#error .title{
    color: #cc0000;
    font-family: TankTrouble;
}

/******************** Tank Info Box **********************/
#tankinfo .icon{
    position: absolute;
    width: 320px;
    height: 192px;
    left: calc(50% + 5px);
    top: -167px;

    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
}

#tankinfo .username{
    position: relative;
    z-index: 1;
    height: 28px;
}

#tankinfo .rank,
#tankinfo .xp {
    position: relative;
    height: 34px;
}

#tankinfo .title {
    position: absolute;
}

#tankinfo .rankIcon {
    position: absolute;
    top: 4px;
}

#tankinfo .progress {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    height: 22px;
    margin: 0 5px 0 5px;
    overflow: hidden;
    position: absolute;
    top: 6px;
    width: calc(100% - 5px - 5px);
}

#tankinfo .progress .border {
    border-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-style: solid;
    border-width: 2px 0 0 0;
    height: 100%;
    position: absolute;
    width: 100%;
}

#tankinfo .progress .bar {
    background-size: 10px 22px;
    height: 100%;
}

#tankinfo .rank .progress .bar {
    background-image: url('../assets/images/tankInfo/rankProgressBar.png');
}

#tankinfo .xp .progress .bar {
    background-image: url('../assets/images/tankInfo/xpProgressBar.png');
}

/* When retina, set background-images to high res versions */
@media 	(-webkit-min-device-pixel-ratio: 2),
(   min--moz-device-pixel-ratio: 2),
(     -o-min-device-pixel-ratio: 2/1),
(        min-device-pixel-ratio: 2),
(                min-resolution: 192dpi),
(                min-resolution: 2dppx) {
    #tankinfo .rank .progress .bar {
        background-image: url('../assets/images/tankInfo/rankProgressBar@2x.png');
    }

    #tankinfo .xp .progress .bar {
        background-image: url('../assets/images/tankInfo/xpProgressBar@2x.png');
    }
}

#tankinfo table {
    border-collapse: separate;
    border-spacing: 0 6px;
    width: 100%;
}

#tankinfo table td {
    position: relative;
}

#tankinfo table .statsIcon {
    position: absolute;
}

#tankinfo table td:last-child .statsIcon {
    right: 5px;
}

#tankinfo table svg {
    display: block;
    position: relative;
}

#tankinfo table td:first-child svg {
    left: 45px;
}

#tankinfo table td:last-child svg {
    left: 3px;
}

@keyframes tankinfoglowscale {
    from {
        transform: scale(1.0);
    }

    to {
        transform: scale(1.5);
    }
}

#tankinfo .glow {
    animation-name: tankinfoglowscale;
    animation-duration: 0.5s;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
    animation-iteration-count: infinite;
    left: auto;
    pointer-events: none;
    right: -1px;
    top: -8px;

}


@keyframes tankinforayopacity {
    from {
        opacity: 0.2;
    }

    to {
        opacity: 1.0;
    }
}

@keyframes tankinforayrotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#tankinfo .ray {
    animation-name: tankinforayopacity, tankinforayrotation;
    animation-timing-function: ease-in-out, linear;
    animation-direction: alternate, normal;
    animation-iteration-count: infinite, infinite;
    left: auto;
    pointer-events: none;
    right: -1px;
    top: -8px;

}

#tankinfo .ray.first {
    animation-duration: 1.0s, 12.2s;
    animation-delay: -0.25s, 0s;
}

#tankinfo .ray.second {
    animation-duration: 1.5s, 12.2s;
    animation-delay: -0.75s, -1.525s;
}

#tankinfo .actions:not(.centered){
    text-align: right;
}

#tankinfo .button {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    width: 52px;
    height: 52px;
}

#tankinfo .button.disabled {
    cursor: default;
}

#tankinfo .button img {
    display: none;
}

#tankinfo .button:not(:active):not(.disabled) .standard,
#tankinfo .button:active:not(.disabled) .active,
#tankinfo .button.disabled .disabled {
    display: inherit;
}

#tankinfo .button.shop:not(:active):not(.disabled) .standard {
    display: none;
}

#tankinfo .button.shop:not(:active):not(.disabled).flicker .standard.flicker,
#tankinfo .button.shop:not(:active):not(.disabled):not(.flicker) .standard:not(.flicker) {
    display: inherit;
}

#tankinfo .button img.buttonMarker {
    display: inherit;
    position: absolute;
    top: -10px;
    right: -1px;
}

/* When viewport width is 800 we assume we are on a mobile and let #tankinfo center on top of .boxbackground */
@media (max-width: 800px) {
    #tankinfo{
        /* Fix to make drop-shadow filter look correct on Safari on Retina displays */
        -webkit-transform: translate(-50%, -40%) translateZ(0) !important;
        -ms-transform: translate(-50%, -40%) !important;
        transform: translate(-50%, -40%) !important;
    }
}

/******************** Settings Box **********************/
#settings {
    text-align: left;
}

/******************** Select User Box **********************/
#selectuser .iconContainer {
    position: relative;
    height: 70px;
}

#selectuser .icon {
    position: absolute;
    width: 140px;
    height: 84px;
    left: calc(50% + 2px);

    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
}

#selectuser .username {
    position: relative;
    height: 28px;
    z-index: 1;
}

#selectuser .option {
    display: inline-block;
    width: 114px;
    position: relative;
}

#selectuser.users1 .option.option2,
#selectuser.users1 .option.option3,
#selectuser.users2 .option.option3 {
    display: none;
}

/******************** Cookie Box **********************/

#cookie {
    background: #000000;
    bottom: 0;
    color: #ffffff;
    display: table;
    padding: 10px;
    position: fixed;
    width: calc(100% - 20px);
    z-index: 100000;
}

#cookie > div {
    display: table-cell;
    vertical-align: middle;
}

#cookie > div:last-child{
    text-align: right;
}

/******************** Chat **********************/
#chat {
    -webkit-filter: drop-shadow(0px 12px 7px rgba(0,0,0,0.5));
    filter: drop-shadow(0px 12px 7px rgba(0,0,0,0.5));

    /* Fix to make drop-shadow filter look correct on Safari on Retina displays */
    -webkit-transform: translateZ(0);

    position: fixed;
    z-index: 10;
    width: 1px;
    height: 1px;
}

#chat .status {
    position: absolute;
    left: -25px;
    top: -12px;
}

#chat .content {
    font-family: verdana;
    font-size: 10pt;
    width: 0;
    pointer-events: none;
    transition: width 0.3s 0.2s;
}

@keyframes chatsend {
    from {
        background-position-x: 0;
    }
    to {
        background-position-x: -50px;
    }
}

#chat form {
    border-radius: 3px;
    background-color: #ffffff;
    pointer-events: auto;
    animation-name: chatsend;
    animation-duration: 2s;
    animation-timing-function: linear;
    animation-direction: normal;
    animation-iteration-count: infinite;
}

#chat.global form {
    background: #68c5ff;
}

#chat.user form {
    background: #00ff02;
}

#chat textarea {
    font-family: Arial;
    font-weight: bold;
    position: relative;
    left: 25px;
    width: 0;
    min-height: 16px !important;
    opacity: 0;
    margin: 0;
    padding: 1px 2px;
    border: none !important;
    outline: none !important;
    overflow-y: hidden;
    resize: none;
    background: none;
    cursor: default;
}

#chat.opening textarea,
#chat.open textarea {
    width: 172px;
    opacity: 1;
    cursor: inherit;
}

#chat.opening textarea {
    transition: width 0.3s, height 0.3s, opacity 0.2s 0.3s;
}

#chat:not(.open):not(.opening) textarea {
    height: 16px !important;
    transition: width 0.3s 0.2s, height 0.3s 0.2s,  opacity 0.2s;
}

#chat .body {
    width: 220px;
    height: 200px;
    margin-left: 20px;
    margin-top: 10px;
    cursor: default;
}

#chat .handle {
    pointer-events: auto;
}

#chat .chatMessage {
    pointer-events: auto;
    width: 0;
}

#chat .whistle {
    position: absolute;
    bottom: -2px;
    cursor: pointer;
}

#chat.opening .content,
#chat.open .content {
    width: 200px;
    transition: width 0.3s;
}

#chat .body.dragging {
    border: 2px dotted #aaaaaa;
    border-radius: 3px;
    margin-left: 18px;
    margin-top: 8px;
}

/******************** Sound Button **********************/

.sound {
    position: absolute;
    right: 108px;
    top: 0px;
    cursor: pointer;
}

.sound img {
    display: none;
}

.sound.low:not(:active) .low.standard,
.sound.low:active .low.active,
.sound.medium:not(:active) .medium.standard,
.sound.medium:active .medium.active,
.sound.high:not(:active) .high.standard,
.sound.high:active .high.active,
.sound.off:not(:active) .off.standard,
.sound.off:active .off.active{
    display: inherit;
}

/******************** Music Button **********************/

.music {
    position: absolute;
    right: 54px;
    top: 0px;
    cursor: pointer;
}

.music img {
    display: none;
}

.music.on:not(:active) .on.standard,
.music.on:active .on.active,
.music.off:not(:active) .off.standard,
.music.off:active .off.active{
    display: inherit;
}

/******************** Settings Button **********************/

.settings {
    position: absolute;
    right: 0px;
    top: 0px;
    cursor: pointer;
}

.settings img {
    display: none;
}

.settings:not(:active) .standard,
.settings:active .active {
    display: inherit;
}

/******************** Tutorial Marker **********************/

@keyframes tutorialmarkeranimation {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(40px, -40px);
    }
}

.tutorialMarker {
    position: absolute;
    animation-name: tutorialmarkeranimation;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
    animation-iteration-count: infinite;
    animation-duration: 0.4s;
    pointer-events: none;
    width: 100px;
    height: 100px;
    opacity: 0;
    transition: width 0.2s ease-in, height 0.2s ease-in, opacity 0.2s ease-in;
}

.tutorialMarker.active {
    width: 62px;
    height: 62px;
    opacity: 1;
    transition: width 0.2s ease-out, height 0.2s ease-out, opacity 0.2s ease-out;
}
