* {
    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;
}

div.mobile-only, img.mobile-only {
	display: none;
}

#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;
}

.decoration {
	width: 100%;
	height: auto;
}

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;
    height: 20px;
    border: 2px solid #ff7efa;
    position: relative;
}

#meter {
	margin-right: 20px;
}

.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;
}

#info-button img {
    position: absolute;
    left: 6px;
    top: 6px;
    width: 16px;
    height: 16px;
}

#skip-button {
	color: #235561;
	font-weight: bold;
	cursor: pointer;
	margin-right: 3px;
	display: none;
}

/************ PUZZLE *************/

#puzzle-screen-container {
    position: relative;
	width: 542px;
	height: 346px;
    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: 3;
    right: 0;
    bottom: 0;
    text-align: center;
	
	display: none;
}

.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;
}

.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;
	font-family: sans-serif;
	font-weight: bold;
    margin: 5px;
}

.qualities {
    text-align: right;
    display: inline-block;
    line-height: 140%;
}

.quality.pass {
    white-space: pre;
}

#match-fail-dialog .message {
	white-space: nowrap;
}

#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 {
    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;
}

.last.bubble {
	margin-bottom: 15px;
}

.start.bubble {
	margin-top: 40px;
}

.start.bubble:before {
	content: "";
	position: absolute;
	border-top: 2px solid #235561;
	left: 80px;
	right: 80px;
	margin-top: -27px;
}

.end.bubble {
	border: none;
}

.endless.bubble {
	color: #59ddff;
	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;
}

/************ SETTINGS *************/

#settings-dialog {
    top: 120px;
    z-index: 5;
}

#settings-dialog > div {
    margin-top: 8px;
    margin-bottom: 40px;
    padding-top: 20px;
}

#settings-dialog .button {
    margin-top: 30px;
}

.mode {
	display: flex;
	justify-content: center;
	align-items: center;
}

.mode > div {
	padding: 10px;
	white-space: pre;
}

/* toggle switch from w3schools.com */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid #ff7efa;
  border-radius: 10px;
}

.slider:before {
  position: absolute;
  content: "";
  width: 20px;
  top: 4px;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background-color: #ff7efa;
  border-radius: 5px;
  -webkit-transition: .2s;
  transition: .2s;
}

input:checked + .slider:before {
  -webkit-transform: translateX(28px);
  -ms-transform: translateX(28px);
  transform: translateX(28px);
}

.message.note {
	margin: 0 0 20px 0;
	font-size: 12px;
}

.vol {
	display: flex;
	align-items: center;
	margin: 10px;
}

.vol div {
	flex: 2;
}

.vol .meter {
	flex: 10;
	border-color: #59ddff;
}

.vol .fill {
	background: #59ddff;
}

.vol .control {
	flex: 1;
	color: #ff7efa;
	font-size: 20px;
	cursor: pointer;
	text-align: center;
}

/* https://www.w3schools.com/howto/howto_css_custom_checkbox.asp */
.settings-hint {
    display: flex;
    flex-direction: row;
    padding: 0 20px 0 25px;
}

.hint-radio {
    display: block;
    position: relative;
    flex-grow: 1;
    padding-left: 26px;
    margin: 10px 10px 20px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide the browser's default radio button */
.hint-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Create a custom radio button */
.checkmark {
    position: absolute;
    top: -2px;
    left: 0;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    border: 2px solid #ff7efa;
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;

    top: 4px;
    left: 4px;
    bottom: 4px;
    right: 4px;
    border-radius: 50%;
    background: #ff7efa;
}

/* Show the indicator (dot/circle) when checked */
.hint-radio input:checked ~ .checkmark:after {
    display: block;
}