/* 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;
}

.home-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 24px;
  color: #333333;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease-in-out;
}

.home-btn:hover {
  background: #202124;
  color: #ffffff;
  border-color: #202124;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Theme Badge */
.theme-badge {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 24px;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #202124;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-badge.pop-animation {
  transform: scale(1.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Base Body Smooth Transition */
body {
  transition: background 1.2s ease, color 1.2s ease !important;
}

body .runner-canvas {
  transition: filter 1.2s ease;
}

/* 1. 기본 (Default) */
body.theme-default {
  background: #f7f7f7 !important;
  color: #333333;
}

/* 2. 노을 (Sunset) */
body.theme-sunset {
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 45%, #8a2387 100%) !important;
  background-attachment: fixed !important;
  color: #ffffff;
}
body.theme-sunset .runner-canvas {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}
body.theme-sunset .theme-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* 3. 밤 (Night) */
body.theme-night {
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%) !important;
  background-attachment: fixed !important;
  color: #ffffff;
}
body.theme-night .runner-canvas {
  filter: invert(0.92) drop-shadow(0 4px 12px rgba(255,255,255,0.2));
}
body.theme-night .theme-badge {
  background: rgba(15, 32, 39, 0.7);
  color: #e0e6ed;
  border-color: rgba(255, 255, 255, 0.2);
}

/* 4. 도시 (Cyber City) */
body.theme-city {
  background: linear-gradient(135deg, #11002c 0%, #3a0066 50%, #800080 100%) !important;
  background-attachment: fixed !important;
  color: #00ffff;
}
body.theme-city .runner-canvas {
  filter: invert(0.9) sepia(1) hue-rotate(250deg) saturate(3) drop-shadow(0 0 10px #ff00ff);
}
body.theme-city .theme-badge {
  background: rgba(17, 0, 44, 0.8);
  color: #00ffff;
  border-color: #ff00ff;
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.5);
}

/* 5. 사막 (Desert) */
body.theme-desert {
  background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%) !important;
  background-attachment: fixed !important;
  color: #4a2c00;
}
body.theme-desert .runner-canvas {
  filter: drop-shadow(0 4px 10px rgba(139, 69, 19, 0.3));
}
body.theme-desert .theme-badge {
  background: rgba(255, 255, 255, 0.85);
  color: #8b4513;
  border-color: #f7971e;
}

/* 6. 우주 (Space) */
body.theme-space {
  background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%) !important;
  background-attachment: fixed !important;
  color: #ffffff;
}
body.theme-space .runner-canvas {
  filter: invert(0.95) drop-shadow(0 0 12px rgba(0, 229, 255, 0.6));
}
body.theme-space .theme-badge {
  background: rgba(9, 10, 15, 0.8);
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.4);
}

/* 7. 비 (Rain) */
body.theme-rain {
  background: linear-gradient(135deg, #2c3e50 0%, #000000 100%) !important;
  background-attachment: fixed !important;
  color: #a1c4fd;
}
body.theme-rain .runner-canvas {
  filter: invert(0.85) hue-rotate(180deg) drop-shadow(0 4px 15px rgba(0, 191, 255, 0.4));
}
body.theme-rain .theme-badge {
  background: rgba(44, 62, 80, 0.8);
  color: #a1c4fd;
  border-color: rgba(161, 196, 253, 0.4);
}

/* 8. 눈 (Snow) */
body.theme-snow {
  background: linear-gradient(135deg, #83a4d4 0%, #b6fbff 100%) !important;
  background-attachment: fixed !important;
  color: #1c3b57;
}
body.theme-snow .runner-canvas {
  filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.8));
}
body.theme-snow .theme-badge {
  background: rgba(255, 255, 255, 0.9);
  color: #1c3b57;
  border-color: #83a4d4;
}

/* Top Floating Nav Bar */
.top-nav-bar {
  position: fixed;
  top: 15px;
  left: 15px;
  right: 15px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.top-nav-bar > * {
  pointer-events: auto;
}

.home-btn {
  position: static !important;
}

.theme-badge {
  position: static !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Auth Profile Bar */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
}

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-auth-trigger.login-theme {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-auth-trigger.register-theme {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-auth-trigger.rank-theme {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.btn-auth-trigger.logout-theme {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-auth-trigger:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.user-badge, .score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #333333;
}

.score-badge strong {
  color: #d97706;
}

/* Modals Overlay & Glass Container */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.glass-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 30px;
  font-family: 'Open Sans', sans-serif;
  color: #1e293b;
  overflow: hidden;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Auth Tabs Switcher */
.auth-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-tab.active-login {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.auth-tab.active-register {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Visually Distinct Header Themes */
.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 24px;
}

.login-badge {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.register-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.rank-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.auth-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.auth-header p {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
}

/* Auth Form Controls */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.95rem;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.form-group input:focus {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

#view-register .form-group input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.btn-submit {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.25s ease;
}

.login-btn {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.register-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-footer a {
  color: #6366f1;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#view-register .auth-footer a {
  color: #10b981;
}

/* Leaderboard List */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 15px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.95rem;
}

.leaderboard-rank {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.rank-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: #cbd5e1;
  color: #334155;
}

.rank-1 { background: #fef08a; color: #854d0e; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #fed7aa; color: #9a3412; }

.leaderboard-score {
  font-weight: 700;
  color: #d97706;
}

/* Pay Modal & Toss Payments Styles */
.pay-card {
  max-width: 440px;
  border-top: 4px solid #3b82f6;
}

.pay-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.pay-header {
  text-align: center;
  margin-bottom: 20px;
}

.pay-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin: 8px 0 4px;
}

.pay-header p {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

.pay-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.pay-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #334155;
}

.pay-feature-item svg {
  width: 18px;
  height: 18px;
  color: #10b981;
  flex-shrink: 0;
}

.pay-price-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px dashed #3b82f6;
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.price-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e40af;
}

.price-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1d4ed8;
}

.pay-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.pay-btn:hover {
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}

.paid-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

