/* Chat message styling for timestamp */
.chat-message {
    position: relative;
    padding-bottom: 1.2em;
}
.chat-msg-content {
    display: block;
}
.chat-msg-time {
    position: absolute;
    right: 0.7em;
    bottom: 0.2em;
    font-size: 0.8em;
    color: #888;
}

:root {
    --cell: 30px;
    --background: #ffffff;
    --black: #000000;
    --white: #ffffff;
    --border-color: #ccc;
    --unused-color: var(--black);
    --number-color: #555;
    --activated: #f8c82d;
    --primary: #d30910;
    --primary-highlight: #f74b51;
    --primary-highlight-number: #fff;
    --error: #f48221;
    --error-border: #bf5d09;
    --selection: #CD171926;
    --selection-border: #C6B0B1;
    --selection-text: #0f0101;
    --selection-number: #0f0101;
    --clue-text: #333;
    --clue-len: #999;
    --clue-selection: #d30910;
    --clue-selection-text: #fff;
    --clue-selection-len: #eaa1a5;
    --ihm-grey-word: #ddd;
    --ihm-grey-letter-color: black;
    --ihm-border: #ccc;
    --ihm-red-circle: #d30910;
    --icon-button: #e3e3e3
}

.dark-mode {
    --background: #1A1A1A;
    --black: #ffffff;
    --white: #000000;
    --border-color: #484848;
    --number-color: #989898;
    --primary: #E6B4B6;
    --primary-highlight: #d98e91;
    --primary-highlight-number: #000;
    --error: #e72138;
    --error-border: #bf5d09;
    --selection: #6b5758;
    --selection-border: #867273;
    --selection-text: #fff;
    --selection-number: #cbcbcb;
    --clue-text: #fff;
    --clue-len: #666;
    --clue-selection: #E6B4B6;
    --clue-selection-text: #000;
    --clue-selection-len: #725a5b;
    --ihm-grey-word: #333;
    --ihm-grey-letter-color: white;
    --ihm-border: #555;
    --ihm-red-circle: #E6B4B6;
    --icon-button: #333333
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    touch-action: manipulation !important
}

html,
body {
    margin: 0;
    padding: 0
}

body {
    background: var(--background);
    color: var(--black)
}

html.zoom #grid {
    zoom: 2
}

html.zoom .topbar-button[data-action="zoom"] {
    background-color: var(--activated)
}

#feelsize {
    position: fixed;
    z-index: -1;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%
}

#settings {
    position: relative;
    z-index: 1;
    top: 0px;
    left: 5px;
    /*width: 300px;
    height: 20px;*/
    opacity: 100%;
    font-size: 14px;
    font-family: sans-serif;
}

#users {
    font-size: 13px;
    font-family: sans-serif;
    padding-left: 2px;
}

#chatbox {
    width: 250px;
    height: 100px;
    overflow-y: auto;
    opacity: 100%;
    font-size: 10px;
    font-family: sans-serif;
}

#chat { list-style-type: none; margin: 0; padding: 0; }
#chat > li { padding: 0.5rem 1rem; }
#chat > li:nth-child(odd) { background: #efefef; }


#game {
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

#outer-grid {
    text-align: center
}

#main {
    max-width: 920px;
    margin: 0 auto;
    overflow: hidden
}

#bottom {
    position: relative;
    z-index: 2;
    overflow: hidden
}

#grid {
    font-size: 0;
    line-height: 0;
    position: relative;
    display: inline-block
}

#grid:focus {
    outline: none
}

.row {
    white-space: nowrap
}

.row:last-child .cell:not(.highlight) .value {
    border-bottom: none
}

.cell {
    position: relative;
    display: inline-block;
    width: var(--cell);
    height: var(--cell);
    text-align: center;
    cursor: default;
    background: var(--background)
}

.cell.right {
    border-right: solid black 2px;
}

.cell.down {
    border-bottom: solid black 2px;
}

.cell .user {
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 25%;
    font-family: sans-serif;
    color: red;
    z-index: 2;
}

.cell .value {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    border-right: solid var(--border-color) 1px;
    border-bottom: solid var(--border-color) 1px;
    font-size: 45%;
    font-family: sans-serif;
    -webkit-transition: all .1s ease-out;
    -moz-transition: all .1s ease-out;
    -ms-transition: all .1s ease-out;
    -o-transition: all .1s ease-out
}

.cell .number {
    position: absolute;
    font-size: 30%;
    line-height: 100%;
    left: 2px;
    top: 2px;
    color: var(--number-color);
    font-family: sans-serif;
    z-index: 2;
    -webkit-transition: all .1s ease-out;
    -moz-transition: all .1s ease-out;
    -ms-transition: all .1s ease-out;
    -o-transition: all .1s ease-out
}

.cell.black {
    background: var(--unused-color)
}

.cell.black .value {
    border-color: var(--unused-color)
}

.cell.grey {
    background: var(--ihm-grey-word);
    color: var(--ihm-grey-letter-color)
}

.cell.grey .value {
    border-color: var(--ihm-border)
}

.cell.red-circle:after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    top: 8%;
    bottom: 8%;
    background: var(--ihm-red-circle);
    border-radius: 1000px
}

.cell.unused:not(.black) {
    visibility: hidden
}

.cell:last-child:not(.highlight) .value {
    border-right: none
}

.cell.error .value {
    background-color: var(--error);
    color: #fff
}

.cell.error .number {
    color: #fff
}

.cell.error.highlight .value {
    background-color: var(--error);
    color: #fff;
    border-color: var(--error-border)
}

.cell.error.highlight.highlight-last .value {
    border-color: var(--error-border)
}

.cell.highlight .number {
    color: var(--selection-number)
}

.cell.highlight .value {
    background-color: var(--selection);
    color: var(--selection-text)
}

.cell.highlight.highlight-h .value {
    border-bottom: none;
    border-right: solid var(--selection-border) 1px
}

.cell.highlight.highlight-v .value {
    border-right: none;
    border-bottom: solid var(--selection-border) 1px
}

.cell.highlight.highlight-last .value {
    border-right: none
}

.cell.highlight.cursor .number {
    color: var(--primary-highlight-number)
}

.cell.highlight.cursor .value {
    color: var(--white);
    background-color: var(--primary)
}

.cell:not(.unused).cell:not(.grey)+.highlight-v:before {
    content: '';
    display: block;
    position: absolute;
    border-right: solid var(--background) 1px;
    left: -1px;
    top: 0;
    height: calc(100% - 1px)
}

html.moving .cell.highlight.cursor .value {
    margin-top: -1px;
    border-bottom-width: 2px
}

html.moving .cell.highlight.cursor .number {
    margin-top: -1px
}

#cursor {
    z-index: 2;
    position: absolute;
    left: 0;
    top: 0;
    width: var(--cell);
    height: var(--cell);
    border: solid red 2px;
    outline: solid red 2px;
    display: none
}

#clues {
    font-size: 16px;
    font-family: sans-serif;
    padding-top: 10px;
    padding-left: 20px;
    padding-bottom: 0px;
    overflow: scroll;
    scrollbar-width: none
}

#clues::-webkit-scrollbar {
    display: none
}

#clues td {
    vertical-align: top
}

#clues h2 {
    font-size: 90%;
    margin: 0 0 4px 0
}

#clues .clue {
    position: relative;
    font-size: 80%;
    padding-left: 25px;
    color: var(--clue-text);
    display: inline-block
}

#clues .clue .nr {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    text-align: right;
    font-weight: bold
}

#clues .clue .len {
    color: var(--clue-len);
    padding-right: 3px;
    font-size: 80%
}

#clues .clue.selected {
    background: var(--clue-selection);
    color: var(--clue-selection-text)
}

#clues .clue.selected .len {
    color: var(--clue-selection-len)
}

#clues #hor {
    margin-bottom: 10px
}

html.landscape #game {
    position: relative;
    width: 100%
}

html.landscape #outer-grid {
    width: 50%;
    float: left;
    overflow: hidden
}

html.landscape #clues,
html.landscape #top {
    width: 50%;
    float: right
}

html.landscape #bottom {
    clear: both
}

html.landscape #clues {
    display: block
}

html.web [data-action="keyboard"] {
    display: none
}

html.web:not(.portrait) #clue {
    display: none
}

#clues {
    display: none
}

#clue {
    position: relative;
    width: 100%;
    font-size: 60%;
    font-family: sans-serif;
    background-color: var(--clue-selection);
    color: var(--clue-selection-text);
    overflow: hidden;
    height: 50px
}

#clue #clue-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 10%;
    height: 100%;
    /* background: url(../img/chevron-left-white.png) no-repeat center center; */
    background-size: auto 50%
}

.dark-mode #clue #clue-left {
   /* background-image: url(../img/chevron-left.png) */
}

#clue #clue-right {
    position: absolute;
    right: 0;
    top: 0;
    width: 10%;
    height: 100%;
    /* background: url(../img/chevron-right-white.png) no-repeat center center; */
    background-size: auto 50%
}

.dark-mode #clue #clue-right {
   /*  background-image: url(../img/chevron-right.png) */
}

#clue .clue-card {
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 100%;
    pointer-events: none
}

#clue .clue-card.anim {
    -webkit-transition: transform .3s ease-out;
    -moz-transition: transform .3s ease-out;
    -ms-transition: transform .3s ease-out;
    -o-transition: transform .3s ease-out
}

#clue .clue-card.demo {
    opacity: 0
}

#clue .clue-card.old {
    opacity: 0
}

#clue .clue-card.new {
    opacity: 0
}

#clue .clue-card.old.pressed-prev,
#clue .clue-card.new.pressed-next {
    -webkit-transform: translateX(20px);
    -moz-transform: translateX(20px);
    -ms-transform: translateX(20px);
    -o-transform: translateX(20px)
}

#clue .clue-card.new.pressed-prev,
#clue .clue-card.old.pressed-next {
    -webkit-transform: translateX(-20px);
    -moz-transform: translateX(-20px);
    -ms-transform: translateX(-20px);
    -o-transform: translateX(-20px)
}

#clue .clue-card ol {
    position: absolute;
    top: 50%;
    width: 100%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    margin: 0
}

#clue .clue-card ol li {
    font-weight: bold
}

#clue .clue-card ol li .clue-text {
    font-weight: normal
}

#clue .clue-card ol li .len {
    opacity: .7;
    font-size: 80%;
    font-weight: normal
}

#clue .clue-card ol li .len:before {
    content: '('
}

#clue .clue-card ol li .len:after {
    content: ')'
}

html.keyboard-fixed #bottom {
    position: fixed;
    bottom: 0;
    width: 100%
}

#keyboard {
    position: relative;
    text-align: center;
    line-height: 0;
    padding: 10px 0;
    color: #000
}

#keyboard .key {
    position: relative;
    display: inline-block;
    margin: 0 4px 4px 0;
    vertical-align: top
}

#keyboard .key .key-value {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    font-size: 70%;
    font-family: sans-serif;
    background: #fff;
    border-radius: 4px;
    border: solid #ccc 1px;
    pointer-events: none
}

#keyboard .key .nr-value {
    position: absolute;
    right: 10%;
    top: 1px;
    font-size: 8px;
    line-height: 12px;
    font-family: sans-serif;
    pointer-events: none;
    color: #777
}

#keyboard .key.highlight .key-value {
    height: 200%;
    background-color: var(--primary-highlight);
    border: none
}

#keyboard .key.highlight .nr-value {
    top: -100%
}

#keyboard .key.show-nr .key-value {
    background-color: #f51a21;
    color: #fff;
    -webkit-transition: all .2s ease-out;
    -moz-transition: all .2s ease-out;
    -ms-transition: all .2s ease-out;
    -o-transition: all .2s ease-out
}

#keyboard .key.show-nr .nr-value {
    display: none
}

#keyboard .key[data-key="backspace"] .key-value {
    right: -25%
}

#keyboard .key[data-key="backspace"] .key-value:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    /* background: url(../img/backspace.png) no-repeat center center; */
    background-size: 70% auto;
    opacity: .5
}

#keyboard .key[data-key="backspace"].highlight .key-value {
    height: 100%;
    background-color: var(--primary-highlight)
}

#keyboard .key[data-key="settings"] {
    position: absolute;
    -webkit-transform: translateX(-100%);
    -moz-transform: translateX(-100%);
    -ms-transform: translateX(-100%);
    -o-transform: translateX(-100%);
    margin-left: -4px
}

#keyboard .key[data-key="settings"] .key-value {
    background-color: var(--primary)
}

#keyboard .key[data-key="settings"] svg use {
    fill: #fff
}

#keyboard .key[data-key="settings"].highlight .key-value {
    height: 100%;
    background-color: var(--primary-highlight)
}

#keyboard .key[data-key-len="3"] .key-value {
    padding-right: 300%
}

#keyboard .key.setting {
    display: none;
    width: auto
}

#keyboard .key.setting .key-value {
    position: static;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto
}

#keyboard #topbar {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none
}

#keyboard.show-settings #topbar {
    opacity: 1;
    pointer-events: all
}

#keyboard.show-settings #topbar .topbar-button .label {
    top: 140%
}

#keyboard.show-settings .key:not(.setting) {
    width: 0px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    border: none;
    margin: 0
}

#keyboard.show-settings .key.setting {
    display: inline-block;
    margin: 0 8px 8px 0
}

#keyboard.show-settings .key.setting .key-value {
    padding: 0 8px 0 30px
}

#keyboard.show-settings .key.setting .key-value:after {
    content: '';
    width: 30px;
    height: 100%;
    left: 2px;
    top: 0;
    position: absolute;
    background: transparent no-repeat center center;
    background-size: 60% auto
}

#keyboard.show-settings .key.setting.highlight {
    height: 100%
}

#keyboard.show-settings .key.setting[data-key="hint"] .key-value:after {
    /* background-image: url(../img/light-bulb.png ) */
}

#keyboard.show-settings .key.setting[data-key="restart"] .key-value:after {
    /* background-image: url(../img/retry.png  */
}

#keyboard.show-settings .key.setting[data-key="back"] .key-value {
    font-size: 0;
    color: transparent;
    padding-right: 4px
}

#keyboard.show-settings .key.setting[data-key="back"] .key-value:after {
    /* background-image: url(../img/close.png ) */
}

#loading {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    z-index: 1000;
    pointer-events: none;
    -webkit-transition: .5s ease-out;
    -moz-transition: .5s ease-out;
    -ms-transition: .5s ease-out;
    -o-transition: .5s ease-out
}

#loading.hide {
    opacity: 0
}

#topbar {
    width: 100%;
    position: relative;
    white-space: nowrap;
    text-align: center;
    padding: 15px 0 20px 0;
    background: var(--background)
}

.topbar-button {
    position: relative;
    display: inline-block;
    width: 35px;
    height: 30px;
    border-radius: 4px;
    background: var(--icon-button);
    background-size: auto 50%;
    margin: 0 15px;
    -webkit-transition: background .3s ease-out;
    -moz-transition: background .3s ease-out;
    -ms-transition: background .3s ease-out;
    -o-transition: background .3s ease-out
}

.topbar-button svg use {
    fill: var(--black)
}

.topbar-button:not(.disabled).topbar-button[data-pressed="1"] {
    background: var(--primary)
}

.topbar-button:not(.disabled).topbar-button[data-pressed="1"] svg use {
    fill: var(--black)
}

.topbar-button.disabled {
    opacity: .2
}

.topbar-button.warning {
    background-color: var(--error)
}

.topbar-button.warning svg use {
    fill: #fff
}

.topbar-button .label {
    font-family: sans-serif;
    position: absolute;
    left: 50%;
    top: 110%;
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -o-transform: translateX(-50%);
    color: var(--clue-text);
    font-size: 12px
}

.topbar-button:before {
    content: '';
    position: absolute;
    left: -10px;
    top: -10px;
    right: -10px;
    bottom: -20px
}

.svg-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    width: 80%;
    height: 80%
}

[data-action="close"] .svg-icon {
    width: 70%;
    height: 70%
}

[data-action="hint"].active {
    background: var(--primary)
}

[data-action="hint"].active svg use {
    fill: #fff
}

