/* 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;
}

/* ==========================================================================
   Score-Based Background Themes (100pt Intervals)
   Sequence: Default -> Sunset -> Night -> City -> Desert -> Space -> Rain -> Snow
   ========================================================================== */

body, html {
  transition: background 1.2s ease-in-out, color 0.6s ease;
  min-height: 100vh;
  overflow: hidden;
}

/* Theme 0: 기본 (Default) */
body.theme-default {
  background: linear-gradient(135deg, #f7f9fa 0%, #e4e9ed 100%);
  color: #333333;
}

/* Theme 1: 노을 (Sunset) */
body.theme-sunset {
  background: linear-gradient(180deg, #2b1055 0%, #7597de 35%, #fe9b7f 70%, #f9d423 100%);
  color: #ffffff;
}

/* Theme 2: 밤 (Night) */
body.theme-night {
  background: linear-gradient(180deg, #090a0f 0%, #111e38 60%, #1b2744 100%);
  color: #ffffff;
}

/* Theme 3: 도시 (City) */
body.theme-city {
  background: linear-gradient(180deg, #0d0221 0%, #190a38 50%, #32104d 80%, #681859 100%);
  color: #00f0ff;
}

/* Theme 4: 사막 (Desert) */
body.theme-desert {
  background: linear-gradient(180deg, #ff8c42 0%, #fcaf3b 40%, #e67e22 75%, #d35400 100%);
  color: #2c3e50;
}

/* Theme 5: 우주 (Space) */
body.theme-space {
  background: radial-gradient(circle at 50% 30%, #1a0b2e 0%, #08020f 70%, #020005 100%);
  color: #ffffff;
}

/* Theme 6: 비 (Rain) */
body.theme-rain {
  background: linear-gradient(180deg, #1f2a38 0%, #2c3e50 60%, #1a252f 100%);
  color: #e0e6ed;
}

/* Theme 7: 눈 (Snow) */
body.theme-snow {
  background: linear-gradient(180deg, #d4e6f1 0%, #eaf2f8 50%, #f4f6f7 100%);
  color: #1b4f72;
}

/* Sprite Filter for Dark / Light Background Contrast */
body.theme-night .runner-canvas,
body.theme-city .runner-canvas,
body.theme-space .runner-canvas,
body.theme-rain .runner-canvas,
body.theme-sunset .runner-canvas {
  filter: invert(90%) drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
  transition: filter 0.6s ease;
}

body.theme-default .runner-canvas,
body.theme-desert .runner-canvas,
body.theme-snow .runner-canvas {
  filter: none;
  transition: filter 0.6s ease;
}

/* Background Particle FX Canvas */
#bg-fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Theme Badge */
.theme-badge {
  position: fixed;
  top: 20px;
  right: 24px;
  padding: 8px 18px;
  border-radius: 30px;
  font-family: 'Open Sans', 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-badge:hover {
  transform: scale(1.05);
}

/* Theme Unlock Toast Notification */
.theme-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px) scale(0.9);
  opacity: 0;
  padding: 12px 28px;
  border-radius: 40px;
  font-family: 'Open Sans', 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(255, 65, 108, 0.5);
  z-index: 1001;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

.theme-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ==========================================================================
   User Profile Navigation Bar (Top Right)
   ========================================================================== */
.profile-bar {
  position: fixed;
  top: 16px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge, .score-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f8fafc;
}

.user-badge svg {
  color: #38bdf8;
  width: 18px;
  height: 18px;
}

.score-badge svg {
  color: #f59e0b;
  width: 18px;
  height: 18px;
}

.score-badge strong {
  color: #fbbf24;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn svg {
  width: 15px;
  height: 15px;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

/* ==========================================================================
   Mandatory Authentication Overlay & Distinct Login/Register Cards
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: all 0.4s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.2rem;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  font-family: 'Inter', sans-serif;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 1. Login Theme (Deep Slate/Indigo) */
.card-login-theme {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 40px rgba(14, 165, 233, 0.2), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.login-icon-glow {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.btn-login-submit {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #0369a1, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

/* 2. Sign Up Theme (Emerald/Teal Glassmorphism) */
.card-register-theme {
  background: linear-gradient(145deg, #064e3b, #0f766e);
  border: 1px solid rgba(45, 212, 191, 0.4);
  box-shadow: 0 0 40px rgba(20, 184, 166, 0.25), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.register-icon-glow {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.btn-register-submit {
  background: linear-gradient(135deg, #10b981, #0d9488);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-register-submit:hover {
  background: linear-gradient(135deg, #059669, #0f766e);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.auth-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #ffffff;
}

.auth-icon-badge svg {
  width: 28px;
  height: 28px;
}

.auth-header h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.auth-header p {
  color: #94a3b8;
  font-size: 0.875rem;
}

.input-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  width: 18px;
  height: 18px;
  transition: color 0.2s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.input-wrapper input:focus + .field-icon,
.input-wrapper input:focus ~ .field-icon {
  color: #38bdf8;
}

.auth-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  text-align: center;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25 ease;
  margin-top: 0.5rem;
}

.auth-switch-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.switch-link {
  background: none;
  border: none;
  color: #38bdf8;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.card-register-theme .switch-link {
  color: #2dd4bf;
}

.switch-link:hover {
  color: #ffffff;
}




