@import url('https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i|Press+Start+2P|Overpass+Mono:400,700|VT323');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');

@font-face {
  font-family: 'BPdots';
  src: url('/fonts/bpdots-regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'BPdots';
  src: url('/fonts/bpdots-bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}

* {
  margin: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: #01a7ee;
  color: #fff;
  font-size: 16px;
  line-height: 1.5;
  font-family: 'Lato', 'Helvetica', 'Arial', sans-serif;
}

img {
  max-width: 100%;
}

section {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 20px;
  font-weight: bold;
}

li {
  line-height: 1.4;
  margin-top: 0.5em;
}

li:first-child {
  margin-top: 0;
}

a {
  color: #fdcf1a;
}

.call {
  color: #fdcf1a;
}

.container {
  max-width: 634px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  width: 100%;
  padding: 20px 0;
  margin: 0 0 10px 0;
}

header h1 {
  display: block;
  margin: 0.5em auto;
}

header h1 a {
  display: block;
  text-align: center;
  width: 200px;
  margin: 0 auto;
}

header h2 {
  font-size: 28px;
  font-weight: bold;
  color: #fdcf1a;
  text-align: center;
  font-family: 'Press Start 2P', sans-serif;
}

header h2 a {
  color: #fdcf1a;
  text-decoration: none;
}

header h3 {
  font-size: 14px;
  color: #EA282E;
  background: #fff;
  padding: 10px 20px;
  margin-top: 40px;
  text-align: center;
  font-family: 'Press Start 2P', sans-serif;
}


/* footer */

.page_wrap {
  min-height: 100%;
  margin-bottom: -110px;  /* equal to footer height */
}

.page_wrap:after {
  content: "";
  display: block;
  height: 110px;  /* equal to footer height */
}

footer {
  height: 110px;
  background: #333;
  padding: 1em;
}

footer section {
  max-width: 600px;
  margin: 0 auto;
}

footer .logos {
  display: flex;
  align-items: center;
  float: left;
  margin-left: 10px;
  margin-top: -4px;
  min-height: 80px;
  font-size: 40px;  /* base size for the logos */
}

footer .logos img {
  display: block;
  margin-right: 0.5em;
}

footer .logos .pixelscamp {
  height: 0.75em;
  margin-top: 0.15em;
}

footer .logos .brpx {
  height: 1em;
}

footer .logos .probely {
  height: 0.65em;
  margin-top: 0.05em;
}

footer .logos .talkdesk {
  height: 0.4em;
  margin-top: -0.15em;
}

footer .logos .whitesmith {
  height: 0.8em;
}

footer .archive,
footer .date {
  float: right;
  font-family: 'BPdots', monospace;
  font-size: 0.9em;
  color: #999;
  margin-top: 24px;
  margin-right: 12px;
  text-align: right;
  text-transform: lowercase;
}

footer .archive a,
footer .date a {
  text-decoration: none;
  color: #ddd;
}


/* main content */

#main_content {
  width: 100%;
  -webkit-font-smoothing: antialiased;
  margin-bottom: 80px;
}

#main_content section img {
  max-width: 100%
}

#main_content h1 {
  margin: 0.8em 0;
  font-weight: bold;
  font-size: 2.1em;
  letter-spacing: -0.03em;
  color: #fdcf1a;
}

#main_content h2 {
  margin: 0.8em 0;
  font-weight: bold;
  font-size: 1.8em;
  letter-spacing: -0.03em;
}

#main_content h3 {
  color: #fdcf1a;
  margin: 2.1em 0 0.8em 0;
  font-weight: bold;
  font-size: 1.2em;
  letter-spacing: -0.03em;
}

#main_content p {
  margin: 1.5em 0;
}

#main_content .column > h3:first-child,
#main_content .column > p:first-child {
  margin-top: 0;
}

#main_content .column h3.optional:first-child {
  display: none;
}

#main_content .diagram {
  width: 82%;
  padding-top: 1em;
  margin: 0 auto;
}

ul li {
  list-style: square;
}

.unmarked li {
  list-style: none;
}

blockquote {
  margin: 1.5em 0;
  padding: 2px 2px 2px 10px;
  font-style: italic;
  font-size: 0.95em;
  border-left: 4px solid #0f0;
}

pre {
  background: #63c0f5;
  color: #0c4970;
  padding: 13px 15px;
  margin: 1em 0;
  font-family: 'Overpass Mono', monospace;
  font-size: 13px;
  word-wrap: normal;
  overflow: auto;
  overflow-y: hidden;
}

tt {
  font-family: 'Overpass Mono', monospace;
  font-size: 0.9em;
  letter-spacing: -0.5px;
}

table {
  width: 100%;
  margin: 0 0 20px 0;
  border-collapse: collapse;
}

th {
  font-weight: bold;
  text-align: left;
  border-bottom: 1px solid #fdcf1a;
  padding: 5px 14px;
}

tr:first-child {
  margin-top: 2px;
}

tr:last-child {
  margin-bottom: 2px;
}

td {
  font-size: 0.9em;
  text-align: left;
  padding: 5px 14px;
}

hr {
  height: 0;
  border: 0;
  border-bottom: 1px solid #fdcf1a;
}

#challenge_list ul {
  margin: 0;
  padding: 0.5em 0 0.5em 1em;
}

#challenge_list li {
  margin: 45px 0;
  position: relative;
  list-style: none;
}

#challenge_list li:first-child {
  margin-top: 16px;
}

#challenge_list li:last-child {
  margin-bottom: 28px;
}

#challenge_list li a {
  color: #fff;
  text-decoration: none;
  margin-left: 5px;
}

#challenge_list li small {
  display: block;
  margin: -5px 0 5px 65px;
  position: absolute;
}

#challenge_list .sequence {
  display: block;
  position: absolute;
  top: 0; left: 0;
  width: 50px; height: 50px;
  margin-right: 10px;
  text-align: center;
  font-family: 'Press Start 2P', sans-serif;
  font-size: 26px;
  line-height: 48px;
  color: #01a7ee;
  background: #f2f2f2;
  padding-left: 3px;
  border: 3px solid #f2f2f2;
  border-radius: 2px;
}

#challenge_list li:first-of-type .sequence {
  padding-left: 1px;  /* because the "1" is aligned right in the font */
}

#challenge_list a[href]:hover .sequence {
  background: #fdcf1a;
  color: #fff;
  border-color: #f2f2f2;
}

#challenge_list .title {
  display: inline-block;
  color: #fff;
  font-family: 'BPdots', monospace;
  font-size: 24px;
  margin: 2px 0 10px 60px;
  line-height: 1;
}

#challenge_list .closed .sequence {
  background: #0c6990;
  border: none;  /* using a border triggers a bug in safari... sigh */
  padding-top: 2px;
}

#challenge_list .closed a[href]:hover .sequence {
  background: #0c6990;
  color: #fff;
}

#challenge_list .closed .title {
  color: #0c6990;
}

#challenge_list .closed small {
  color: #0c6990;
}

#challenge_list .blurred .sequence {
  background: #0c6990aa;
  border: none;  /* using a border triggers a bug in safari... sigh */
  padding-top: 2px;
}

.blurred .title, .blurred small {
  text-shadow: 0 0 12px #08435caa;
  color: transparent !important;
}

.closed {
  color: #0c6990;
}

.borderless,
.borderless canvas,
.borderless img {
  border: none !important;
}

.centered {
  display: block;
  margin: auto;
  text-align: center;
}

.challenge-kicker {
  display: block;
  max-height: 150px;
  margin: auto;
  text-align: center;
}

.info,
.ok,
.warning,
.error {
  font-family: 'Overpass Mono', monospace;
  font-size: 12px;
  padding: 10px 12px;
}

.info::before,
.ok::before,
.warning::before,
.error::before {
  float: right;
  font-family: 'FontAwesome';
  font-style: normal;
  font-size: 14px;
  color: #ffffff90;
  padding-left: 10px;
}

.info a,
.ok a,
.warning a,
.error a {
  text-decoration: none;
  border-bottom: 1px solid;  /* farther away from the text */
}

.info {
  background: #63c0f5;
  color: #0c4970;
}

.info a {
  color: #0c4970;
}

.info::before {
  content: '\f129';  /* fa-info */
}

.ok {
  background: #4fba49;
  color: #eeffee;
}

.ok a {
  color: #eeffee;
}

.ok::before {
  content: '\f00c';  /* fa-check */
}

.warning {
  background: #fdcf1a;
  color: #222200;
}

.warning a {
  color: #222200;
}

.warning::before {
  content: '\f071';  /* fa-exclamation-triangle */
}

.error {
  background: #ea282e;
  color: #ffeeee;
}

.error a {
  color: #ffeeee;
}

.error::before {
  content: '\f057';  /* fa-times-circle */
}

#challenge_info {
  font-style: italic;
  min-height: 2em;
  margin-top: -10px;
}

#challenge_info :first-child {
  margin-top: 0;
}

#challenge_info :last-child {
  margin-bottom: 0.8em;
}

#challenge_info .open::before {
  font-family: 'FontAwesome';
  font-style: normal;
  font-size: 1.1em;
  color: #fdcf1a;
  content: '\f11e';  /* fa-flag-checkered */
  padding-right: 0.9ch;
}

#challenge_info .completion_notice {
  color: #0c6990;
  padding: 1em;
  background: #63c0f5;
  font-size: 0.95em;
}

#challenge_info .completion_notice #solution,
#challenge_info .completion_notice a {
  color: #f0ffff;
  border-bottom: 1px dashed #f0ffff;
  cursor: pointer;
  text-decoration: none;
}

#challenge_info .completion_notice #solution:hover,
#challenge_info .completion_notice a:hover {
  border-bottom: 1px dashed #fdcf1a;
}

/* answer form */

#answer {
  margin: 1.5em 0;
}

#answer textarea {
  color: #222;
  font-family: 'Overpass Mono', monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid #63c0f5;
  border-radius: 0;
  width: 100%; height: 240px;
  opacity: 1;
  -webkit-appearance: none;  /* no rounded controls on iOS */
  -webkit-border-radius: 0px;
}

input[type="submit"],
input[type="button"] {
  color: #444;
  background-color: #fff;
  border: 1px solid #63c0f5;
  border-radius: 0;
  display: inline-block;
  cursor: pointer;
  font-size: 13px;
  padding: 5px 20px;
  text-decoration: none;
  margin: 5px 5px 5px 0;
  opacity: 1;
  -webkit-appearance: none;  /* no rounded controls on iOS */
  -webkit-border-radius: 0px;
}

input[type="submit"]:disabled,
input[type="button"]:disabled {
  color: #ccc;
}

input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: #f6f6f6;
}

input[type="submit"]:active,
input[type="button"]:active {
  background-color: #ddd;
}

input[type="checkbox"] {
  margin: 5px;
}

input[type="checkbox"] + label {
  font-size: 0.8em;
}

#answer .buttons {
  float: right;
  margin-right: -5px;
}

/* single submit button (i.e. no ".buttons" container) */
#answer > input[type="submit"] {
  float: right;
  margin-right: 0;
}

#answer .length {
  visibility: hidden;
  margin: 4px 0 10px 0;
  font-size: 0.8em;
}

#message {
  min-height: 2.5em;
  margin-bottom: -0.5em;  /* pull the answer form closer */
}


/* global scoreboard (check "common.js" when modifying these styles) */

#scoreboard {
  display: none;
}

#scoreboard p:first-child {
  margin: 1.5em 0;
}

#scoreboard table {
  width: 100%;
}

#scoreboard thead,
#scoreboard tbody tr {
  display: table;
  table-layout: fixed;
  width: 100%;
}

#scoreboard th:nth-child(2),
#scoreboard td:nth-child(2) {
  width: 60%;  /* participant name */
}

#scoreboard tbody {
  display: block;
}

#scoreboard tbody tr {
  display: none;
}

#scoreboard tbody tr:nth-child(-n+5) {  /* top 5 by default */
  display: table;
}

#scoreboard .final tbody tr:nth-child(1) td:nth-child(2)::after {
  font-family: 'FontAwesome';
  content: ' \f11e';  /* fa-flag-checkered */
  color: #fdcf1a;
}

#scoreboard tbody tr:nth-child(16) {  /* water line */
  border-bottom: 1px dashed #87cdf5;
}

#scoreboard table a {
  text-decoration: none;
  color: #fff;
}

#scoreboard table a:hover {
  text-decoration: none;
  color: #fdcf1a;
}

#scores_expand {
  display: block;
  width: 100%;
  text-align: right;
  color: #fdcf1a;
  font-size: 0.7em;
  font-weight: bold;
  padding: 2px;
  cursor: pointer;
  margin-top: -18px !important;
  border-top: 1px dashed #fdcf1a;
}


/* challenge leaderboard */

#leaderboard ul {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

#leaderboard li {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

#leaderboard img {
  display: block;
  background-color: #fff;
  width: 40px; height: 44px;  /* leave room for the status color */
  margin: 0; padding: 0;
}

#leaderboard a::before {  /* shadow highlight over the avatar */
  display: block;
  position: absolute;
  z-index: 1;
  height: 40px; width: 40px;
  bottom: 4px; right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.3) 100%);
  content: '';
}

#leaderboard a::after {  /* status symbol as alternative to color coding */
  display: block;
  position: absolute;
  z-index: 2;
  font-size: 14px;
  bottom: 2px; right: 1px;
  font-family: 'FontAwesome';
}

#leaderboard .waiting a::after {
  color: #ff0;
  content: '\f017';  /* fa-clock-o */
}

#leaderboard .accepted a::after {
  color: #0f0;
  content: '\f00c';  /* fa-check */
}

#leaderboard .rejected a::after {
  color: #f00;
  content: '\f00d';  /* fa-times */
}

#leaderboard .waiting img {
  border-bottom: 4px solid #ff0;
}

#leaderboard .accepted img {
  border-bottom: 4px solid #0f0;
}

#leaderboard .rejected img {
  border-bottom: 4px solid #f00;
}

#leaderboard [data-tooltip] {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

#leaderboard [data-tooltip]:before,
#leaderboard [data-tooltip]:after {
  visibility: hidden;
  opacity: 1;
  pointer-events: none;
}

#leaderboard [data-tooltip]:before {
  display: inline-block;
  position: absolute;
  bottom: 110%;
  left: 50%;
  margin-bottom: 5px;
  margin-left: -120px;
  padding: 6px;
  width: 240px;
  border-radius: 3px;
  background: #333;
  color: #eee;
  content: attr(data-tooltip);
  text-align: center;
  font-size: 0.75em;
  height: auto;
}

#leaderboard [data-tooltip]:after {  /* small arrow on the bottom */
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -7px;
  width: 0;
  border-top: 10px solid #333;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  content: " ";
  font-size: 0;
  line-height: 0;
}

#leaderboard [data-tooltip]:hover:before,
#leaderboard [data-tooltip]:hover:after {
  visibility: visible;
}

.placeholder {
  position: relative;
  height: 0;
  width: 100%;
}

.placeholder > * {
  position: absolute;
  left: 0;
  top: 0;
  width: 100% !important;
  height: 100% !important;
}

.placeholder iframe,
.placeholder img,
.placeholder canvas {
  border: 4px solid #f4f4f4;
}

a.video::after {
  display: block;
  position: absolute;
  z-index: 2;
  font-size: 40px !important;
  bottom: 0; left: 20px;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'FontAwesome';
  text-shadow: 0 0 10px #000;
  content: '\f16a';  /* fa-youtube-play */
}

a.video:hover::after {
  color: rgba(255, 255, 255, 0.9);
}

.ratio_16_9 {
  padding-top: 56.25%;
}

.ratio_16_10 {
  padding-top: 62.5%;
}

.ratio_4_3 {
  padding-top: 75%;
}

.ratio_2_1 {
  padding-top: 50%;
}

header .countdown_container {
  font-size: 12px;
  color: #fff;
  padding: 10px;
  margin: 2em 0 0 0;
  border: 3px solid #fff;
  text-align: center;
  min-height: 46px;
  font-family: 'Press Start 2P', sans-serif;
  background: #4fba49;
  text-shadow: 0 0 2px #4fba49;  /* fix rendering issue in chrome */
}

header .countdown_text {
  line-height: 2em;
}

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

.loading {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.25ch;
  margin-top: -0.4em;
  line-height: 0.5em;
  padding: 0.5em 0;
}

.loading span {
  animation-name: blink;
  animation-duration: 1.4s;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.loading span:nth-child(2) {
  animation-delay: .2s;
}

.loading span:nth-child(3) {
  animation-delay: .4s;
}

.attention {
  color: #fff;
  background: #4fba49;
  padding: 0.5em 1ch;
  margin: -0.5em auto 2em auto;
  width: 90%;
  border: 3px solid #fff;
  font-size: 18px;
  font-family: 'VT323', sans-serif;
  font-weight: normal;
  letter-spacing: 0.25px;
  line-height: 1em;
  text-align: center;
}

.attention a {
  color: #fff;
}

.attention.orange {
  background: #f80;
}

.attention.green {
  background: #4fba49;
}

.attention.red {
  background: #ea282e;
}

.signature {
  display: block;
  font-family: 'Overpass Mono', monospace;
  font-size: 0.8em;
  letter-spacing: -0.5px;
}

.signature::before {
  display: block;
  content: '--';
}

.signature a {
  color: inherit !important;
  text-decoration: none;
  border-bottom: 1px dashed #88c8ec;
}

.signature a:hover {
  border-bottom: 1px solid #fdcf1a;
}

/* columnar front page */
@media (min-width: 1200px) {
  .wide {
    max-width: 1200px;
  }

  footer .wide {
    margin: 0 auto;
    padding: 0 1rem;
    max-width: 1128px;
  }

  .columns {
    display: flex;
  }

  .column {
    margin: 0 36px;
  }

  .column.left {
    order: 1;
    flex-basis: 50%;
  }

  .column.right {
    order: 2;
    flex-basis: 50%;
  }

  /* images perceptually aligned to the text's right ragged edges */
  .column .placeholder {
    width: auto;
    margin-right: 4px;
  }

  /* align with a left column containing a more important title */
  #main_content .column.right h3.optional:first-child {
    display: block;
    visibility: hidden;
  }

  .index_page header {
    margin-bottom: 16px;
  }

  .attention {
    width: 80%;
  }
}

/* when margins stop being real close to content */
@media (min-width: 768px) {
  header h3 {
    margin-left: -20px;
    margin-right: -20px;
  }

  footer .logos {
    margin-left: 1px;
  }
}

/* mobile front page */
@media (max-width: 580px) {
  header h1 img {
    height: 60px;
  }

  header h2 {
    font-size: 24px;
  }

  header .countdown_container {
    font-size: 10px;
  }

  footer .archive,
  footer .date {
    font-size: 0.8em;
  }

  #challenge_list li {
    margin: 55px 0;
  }

  footer .logos {
    font-size: 30px;  /* base size for the logos */
  }
}

/* too narrow for some elements */
@media (max-width: 500px) {
  .optional {
    display: none;
  }
}
