* {
    margin: 0;
    padding: 0;
    border: 0;
}

@font-face {
	font-family: 'excalidraw';
	src: url('../fonts/Excalifont-Regular.woff2') format('woff2');
}

html, body {
    background-color: #111;
    width: 100%;
    display: flex;
    
    /*
    */
    min-height: 100%;
    height: 100%;

	overflow: hidden;
	overscroll-behavior: none;

    font-family: excalidraw;
}

#wrapper {
    display: flex;
    flex-direction: row;
    flex-direction: column;

    width: 100%;
    max-width: 500px;
    height: 100%;
    justify-content: flex-start;
    /*
    background-color: rgba(0, 0, 0, 0.2);
    */
}

#canvasWrapper {
    position: relative;
    /*
    top: calc(1em + env(safe-area-inset-bottom));
    */
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 0;

    /* Prevent text selection */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;      /* IE 10+ */
    user-select: none;         /* Standard */
    
    /* Prevent the iOS "callout" menu on long-press */
    -webkit-touch-callout: none;
}

canvas {
    position: absolute;
    top: 0;
    width: 100%;
    
    aspect-ratio: 600 / 550;
    height: auto;
}

#gameCanvas {
    position: relative; /*HACK to make parent-div have a size; required because all canvases have position absolute to be stackable*/

    background: #111; /*TODO set with theme*/
    z-index: 1;
}

#debugCanvas {
    z-index: 2;
    pointer-events: none;
}

#chat {
    z-index: 2;

    width: 100%;
    pointer-events: none;
}

#chat * {
    color: #ccc;
    font-size: 11pt;
}
@media (max-width: 768px) {
  #chat * {
    font-size: 7pt;
  }
}

#chat input {
    background-color: transparent;
    border: 0;
    padding: 5px;
    padding-left: 10px;
    margin-left: 10px;
    outline: none;
    width: 92%; /* WTF */
    /*
    width: 350px;
    */
}

#chat input:focus {
    color: black;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.33);
}

#chatHistory {
    margin: 10px;;
    max-height: 300px;
    overflow: scroll;
    scrollbar-width: none;  /* Firefox */
}

#highscores {
    display: flex;
    flex-direction: column;
    padding: 10px;

    pointer-events: none;
    z-index: 100;
    
    width: auto;
    margin: 7px;

    /*max-height: 300px;
    */
    overflow: scroll;
    scrollbar-width: none;  /* Firefox */

    font-family: excalidraw;
    background-color: rgba(0, 0, 0, 0.0);
    color: #ccc;
}
#log {
    pointer-events: none;
    z-index: 100;

    /*pointer-events: none;
    */
    width: 100%-20px;
    margin-bottom: 7px;

    overflow: scroll;
    scrollbar-width: none;  /* Firefox */

    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ddd;

    background-color: rgba(0, 0, 0, 1.0);
    color: rgba(0, 0, 0, 0.33);
    color: #ccc;
    color: #0c0;
    flex: 1;
    margin: 10px;
    margin-bottom: 0px;
    padding: 8px;
    border-radius: 8px;
}

#log p {
    padding-left: 10px;
}

#log p span{
    margin-right: 25px;
}
#log p span:hover {
    color: black;
    /*
    text-decoration: underline;
    */
}

.error {
    color: red;
}


#chatHistory::-webkit-scrollbar {
	display: none;  /* Safari and Chrome */
}


#log::-webkit-scrollbar {
	display: none;  /* Safari and Chrome */
}

#top {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;

    /* Prevent text selection */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;      /* IE 10+ */
    user-select: none;         /* Standard */
    
    /* Prevent the iOS "callout" menu on long-press */
    -webkit-touch-callout: none;
}

#infopanel {
    display: flex;
    flex-direction: column;
    flex: 1;

	overflow: hidden;
	overscroll-behavior: none;
}

.toprowcontainer {
    flex: 0;
    width: 100%-20px;
	display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}
.bottomrowcontainer {
    flex: 0;
    width: 100%-20px;
	display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

.buttonrow {
	display: flex;
    flex-direction: row;
	height: 32px;
    z-index: 1440;
    gap: 6px;
}

.buttonrow * {
	height: 100%;
	vertical-align: center;
    flex:1;
    background-color: #333;
    color: #ccc;
    border-radius: 5px;
}

#hud {
    z-index: 100;
    pointer-events: none;

    position: absolute;
    top: 0;
    right: 0;
    margin: 6px;
    font-family: monospace;
    font-family: excalidraw;
    color: #ccc;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11pt;
}


.visible {
    display: unset;
}
.hidden {
    display: none !important;
}

.visible-animate {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease-in-out 1s, visibility 0.25s ease-in-out 1s;
}
.hidden-animate {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
}

.tableheader {
    text-align: center;
}

table {
    min-width: 280px;
}
td {
    border: 0px solid black;
}

th {
    font-weight: bold;
    text-align: center;
}

#highscoreheader  {
    font-size: 12pt;
    font-weight: bold;
}

#highscores table {
    width: 100%;
}



.right {
    text-align: right;
}


#servererror {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #777;
    pointer-events: none;
    z-index: 1000;
    font-family: monospace;
}

.icons {
    height: 30px;
}
.icons button {
    font-size: 16pt;
    color: #bbb;
}

.bold {
    font-weight: bold;
    color: #ddd;
}


#topbuttons {
    display: flex;
    justify-content: space-between;
    padding: 11px;
}

#topbuttons button {
    display: flex;

    /*
    font-size: 18pt;
    padding: 12px 20px 12px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    */

    padding: 0px;

    border-radius: 15px;
    color: #ddd;
    background-color: transparent;
}


button {
    /* Prevent text selection */
    -webkit-user-select: none;      /* Safari */
    -ms-user-select: none;          /* IE 10+ */
    user-select: none;              /* Standard */
    -webkit-touch-callout: none;    /* iOS */
}
