:root {
  color-scheme: dark;
  --bg: #0b0b12;
  --text: #f5f5f7;
  --text-dim: rgba(245, 245, 247, 0.72);
  --dock-bg: rgba(255, 255, 255, 0.18);
  --dock-border: rgba(255, 255, 255, 0.28);
  --icon-size: 64px;
  --label-size: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  touch-action: manipulation;
}

.wallpaper {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(94, 92, 230, 0.55), transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(48, 209, 88, 0.35), transparent 55%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(255, 55, 95, 0.25), transparent 60%),
    linear-gradient(160deg, #12121f 0%, #0b0b12 45%, #151528 100%);
  filter: saturate(1.1);
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(8px + var(--safe-top)) 18px calc(10px + var(--safe-bottom));
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 6px 10px;
}

.status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.signal, .wifi, .battery {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
  opacity: 0.9;
}

.battery {
  width: 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  position: relative;
}

.battery::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.85);
}

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}

.home::-webkit-scrollbar {
  display: none;
}

.widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.widget {
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.widget-label {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.widget-big {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 10px;
  align-content: start;
  padding-top: 4px;
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: inherit;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.app:active .icon-shell {
  transform: scale(0.92);
  filter: brightness(0.92);
}

.icon-shell {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 120ms ease, filter 120ms ease;
}

.icon-shell svg {
  width: 34px;
  height: 34px;
  fill: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.app-label {
  font-size: var(--label-size);
  line-height: 1.15;
  text-align: center;
  max-width: 78px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  word-break: keep-all;
}

.dock-wrap {
  margin-top: auto;
  padding-top: 8px;
}

.dock {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 28px;
  background: var(--dock-bg);
  backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid var(--dock-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.dock .app {
  gap: 0;
}

.dock .app-label {
  display: none;
}

.dock .icon-shell {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.home-indicator {
  width: 132px;
  height: 5px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(30, 30, 36, 0.92);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 20;
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (display-mode: standalone) {
  .status-bar {
    padding-top: 2px;
  }
}
