* {
    box-sizing: border-box;
    user-select: none;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: black;
    color: #59ddff;
    font-family: 'Share Tech Mono', monospace;

    display: flex;
    justify-content: center;
    align-items: center;
}

#game {
    width: 940px;
    height: 600px;

    display: flex;
    flex-direction: row;

    visibility: hidden; /* until we start the game */
}

.column {
    position: relative;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

h2 {
    position: relative;
    font-weight: normal;
    padding: 5px 10px;
    margin: 0;
    font-size: 1.3em;
    text-align: center;
}

.header-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 5px 0 10px;
}

.title {
    position: relative;
}

.title .inner-border {
    margin: 0;
}

.message {
    font-size: 14px;
    padding: 2px;
}

.pink {
	color: #ff7efa;
}

#transmit-message {
	display: none;
}

#routing-message {
	white-space: pre;
}

.block {
    border: 2px solid;
    position: relative;
}

.inner-border {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    margin: 10px;
    border: 2px solid #235561;
}

.inner-border:before, .inner-border:after {
    content: "";
    position: absolute;
    background: black;
    top: 0; bottom: 0; left: 0; right: 0;
}

.inner-border:before {
    margin: -5px 20px;
}

.inner-border:after {
    margin: 20px -5px;
}

/************ METER *************/

#meter {
    flex: 1 1;
    margin: 5px 20px 5px 5px;
    height: 20px;
    border: 2px solid #ff7efa;
    position: relative;
}

#meter .fill {
    height: 100%;
    background: #ff7efa;
    transition: width 0.5s;
}

/************ BUTTON *************/

.button {
    display: inline-block;
    cursor: pointer;
    border: 2px solid;
    padding: 10px 20px;
    background: black;
}

.button:hover {
    background: #16353c;
}

.button.disabled {
    cursor: default;
    border-color: #235561;
    color: #235561;
    background: black;
}

#info-button {
    position: absolute;
    bottom: 28px;
    right: 28px;
    height: 32px;
    width: 32px;
    padding: 5px 10px;
}

#info-button:hover {
    background: #16353c;
}

#skip-button {
	color: #235561;
	font-weight: bold;
	cursor: pointer;
	margin-right: 3px;
	display: none;
}

/************ PUZZLE *************/

#puzzle-screen-container {
    position: relative;
    width: 542px;
    height: 346px;
    overflow: hidden;
    margin-bottom: 5px;
}

#puzzle-screen {
    display: flex;
    flex-direction: column;

    padding: 15px 35px;
}

.relay-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.relay {
    width: 44px;
    height: 44px;
    position: relative;
    
    margin: 17px;
    
    font-size: 26px;
    text-align: center;
    z-index: 1;
    
    transition: transform 0.1s ease;
}

.relay > div {
	background: black;
    border: 2px solid;
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
}

.relay:after {
    content: "";
    position: absolute;
    left: 11px;
    top: 11px;
    width: 23px;
    height: 23px;
    background: url(images/icons.svg) no-repeat;
    background-position-y: -22px;
}

/* heart icon */
.relay.attr1-0:after {
    background-position-x: -24px;
}

/* diamond icon */
.relay.attr1-1:after {
    background-position-x: -47px;
}

/* star icon */
.relay.attr1-2:after {
    background-position-x: 0px;
}

/* circle shape */
.relay.attr0-1 > div, .relay.attr0-1 > div:before {
    border-radius: 50%;
}

/* diamond shape */
.relay.attr0-2 > div {
    transform: rotate(45deg) scale(0.85);
}

/* dashed border */
.relay.attr2-1 > div {
    border: dashed;
}

.relay.selected {
	color: #ff7efa;
}

.relay.selected:after {
    background-position-y: 0;
}

#puzzle-screen.active .relay.available,
#puzzle-screen.active .relay.selected {
	cursor: pointer;
}

#puzzle-screen.active .relay.available:hover {
    transform: scale(1.1);
}

.line {
	background: #ff7efa;
	/* width is set via constant */
	height: 3px;
	position: absolute;
}

.line.in {
    left: 0;
    bottom: 53px;
    width: 60px;
}

.line.out {
    right: 0;
    top: 53px;
    width: 60px;
}

/************ DIALOG *************/

.dialog {
    position: absolute;
    top: 0;
    left: 0;
    background: #000000c0;
    z-index: 1;
    right: 0;
    bottom: 0;
    text-align: center;
}

.dialog > div {
    position: absolute;
    top: 0;
    bottom: 0;
	left: 0;
	right: 0;
    margin: 20px 45px;
    border: 2px solid;
    background: black;
    padding: 5px 30px;
}

.dialog h2 {
    border-style: none none solid none;
	border-color: #59ddff;
    color: #ff7efa;
}

.dialog .message {
	margin: 10px 0 25px;
}

#match-fail-dialog .message {
	white-space: nowrap;
}

.dialog .button {
    display: block;
    width: 150px;
    margin: 15px auto;
}

.example {
    margin: 15px 0 10px;
}

.example .relay {
    margin: 0;
}

.example .lines {
    color: #ff7efa;
    width: 50px;

    display: flex;
    flex-direction: row;
    align-items: center;
}

.example .line {
    position: static;
    flex: 1 1;
}

.example .x {
    font-size: 18px;
    margin: 5px;
}

.qualities {
    text-align: right;
    display: inline-block;
    line-height: 140%;
}

.quality.pass {
    white-space: pre;
}

#match-fail-dialog .quality.fail {
    color: #ff7efa;
}

#info-dialog .example {
	display: flex;
	justify-content: space-around;
	margin-bottom: 20px;
}

#info-dialog .fail {
	color: #59ddff;
}

#info-dialog .fail .line {
	background: #59ddff;
}

/************ CHAT *************/

#chat-section {
    display: flex;
    flex: 1 1;
}

#chat-section .content {
    flex: 1 1;
    display: flex;
    flex-direction: column;
}

#chat-screen {
    flex: 1 1;
    display: flex;
    flex-direction: column;
}

#chat-history-section {
    position: relative;
	overflow: auto;
    height: 423px;
    padding: 8px;

    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
#chat-history-section::-webkit-scrollbar {
    display: none;
}

.bubble {
    background: black;
    border: 1px solid;
    margin: 0 10px 10px;
    padding: 10px 15px;
    border-radius: 20px;
    display: inline-block;
    clear: both;
}

.our.bubble {
    margin-left: 40px;
    float: right;
}

.their.bubble {
    margin-right: 40px;
    float: left;
    border-color: #ff7efa;
    color: #ff7efa;
}

.sys.bubble {
    display: block;
    border-radius: 0;
    text-align: center;
    padding: 5px;
    margin: 10px;
    border-color: #ff7efa;
    color: #ff7efa;
}

.final.bubble, .connect.bubble {
	margin-bottom: 40px;
}

.final.bubble:after, .connect.bubble:after {
	content: "";
	position: absolute;
	border-bottom: 2px solid #235561;
	left: 80px;
	right: 80px;
	height: 43px;
}

.end.bubble {
	border: none;
}

#chat-response-section  {
    position: relative;
    text-align: center;
    border-top: 2px solid #235561;
    padding: 15px;
}

#chat-respond {
    width: 150px;
}

#chat-wait-label  {
    font-weight: bold;
    position: relative;
    bottom: 3px;
}

#chat-respond #chat-wait-label {
    display: none;
}

#chat-respond.disabled #chat-respond-label {
    display: none;
}

#chat-respond.disabled #chat-wait-label {
    display: inline;
}
