* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background: #fff;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  position: relative;
  perspective: 1200px;
  transform-style: preserve-3d;
  min-height: 100vh;
  touch-action: manipulation;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Стили для кнопки смены темы (левый верхний угол) */
.ios-theme-toggle-wrapper {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  z-index: 1000;
  cursor: pointer;
}

.ios-theme-icon {
  width: 44px;
  height: 44px;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #1d1d1f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ios-theme-icon:active {
  transform: scale(0.95);
}

/* Стили для значка уведомления iOS в правом верхнем углу */
.ios-notification-badge-wrapper {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 1000;
  cursor: pointer;
}

.ios-bell-icon {
  width: 44px;
  height: 44px;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #1d1d1f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
  position: relative;
}

.ios-bell-icon:active {
  transform: scale(0.95);
}

.notification-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Выпадающее окно уведомления */
.ios-notification-popup {
  position: absolute;
  top: 56px;
  right: 0;
  width: 300px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
  color: inherit;
  display: block;
}

.ios-notification-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #86868b;
  margin-bottom: 6px;
}

.notif-app-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.notif-body h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
}

.notif-body p {
  margin: 0;
  font-size: 13px;
  color: #424245;
  line-height: 1.4;
}

/* Главный блок по центру */
main {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  will-change: transform;
  transform-style: preserve-3d;
  width: 100%;
  padding: 0 20px;
}

.title-text {
  font-size: clamp(32px, 7vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.social-icons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.social-icons a,
.discord-container {
  color: inherit;
  font-size: clamp(22px, 4vw, 28px);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icons a:hover,
.discord-container:hover {
  opacity: 0.6;
  transform: translateY(-2px);
}

.discord-container {
  position: relative;
}

.ios-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ios-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
}

.discord-container:hover .ios-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Фиксированный плеер */
.spotify-fixed-corner {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: 24px;
  width: 300px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

footer {
  position: fixed;
  left: 0;
  bottom: 4px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: -0.01em;
  pointer-events: none;
  color: #86868b;
  z-index: 90;
}


/* ТЕМНАЯ ТЕМА */
body.dark-theme {
  background: #000;
  color: #fff;
}

body.dark-theme .ios-theme-icon,
body.dark-theme .ios-bell-icon {
  background: rgba(40, 40, 42, 0.8);
  color: #f5f5f7;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

body.dark-theme .ios-notification-popup {
  background: rgba(28, 28, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark-theme .notif-body h4 {
  color: #f5f5f7;
}

body.dark-theme .notif-body p {
  color: #a1a1a6;
}

body.dark-theme .notification-count {
  border-color: #000;
}


/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 768px) {
  .title-text {
    font-size: 11vw;
    white-space: normal;
  }

  .social-icons {
    margin-top: 16px;
    gap: 22px;
  }

  .ios-notification-popup {
    width: 260px;
    right: -10px;
  }

  .spotify-fixed-corner {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: 320px;
  }

  main {
    top: 42%;
  }

  footer {
    bottom: 6px;
    font-size: 10px;
  }
}