/* iPhone Home Screen (Scene 0) */
.scene-home {
  background: #000;
  overflow: hidden;
  z-index: 1;
}

.scene-home.active {
  z-index: 2;
}

/* Status bar всегда поверх home screen */
.phone-screen:has(.scene-home.active) .iphone-status-bar {
  z-index: 50;
  color: #fff;
}

.home-wallpaper {
  position: absolute;
  inset: -8%;
  background: center/cover no-repeat;
  transform: scale(1.06);
  transition: transform 0.6s ease, filter 0.55s ease;
  will-change: transform, filter;
}

/* TG: обои без референс-скриншота (там были вшиты иконки) */
.scene-home[data-wallpaper="tg"] .home-wallpaper {
  background-image: none;
  background-color: #1a2420;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, transparent 40%, rgba(0, 0, 0, 0.45) 100%),
    radial-gradient(ellipse 90% 55% at 72% 18%, rgba(90, 120, 140, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 25% 75%, rgba(30, 50, 40, 0.7) 0%, transparent 50%),
    linear-gradient(155deg, #4a5f6b 0%, #2a3d35 38%, #141f18 72%, #0c1210 100%);
}

.scene-home[data-wallpaper="vk"] .home-wallpaper {
  background-image: url('assets/home-wallpaper-vk.png');
}

.home-wallpaper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, transparent 18%, transparent 72%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

.home-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 50px 20px 0;
  box-sizing: border-box;
  transition: filter 0.45s ease, opacity 0.45s ease;
}

.scene-home.is-launching .home-content {
  filter: blur(14px);
  opacity: 0.55;
}

.scene-home.is-launching .home-wallpaper {
  filter: blur(18px) brightness(0.75);
  transform: scale(1.1);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 14px;
  padding: 8px 4px 0;
  max-width: 100%;
}

.home-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  padding: 0;
  cursor: default;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.home-app--decoy {
  pointer-events: none;
}

.home-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 12.5px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.32),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
  transform-origin: center center;
}

.home-app.is-tapping .home-app-icon {
  transform: scale(1.2);
}

.home-app-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-app-badge {
  position: absolute;
  top: -4px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.home-app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

.home-app-icon--telegram {
  background: linear-gradient(145deg, #2aabee 0%, #229ed9 100%);
  padding: 0;
  overflow: hidden;
}

.home-app-icon--telegram svg {
  width: 34px;
  height: 34px;
}

.home-app-icon--vk {
  background: #0077ff;
  padding: 0;
  overflow: hidden;
}

.home-app-icon--vk svg {
  width: 36px;
  height: 36px;
}

.home-spacer {
  flex: 1;
  min-height: 8px;
}

.home-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-bottom: 10px;
}

.home-pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  align-self: center;
  margin-bottom: 14px;
  padding: 5px 11px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.home-page-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.home-page-dot.is-active {
  background: #fff;
  transform: scale(1.05);
}

.home-dock-wrap {
  flex-shrink: 0;
  padding: 0 12px 2px;
}

.home-dock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  column-gap: 0;
  padding: 11px 8px 12px;
  border-radius: 26px;
  background: rgba(120, 120, 128, 0.32);
  backdrop-filter: blur(28px) saturate(1.65);
  -webkit-backdrop-filter: blur(28px) saturate(1.65);
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
  transition: filter 0.45s ease, opacity 0.45s ease;
}

.scene-home.is-launching .home-dock {
  filter: blur(10px);
  opacity: 0.5;
}

.home-dock-app {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  pointer-events: none;
}

.home-dock-icon {
  width: 52px;
  height: 52px;
  border-radius: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  background: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.home-dock-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
  image-rendering: -webkit-optimize-contrast;
}

.home-dock-badge {
  position: absolute;
  top: -5px;
  right: calc(50% - 30px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

/* App launch zoom overlay */
.home-launch-zoom {
  position: absolute;
  z-index: 55;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.12s ease,
    width 0.58s cubic-bezier(0.32, 0.72, 0, 1),
    height 0.58s cubic-bezier(0.32, 0.72, 0, 1),
    left 0.58s cubic-bezier(0.32, 0.72, 0, 1),
    top 0.58s cubic-bezier(0.32, 0.72, 0, 1),
    border-radius 0.58s cubic-bezier(0.32, 0.72, 0, 1);
}

.home-launch-zoom.is-visible {
  opacity: 1;
  visibility: visible;
}

.home-launch-zoom-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  overflow: hidden;
}

.home-launch-zoom .home-app-icon {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.phone-screen.is-app-launching {
  overflow: hidden;
}
