* {
  transition: color 0.25s, margin 0.25s, padding 0.25s, width 0.25s,
    height 0.25s, background-color 0.25s, scroll 0.25s, opacity 0.25s;
  box-sizing: border-box;
}

html,
body {
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.5em;
  font-weight: 400;
  background: #efefef;
  color: #444;
}
p {
  margin: 0 0 1em;
}

ol {
  padding: 1em 1em 1em 2em;
  margin: 0 auto 2em;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1em 0;
  padding: 0;
}

h1 {
  padding: 0 0 0.5em 0;
  border-bottom: 1px solid #ddd;
}

textarea {
  width: 100%;
  max-width: 100%;
  min-height: 8em;
  margin: 0 0 1em 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5em 0.25em 0.25em 0.5em;
}

input {
  border: 1px solid #ddd;
  padding: 0.25em 0.5em;
}

button {
  /* #f09819 */
  background: rgba(240, 152, 25, 0.8);
  border: none;
  box-shadow: none;
  padding: 0.5em 0.75em;
  cursor: pointer;
  border-radius: 4px;
  max-height: 2.5em;
  cursor: pointer;
  touch-action: manipulation;
  font-weight: 600;
  color: #fff;
}

button:hover {
  background: rgba(240, 152, 25, 1);
}
button:active {
  background: #888;
  transform: scale(0.95);
}

footer {
  margin-top: 1em;
  text-align: center;
}

footer.note {
  font-size: 1em;
  max-width: 512px;
  padding: 1em 1.5em;
  background-color: #eee;
  margin: auto;
  text-align: left;
  border-radius: 4px;
}

section.main {
  background: #fff;
  width: 90%;
  max-width: 1280px;
  margin: 5vh auto 1vh;
  padding: 2em;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

section.container.small {
  margin: 0 auto;
  max-width: 512px;
}

#loading {
  display: inline-block;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

#loading.active {
  width: 1em;
  height: 1em;
  opacity: 1;
}

#new-room {
  margin: 2em 0;
  padding: 1em;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
}

#messages {
  padding: 1em 2em;
  margin: 0 1em 1em 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: auto;
}

#messages .author,
#messages .datetime {
  display: inline-block;
  margin: 0 0.5em 0 0;
  font-size: 0.8em;
  border-bottom: 1px dashed #aaa;
}

#messages .author {
  font-weight: bold;
}
.author.you {
  color: #f6ae06;
}

#messages p {
  margin: 0.25em 0 0.5em 0;
  padding: 0 0 0 0.25em;
}

#members {
  max-width: 20em;
  padding: 1em;
  margin: 0 0 1em;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: auto;
}
#messages,
#members {
  height: 60vh;
  min-height: 20em;
  max-height: 40em;
}
#members-list {
  border: none;
  padding: 0 1em 0;
}

#members-list li span {
  width: 100%;
  height: 1.5em;
  display: block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-wrap: nowrap;
}

.nolist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nolist li {
  padding: 0.25em 0.5em;
}

#live-rooms-count {
  display: block;
  font-size: 0.6em;
  float: right;
  font-weight: normal;
  color: #999;
}

#public-chat-rooms {
  max-height: 50vh;
  overflow: auto;
}
#public-chat-rooms .room-link {
  display: block;
  border-bottom: 1px solid #ddd;
  padding: 0.5em 0.75em;
  text-decoration: none;
}

#public-chat-rooms li:last-child .room-link {
  border-bottom: none;
}

#public-chat-rooms .room:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.room-link .phantom {
  display: inline-block;
  vertical-align: top;
  font-size: 0.7em;
  margin: -0.5em 0 0 -0.25em;
}

.room-members-count {
  font-size: 0.75em;
  float: right;
}

.sub-header {
  color: #f6ae06;
  text-align: right;
  margin-top: -1em;
}

span#sse-status.active {
  color: #7adaa5;
}

span#sse-status.inactive,
.error-message,
.critical {
  color: #d92c54;
}

h1 .members {
  color: #999;
  font-size: 0.35em;
}

span#room-name {
  max-width: 75%;
  display: inline-block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-wrap: nowrap;
  height: 1.25em;
  line-height: 1em;
}
span#room-name .phantom {
  font-size: 0.5em;
  display: inline-block;
  vertical-align: top;
  margin-top: -0.5em;
}

#joinform button {
  max-width: 5em;
}

.joinform-container.flex-container > form {
  max-width: 26em;
}

.phantom {
  font-variant-emoji: text;
  cursor: default;
  font-size: 1.25em;
}

.phantom::after,
#new-room .phantom:hover::after {
  content: " ";
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  background: url("/static/images/phrispr.svg") no-repeat center center;
  background-size: cover;
}

.active.phantom::after {
  background-image: url("/static/images/phrispr-active.svg");
}

.flex-container {
  display: flex;
  width: 100%;
}

.flex-container > * {
  flex: 1;
}

@media screen and (max-width: 460px) {
  .flex-container {
    flex-direction: column; /* stack items vertically */
  }
  .flex-container > * {
    margin-bottom: 0.5em;
  }
  #sse-status {
    font-size: 0.5em;
  }
}

@media screen and (max-width: 520px) {
  html,
  body {
    font-size: 13px;
  }
  #sse-status {
    font-size: 0.5em;
  }
}
