/* Copyright 2013 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

html, body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

.icon {
  -webkit-user-select: none;
  user-select: none;
  display: inline-block;
}

.icon-offline {
  content: -webkit-image-set( url(assets/default_100_percent/100-error-offline.png) 1x, url(assets/default_200_percent/200-error-offline.png) 2x);
  position: relative;
}

.hidden {
  display: none;
}


/* Offline page */

.offline .interstitial-wrapper {
  color: #2b2b2b;
  font-size: 1em;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 600px;
  padding-top: 100px;
  width: 100%;
}

.offline .runner-container {
  height: 150px;
  max-width: 600px;
  overflow: hidden;
  position: absolute;
  top: 35px;
  width: 44px;
}

.offline .runner-canvas {
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 2;
}

.offline .controller {
  background: rgba(247, 247, 247, .1);
  height: 100vh;
  left: 0;
  position: absolute;
  top: 0;
  width: 100vw;
  z-index: 1;
}

#offline-resources {
  display: none;
}

@media (max-width: 420px) {
  .suggested-left > #control-buttons, .suggested-right > #control-buttons {
    float: none;
  }
  .snackbar {
    left: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
  }
}

@media (max-height: 350px) {
  h1 {
    margin: 0 0 15px;
  }
  .icon-offline {
    margin: 0 0 10px;
  }
  .interstitial-wrapper {
    margin-top: 5%;
  }
  .nav-wrapper {
    margin-top: 30px;
  }
}

@media (min-width: 600px) and (max-width: 736px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: 420px) and (max-width: 736px) and (min-height: 240px) and (max-height: 420px) and (orientation:landscape) {
  .interstitial-wrapper {
    margin-bottom: 100px;
  }
}

@media (min-height: 240px) and (orientation: landscape) {
  .offline .interstitial-wrapper {
    margin-bottom: 90px;
  }
  .icon-offline {
    margin-bottom: 20px;
  }
}

@media (max-height: 320px) and (orientation: landscape) {
  .icon-offline {
    margin-bottom: 0;
  }
  .offline .runner-container {
    top: 10px;
  }
}

@media (max-width: 240px) {
  .interstitial-wrapper {
    overflow: inherit;
    padding: 0 8px;
  }
}

.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode #buttons,
.arcade-mode #main-content {
  opacity: 0;
  overflow: hidden;
}

.arcade-mode .interstitial-wrapper {
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .runner-container {
  left: 0;
  margin: auto;
  right: 0;
  transform-origin: top center;
  transition: transform 250ms cubic-bezier(0.4, 0, 1, 1) 400ms;
  z-index: 2;
}

/* ---- Leaderboard ---- */

.lb-hidden {
  display: none !important;
}

#leaderboard {
  margin: 20px auto 40px;
  max-width: 360px;
  width: 100%;
  background: #f7f7f7;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  font-family: 'Open Sans', sans-serif;
  color: #2b2b2b;
  box-sizing: border-box;
}

#leaderboard .lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
}

#leaderboard .lb-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#leaderboard .lb-small {
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
}

#leaderboard ol {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

#leaderboard li {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 14px;
}

#leaderboard li:nth-child(odd) {
  background: #fbfbfb;
}

#leaderboard .lb-rank {
  width: 24px;
  flex: 0 0 24px;
  color: #888;
  font-variant-numeric: tabular-nums;
}

#leaderboard .lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

#leaderboard .lb-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#leaderboard .lb-empty {
  color: #888;
  font-style: italic;
  justify-content: center;
}

/* ---- Score submission overlay ---- */

#score-submit {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#score-submit .lb-panel {
  background: #fff;
  padding: 24px 28px;
  border-radius: 6px;
  width: 300px;
  max-width: 90vw;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  color: #2b2b2b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

#score-submit h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

#score-submit p {
  margin: 0 0 16px;
  font-size: 15px;
}

#score-submit #lb-final-score {
  font-weight: 700;
  font-size: 18px;
  color: #359697;
}

#score-submit .lb-hint {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}

#score-submit input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 16px;
  font-family: inherit;
}

#score-submit input:focus {
  outline: none;
  border-color: #359697;
}

#score-submit .lb-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

#score-submit button,
#leaderboard button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  background: #359697;
  color: #fff;
}

#score-submit button:hover,
#leaderboard button:hover {
  background: #2d7d7e;
}

#score-submit button:disabled {
  background: #9bb8b8;
  cursor: default;
}

#score-submit .lb-secondary,
#leaderboard .lb-secondary {
  background: #e0e0e0;
  color: #2b2b2b;
}

#score-submit .lb-secondary:hover,
#leaderboard .lb-secondary:hover {
  background: #cfcfcf;
}
