* {
    padding: 0;
    margin: 0;
    box-sizing: content-box;
}

html {
    background: #BBB;
    height: 100%;
}

body {
    font-family: verdana, arial, helvetica, sans-serif !important;
    font-size: 10pt !important;
    position: relative !important;
    width: 820px !important;
    min-width: 360px !important;
    min-height: 100% !important;
    margin: 0 auto !important;
    background: #EEE !important;
    border-right: 1px solid #555 !important;
    border-left: 1px solid #555 !important;
    color: black !important;
    line-height: normal !important;
    background-color: #EEE !important;
    display: flex !important;
    flex-direction: column !important;
}

a#logo, div#player, div#note, h1#title {
    display: block !important;
    visibility: visible !important;
}

div#header {
    background: #A21 url('../images/h1_gradient.gif') repeat-x !important;
    position: relative;
    width: 100%;
    min-height: 55px;
}

ul.list {
    padding: 0 0 0 20px;
}

h1 {
    margin: 0 !important;
    padding: 10px 0 0 55px !important;
    font-size: 200% !important;
    color: black !important;
    position: relative;
    overflow: visible;
}

a#logo {
    background: url('../images/logo.png') no-repeat;
    width: 40px;
    height: 55px;
    position: absolute;
    top: 0;
    left: 10px;
    display: block;
    text-decoration: none;
    border: none;
    z-index: 10;
}

a#logo:hover {
    text-decoration: none;
    border: none;
}

div#player {
    position: absolute;
    top: 10px;
    right: 10px;
    color: black;
    z-index: 5;
}

div#note {
    position: absolute;
    top: 30px;
    right: 10px;
    color: black;
    z-index: 5;
}

h2 {
    background: #EEE url('/static/images/h2_gradient.gif') repeat-x;
    padding: 2px 10px;
    margin: 15px -10px 10px -10px;
    font-size: 150%;
}

h3 {
    font-size: 100%;
    font-weight: bold;
    margin: 0 0 5px 0;
}

a {
    color: #157;
    text-decoration: none;
    border-bottom: 1px dotted #157;
    padding: 0 1px;
}

a:hover {
    color: #E21;
    border-bottom-style: solid;
    border-bottom-color: #E21;
}

#player a:hover, #note a:hover {
    color: #157;
    border-bottom-style: solid;
    border-bottom-color: #157;
}

div#content {
    position: relative;
    overflow: hidden;
    padding: 10px 10px 20px 10px;
    width: 800px;
    flex: 1;
}

div#footer {
    position: relative;
    overflow: hidden;
    width: 800px;
    padding: 0 10px;
    background-color: #BBB;
    border-top: 1px solid #555;
    font-size: 80%;
    margin-top: auto;
}

div#footer div#validation {
    float: right;
    padding: 1px 0;
}

div#game, div#players {
    position: relative;
    width: 100%;
    min-height: 150px;
    border-top: 1px solid #EEE;
    border-bottom: 1px solid #555;
    margin: -10px -10px 10px -10px;
    padding: 0 10px;
}

div#description {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

div#game div#words,
div#game div#new_word,
div#game div#task,
div#players div#new_message,
div.scores {
    position: relative;
    overflow: hidden;
    margin: 10px 0;
    width: 395px;
}

div#game div#task span#task_word {
    font-weight: bold;
    letter-spacing: 3px;
    font-size: 125%;
}

div#game div#new_word, div#players div#new_message {
    position: relative;
    overflow: hidden;
}

form.slovoblud p {
    position: relative;
    overflow: hidden;
    width: 100%;
}

form.slovoblud label {
    display: block;
    float: left;
    width: 55px;
}

form.slovoblud input.field {
    float: left;
    width: 240px;
}

form.slovoblud input.submit {
    float: left;
    width: 86px;
}

form.slovoblud img.indicator {
    position: absolute;
    top: 2px;
    left: 275px;
}

#application_indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

#application_indicator img.indicator {
    position: static;
    top: auto;
    left: auto;
}

.wrongWord {
    color: #E21;
}

#words #view_mode_link,
#results #all_results {
    position: absolute;
    top: 0px;
    right: 5px;
    font-size: 80%;
}

#words #view_mode_indicator {
    position: absolute;
    top: 15px;
    right: 5px;
}

#words h3,
#results h3 {
    padding-right: 100px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

ul.words,
ul.words li.letter ul {
    list-style: none;
    overflow: hidden;
    width: 100%;
}

ul.words li.letter ul {
    border-bottom: 1px solid #FFF;
}

ul.words li.letter ul li {
    float: left;
    margin: 0 10px 0 0;
    font-size: 80%;
}

ul.words li.title {
    font-size: 80%;
    padding-bottom: 5px;
}

ul.words li.letterStat {
    float: left;
    margin-right: 20px;
}

ul.words li.letterStat p {
    margin: 0;
}

ul.words li.letterStat p.letterStatLetter {
    font-weight: bold;
}

div.messages {
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 10px;
    width: 400px;
    overflow: auto;
    border: 1px solid #FFF;
    background-color: #DDD;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

div.messages div.message {
    border-bottom: 1px solid #FFF;
    position: relative;
    padding: 3px;
    font-size: 80%;
    margin: 0 !important;
    border-radius: 0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

div.messages div.message div.title {
    border-bottom: 1px dotted #FFF;
    font-weight: bold;
}

div.messages div.message div.title a {
    color: #000;
    border-color: #000;
}

div.messages div.message div.time {
    position: absolute;
    top: 3px;
    right: 3px;
}

div.messages div.info {
    background-color: #E0E0FF !important;
    color: black !important;
}

div.messages div.error {
    background-color: #FFE0D9 !important;
    color: black !important;
}

div.messages div.chat {
    background-color: #E3D9FF !important;
    color: black !important;
}

div.messages div.message-chat {
    background-color: #E3D9FF !important;
    color: black !important;
}

div.messages div.message-info {
    background-color: #E0E0FF !important;
    color: black !important;
}

div.messages div.message-error {
    background-color: #FFE0D9 !important;
    color: black !important;
}

div.messages div.self {
    background-color: #E3FFE3 !important;
    color: black !important;
}

div.messages div.tome {
    background-color: #F6D9E3 !important;
    color: black !important;
}

div.scores ul {
    list-style: none;
    overflow: hidden;
}

div.scores ul li {
    overflow: hidden;
    width: 100%;
    border-bottom: 1px solid #FFF;
}

div.scores ul li a, div.scores ul li a:hover {
    color: #000;
    border-color: #000;
}

div.scores ul li.header {
    font-size: 70%;
    background: #f0f0f0;
}

div.scores ul li span {
    float: left;
    padding: 1px 5px 1px 0;
    overflow: hidden;
}

div.scores ul li span.result {
    width: 25px;
    text-align: center;
}

div.scores ul li span.login {
    width: 130px;
}

div.scores ul li.offline span.login a,
div.scores ul li.offline span.login a:hover {
    color: #999;
    border-color: #999;
}

div.scores ul li span.words_count,
div.scores ul li span.score,
div.scores ul li span.word_at {
    width: 70px;
    text-align: center;
}

div.scores ul li.offline {
    color: #999;
}

div.scores div#longest_words {
    font-size: 80%;
    margin: 5px;
}

.shaddowed {
    color: #999;
}

.message {
    margin-bottom: 5px;
    padding: 3px;
    border-radius: 3px;
}

.message-chat {
    background: #f8f9fa;
}

.message-info {
    background: #d1ecf1;
}

.message-error {
    background: #f8d7da;
}

@media (max-width: 360px) {
    body {
        border: none !important;
    }
}

@media (max-width: 820px) {
    body {
        min-width: 360px !important;
        width: 100% !important;
        max-width: 550px !important;
        overflow-x: hidden;
        display: flex !important;
        flex-direction: column !important;
    }

    div#header {
        position: relative;
        width: 100%;
        box-sizing: border-box;
        padding: 10px 10px 10px 55px;
        min-height: 55px;
    }

    div#header h1#title {
        display: none !important;
    }

    div#header a#logo {
        position: absolute;
        top: 0;
        left: 10px;
        z-index: 10;
    }

    div#header div#player {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100%;
        padding: 0;
        margin: 0 0 5px 0;
        text-align: left;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 85%;
        color: black;
    }

    div#header div#note {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100%;
        padding: 0;
        margin: 0;
        text-align: left;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 85%;
        color: black;
    }

    div#footer {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        box-sizing: border-box;
        margin-top: auto;
    }

    div#content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px;
        box-sizing: border-box;
        flex: 1;
    }

    form.layouted {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    form.layouted div.cancel,
    form.layouted div.submit {
        width: calc(50% - 7.5px) !important;
        max-width: 200px !important;
        box-sizing: border-box;
    }

    form.layouted div.cancel {
        margin: 0 7.5px 0 0 !important;
    }

    form.layouted div.submit {
        margin: 0 0 0 7.5px !important;
    }

    div#game, div#players {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    div#game div#task { order: 1; }
    div#game div#new_word { order: 2; }
    div#game div#words { order: 3; }
    div#game div#messages { order: 4; }

    div#players div#scores { order: 1; }
    div#players div#chat { order: 2; }
    div#players div#new_message { order: 3; }
    div#players div#results { order: 4; }

    div#game div#words,
    div#game div#new_word,
    div#game div#task,
    div#players div#new_message,
    div.scores {
        width: 100%;
        box-sizing: border-box;
    }

    form.slovoblud input.field {
        width: calc(100% - 150px) !important;
        max-width: none !important;
        box-sizing: border-box;
    }

    form.slovoblud input.submit {
        width: auto !important;
        min-width: 86px;
        box-sizing: border-box;
    }

    form.slovoblud img.indicator {
        left: auto !important;
        right: 100px;
    }

    div.messages {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 200px;
        margin: 10px 0 !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        left: auto !important;
        box-sizing: border-box;
    }

    div#game div.messages,
    div#players div.messages {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #words h3,
    #results h3 {
        padding-right: 150px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    div.scores ul li span.result {
        width: auto;
        min-width: 25px;
    }

    div.scores ul li span.login {
        width: auto;
        min-width: 100px;
        flex: 1;
    }

    div.scores ul li span.words_count,
    div.scores ul li span.score,
    div.scores ul li span.word_at {
        width: auto;
        min-width: 60px;
    }

    div.scores ul li {
        display: flex;
        flex-wrap: wrap;
    }

    div.scores ul li span {
        flex: 0 0 auto;
    }
}

div.gamelink {
    text-align: center;
    padding: 15px;
}

div.gamelink a {
    font-size: 150%;
    font-weight: bold;
}

div.gamelink p {
    font-size: 80%;
    color: #555;
}

div.sign {
    text-align: right;
    color: #555;
    padding: 0 0 10px 0;
}

form.layouted {
    overflow: hidden;
    position: relative;
    width: 100%;
}

form.layouted p {
    overflow: hidden;
    width: 100%;
    position: relative;
    margin: 15px 0;
}

form.layouted label {
    float: left;
    width: 150px;
}

form.layouted span.field {
    float: right;
    width: calc(100% - 150px);
}

form.layouted div.submit {
    float: right;
    margin: 0 0 0 15px;
    width: 196px;
}

form.layouted div.cancel {
    float: left;
    margin: 0 15px 0 0;
    width: 196px;
}

form.layouted input, form.layouted select, form.layouted textarea, form.layouted button {
    width: 100%;
    box-sizing: border-box;
}

form.layouted div.fieldWithErrors {
    border: 2px solid #E21;
}

form.layouted div.block {
    border-top: 1px dotted #555;
}

form.layouted div#notice ul {
    color: #E21;
    list-style: none;
    overflow: hidden;
    width: 100%;
}

form.layouted div#notice {
    margin: 0 0 15px 0;
}

div.commands {
    padding-top: 10px;
    height: 25px;
}

div.commands form {
    display: inline-block;
    margin-right: 10px;
}

div.commands input[type="submit"] {
    padding: 2px 8px;
    margin-right: 5px;
}

@keyframes blindDown {
    from {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
    }
    to {
        max-height: 500px;
        opacity: 1;
        overflow: visible;
    }
}

@keyframes blindUp {
    from {
        max-height: 500px;
        opacity: 1;
        overflow: visible;
    }
    to {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
    }
}

.register-block-showing {
    animation: blindDown 1s ease-out forwards;
    max-height: 500px;
    opacity: 1;
}

.register-block-hiding {
    animation: blindUp 1s ease-out forwards;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

form.layouted div#notice ul {
    color: #E21;
    list-style: none;
    overflow: hidden;
    width: 100%;
}

form.layouted div#notice {
    margin: 0 0 15px 0;
}
