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

/* Animated sparkling stars background */
body {
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: 'Helvetica', sans-serif;
  overflow: hidden;
  position: relative;
}

/* Animated stars */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 100 100"%3E%3Ccircle cx="10" cy="10" r="1" fill="%23ff00ff" /%3E%3Ccircle cx="50" cy="50" r="1.2" fill="%23ff00ff" /%3E%3Ccircle cx="70" cy="30" r="1" fill="%23ff00ff" /%3E%3Ccircle cx="30" cy="60" r="1.3" fill="%23ff00ff" /%3E%3Ccircle cx="80" cy="20" r="0.9" fill="%23ff00ff" /%3E%3Ccircle cx="90" cy="80" r="1.1" fill="%23ff00ff" /%3E%3C/svg%3E') repeat;
  animation: starsAnimation 10s infinite linear;
}

@keyframes starsAnimation {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}


.iphone {
  width: 320px;
  height: 568px;
  background-color: #fff;
  border-radius: 25px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
  border: 3px solid #333;
}

.screen {
  width: 100%;
  height: 100%;
  background-color: #000;  
  position: relative;
  border-radius: 20px;
  background-image: url('');  
  background-size: cover;
  background-position: center;
}


.top-bar {
  height: 25px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
}

.signal {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.signal-bars {
  height: 2px;
  width: 3px;
  background-color: #fff;
  margin: 1px 0;
}

.wifi {
  display: flex;
  margin-left: 5px;
}

.wifi-icon {
  width: 16px;
  height: 16px;
  position: relative;
}

.wifi-bar {
  background-color: #fff;
  height: 3px;
  width: 10px;
  margin: 2px;
  position: absolute;
  top: 0;
}

.wifi-bar:nth-child(1) {
  width: 16px;
  top: -3px;
}

.wifi-bar:nth-child(2) {
  width: 12px;
  top: 3px;
}

.wifi-bar:nth-child(3) {
  width: 8px;
  top: 8px;
}

.time {
  font-size: 12px;
}

.battery {
  display: flex;
  align-items: center;
}

.battery-icon {
  width: 18px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 2px;
  position: relative;
}

.battery-level {
  width: 80%;
  height: 100%;
  background-color: #00FF00;
  border-radius: 2px;
}

.battery-level-text {
  font-size: 12px;
  margin-left: 5px;
}

.home-screen {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 20px;
}

.app {
  width: 70px;
  text-align: center;
  margin: 5px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.app img {
  width: 50px;
  height: 50px;
}

.app p {
  font-size: 12px;
  color: #fff;
  margin-top: 5px;
}

.bottom-bar {
  height: 60px;
  background-color: #333;
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-button {
  width: 60px;
  height: 60px;
  background-color: #fff;
  border-radius: 30px;
  cursor: pointer;
  border: 3px solid #333;
  transition: transform 0.1s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-button img {
  width: 30px;
  height: 30px;
}

.home-button:active {
  transform: scale(0.9);
}

.snake-game {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
  width: 280px;
  height: 320px;
  text-align: center;
}

button {
  padding: 10px 20px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 20px;
}

button:hover {
  background-color: #555;
}

canvas {
  border: 2px solid #333;
  margin-top: 20px;
  width: 100%;
  height: 200px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: transparent;
  border: none;
  font-size: 20px;
  color: #333;
  cursor: pointer;
}

.close-btn:hover {
  color: red;
}

.restart-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 2;
}

.restart-button:hover {
  background-color: #555;
}


/* Music player layout settings */
.music-player {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
  width: 280px;
  height: 180px;
  text-align: center;
}

.music-info {
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 10px;
}

#song-title {
  font-size: 16px;
  color: #333;
}

.music-player audio {
  width: 100%;
  margin-top: 10px;
}

.controls {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.controls button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.controls img {
  width: 25px;
  height: 25px;
}

.home-button img {
  width: 30px;
  height: 30px;
}

.home-button:active {
  transform: scale(0.9);
}

.snake-game {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
  width: 280px;
  height: 320px;
  text-align: center;
}

.close-btn {
  display: none;
}


/* Styles for the photo gallery */
.photos-gallery {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  z-index: 2;
  width: 280px;  
  height: 300px; 
  text-align: center;
  overflow: hidden;
}

.photo-display {
  width: 100%;
  height: 200px;  
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.gallery-controls {
  position: absolute;
  bottom: 20px;  
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  width: 100%; 
  padding: 0 20px;
}

.gallery-controls button {
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  padding: 10px 15px;
  transition: background-color 0.3s;
  flex: 1; 
  margin: 0 10px; 
}

.gallery-controls button:hover {
  background-color: #555;
}


.messages-modal {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  z-index: 3;
  width: 280px;
  height: 320px;
  text-align: center;
  overflow: hidden;
}

.messages-header {
  background-color: #333;
  color: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messages-header h3 {
  margin: 0;
}

.messages-body {
  padding: 10px;
  height: 200px;
  overflow-y: auto;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.message {
  padding: 8px 12px;
  margin: 5px 0;
  border-radius: 12px;
  max-width: 80%;
}

.message.received {
  background-color: #e5e5e5;
  align-self: flex-start;
}

.message.sent {
  background-color: #d1f7c4;
  align-self: flex-end;
}

.messages-footer {
  display: flex;
  align-items: center;
  border-top: 1px solid #ccc;
  padding: 5px;
  background-color: #f1f1f1;
}

#message-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px;
  margin-right: 5px;
}

.messages-footer button {
  padding: 5px 10px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.messages-footer button:hover {
  background-color: #555;
}
