@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000000;
  color: #e0e0e0;
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(200, 200, 200, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(150, 150, 150, 0.06) 0%, transparent 50%);
  animation: bgShift 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes bgShift {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: float 20s infinite linear;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }

  50% {
    transform: translateY(-100px) translateX(50px);
    opacity: 0.6;
  }
}

.container {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 64px - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  padding-top: calc(64px + 2rem);
  padding-bottom: calc(80px + 2rem);
}

#atc-online {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 0;
  z-index: 100;
}

.marquee-container {
  height: 2.2em;
  overflow: hidden;
  font-size: 0.95rem;
  user-select: none;
}

.marquee {
  position: absolute;
  white-space: nowrap;
  line-height: 2.2em;
  will-change: transform;
  pointer-events: none;
}

#info {
  position: fixed;
  top: 4.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  color: #a0a0a0;
  z-index: 200;
  transition: all 0.3s ease;
}

#info:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

main {
  text-align: center;
  max-width: 800px;
  width: 100%;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.3s forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-container {
  margin-bottom: 2rem;
}

#tilt-title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 50%, #888888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
  display: inline-block;
  animation: glow 3s ease-in-out infinite;
  cursor: default;
}

@keyframes glow {

  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
  }

  50% {
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.7));
  }
}

.subtitle {
  margin: 0.5rem 0 3rem;
  font-size: 1.1rem;
  color: #a0a0a0;
  font-weight: 300;
  letter-spacing: 0.05em;
  cursor: default;
}

.search-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s ease;
}

.search-container:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2);
}

form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

input[type="text"] {
  flex: 1;
  min-width: 280px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

input::placeholder {
  color: #666;
}

button[type="submit"] {
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  color: #000000;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transition: left 0.5s ease;
}

button[type="submit"]:hover::before {
  left: 100%;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.4);
}

#leaderboardBtn {
  padding: 0.9rem 2rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

#leaderboardBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-evenly;
  gap: 2rem;
  flex-wrap: wrap;
  z-index: 100;
}

footer p,
footer a {
  font-size: 0.9rem;
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #ffffff;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  opacity: 0;
  animation: popupExpand 0.3s forwards ease-out;
}

@keyframes popupExpand {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #000000;
  flex-shrink: 0;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

.user-info h2 {
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2rem;
  margin: 0;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.user-stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.2rem;
  transition: all 0.3s ease;
}

.user-stat-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.user-stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.user-stat-label {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.3rem;
}

.user-stat-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffffff;
}

.leaderboard-container {
  width: 100%;
}

.leaderboard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.leaderboard-header h2 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  background-clip: text;

  -webkit-text-fill-color: transparent;
  margin: 0 0 0.5rem 0;
}

.leaderboard-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.2rem 2rem;
  min-width: 180px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

.stat-label {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  background-clip: text;

  -webkit-text-fill-color: transparent;
}

.podium-section {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1rem;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
}

.podium-item:hover {
  transform: translateY(-5px);
}

.podium-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.podium-item.first .podium-avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 2.5rem;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
}

.podium-item.second .podium-avatar {
  background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
  color: #000;
  box-shadow: 0 0 30px rgba(192, 192, 192, 0.6);
}

.podium-item.third .podium-avatar {
  background: linear-gradient(135deg, #CD7F32, #B8732F);
  color: #000;
  box-shadow: 0 0 30px rgba(205, 127, 50, 0.6);
}

.podium-medal {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.podium-username {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.3rem;
  text-align: center;
}

.podium-time {
  font-size: 1rem;
  color: #aaa;
  font-weight: 600;
}

.podium-base {
  width: 120px;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 2px solid;
  margin-top: 0.5rem;
}

.podium-item.first .podium-base {
  height: 140px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.2), rgba(255, 179, 0, 0.1));
  border-color: rgba(255, 193, 7, 0.5);
}

.podium-item.second .podium-base {
  height: 110px;
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
  border-color: rgba(211, 211, 211, 0.5);
}

.podium-item.third .podium-base {
  height: 90px;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.1));
  border-color: rgba(218, 165, 32, 0.5);
}

.rank-number {
  font-size: 2rem;
  font-weight: 900;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  background-clip: text;

  -webkit-text-fill-color: transparent;
}

.leaderboard-list {
  max-height: 400px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
}

.leaderboard-list::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(5px);
}

.leaderboard-rank {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 50px;
  color: #888;
}

.leaderboard-user {
  flex: 1;
  text-align: left;
}

.leaderboard-username {
  font-weight: 600;
  color: #ffffff;
}

.leaderboard-time {
  font-weight: 600;
  color: #aaa;
  text-align: right;
}

.opt-in-info {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  color: #888;
  text-align: center;
}

.opt-in-info a {
  color: #fff;
  text-decoration: underline;
}

.history-section h3 {
  margin: 2rem 0 1rem;
  font-size: 1.3rem;
  color: #e0e0e0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  transition: all 0.3s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(5px);
}

.history-airport {
  font-weight: 600;
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.history-details {
  color: #888;
  font-size: 0.9rem;
}

.tippy-box[data-theme~='dark'] {
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #e0e0e0;
  font-size: 0.9rem;
  padding: 0.8rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.tippy-box[data-theme~='dark'] .tippy-arrow {
  color: rgba(10, 10, 10, 0.98);
}

#globalLoader {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#globalLoader.active {
  display: flex;
}

.loader-spinner,
.modal-loader {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.clippy-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 2;
  animation: slideInClippy 0.5s ease-out 1s forwards;
  opacity: 0;
}

@keyframes slideInClippy {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.clippy {
  width: 94px;
  height: 94px;
  align-self: flex-start;
  margin-top: 15px;
}

.bubble {
  width: 360px;
  background: linear-gradient(180deg, #fffed7, #fff8c6);
  border: 2px solid #d6d59a;
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
  position: relative;
  color: #111;
  line-height: 1.36;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.bubble p {
  margin: 0;
  font-size: 15px;
}

.top-dot {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.055);
}

.bubble::after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: -22px;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 22px solid #fff8c6;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.03));
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.06);
  background: white;
  transition: transform 0.08s ease;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
}

.btn:active {
  transform: translateY(1px);
}

.bubble {
  opacity: 0;
  transform-origin: bottom center;
  transform: translateY(20px) scaleX(0.18) scaleY(0.12);
}

.bubble.show {
  animation: clippyPopIn 420ms cubic-bezier(.2, 1.15, .3, 1) forwards;
}

@keyframes clippyPopIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scaleX(0.18) scaleY(0.12);
  }

  48% {
    transform: translateY(-12px) scaleX(1.28) scaleY(1.32);
    opacity: 1;
  }

  72% {
    transform: translateY(-4px) scaleX(0.92) scaleY(0.9);
  }

  100% {
    transform: translateY(0) scaleX(1) scaleY(1);
    opacity: 1;
  }
}

.bubble .bubble-text {
  display: inline-block;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn.primary {
  background: #2b73d6;
  color: white;
  border-color: #235fae;
}

.btn.hidden {
  display: none;
}

@media (max-width: 768px) {
  .clippy-container {
    bottom: 100px;
    right: 20px;
    left: 20px;
    align-items: center;
  }

  .bubble {
    width: 100%;
    max-width: 360px;
  }

  .clippy {
    align-self: center;
    margin-left: 0;
  }

  .bubble::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .podium-section {
    flex-direction: column;
    align-items: center;
  }

  .podium-item.first .podium-base,
  .podium-item.second .podium-base,
  .podium-item.third .podium-base {
    height: 120px;
  }
}