:root {
  --phone-width: min(92vw, 400px);
  --phone-height: min(95vh, 840px);
  --glass: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "Inter", "SF Pro Display", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 15%, #6df8ff 0%, transparent 35%),
    radial-gradient(circle at 80% 10%, #9c80ff 0%, transparent 30%),
    radial-gradient(circle at 50% 85%, #ff8fdd 0%, transparent 30%),
    linear-gradient(145deg, #080b23, #0b173d 45%, #101c40);
  color: #f8fbff;
  padding: 2rem;
}

.scene {
  perspective: 1800px;
}

.iphone {
  width: var(--phone-width);
  height: var(--phone-height);
  border-radius: 52px;
  padding: 11px;
  background: linear-gradient(160deg, #1f2338, #0f1221 45%, #252c47);
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 2px 9px rgba(255, 255, 255, 0.08);
  transform: rotateX(6deg) rotateY(-8deg);
  position: relative;
}

.frame-shine {
  position: absolute;
  inset: 7px;
  border-radius: 45px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  padding: 1rem 1rem 2.25rem;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.3), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(171, 94, 255, 0.45), transparent 25%),
    linear-gradient(155deg, #0e2b52 2%, #4b2f86 45%, #171f38 100%);
}

.status-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.status-time {
  font-size: 0.92rem;
  font-weight: 650;
  padding-left: 0.35rem;
}

.island {
  width: 122px;
  height: 33px;
  border-radius: 18px;
  background: linear-gradient(165deg, #0b0b10, #1c1c22);
  box-shadow: inset 0 -1px 3px rgba(255, 255, 255, 0.08);
}

.status-icons {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-right: 0.35rem;
}

.signal,
.wifi {
  width: 15px;
  height: 11px;
  border: 2px solid #e6ebf8;
  border-top: none;
  border-radius: 0 0 3px 3px;
  opacity: 0.85;
}

.wifi {
  width: 14px;
  height: 10px;
  border-radius: 0 0 12px 12px;
}

.battery {
  width: 25px;
  height: 12px;
  border-radius: 3px;
  border: 1.8px solid #e6ebf8;
  padding: 1px;
  position: relative;
}

.battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 2px;
  height: 5px;
  border-radius: 1px;
  background: #e6ebf8;
}

.level {
  display: block;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, #77ffa3, #48cf74);
  border-radius: 1px;
}

.glass {
  backdrop-filter: blur(14px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.hero-widget {
  border-radius: 22px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 15px 40px rgba(14, 8, 31, 0.35);
}

.widget-title {
  margin: 0;
  opacity: 0.9;
}

.widget-date {
  margin: 0.25rem 0;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
}

.widget-temp {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.95;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.app,
.dock-app {
  appearance: none;
  border: none;
  color: #fff;
  border-radius: 19px;
  aspect-ratio: 1;
  display: grid;
  place-items: end center;
  padding: 0.45rem;
  font-weight: 550;
  font-size: 0.72rem;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 8px 20px rgba(10, 9, 25, 0.35);
}

.app span,
.dock-app span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.app:hover,
.app:focus-visible,
.dock-app:hover,
.dock-app:focus-visible {
  transform: translateY(-4px) scale(1.03);
  outline: none;
}

.purple { background: linear-gradient(145deg, #8865ff, #5844d4); }
.blue { background: linear-gradient(145deg, #67c8ff, #2e73f5); }
.orange { background: linear-gradient(145deg, #ffad6a, #f96d2a); }
.green { background: linear-gradient(145deg, #7bffa7, #3ecf5c); }
.cyan { background: linear-gradient(145deg, #7cfaff, #26b8eb); }
.pink { background: linear-gradient(145deg, #ff94d4, #f05995); }
.red { background: linear-gradient(145deg, #ff8585, #f14848); }
.yellow { background: linear-gradient(145deg, #ffe07d, #f5ba35); }
.indigo { background: linear-gradient(145deg, #8f97ff, #5558df); }
.teal { background: linear-gradient(145deg, #89ffe9, #22c9b5); }
.violet { background: linear-gradient(145deg, #cc92ff, #9759ea); }
.lime { background: linear-gradient(145deg, #d8ff8e, #93d833); }

.dock {
  border-radius: 27px;
  padding: 0.55rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: auto;
}

.dock-app {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.15));
  border-radius: 16px;
}

.home-indicator {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 135px;
  height: 5px;
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.75);
}

.edit-mode .app,
.edit-mode .dock-app {
  animation: wiggle 0.22s ease-in-out infinite alternate;
}

@keyframes wiggle {
  from { transform: rotate(-1.8deg); }
  to { transform: rotate(1.8deg); }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .iphone {
    transform: none;
  }
}
