/* 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. */

:root {
  --ink: #141413;
  --paper: #faf9f5;
  --sand: #e8e6dc;
  --accent: #d97757;
  --blue: #6a9bcc;
  --green: #788c5d;
}

@font-face {
  font-family: "Kalam";
  src: url("assets/fonts/kalam-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kalam";
  src: url("assets/fonts/kalam-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

body {
  position: relative;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(217, 119, 87, 0.08), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(106, 155, 204, 0.08), transparent 45%),
    linear-gradient(0deg, rgba(20, 20, 19, 0.04), rgba(20, 20, 19, 0.04)),
    repeating-linear-gradient(45deg, rgba(20, 20, 19, 0.02) 0 2px, transparent 2px 6px);
  color: var(--ink);
  font-family: "Kalam", "Comic Sans MS", "Chalkboard SE", "Segoe Print", cursive;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
}

.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;
  display: none;
}

.hidden {
  display: none;
}

#messageBox.hidden {
  display: none !important;
}

.rain-layer {
  position: absolute;
  inset: -30% -10% 0 -10%;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    120deg,
    rgba(20, 20, 19, 0.32) 0,
    rgba(20, 20, 19, 0.32) 1.5px,
    rgba(250, 249, 245, 0) 1.5px,
    rgba(250, 249, 245, 0) 18px
  );
  background-size: 18px 18px;
  animation: rain 0.4s linear infinite;
  z-index: 1;
  mix-blend-mode: multiply;
}

.rain-back {
  opacity: 0.18;
  animation-duration: 12s;
  z-index: 1;
}

.rain-front {
  opacity: 0.28;
  animation-duration: 8s;
  z-index: 2;
}

@keyframes rain {
  from { background-position: 0 -200px; }
  to { background-position: -120px 200px; }
}

.top-bar {
  width: min(920px, 92vw);
  margin: 26px auto 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-mark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.brand-sub {
  font-size: 13px;
  color: #6f6b5f;
}

.controls-hint {
  font-size: 14px;
  color: #6f6b5f;
  text-align: right;
}

#messageBox.sendmessage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 245, 0.82);
  backdrop-filter: blur(2px);
  z-index: 5;
}

.msg-card {
  max-width: 340px;
  background: #fdfbf4;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 22px 24px;
  text-align: center;
  box-shadow: 6px 8px 0 #d7d3c4;
}

.msg-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0.4px;
}

.msg-card p {
  margin: 0 0 14px;
  font-size: 14px;
  color: #5b574e;
}

#startBtn {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

#startBtn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

#startBtn:active {
  transform: translateY(1px);
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .controls-hint {
    text-align: left;
  }
}


/* Offline page */

.offline .interstitial-wrapper {
  position: relative;
  color: var(--ink);
  font-size: 1em;
  line-height: 1.55;
  margin: 12px auto 36px;
  width: min(920px, 94vw);
  height: 280px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: #fdfbf4;
  box-shadow: 6px 8px 0 #d7d3c4;
  overflow: hidden;
}

.offline .runner-container {
  height: 150px;
  max-width: 600px;
  overflow: hidden;
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: min(92vw, 600px);
}

.offline .runner-canvas {
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 4;
  width: min(92vw, 600px);
}

.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;
}
