:root {
  --bg: #0e0e14;
  --panel: #1a1a2e;
  --card: #2a2a42;
  --text: #f5f5fa;
  --muted: #9a9ab0;
  --accent: #4c6ef5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#app { height: 100vh; }

.phone {
  max-width: 420px;
  margin: 0 auto;
  height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.clock {
  text-align: center;
  font-size: 40px;
  font-weight: 200;
  margin: 24px 0 8px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  justify-items: center;
}

.app-card {
  background: transparent;
  border: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px;
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
}

.app-icon img, .topbar-icon img { width: 100%; height: 100%; object-fit: cover; }

.app-name {
  font-size: 12px;
  color: var(--text);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }

.dock { flex: 1; }

/* App dins del frame */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid #000;
}

.app-topbar .back {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 8px;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  flex: 1;
}

.topbar-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; }

.app-topbar .external {
  color: var(--muted);
  text-decoration: none;
  font-size: 18px;
}

.app-frame {
  flex: 1;
  border: none;
  background: #fff;
  width: 100%;
}
