/* 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%;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  transition: background 1.2s ease-in-out;
}

.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;
}

body.inverted .runner-canvas {
  filter: invert(100%);
}

/* Authentication Screen & Visual Distinction */
#auth-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Open Sans', sans-serif;
  z-index: 100;
}

.auth-container {
  display: flex;
  flex-direction: row;
  gap: 30px;
  max-width: 850px;
  width: 90%;
  perspective: 1000px;
}

.auth-panel {
  flex: 1;
  padding: 35px 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.auth-panel:hover {
  transform: translateY(-5px);
}

/* Distinct color accents */
/* Login Card: Accented in Indigo */
.login-panel {
  border-top: 6px solid #4f46e5;
  box-shadow: 0 15px 35px rgba(79, 70, 229, 0.1);
}

.login-panel .header-icon {
  color: #4f46e5;
}

.login-panel .btn-submit {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.login-panel .btn-submit:hover {
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

/* Signup Card: Accented in Emerald */
.signup-panel {
  background: #fcfdfc;
  border-top: 6px solid #059669;
  box-shadow: 0 15px 35px rgba(5, 150, 105, 0.08);
}

.signup-panel .header-icon {
  color: #059669;
}

.signup-panel .btn-submit {
  background: linear-gradient(135deg, #10b981, #059669);
}

.signup-panel .btn-submit:hover {
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
}

.panel-header {
  text-align: center;
  margin-bottom: 25px;
}

.header-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.panel-header h2 {
  font-size: 1.5rem;
  margin: 0 0 5px;
  color: #1f2937;
  font-weight: 700;
}

.panel-header p {
  font-size: 0.875rem;
  margin: 0;
  color: #6b7280;
}

/* Form Styling */
.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9ca3af;
  pointer-events: none;
}

.input-group input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  color: #1f2937;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: currentColor;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
}

.login-panel .input-group input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.signup-panel .input-group input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.btn-submit {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Feedback messages */
.message {
  margin-top: 15px;
  font-size: 0.85rem;
  text-align: center;
  min-height: 20px;
  font-weight: 500;
}

.message.success {
  color: #059669;
}

.message.error {
  color: #dc2626;
}

/* Game Scoreboard Header Top Bar */
#game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 15px auto;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  font-family: 'Open Sans', sans-serif;
  box-sizing: border-box;
}

.user-info {
  display: flex;
  gap: 20px;
  align-items: center;
}

.user-name, .user-score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: #374151;
  font-weight: 600;
}

.header-icon-inline {
  width: 16px;
  height: 16px;
  color: #4f46e5;
}

.user-score .header-icon-inline {
  color: #d97706; /* Trophy Gold */
}

.btn-logout {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
  background: transparent;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.btn-icon-inline {
  width: 14px;
  height: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
  }
}

@keyframes scaleUp {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

