/* ===== Apps back panel ===== */
.flip-container.show-apps {
  width: var(--card-width-apps);
}

.flip-container.show-apps .back-apps {
  display: block;
}

.back-apps {
  background: transparent;
  box-shadow: none;
  border-radius: 20px;
  min-height: 700px;
}

#phone-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 0 20px;
  height: 680px;
  overflow: hidden;
}

#phone-body {
  position: relative;
  width: 360px;
  height: 660px;
  background: linear-gradient(150deg, #44464a 0%, #25262a 22%, #141519 55%, #25262a 88%, #44464a 100%);
  border-radius: 54px;
  padding: 13px;
  box-shadow:
    inset 0 0 3px 2px rgba(255,255,255,0.22),   /* polished inner edge */
    0 3px 8px rgba(0,0,0,0.22),                  /* contact shadow */
    0 14px 28px rgba(0,0,0,0.20),                /* mid falloff */
    0 4px 20px rgba(0,0,0,0.6);                /* soft ambient */
  display: flex;
  flex-direction: column;
}

/* Side buttons */
#phone-body::before {   /* power button (right) */
  content: "";
  position: absolute;
  right: -2px;
  top: 188px;
  width: 3px;
  height: 86px;
  background: linear-gradient(to right, #1a1b1e, #54565b);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
#phone-body::after {    /* volume rocker (left) */
  content: "";
  position: absolute;
  left: -2px;
  top: 168px;
  width: 3px;
  height: 124px;
  background: linear-gradient(to left, #1a1b1e, #54565b);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Dynamic Island */
#phone-notch {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 106px;
  height: 30px;
  background: #000;
  border-radius: 16px;
  z-index: 6;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#phone-notch::after {   /* camera lens */
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a4d63 0%, #0b0f15 65%);
  box-shadow: inset 0 0 1px rgba(120,160,200,0.7);
}

#phone-screen {
  position: relative;
  flex: 1;
  background: url("../pic/cellphone-background.jpg") center/cover no-repeat;
  border-radius: 42px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#phone-screen::before {  /* glass reflection */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 22%, rgba(255,255,255,0) 45%);
  pointer-events: none;
  z-index: 5;
}

#phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px 6px;
  color: black;
  font-size: 14px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

#app-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 16px;
  row-gap: 28px;
  padding: 40px 16px 20px;
  align-content: start;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.app-icon img {
  width: 85px;
  height: 85px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.app-icon-placeholder {
  width: 85px;
  height: 85px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.app-icon span {
  color: white;
  font-size: 10px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

#phone-footer {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45);
  padding: 0;
}

#phone-home {
  position: absolute;
  bottom: 21px;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 5px;
  background: rgba(0,0,0,0.55);
  border-radius: 3px;
  z-index: 6;
}
