html {
    background-color: #eee;
    line-height: 1.15;
    font-size: large;
    height: 100%;
}
body {
    height: 100%;
    margin: 0;
}
#main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
}

.flipped {
    transform: rotate(180deg);
}

#open-games {
    padding: 10px;
    margin: 3px;
    flex: 1;
}
#new-game-form {
    padding: 10px;
    margin: 3px;
    flex: 1;
}
#open-games-container > ul {
    list-style-type: none;
    list-style: none;
    padding-left: 0px;
    margin-top: 5px;
}
#open-games-container label {
    padding-left: 10px;
}

#card-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#game {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    margin: .5em;
    padding: .5em;
    border: .25em solid black;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    user-select: none;
    background-color: white;
}
.card .name {
    flex: auto;
    font-family: papyrus;
    font-size: x-large;
    font-weight: 900;
    text-align: center;
}
.card .kanji {
    flex: 1;
    font-family: serif;
    font-size: xx-large;
    opacity: 0.5;
}
.dot-grid {
    flex: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 40%;
}
.dot-grid > div {
    width: calc(20% - 6px);
    flex: 1 0 auto;
    height: auto;
    font-size: small;
    background-color: #d1d6d3;
    border: 1px solid black;
    border-radius: 50%;
    margin: 2px;
}
.dot-grid > div:before {
    content: '';
    float: left;
    padding-top: 100%;
}
.dot-grid > div:nth-child(13) {
    background-color: red;
    border-color: red;
}
.dot-grid > div.movable {
    background-color: green;
    border-color: green;
}

#opponent-cards {
    transform: rotate(180deg);
    display: flex;
    flex-direction: row;
    flex: 1;
    align-items: center;
}
#my-cards {
    display: flex;
    flex-direction: row;
    flex: 1;
    align-items: center;
}
#my-cards .card:hover {
    cursor: pointer;
}
#my-cards .card.selected {
    background-color: yellowgreen;
}
#suspended-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition-property: transform;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    width: 50%;
}

#game-board {
    padding: .5em;
    user-select: none;
}
#game-board .container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    border: .25em solid #222;
}
#game-board .container > div {
    width: 20%;
    flex: 1 0 auto;
    height: auto;
    font-size: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
}
#game-board .container > div.white {
    color: white;
}
#game-board .container > div.black {
    transform: rotate(180deg);
}
#game-board .container > div.friendly {
    cursor: pointer;
}
#game-board .container > div:before {
    content: '';
    float: left;
    padding-top: 100%;
}
#game-board .container > div:nth-child(odd) {
    background-color: #bbb;
}
#game-board .container > div:nth-child(even) {
    background-color: #666;
}
#game-board .container > div.selected {
    background-color: yellowgreen;
}
#game-board .container > div.move-target {
    background-color: lightgreen;
    cursor: pointer;
}

#chat {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#chat #chat-history {
    background-color: white;
    flex: auto;
    margin-bottom: 0;
    margin-top: 0;
    border: 0;
    border-left: 1px solid black;
    display: flex;
    flex-direction: column-reverse;
    padding-left: .25em;
    padding-right: .25em;
    padding-top: .5em;
    overflow-y: scroll;
}
#chat .chat-message {
    margin-bottom: .25em;
    margin-top: .5em;
    border: 1px solid black;
    border-radius: .25em;
    padding: .25em;
    font-size: medium;
}
#chat .chat-message.system {
    border: 0;
    text-align: center;
    color: #888;
    font-style: italic;
    font-family: monospace;
    font-size: medium;
}
#chat .chat-message.system:before {
    content: "<\a0";
}
#chat .chat-message.system:after {
    content: "\a0>";
}
#chat .chat-message.self {
    background-color: skyblue;
    padding-right: .5em;
    text-align: right;
    margin-left: 1em;
}
#chat .chat-message.opponent {
    background-color: yellowgreen;
    padding-left: .5em;
    margin-right: 1em;
}
#chat textarea {
    resize: none;
    border-left: 1px solid black;
    border-top: 1px solid black;
    box-sizing: border-box;
    display: block;
    flex: none;
}
