/*
 * Copyright (C) 2016 Jan-Dirk van Dingenen
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro);

body {
    background-color:rgb(10,10,10);
    background-image:url(background.jpg);
    background-repeat: no-repeat;
    background-size:cover;
    padding:0;
    margin:0;
}

#game {
    width:1280px;
    cursor: default;
    position:relative;
    margin-left: auto;
    margin-right: auto;
}

#gameBoard {
    display:inline-block;   
    border-radius: 4px;
    margin-left: 2px;
}

#myCanvas {
    background-color:transparent;
}

#controls {
    width: 250px;
    height: 745px;
    display: inline-block;
    position: absolute;
    top: 15px;
    margin-left: 8px;
}

#gameLogo {
    height: 55px;
    width: 300px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 40px;
    font-family: arial;
    font-weight: bold;
    line-height: 65px;
    text-align: center;
    background-image: url(necronomySmall.png);
    background-repeat: no-repeat;
    background-position: center;
    margin-top: 5px;
}

#stockMarket, #players, #activity, #actions, #cards, #gameLogo {
    background-color: rgba(255, 255, 255,0.1);
    color: rgba(255, 255, 255,0.7);
}

#stockMarket {
    height:345px;
    width: 300px;
    margin-bottom:10px;
    font-family: 'Source Code Pro', monospace;
    font-size: 16px;
    border-radius: 4px;
}

#stockMarket table {
    border-collapse: collapse;
    width: 100%;
}

#stockMarket table th, #stockMarket table td {
    font-family: 'Source Code Pro', monospace;
    font-size: 13px;
    min-width: 18px;
    text-align: left;
}

#stockMarket table th {
    font-size: 60%;
    text-align: center;
}

#stockMarket table td div.company, #actions .company, div.pickCompany div.company {
    text-align: center;
    width: 34px;
    height: 34px;
    line-height: 34px;
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    color: rgb(255, 255, 255);
    font-weight: bold;
    border-radius: 2px;
    margin-left: 2px;
    cursor:pointer;
}
#actions .company, div.pickCompany div.company {
    font-family: 'Source Code Pro', monospace;
    display: inline-block;
    float: left;
    margin-bottom: 2px;
}

div.pickCompany {
    line-height: 34px;
    clear: both;
    background-color: rgb(240, 240, 240);
    padding: 3px;
    margin-bottom: 3px;
    cursor: pointer;
    border-radius: 4px;
}

div.pickCompany div.company {
    margin-right: 10px;
}

div.pickCompany:hover, div.pickCompany:focus {
    background-color: rgb(200, 200, 200);
}

div.pickCompany div.startPrice {
    float:right;
}

.pickCompany .stockValue {
    padding-right: 10px;
    float: right;
}

#stockMarket table tbody td {
    border-top: solid 1px rgba(0, 0, 0, 0.1);
    padding-bottom: 6px;
    padding-top: 6px;
    text-align: center;
}

#stockMarket table td.playerStock {
    text-align: center;
    font-weight:bold;
}

#stockMarket table td.companySize {
    text-align: center;
}

#stockMarket table td.maxed {
    font-weight: bold;
    background-color: rgba(255, 255, 255,0.1);
}

#stockMarket button {
    height: 34px;
    cursor:pointer;
}

#players {
    height: 300px;
    width: 300px;
    margin-bottom: 10px;
    font-family: 'Source Code Pro', monospace;
    font-size: 16px;
    border-radius: 4px;
    padding: 3px;
    box-sizing: border-box;
    padding-top: 5px;

}

#players .playerBlock {
    height: 57px;
    background-color: rgba(255, 255, 255,0.3);
    margin-bottom: 2px;
    border-radius: 5px;
    box-sizing: border-box;
    border: solid 1px rgb(200,200,200);
}

#players .stockBlock {
    text-align: center;
    width: 34px;
    height: 34px;
    line-height: 34px;
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    color: rgb(255, 255, 255);
    font-weight: bold;
    border-radius: 2px;
    margin-left: 5px;
    float:left;
    cursor:pointer;
}

#players .playerName {
    display: inline-block;
    height: 20px;
    line-height: 20px;
    margin-left: 5px;
    text-decoration: underline;
}

#players .playerStock {
    clear: both;
}

#players .playerMoney {
    display: inline-block;
    margin-left: 20px;
    font-weight: bold;
}

#under {
    width:100%;
    padding-left:2px;
    margin-top: 5px;
    box-sizing: border-box;
}

#cards {
    height: 85px;
    width: 500px;
    border-radius: 4px;
    margin-left: 8px;
    display:inline-block;
}

.card, .dummyCard {
    width: 60px;
    height: 60px;
    float: left;
    text-align: center;
    line-height: 60px;
    margin: 9px;
    font-size: 30px;
    font-family: 'Source Code Pro', monospace;
    border: solid 2px rgb(0, 0, 0);
    border-radius: 4px;
    background: radial-gradient(ellipse at center, rgb(69, 72, 77) 0%,rgb(0, 0, 0) 100%);
    color: rgb(255, 255, 255);
    box-shadow: 3px 3px 5px rgb(0, 0, 0);
    cursor:pointer;
    position:relative;
}

.card.illegal {
    cursor: not-allowed;
}

.card.illegal:before, .card.illegal:after  {
    position: absolute;
    left: 28px;
    content: ' ';
    height: 89px;
    width: 5px;
    background-color: rgba(180, 0, 0,0.7);
    top: -14px;    
}
.card.illegal:before {
  transform: rotate(45deg);
}
.card.illegal:after {
  transform: rotate(-45deg);
}

.dummyCard {
    margin: 0px 9px 0px 0px;
    cursor:default;
}

#actions {
    height: 85px;
    width: 200px;
    border-radius: 4px;
    margin-left: 8px;
    display:inline-block;
    padding: 9px;
    box-sizing: border-box;
}

#endturn, #endgame {
    height: 85px;
    width: 300px;
    border-radius: 4px;
    float: right;
    text-align: center;
    font-size: 20px;
    font-family: arial;
    font-weight: bold;
    line-height: 85px;
    cursor:pointer;
    border:solid 2px #7B7B7B;
    box-sizing: border-box;
    outline:none;
    background: rgba(255, 255, 255,1);
}

#endgame {
    margin-left:10px;
    width: 145px;
    display:none;
}

#endturn.inactive, .notMyTurn #endgame, #endgame.inactive {
    background: rgba(255, 255, 255,0.1);
    color: rgba(255,255,255,0.1);
    border: solid 2px rgba(163, 163, 163,0.2);
    cursor: not-allowed;
}

.notMyTurn .card, #cards.inactive .card {
    color: rgb(128, 128, 128);
    border: solid 2px rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.1);
    box-shadow: none;
    cursor: not-allowed;
}

.notMyTurn .buy,  #stockMarket.inactive .buy,  #stockMarket button.dummybuy{
    height: 34px;
    cursor: pointer;
    opacity: 0.7;
    color: rgb(160, 160, 160);
    cursor: not-allowed;
    outline:none;
}

.message {
    display:none;
    position: absolute !important;
    width: 500px;
    min-height:240px;
    background-color: transparent;
    top: 181px;
    left: 247px;  
    font-family: 'Source Code Pro', monospace;
    font-size: 16px;
    z-index:20;
}

.message div.handle {
    width: 100%;
    background-color: rgba(57, 70, 78,0.9);
    cursor: move;
    height: 40px;
    color: rgb(190, 200, 200);
    line-height:40px;
    padding-left:20px;    
    box-sizing: border-box;
    border-radius: 4px 4px 0px 0px;
}

.message div.messageText {
    cursor: move;
    color: rgb(30,30,30);
    background-color: rgba(255,255,255,0.9);
    min-height:200px;
    width:100%;
    box-sizing: border-box;
    padding:20px;
    border-radius: 0px 0px 4px 4px;
}

.message .closeMessage {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 25px;
    color: rgb(255, 255, 255);
    cursor: pointer;
    padding: 5px 16px 5px 10px;
    opacity: 0.7;
}

.message .closeMessage:hover, .message .closeMessage:focus {
    opacity:1;
}

.message:focus {
    z-index:100;
}

#message h2 {
    margin-top: 0px;
    text-align: center;
}

.companyMessage {
    z-index:10;
}

.companyMessage .sizeValueTable {
    display:inline-block;
}

.companyMessage .sizeValueTable table {
    border-collapse: collapse;    
}

.companyMessage .sizeValueTable table td, .sizeValueTable table th {
    border: solid 1px rgba(0,0,0,0.1);
    padding:4px;
}

.companyMessage .sizeValueTable th {
    min-width:50px;
    text-align: center;
}

.companyMessage .sizeValueTable .listSize {
    text-align: center;
}

.companyMessage .sizeValueTable .listVal {
    text-align:right;
}

.companyMessage .sizeValueTable tr.current {
    background-color: rgba(255, 255, 255,0.5);
}

.companyMessage .currentInfo {
    display: inline-block;
    vertical-align: top;
    margin-left: 20px;
    width:200px;
}

.companyMessage .currentInfo div {
    font-weight:bold;
    margin-top:10px;
    margin-bottom:5px;
    padding:5px;
}

.companyMessage .currentInfo div:first-child {
    margin-top:0px;
}

.companyMessage .currentInfo span {
    display:inline-block;
    float:right;
}

#activity {
    height: 85px;
    width: 244px;
    border-radius: 4px;
    margin-left: 2px;
    display:inline-block;
    padding: 9px;
    box-sizing: border-box;
    float:left;
}

#activity .flash {
    width:10px;
    height:10px;
    border-radius: 50%;
    border: solid 1px #d0d0d0;
    background: linear-gradient(-45deg,  rgba(0,0,0,0.2) 0%,rgba(0,0,0,0) 100%);  
    display:inline-block;
    background-color: rgba(255, 255, 255, 0.5);
    float:left;
    transition: background-color 300ms linear;
}

#activity .flash.statusGreen {
    background-color: rgb(0, 238, 0);
}

#activity .flash.statusYellow {
    background-color: rgb(238, 238, 0);
}

#activity .flash.statusRed {
    background-color: rgb(238, 0, 0);
}

.activePlayer {
    float: left;
    clear: both;
    width: 100%;
    height: 14px;
    vertical-align: top;
    line-height: 14px;
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    display:none;
}

.activePlayer.turnPlayer {
    font-weight:bold;
    color: rgb(255, 255, 255);
}

.activePlayer.turnPlayer:after {
    content: ' (turn) ';
}

.message .mergeBetween {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 29px 0 29px 40px;
    border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(57, 70, 78,0.2);
    float: left;
}

.message .mergeOld, .message .mergeTo {
    width: 45%;
    float: left;
}

.message .mergeTo div, .message .mergeFrom {
    padding:5px;
    color:#fff;
    height:19px;
    font-size: 14px;
    overflow:hidden;
}

.message .mergeBonus {
    clear:both;
    padding-top: 5px;
}

.message .mergeChoices {
    padding-top:5px;
    clear:both;
}

.message .mergeDone, .message .mergeFinish {
    margin-top: 20px;
    clear: both;
    width: 100%;
    height: 40px;
    cursor:pointer;
}

.message .mergeSeperator {
    clear: both;
    width: 100%;
    height: 5px;
}

.message .mergeSell, .message .mergeKeep, .message .mergeTrade {
    width: 130px;
    float: left;
    height: 120px;
    background-color: rgba(57, 70, 78,0.5);
    position: relative;
    font-size: 40px;
    color: rgba(0,0,0,0.8);
    padding-top: 45px;
    box-sizing: border-box;
    text-align: center;
}
.message .moveStock1, .message .moveStock2 {
    float:left;
    height:120px;
    width: 35px;
}

.message .mergeSell:before, .message .mergeKeep:before, .message .mergeTrade:before {
    position: absolute;
    top: 0px;
    left: 0px;
    text-align: center;
    line-height: 50px;
    width: 130px;
    font-size: 40px;
    font-weight: bold;
}
    
.message .mergeSell:before {
    content: 'SELL';    
}

.message .mergeKeep:before {
    content: 'KEEP';    
}

.message .mergeTrade:before {
    content: 'TRADE';   
}

.message .arrowRight {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 25px 0 25px 25px;
    border-color: transparent transparent transparent rgba(57, 70, 78,0.5);
    margin-left: 5px;
    cursor:pointer;
}

.message .arrowLeft {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 25px 25px 25px 0;
    border-color: transparent rgba(57, 70, 78,0.5) transparent transparent;
    margin-top: 20px;
    margin-left: 5px;
    cursor:pointer;
}

.message .arrowRight:hover {
    border-color: transparent transparent transparent rgba(57, 70, 78,0.8);
}

.message .arrowLeft:hover {
    border-color: transparent rgba(57, 70, 78,0.8) transparent transparent;
}

#setupLogo {
    box-sizing: border-box;
    width: 50%;
    min-height: 100px;
    background-color: rgba(200, 200, 200,0);
    font-family: 'Source Code Pro', monospace;
    font-size: 16px;
    margin: 50px auto 0px auto;
    background-image:url(necronomy.png);
    background-size:100% 100%;
    background-repeat: no-repeat;
}

#setup {
    box-sizing: border-box;
    width: 50%;
    min-height: 400px;
    background-color: rgb(200, 200, 200);
    font-family: 'Source Code Pro', monospace;
    font-size: 16px;
    margin: 50px auto 0px auto;
    border-radius: 5px;
    box-shadow: 0px 0px 40px rgb(255, 255, 255);
    padding: 10px 20px;
}

#setup .setBlock {
    width: 100%;
    height: 110px;
    box-sizing: border-box;
    background-color: rgb(255, 255, 255);
    border-radius: 5px;
    border: solid 1px rgba(255,255,255,0.5);
    margin: 13px 0px;
    position: relative;
}

#setup button.setupButton {
    height: 90px;
    margin: 10px;
    float: right;
    text-align: center;
    width: 120px;
    cursor:pointer;
}

#setup button.setupButton:hover {
    opacity: 0.8;
    border-color: rgb(255, 165, 30);
}

#setup div.leftBlock {
    margin-left:10px;
    margin-top:10px;    
    float:left;
}

#setup div.leftBlock input, #setup div.leftBlock select {
    outline: none;
}

#setup .feedback {
    position: absolute;
    bottom: 10px;
    left: 10px;
    height: 33px;
}

#setup .feedback span {
    font-weight:bold;
}

#setup span#publicGameCodes {
width: 275px;
    display: inline-block;
    vertical-align: top;
    font-size: 14px;
    overflow-y: auto;
    height: 75px;
}

#setup span#publicGameCodes span {
    display: inline-block;
    margin-left:5px;
    text-decoration: underline;
    color:#000066;
    cursor:pointer;
}

#setup.loading {
    opacity:0.6;
}

#setup.loading button.setupButton {
    cursor:default;
}

.pushme {
    font-weight: bold;
    border: solid 1px rgb(0, 0, 0);
    border-radius: 2px;
}

::selection, button::selection {
  background: transparent;
}
::-moz-selection, button::-moz-selection {
  background: transparent; 
}

.spareStock {
    box-sizing: border-box;
    padding: 6px 6px;
    text-align: center;
    width: 29px;
    margin: 0px;
    border-radius: 2px;
}

#stockMarket table th.stockhead {
    text-align:left;
}

#other {
    position:absolute;
    top:5px;
    right:5px;
}

#other a {
    color:rgba(255,255,255,0.5);
    font-family: 'Source Code Pro', monospace;
    font-size:75%;
}