@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');

::-webkit-scrollbar{
  width: 12px;
}
::-webkit-scrollbar-track{
  background: #333;
}
::-webkit-scrollbar-track:hover{
  background: #444;
}
/* ::-webkit-scrollbar-track:active{
  background: #999;
} */
::-webkit-scrollbar-thumb{
  background-color: #666;
  border-radius: 10px;
  border: 2px solid #333;
}
::-webkit-scrollbar-thumb:hover{
background: #888;
}
::-webkit-scrollbar-thumb:active{
  background: #AAA;
}

html {
  background: linear-gradient(#000000, #646262);
  color: #ffffff;
  height: 100%;
  font-family: monospace;
  /*font-style: italic;/*
  /*filter: opacity(0%) blur(10px);*/
  margin: 0;
  animation: intro-load 1s ease-in-out infinite;
}
body {
  margin: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: auto;
  grid-template-rows   : auto 1fr auto;
  grid-template-areas: "top" "middle" "bottom";
  gap: 3px;
}
@keyframes intro-load{
  0%{
    filter: opacity(5%);
  }
  50%{
    filter: opacity(15%);
  }
  100%{
    filter: opacity(5%);
  }
}
@keyframes intro {
  0% {
    filter: opacity(0%) blur(15px);
  }

  100% {
    filter: opacity(100%) blur(0px);
  }
}

body > *{
  margin: 5px;
  padding: 5px;
}
header {
  grid-area: top;
}

header #header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* overflow-x: auto; */
  font-family: "Trebuchet MS";
  font-style: italic;
}
header #title {
  margin-bottom: 0;
  margin-top: 0;
}
header #subtitle {
  margin-top: 10px;
}

header #buttons {
  display: grid;
  grid-template-columns: clamp(100px, 20vw, 250px) clamp(100px, 20vw, 250px);
  /* grid-row: auto auto; */
  column-gap: 1ch;
  row-gap: 1ch;
}
header #buttons .button{
  display: flex;
  justify-content: center;
}
header #buttons .button > *{
  background: #404040;
  color: white;
  border-style: outset;
  outline: none;
  box-sizing: border-box;
  width: 100%;
  text-align: center;
} /* don't forget: add a focus selector to help those disabled people (who cares?????) */
header #buttons .button > *:active{
  border-style: inset;
  transform: translateX(1px) translateY(1px);
}
header input {
  width: 90%;
  background-color: transparent;
  color: white;
  border: 1px solid #333333;
  transition: border 0.5s, background-color 0.5s;
  text-align: center;
}
header input:hover {
  border: 1px solid #585555;
}
header input:focus {
  background-color: white;
  color: black;
  outline: 2px solid darkgray;
}

body > #content {
  border: 3px inset black;
  flex-direction: column;
  grid-area: middle;
  display: grid;
  grid-template-areas: "top" "rest";
  grid-template-rows: auto 1fr;
  overflow-y: auto;
}
#extra_container{
  grid-area: top;
}
.extra{
  border: 2px solid green;
  margin: 2px;
}
#debugTools {
  border: 2px outset gray;
  background: #00000088;
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 5px;
  display: block;
}

#app_container{
  grid-area: rest;
  overflow: auto;
}
.app{
  height: 100%;
  background: #222;
  overflow-y: auto;
}
.app > .top{
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background: gray;
}
.app > .top > .title{
  color: #DDD;
  text-align: center;
  font-size: 2rem;
  font-family: "Oswald";
  font-weight: bold;
  /* letter-spacing: 0.05em; */
}
.app > .top .action-container{
  margin: 5px;
}
.app > .top .actions{
  display: flex;
  align-items: center;
}
.app > .paginator-containers{
  display: flex;
  align-items: center;
  margin-left: 25px;
}
.app > .middle{
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.app > .middle > .subtitle{
  font-size: 1.25rem;
  font-family: "Oswald";
  background: #666;
  padding: 10px;
  z-index: 1;
}
.app > .middle > .info{
  padding: 10px;
  font-size: 1rem;
  background: #444;
  border: 3px solid black;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.5s;
  z-index: 0;
}
.app > .middle > .info:empty{
  display: none;
}
.app > .middle > .info[error]{
  background: #822;
}
.app > .middle > .info button{
  background: #22222288;
  border-radius: 5px;
  border: 2px solid #00000088;
  cursor: pointer;
}
.app > .middle > .info button:hover{
  background: #22222244;
}
.app > .middle > .info button:active{
  transform: translate(1px, 1px);
  border: 2px inset #00000088
}

#games {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  grid-template-areas: "top" "middle" "bottom";
  font-family: monospace;
}
#games > .top{
  display: flex;
  justify-content: space-between;
}
#games > .top > .title{
  font-size: 1.5em;
  font-family: Roboto;
}
#games > .top > .actions{
  display: flex;
  justify-content: space-evenly;
}
#games .box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid white;
  border-radius: 10px;
  margin: 10px;
  padding: 10px;
}
#games .info {
  font-size: 1.5em;
}
#games .joinContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  min-height: 4em;
}
#games .join {
  font-size: 1.5em;
  margin: 0.1em;
  border: 0.05em solid black;
  border-radius: 0.3em;
  padding: 0.2em;
  width: 100%;
  background: linear-gradient(90deg, gray, lightblue);
  cursor: pointer;
  height: 2.75%;
  outline: none;
}
#games .join:hover {
  border: 0.1em inset black;
}
#games .join:active {
  border: 0.15em inset black;
  filter: brightness(90%);
  border-radius: 10px;
  outline: none;
  font-size: 1.25em;
}
@keyframes games-join {

  /*applies to the html tag*/
  0% {
    border-radius: 0;
    transform: scale3d(0, 0, 0) rotateZ(0deg);
  }
  100% {
    border-radius: 100px;
    transform: scale3d(0, 0, 0) rotateZ(360deg);
  }
}

#chat {
  display: flex;
  flex-direction: column;
}
#chat > .middle {
  display: flex;
  flex-direction: column;
  flex: 1;
  scroll-behavior: smooth;
  overflow-y: auto;
}
#chat > .middle > .list{
  overflow-y: auto;
  padding: 10px;
}
#chat > .middle > .list > .message {
  display: flex;
  flex-direction: column;
}
#chat > .middle > .list > .message.left {
  align-items: flex-start;
}
#chat > .middle > .list > .message.right {
  align-items: flex-end;
}
#chat > .middle > .list > .message > .upper{
  color: darkgray;
}
#chat > .middle > .list > .message > .pic{
  border: 1px solid black;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
#chat > .middle > .list > .message > .name{
  color: darkgray;
}
#chat > .middle > .list > .message > .lower{
  border: 2px solid black;
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 10px;
}
#chat > .middle > .list > .message > .text {
  color: white;
}
#chat > .middle > .list > .message.left > .lower {
  background: blue;
  border-bottom-left-radius: 0;
}
#chat > .middle > .list > .message.right > .lower {
  background: gray;
  border-bottom-right-radius: 0;
}
#chat > .bottom {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  background: #222;
  border-top: 5px solid black;
}
#chat > .bottom > #input{
  width: 50%;
  resize: none;
  background: #444;
  border-radius: 5px;
  margin: 5px;
  color: #BBB;
  font-family: sans-serif;
}
#chat > .bottom > #send{
  background: #666;
  color: #DDD;
  border-radius: 5px;
  margin: 5px;
}
#chat > .bottom > #send[disabled]{
  background: #444;
  color: #999;
}
#chat > .bottom > #send:active{
  transform: translate(1px, 1px);
}
#chat > .bottom > #send[disabled]:active{
  transform: translate(0, 0);
}
#chat > .bottom #animation{
  position: fixed;
  transition: 1s;
  float: left; 
  bottom: 0;
  font-family: "Arial";
  margin-left: 5px;
  margin-bottom: 60px;
  font-size: 0.9rem;
  word-wrap: break-word;
}

#settings{
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  grid-template-areas: "top" "middle" "bottom";
}

footer{
  grid-area: bottom;
  border: 5px inset #444;
  background: #444;
  display: grid;
  grid-template-areas: "l c r";
  grid-template-columns: auto 1fr auto;
}
footer > *{
  border: 2px solid #333;
  border-radius: 3px;
  margin: 1px;
  padding: 2px;
}
footer #version{
  grid-area: l;
}
footer #message{
  grid-area: c;
}
footer #ping{
  grid-area: r;
}
dialog{
  border: 3px solid #444;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 5px 5px 10px 5px #00000088;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(50vw, -50%);
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
dialog[justOpened]{
  transform: translate(-50%, -50%);
}
dialog::backdrop{
  background-color: #00000000;
  transition: background-color 0.5s ease;
}
dialog[justOpened]::backdrop{
  background-color: #00000088;
  transition: background-color 0.5s ease;
}
dialog ul{
  list-style: none;
  text-align: center;
  padding-left: 0;
}
dialog ul li::before{
  content: "•";
  display: inline-block;
  margin-right: 0.3em;
  position: absolute;
  transform: translate(-20px, 3px);
}
dialog .dialog-cancel{
  margin-left: auto;
}
